Skip to content

chore: update subgraph urls #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,27 @@ function getLiNearSDKConfig(): LiNearSDKConfig {
}

/**
* custom configauation for LiNear SDK
* custom configuration for LiNear SDK
* @param config custom config
*/
function setLiNearSDKConfig(config: LiNearSDKConfig) {
SDK_CUSTOM_CONFIG = config;
}

export { changeSDKEnvironment, getLiNearSDKConfig, setLiNearSDKConfig };
/**
* change subgraph API URL
*/
function changeSubgraphApiUrl(apiUrl: string) {
const config = getLiNearSDKConfig();
setLiNearSDKConfig({
...config,
apiUrl,
});
}

export {
changeSDKEnvironment,
getLiNearSDKConfig,
setLiNearSDKConfig,
changeSubgraphApiUrl,
};
3 changes: 2 additions & 1 deletion src/config/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const connectConfig: ConnectConfig = {
headers: {},
};

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

const contractId = 'linear-protocol.near';

Expand Down
2 changes: 1 addition & 1 deletion src/config/testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const connectConfig: ConnectConfig = {
};

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

const contractId = 'linear-protocol.testnet';

Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// env
export { changeSDKEnvironment, setLiNearSDKConfig } from './config';
export {
changeSDKEnvironment,
setLiNearSDKConfig,
getLiNearSDKConfig,
changeSubgraphApiUrl,
} from './config';

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

Expand Down
Loading