Skip to content

Commit

Permalink
Add InfuraNetworkId
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhuiluo authored and gnarlycow committed Dec 26, 2023
1 parent 43dffba commit 2e16b42
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ const UNISWAP_OFFICIAL_ROUTING_API_INFO: ChainSpecificRoutingAPIInfo = {
type: 'UNIFIED_ROUTING_API',
};

export type InfuraNetworkId =
| 'goerli'
| 'arbitrum-goerli'
| 'mainnet'
| 'arbitrum'
| 'matic'
| 'optimism'
| 'celo'
| 'bnbsmartchain'
| 'base'
| 'avalanche';

export interface ChainInfo {
chain: Chain;
uniswap_v3_factory: Address;
Expand All @@ -47,7 +59,7 @@ export interface ChainInfo {
// Automan maximum allowed gas deduction ceiling.
maxGasCeiling: number;
// Only populated for networks that have an Infura endpoint.
infura_network_id?: string;
infura_network_id?: InfuraNetworkId;
// Only populated for networks that do not have an Infura endpoint.
rpc_url?: string;
// Only populated for networks with a CoinGecko asset platform ID.
Expand Down Expand Up @@ -272,6 +284,7 @@ const CHAIN_ID_TO_INFO: {
'Celo native asset',
),
coingecko_asset_platform_id: 'celo',
infura_network_id: 'celo',
rpc_url: 'https://forno.celo.org',
uniswap_subgraph_url:
'https://api.thegraph.com/subgraphs/name/jesse-sawa/uniswap-celo',
Expand Down Expand Up @@ -306,6 +319,7 @@ const CHAIN_ID_TO_INFO: {
'Wrapped BNB',
),
coingecko_asset_platform_id: 'binance-smart-chain',
infura_network_id: 'bnbsmartchain',
rpc_url: 'https://bsc-dataseed.bnbchain.org',
uniswap_subgraph_url:
'https://api.thegraph.com/subgraphs/name/ilyamk/uniswap-v3---bnb-chain',
Expand Down Expand Up @@ -340,6 +354,7 @@ const CHAIN_ID_TO_INFO: {
'Wrapped Ether',
),
coingecko_asset_platform_id: 'base',
infura_network_id: 'base',
rpc_url: 'https://mainnet.base.org',
uniswap_subgraph_url:
'https://api.studio.thegraph.com/query/48211/uniswap-v3-base/version/latest',
Expand Down Expand Up @@ -374,6 +389,7 @@ const CHAIN_ID_TO_INFO: {
'Wrapped AVAX',
),
coingecko_asset_platform_id: 'avalanche',
infura_network_id: 'avalanche',
rpc_url: 'https://api.avax.network/ext/bc/C/rpc',
uniswap_subgraph_url:
'https://api.thegraph.com/subgraphs/name/lynnshaoyu/uniswap-v3-avax',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aperture_finance/uniswap-v3-automation-sdk",
"version": "1.11.0",
"version": "1.12.0",
"description": "SDK for Aperture's Uniswap V3 automation platform",
"author": "Aperture Finance <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 2e16b42

Please sign in to comment.