Skip to content
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

fix(gql): get FOT from GQL for all supported chains #797

Merged
merged 1 commit into from
Jul 30, 2024
Merged
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
19 changes: 18 additions & 1 deletion lib/graphql/graphql-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,27 @@ export class UniGraphQLProvider implements IUniGraphQLProvider {
* GraphQL Chain Enum located here: https://github.com/Uniswap/data-api-graphql/blob/main/graphql/schema.graphql#L155
* */
private _chainIdToGraphQLChainName(chainId: ChainId): string | undefined {
// TODO: add complete list / use data-graphql-api to populate. Only MAINNET for now.
switch (chainId) {
case ChainId.MAINNET:
return 'ETHEREUM'
case ChainId.ARBITRUM_ONE:
return 'ARBITRUM'
case ChainId.AVALANCHE:
return 'AVALANCHE'
case ChainId.OPTIMISM:
return 'OPTIMISM'
case ChainId.POLYGON:
return 'POLYGON'
case ChainId.CELO:
return 'CELO'
case ChainId.BNB:
return 'BNB'
case ChainId.BASE:
return 'BASE'
case ChainId.BLAST:
return 'BLAST'
case ChainId.ZORA:
return 'ZORA'
default:
throw new Error(`UniGraphQLProvider._chainIdToGraphQLChainName unsupported ChainId: ${chainId}`)
}
Expand Down
Loading