Skip to content

Commit

Permalink
fix(gql): get FOT from GQL for all supported chains
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsv committed Jul 29, 2024
1 parent 88968a2 commit 15d7445
Showing 1 changed file with 18 additions and 1 deletion.
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

0 comments on commit 15d7445

Please sign in to comment.