INNER CODE UNIT · TypeScript
SubgraphService
yearn/yearn-sdk · src/services/subgraph/index.ts:6
export class SubgraphService extends Service {
yearnSubgraphEndpoint?: string;
constructor(chainId: ChainId, ctx: Context) {
super(chainId, ctx);
switch (chainId) {
case 1:
case 1337:
// no fallback for mainnet as the hosted version has been deprecated.
this.yearnSubgraphEndpoint = ctx.subgraph?.mainnetSubgraphEndpoint;
break;
case 10:
this.yearnSubgraphEndpoint =
ctx.subgraph?.optimismSubgraphEndpoint ||
"https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-optimism";
break;
case 250: