Skip to content

Commit d162b80

Browse files
authored
chore: update subgraph urls (#6)
1 parent 0699325 commit d162b80

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

src/config/index.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,27 @@ function getLiNearSDKConfig(): LiNearSDKConfig {
2323
}
2424

2525
/**
26-
* custom configauation for LiNear SDK
26+
* custom configuration for LiNear SDK
2727
* @param config custom config
2828
*/
2929
function setLiNearSDKConfig(config: LiNearSDKConfig) {
3030
SDK_CUSTOM_CONFIG = config;
3131
}
3232

33-
export { changeSDKEnvironment, getLiNearSDKConfig, setLiNearSDKConfig };
33+
/**
34+
* change subgraph API URL
35+
*/
36+
function changeSubgraphApiUrl(apiUrl: string) {
37+
const config = getLiNearSDKConfig();
38+
setLiNearSDKConfig({
39+
...config,
40+
apiUrl,
41+
});
42+
}
43+
44+
export {
45+
changeSDKEnvironment,
46+
getLiNearSDKConfig,
47+
setLiNearSDKConfig,
48+
changeSubgraphApiUrl,
49+
};

src/config/mainnet.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const connectConfig: ConnectConfig = {
1111
headers: {},
1212
};
1313

14-
const apiUrl = 'https://api.thegraph.com/subgraphs/name/linear-protocol/linear';
14+
const apiUrl =
15+
'https://api.studio.thegraph.com/query/76854/linear/version/latest';
1516

1617
const contractId = 'linear-protocol.near';
1718

src/config/testnet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const connectConfig: ConnectConfig = {
1212
};
1313

1414
const apiUrl =
15-
'https://api.thegraph.com/subgraphs/name/linear-protocol/linear-testnet';
15+
'https://api.studio.thegraph.com/query/76854/linear-testnet/version/latest';
1616

1717
const contractId = 'linear-protocol.testnet';
1818

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// env
2-
export { changeSDKEnvironment, setLiNearSDKConfig } from './config';
2+
export {
3+
changeSDKEnvironment,
4+
setLiNearSDKConfig,
5+
getLiNearSDKConfig,
6+
changeSubgraphApiUrl,
7+
} from './config';
38

49
export { SDK_ENV, LiNearSDKConfig } from './config/type';
510

0 commit comments

Comments
 (0)