sushi 4.2.3 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/_cjs/address/getCreate2Address.js +2 -2
- package/_cjs/address/getCreate2Address.js.map +1 -1
- package/_cjs/api/price.js.map +1 -1
- package/_cjs/chain/chain-key.js +14 -0
- package/_cjs/chain/chain-key.js.map +1 -0
- package/_cjs/chain/evm/generated-chain-data.js.map +1 -0
- package/_cjs/chain/evm/id.js +60 -0
- package/_cjs/chain/evm/id.js.map +1 -0
- package/_cjs/chain/evm/index.js +278 -0
- package/_cjs/chain/evm/index.js.map +1 -0
- package/_cjs/chain/id.js +6 -54
- package/_cjs/chain/id.js.map +1 -1
- package/_cjs/chain/index.js +3 -274
- package/_cjs/chain/index.js.map +1 -1
- package/_cjs/chain/non-evm/aptos/id.js +7 -0
- package/_cjs/chain/non-evm/aptos/id.js.map +1 -0
- package/_cjs/chain/non-evm/aptos/index.js +30 -0
- package/_cjs/chain/non-evm/aptos/index.js.map +1 -0
- package/_cjs/chain/non-evm/index.js +19 -0
- package/_cjs/chain/non-evm/index.js.map +1 -0
- package/_cjs/chain/non-evm/tron/id.js +7 -0
- package/_cjs/chain/non-evm/tron/id.js.map +1 -0
- package/_cjs/chain/non-evm/tron/index.js +30 -0
- package/_cjs/chain/non-evm/tron/index.js.map +1 -0
- package/_cjs/config/api.js +1 -3
- package/_cjs/config/api.js.map +1 -1
- package/_cjs/config/features/aggregator.js +9 -9
- package/_cjs/config/features/aggregator.js.map +1 -1
- package/_cjs/config/features/bentobox.js +43 -43
- package/_cjs/config/features/bentobox.js.map +1 -1
- package/_cjs/config/features/extractor.js +44 -44
- package/_cjs/config/features/extractor.js.map +1 -1
- package/_cjs/config/features/furo.js +16 -16
- package/_cjs/config/features/furo.js.map +1 -1
- package/_cjs/config/features/master-chef.js +3 -3
- package/_cjs/config/features/master-chef.js.map +1 -1
- package/_cjs/config/features/merkl.js +17 -17
- package/_cjs/config/features/merkl.js.map +1 -1
- package/_cjs/config/features/mini-chef.js +34 -34
- package/_cjs/config/features/mini-chef.js.map +1 -1
- package/_cjs/config/features/pancakeswap-v2.js +22 -22
- package/_cjs/config/features/pancakeswap-v2.js.map +1 -1
- package/_cjs/config/features/pancakeswap-v3.js +29 -29
- package/_cjs/config/features/pancakeswap-v3.js.map +1 -1
- package/_cjs/config/features/route-processor.js +323 -323
- package/_cjs/config/features/route-processor.js.map +1 -1
- package/_cjs/config/features/squid.js +32 -32
- package/_cjs/config/features/squid.js.map +1 -1
- package/_cjs/config/features/stargate.js +580 -577
- package/_cjs/config/features/stargate.js.map +1 -1
- package/_cjs/config/features/sushiswap-v2.js +138 -137
- package/_cjs/config/features/sushiswap-v2.js.map +1 -1
- package/_cjs/config/features/sushiswap-v3.js +146 -146
- package/_cjs/config/features/sushiswap-v3.js.map +1 -1
- package/_cjs/config/features/sushiswap.js.map +1 -1
- package/_cjs/config/features/sushixswap.js +89 -89
- package/_cjs/config/features/sushixswap.js.map +1 -1
- package/_cjs/config/features/trident.js +42 -42
- package/_cjs/config/features/trident.js.map +1 -1
- package/_cjs/config/features/uniswap-v2.js +19 -19
- package/_cjs/config/features/uniswap-v2.js.map +1 -1
- package/_cjs/config/features/uniswap-v3.js +67 -67
- package/_cjs/config/features/uniswap-v3.js.map +1 -1
- package/_cjs/config/governance.js +2 -2
- package/_cjs/config/governance.js.map +1 -1
- package/_cjs/config/index.js +0 -2
- package/_cjs/config/index.js.map +1 -1
- package/_cjs/config/native-ids.js +54 -54
- package/_cjs/config/native-ids.js.map +1 -1
- package/_cjs/config/subgraph/get-subgraph-url.js +43 -0
- package/_cjs/config/subgraph/get-subgraph-url.js.map +1 -0
- package/_cjs/config/subgraph/hosts.js +7 -10
- package/_cjs/config/subgraph/hosts.js.map +1 -1
- package/_cjs/config/subgraph/max-first.js +2 -2
- package/_cjs/config/subgraph/max-first.js.map +1 -1
- package/_cjs/config/subgraph/seconds-between-blocks.js +26 -26
- package/_cjs/config/subgraph/seconds-between-blocks.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/bentobox.js +23 -16
- package/_cjs/config/subgraph/subgraphs/bentobox.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/blocks.js +42 -35
- package/_cjs/config/subgraph/subgraphs/blocks.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/furo.js +25 -18
- package/_cjs/config/subgraph/subgraphs/furo.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/master-chef-v1.js +12 -3
- package/_cjs/config/subgraph/subgraphs/master-chef-v1.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/master-chef-v2.js +12 -3
- package/_cjs/config/subgraph/subgraphs/master-chef-v2.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/mini-chef.js +26 -19
- package/_cjs/config/subgraph/subgraphs/mini-chef.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/sushi-bar.js +12 -3
- package/_cjs/config/subgraph/subgraphs/sushi-bar.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/sushiswap-v2.js +49 -37
- package/_cjs/config/subgraph/subgraphs/sushiswap-v2.js.map +1 -1
- package/_cjs/config/subgraph/subgraphs/sushiswap-v3.js +44 -32
- package/_cjs/config/subgraph/subgraphs/sushiswap-v3.js.map +1 -1
- package/_cjs/config/token-chomper.js +85 -85
- package/_cjs/config/token-chomper.js.map +1 -1
- package/_cjs/config/token-maps/additional-bases.js +85 -81
- package/_cjs/config/token-maps/additional-bases.js.map +1 -1
- package/_cjs/config/token-maps/bases-to-check-trades-against.js +337 -337
- package/_cjs/config/token-maps/bases-to-check-trades-against.js.map +1 -1
- package/_cjs/config/token-maps/custom-bases.js +5 -5
- package/_cjs/config/token-maps/custom-bases.js.map +1 -1
- package/_cjs/config/token-maps/default-bases.js +358 -348
- package/_cjs/config/token-maps/default-bases.js.map +1 -1
- package/_cjs/config/token-maps/default-quote.js +54 -51
- package/_cjs/config/token-maps/default-quote.js.map +1 -1
- package/_cjs/config/token-maps/lsds.js +108 -108
- package/_cjs/config/token-maps/lsds.js.map +1 -1
- package/_cjs/config/token-maps/short-name-to-currency.js +230 -230
- package/_cjs/config/token-maps/short-name-to-currency.js.map +1 -1
- package/_cjs/config/token-maps/stables.js +202 -172
- package/_cjs/config/token-maps/stables.js.map +1 -1
- package/_cjs/config/token-security.js +16 -16
- package/_cjs/config/token-security.js.map +1 -1
- package/_cjs/config/wallet.js +77 -77
- package/_cjs/config/wallet.js.map +1 -1
- package/_cjs/config/wnative.js.map +1 -1
- package/_cjs/currency/currency.js +1 -3
- package/_cjs/currency/currency.js.map +1 -1
- package/_cjs/currency/native.js +2 -2
- package/_cjs/currency/native.js.map +1 -1
- package/_cjs/currency/token-addresses.js +454 -454
- package/_cjs/currency/token-addresses.js.map +1 -1
- package/_cjs/currency/token.js.map +1 -1
- package/_cjs/currency/tokens.js +179 -179
- package/_cjs/currency/tokens.js.map +1 -1
- package/_cjs/currency/zod.js +3 -2
- package/_cjs/currency/zod.js.map +1 -1
- package/_cjs/format/id.js +7 -3
- package/_cjs/format/id.js.map +1 -1
- package/_cjs/index.js +2 -2
- package/_cjs/index.js.map +1 -1
- package/_cjs/pool/sushiswap-v2/sushiswap-v2-pool.js +2 -2
- package/_cjs/pool/sushiswap-v2/sushiswap-v2-pool.js.map +1 -1
- package/_cjs/router/get-currency-combinations.js.map +1 -1
- package/_cjs/token-list/wrapped-token-info.js.map +1 -1
- package/_esm/address/getCreate2Address.js +2 -2
- package/_esm/address/getCreate2Address.js.map +1 -1
- package/_esm/api/price.js.map +1 -1
- package/_esm/chain/chain-key.js +11 -0
- package/_esm/chain/chain-key.js.map +1 -0
- package/_esm/chain/evm/generated-chain-data.js.map +1 -0
- package/_esm/chain/evm/id.js +67 -0
- package/_esm/chain/evm/id.js.map +1 -0
- package/_esm/chain/evm/index.js +280 -0
- package/_esm/chain/evm/index.js.map +1 -0
- package/_esm/chain/id.js +6 -64
- package/_esm/chain/id.js.map +1 -1
- package/_esm/chain/index.js +3 -293
- package/_esm/chain/index.js.map +1 -1
- package/_esm/chain/non-evm/aptos/id.js +4 -0
- package/_esm/chain/non-evm/aptos/id.js.map +1 -0
- package/_esm/chain/non-evm/aptos/index.js +11 -0
- package/_esm/chain/non-evm/aptos/index.js.map +1 -0
- package/_esm/chain/non-evm/index.js +3 -0
- package/_esm/chain/non-evm/index.js.map +1 -0
- package/_esm/chain/non-evm/tron/id.js +4 -0
- package/_esm/chain/non-evm/tron/id.js.map +1 -0
- package/_esm/chain/non-evm/tron/index.js +11 -0
- package/_esm/chain/non-evm/tron/index.js.map +1 -0
- package/_esm/config/api.js +1 -3
- package/_esm/config/api.js.map +1 -1
- package/_esm/config/features/aggregator.js +9 -9
- package/_esm/config/features/aggregator.js.map +1 -1
- package/_esm/config/features/bentobox.js +43 -43
- package/_esm/config/features/bentobox.js.map +1 -1
- package/_esm/config/features/extractor.js +44 -44
- package/_esm/config/features/extractor.js.map +1 -1
- package/_esm/config/features/furo.js +16 -16
- package/_esm/config/features/furo.js.map +1 -1
- package/_esm/config/features/master-chef.js +7 -7
- package/_esm/config/features/master-chef.js.map +1 -1
- package/_esm/config/features/merkl.js +18 -18
- package/_esm/config/features/merkl.js.map +1 -1
- package/_esm/config/features/mini-chef.js +35 -35
- package/_esm/config/features/mini-chef.js.map +1 -1
- package/_esm/config/features/pancakeswap-v2.js +24 -24
- package/_esm/config/features/pancakeswap-v2.js.map +1 -1
- package/_esm/config/features/pancakeswap-v3.js +29 -29
- package/_esm/config/features/pancakeswap-v3.js.map +1 -1
- package/_esm/config/features/route-processor.js +329 -329
- package/_esm/config/features/route-processor.js.map +1 -1
- package/_esm/config/features/squid.js +32 -32
- package/_esm/config/features/squid.js.map +1 -1
- package/_esm/config/features/stargate.js +598 -595
- package/_esm/config/features/stargate.js.map +1 -1
- package/_esm/config/features/sushiswap-v2.js +201 -200
- package/_esm/config/features/sushiswap-v2.js.map +1 -1
- package/_esm/config/features/sushiswap-v3.js +157 -157
- package/_esm/config/features/sushiswap-v3.js.map +1 -1
- package/_esm/config/features/sushiswap.js.map +1 -1
- package/_esm/config/features/sushixswap.js +91 -91
- package/_esm/config/features/sushixswap.js.map +1 -1
- package/_esm/config/features/trident.js +45 -45
- package/_esm/config/features/trident.js.map +1 -1
- package/_esm/config/features/uniswap-v2.js +19 -19
- package/_esm/config/features/uniswap-v2.js.map +1 -1
- package/_esm/config/features/uniswap-v3.js +67 -67
- package/_esm/config/features/uniswap-v3.js.map +1 -1
- package/_esm/config/governance.js +2 -2
- package/_esm/config/governance.js.map +1 -1
- package/_esm/config/index.js +0 -2
- package/_esm/config/index.js.map +1 -1
- package/_esm/config/native-ids.js +65 -65
- package/_esm/config/native-ids.js.map +1 -1
- package/_esm/config/subgraph/get-subgraph-url.js +46 -0
- package/_esm/config/subgraph/get-subgraph-url.js.map +1 -0
- package/_esm/config/subgraph/hosts.js +4 -9
- package/_esm/config/subgraph/hosts.js.map +1 -1
- package/_esm/config/subgraph/max-first.js +2 -2
- package/_esm/config/subgraph/max-first.js.map +1 -1
- package/_esm/config/subgraph/seconds-between-blocks.js +27 -27
- package/_esm/config/subgraph/seconds-between-blocks.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/bentobox.js +23 -16
- package/_esm/config/subgraph/subgraphs/bentobox.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/blocks.js +47 -40
- package/_esm/config/subgraph/subgraphs/blocks.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/furo.js +25 -18
- package/_esm/config/subgraph/subgraphs/furo.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/master-chef-v1.js +11 -2
- package/_esm/config/subgraph/subgraphs/master-chef-v1.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/master-chef-v2.js +11 -2
- package/_esm/config/subgraph/subgraphs/master-chef-v2.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/mini-chef.js +27 -20
- package/_esm/config/subgraph/subgraphs/mini-chef.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/sushi-bar.js +11 -2
- package/_esm/config/subgraph/subgraphs/sushi-bar.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/sushiswap-v2.js +49 -37
- package/_esm/config/subgraph/subgraphs/sushiswap-v2.js.map +1 -1
- package/_esm/config/subgraph/subgraphs/sushiswap-v3.js +44 -32
- package/_esm/config/subgraph/subgraphs/sushiswap-v3.js.map +1 -1
- package/_esm/config/token-chomper.js +85 -85
- package/_esm/config/token-chomper.js.map +1 -1
- package/_esm/config/token-maps/additional-bases.js +85 -81
- package/_esm/config/token-maps/additional-bases.js.map +1 -1
- package/_esm/config/token-maps/bases-to-check-trades-against.js +339 -339
- package/_esm/config/token-maps/bases-to-check-trades-against.js.map +1 -1
- package/_esm/config/token-maps/custom-bases.js +5 -5
- package/_esm/config/token-maps/custom-bases.js.map +1 -1
- package/_esm/config/token-maps/default-bases.js +369 -359
- package/_esm/config/token-maps/default-bases.js.map +1 -1
- package/_esm/config/token-maps/default-quote.js +71 -68
- package/_esm/config/token-maps/default-quote.js.map +1 -1
- package/_esm/config/token-maps/lsds.js +108 -108
- package/_esm/config/token-maps/lsds.js.map +1 -1
- package/_esm/config/token-maps/short-name-to-currency.js +256 -256
- package/_esm/config/token-maps/short-name-to-currency.js.map +1 -1
- package/_esm/config/token-maps/stables.js +212 -182
- package/_esm/config/token-maps/stables.js.map +1 -1
- package/_esm/config/token-security.js +16 -16
- package/_esm/config/token-security.js.map +1 -1
- package/_esm/config/wallet.js +77 -77
- package/_esm/config/wallet.js.map +1 -1
- package/_esm/config/wnative.js.map +1 -1
- package/_esm/currency/currency.js +1 -3
- package/_esm/currency/currency.js.map +1 -1
- package/_esm/currency/native.js +2 -2
- package/_esm/currency/native.js.map +1 -1
- package/_esm/currency/token-addresses.js +483 -483
- package/_esm/currency/token-addresses.js.map +1 -1
- package/_esm/currency/token.js.map +1 -1
- package/_esm/currency/tokens.js +195 -195
- package/_esm/currency/tokens.js.map +1 -1
- package/_esm/currency/zod.js +3 -2
- package/_esm/currency/zod.js.map +1 -1
- package/_esm/format/id.js +7 -3
- package/_esm/format/id.js.map +1 -1
- package/_esm/index.js +2 -2
- package/_esm/index.js.map +1 -1
- package/_esm/pool/sushiswap-v2/sushiswap-v2-pool.js +2 -2
- package/_esm/pool/sushiswap-v2/sushiswap-v2-pool.js.map +1 -1
- package/_esm/router/get-currency-combinations.js.map +1 -1
- package/_esm/token-list/wrapped-token-info.js.map +1 -1
- package/_types/address/getCreate2Address.d.ts +2 -2
- package/_types/address/getCreate2Address.d.ts.map +1 -1
- package/_types/api/price.d.ts +3 -3
- package/_types/api/price.d.ts.map +1 -1
- package/_types/chain/chain-key.d.ts +63 -0
- package/_types/chain/chain-key.d.ts.map +1 -0
- package/_types/chain/{generated-chain-data.d.ts.map → evm/generated-chain-data.d.ts.map} +1 -1
- package/_types/chain/evm/id.d.ts +58 -0
- package/_types/chain/evm/id.d.ts.map +1 -0
- package/_types/chain/evm/index.d.ts +1197 -0
- package/_types/chain/evm/index.d.ts.map +1 -0
- package/_types/chain/id.d.ts +2 -0
- package/_types/chain/id.d.ts.map +1 -1
- package/_types/chain/index.d.ts +3 -1190
- package/_types/chain/index.d.ts.map +1 -1
- package/_types/chain/non-evm/aptos/id.d.ts +5 -0
- package/_types/chain/non-evm/aptos/id.d.ts.map +1 -0
- package/_types/chain/non-evm/aptos/index.d.ts +13 -0
- package/_types/chain/non-evm/aptos/index.d.ts.map +1 -0
- package/_types/chain/non-evm/index.d.ts +3 -0
- package/_types/chain/non-evm/index.d.ts.map +1 -0
- package/_types/chain/non-evm/tron/id.d.ts +5 -0
- package/_types/chain/non-evm/tron/id.d.ts.map +1 -0
- package/_types/chain/non-evm/tron/index.d.ts +13 -0
- package/_types/chain/non-evm/tron/index.d.ts.map +1 -0
- package/_types/config/api.d.ts +1 -1
- package/_types/config/api.d.ts.map +1 -1
- package/_types/config/features/aggregator.d.ts +2 -2
- package/_types/config/features/aggregator.d.ts.map +1 -1
- package/_types/config/features/bentobox.d.ts +2 -2
- package/_types/config/features/bentobox.d.ts.map +1 -1
- package/_types/config/features/furo.d.ts +2 -2
- package/_types/config/features/furo.d.ts.map +1 -1
- package/_types/config/features/merkl.d.ts +2 -2
- package/_types/config/features/merkl.d.ts.map +1 -1
- package/_types/config/features/mini-chef.d.ts +2 -2
- package/_types/config/features/mini-chef.d.ts.map +1 -1
- package/_types/config/features/pancakeswap-v2.d.ts +2 -2
- package/_types/config/features/pancakeswap-v2.d.ts.map +1 -1
- package/_types/config/features/pancakeswap-v3.d.ts +2 -2
- package/_types/config/features/pancakeswap-v3.d.ts.map +1 -1
- package/_types/config/features/route-processor.d.ts +9 -9
- package/_types/config/features/route-processor.d.ts.map +1 -1
- package/_types/config/features/stargate.d.ts.map +1 -1
- package/_types/config/features/sushiswap-v2.d.ts +4 -4
- package/_types/config/features/sushiswap-v2.d.ts.map +1 -1
- package/_types/config/features/sushiswap-v3.d.ts +7 -6
- package/_types/config/features/sushiswap-v3.d.ts.map +1 -1
- package/_types/config/features/sushiswap.d.ts +2 -2
- package/_types/config/features/sushiswap.d.ts.map +1 -1
- package/_types/config/features/sushixswap.d.ts +5 -5
- package/_types/config/features/sushixswap.d.ts.map +1 -1
- package/_types/config/features/trident.d.ts +2 -2
- package/_types/config/features/trident.d.ts.map +1 -1
- package/_types/config/features/uniswap-v3.d.ts +2 -2
- package/_types/config/features/uniswap-v3.d.ts.map +1 -1
- package/_types/config/index.d.ts +0 -2
- package/_types/config/index.d.ts.map +1 -1
- package/_types/config/subgraph/get-subgraph-url.d.ts +20 -0
- package/_types/config/subgraph/get-subgraph-url.d.ts.map +1 -0
- package/_types/config/subgraph/hosts.d.ts +4 -3
- package/_types/config/subgraph/hosts.d.ts.map +1 -1
- package/_types/config/subgraph/max-first.d.ts +2 -2
- package/_types/config/subgraph/max-first.d.ts.map +1 -1
- package/_types/config/subgraph/seconds-between-blocks.d.ts +2 -2
- package/_types/config/subgraph/seconds-between-blocks.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/bentobox.d.ts +9 -2
- package/_types/config/subgraph/subgraphs/bentobox.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/blocks.d.ts +9 -2
- package/_types/config/subgraph/subgraphs/blocks.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/data-api.d.ts +1 -1
- package/_types/config/subgraph/subgraphs/data-api.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/furo.d.ts +9 -2
- package/_types/config/subgraph/subgraphs/furo.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/master-chef-v1.d.ts +9 -1
- package/_types/config/subgraph/subgraphs/master-chef-v1.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/master-chef-v2.d.ts +9 -1
- package/_types/config/subgraph/subgraphs/master-chef-v2.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/mini-chef.d.ts +9 -2
- package/_types/config/subgraph/subgraphs/mini-chef.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/sushi-bar.d.ts +9 -1
- package/_types/config/subgraph/subgraphs/sushi-bar.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/sushiswap-v2.d.ts +9 -2
- package/_types/config/subgraph/subgraphs/sushiswap-v2.d.ts.map +1 -1
- package/_types/config/subgraph/subgraphs/sushiswap-v3.d.ts +9 -2
- package/_types/config/subgraph/subgraphs/sushiswap-v3.d.ts.map +1 -1
- package/_types/config/token-chomper.d.ts +2 -2
- package/_types/config/token-chomper.d.ts.map +1 -1
- package/_types/config/token-maps/additional-bases.d.ts.map +1 -1
- package/_types/config/token-maps/default-bases.d.ts +1 -1
- package/_types/config/token-maps/default-bases.d.ts.map +1 -1
- package/_types/config/token-maps/default-quote.d.ts.map +1 -1
- package/_types/config/token-maps/lsds.d.ts.map +1 -1
- package/_types/config/token-maps/short-name-to-currency.d.ts +4 -4
- package/_types/config/token-maps/short-name-to-currency.d.ts.map +1 -1
- package/_types/config/token-maps/stables.d.ts.map +1 -1
- package/_types/config/token-security.d.ts +2 -2
- package/_types/config/token-security.d.ts.map +1 -1
- package/_types/config/wallet.d.ts +2 -2
- package/_types/config/wallet.d.ts.map +1 -1
- package/_types/config/wnative.d.ts +2 -2
- package/_types/config/wnative.d.ts.map +1 -1
- package/_types/currency/currency.d.ts +4 -4
- package/_types/currency/currency.d.ts.map +1 -1
- package/_types/currency/native.d.ts +3 -2
- package/_types/currency/native.d.ts.map +1 -1
- package/_types/currency/token.d.ts +2 -1
- package/_types/currency/token.d.ts.map +1 -1
- package/_types/currency/tokens.d.ts.map +1 -1
- package/_types/currency/zod.d.ts +10 -10
- package/_types/currency/zod.d.ts.map +1 -1
- package/_types/format/id.d.ts +1 -2
- package/_types/format/id.d.ts.map +1 -1
- package/_types/index.d.ts +2 -2
- package/_types/index.d.ts.map +1 -1
- package/_types/pool/sushiswap-v2/zod.d.ts +16 -16
- package/_types/pool/sushiswap-v3/utils/computePoolAddress.d.ts +2 -2
- package/_types/pool/sushiswap-v3/utils/computePoolAddress.d.ts.map +1 -1
- package/_types/pool/trident-constant-product/zod.d.ts +16 -16
- package/_types/pool/trident-stable/zod.d.ts +16 -16
- package/_types/router/get-currency-combinations.d.ts +3 -3
- package/_types/router/get-currency-combinations.d.ts.map +1 -1
- package/_types/token-list/wrapped-token-info.d.ts +3 -3
- package/_types/token-list/wrapped-token-info.d.ts.map +1 -1
- package/_types/types/sushi-pool/pool-id.d.ts +2 -2
- package/_types/types/sushi-pool/pool-id.d.ts.map +1 -1
- package/_types/types/sushi-pool/pool-with-incentives.d.ts +2 -2
- package/_types/types/sushi-pool/pool-with-incentives.d.ts.map +1 -1
- package/_types/types/token.d.ts +2 -2
- package/_types/types/token.d.ts.map +1 -1
- package/address/getCreate2Address.ts +7 -3
- package/api/price.ts +6 -3
- package/chain/chain-key.ts +17 -0
- package/chain/{generate.ts → evm/generate.ts} +10 -17
- package/chain/evm/id.ts +68 -0
- package/chain/evm/index.ts +371 -0
- package/chain/id.ts +8 -64
- package/chain/index.ts +3 -376
- package/chain/non-evm/aptos/id.ts +5 -0
- package/chain/non-evm/aptos/index.ts +23 -0
- package/chain/non-evm/index.ts +2 -0
- package/chain/non-evm/tron/id.ts +5 -0
- package/chain/non-evm/tron/index.ts +23 -0
- package/config/api.ts +1 -4
- package/config/features/aggregator.ts +10 -10
- package/config/features/bentobox.ts +44 -44
- package/config/features/extractor.ts +44 -44
- package/config/features/furo.ts +17 -17
- package/config/features/master-chef.ts +7 -7
- package/config/features/merkl.ts +19 -19
- package/config/features/mini-chef.ts +36 -36
- package/config/features/pancakeswap-v2.ts +25 -25
- package/config/features/pancakeswap-v3.ts +30 -30
- package/config/features/route-processor.ts +336 -337
- package/config/features/squid.ts +32 -32
- package/config/features/stargate.ts +598 -595
- package/config/features/sushiswap-v2.ts +202 -202
- package/config/features/sushiswap-v3.ts +169 -173
- package/config/features/sushiswap.ts +2 -2
- package/config/features/sushixswap.ts +95 -95
- package/config/features/trident.ts +48 -46
- package/config/features/uniswap-v2.ts +19 -19
- package/config/features/uniswap-v3.ts +68 -68
- package/config/governance.ts +2 -2
- package/config/index.ts +0 -2
- package/config/native-ids.ts +65 -65
- package/config/subgraph/get-subgraph-url.ts +107 -0
- package/config/subgraph/hosts.ts +8 -11
- package/config/subgraph/max-first.ts +5 -5
- package/config/subgraph/seconds-between-blocks.ts +28 -28
- package/config/subgraph/subgraphs/bentobox.ts +26 -20
- package/config/subgraph/subgraphs/blocks.ts +49 -41
- package/config/subgraph/subgraphs/furo.ts +27 -19
- package/config/subgraph/subgraphs/master-chef-v1.ts +11 -2
- package/config/subgraph/subgraphs/master-chef-v2.ts +11 -2
- package/config/subgraph/subgraphs/mini-chef.ts +30 -25
- package/config/subgraph/subgraphs/sushi-bar.ts +11 -2
- package/config/subgraph/subgraphs/sushiswap-v2.ts +52 -39
- package/config/subgraph/subgraphs/sushiswap-v3.ts +47 -34
- package/config/token-chomper.ts +86 -86
- package/config/token-maps/additional-bases.ts +85 -81
- package/config/token-maps/bases-to-check-trades-against.ts +339 -339
- package/config/token-maps/custom-bases.ts +5 -5
- package/config/token-maps/default-bases.ts +370 -360
- package/config/token-maps/default-quote.ts +72 -69
- package/config/token-maps/lsds.ts +109 -109
- package/config/token-maps/short-name-to-currency.ts +257 -257
- package/config/token-maps/stables.ts +213 -183
- package/config/token-security.ts +17 -17
- package/config/wallet.ts +78 -78
- package/config/wnative.ts +2 -2
- package/currency/currency.ts +4 -6
- package/currency/native.ts +4 -4
- package/currency/token-addresses.ts +483 -483
- package/currency/token.ts +2 -1
- package/currency/tokens.ts +204 -200
- package/currency/zod.ts +3 -2
- package/format/id.ts +8 -4
- package/index.ts +2 -2
- package/package.json +1 -1
- package/pool/sushiswap-v2/sushiswap-v2-pool.ts +2 -2
- package/pool/sushiswap-v3/utils/computePoolAddress.ts +2 -2
- package/router/get-currency-combinations.ts +3 -3
- package/token-list/wrapped-token-info.ts +3 -3
- package/types/sushi-pool/pool-id.ts +2 -2
- package/types/sushi-pool/pool-with-incentives.ts +2 -2
- package/types/token.ts +2 -2
- package/_cjs/chain/generated-chain-data.js.map +0 -1
- package/_cjs/config/viem.js +0 -849
- package/_cjs/config/viem.js.map +0 -1
- package/_cjs/lowercase-map.js +0 -19
- package/_cjs/lowercase-map.js.map +0 -1
- package/_esm/chain/generated-chain-data.js.map +0 -1
- package/_esm/config/viem.js +0 -906
- package/_esm/config/viem.js.map +0 -1
- package/_esm/lowercase-map.js +0 -15
- package/_esm/lowercase-map.js.map +0 -1
- package/_types/config/viem.d.ts +0 -5279
- package/_types/config/viem.d.ts.map +0 -1
- package/_types/lowercase-map.d.ts +0 -7
- package/_types/lowercase-map.d.ts.map +0 -1
- package/config/viem.ts +0 -1046
- package/lowercase-map.ts +0 -14
- /package/_cjs/chain/{generated-chain-data.js → evm/generated-chain-data.js} +0 -0
- /package/_esm/chain/{generated-chain-data.js → evm/generated-chain-data.js} +0 -0
- /package/_types/chain/{generated-chain-data.d.ts → evm/generated-chain-data.d.ts} +0 -0
- /package/chain/{generated-chain-data.ts → evm/generated-chain-data.ts} +0 -0
package/chain/evm/id.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const EvmChainId = {
|
|
2
|
+
ETHEREUM: 1,
|
|
3
|
+
// ROPSTEN: 3,
|
|
4
|
+
// RINKEBY: 4,
|
|
5
|
+
GÖRLI: 5,
|
|
6
|
+
// KOVAN: 42,
|
|
7
|
+
POLYGON: 137,
|
|
8
|
+
POLYGON_TESTNET: 80001,
|
|
9
|
+
FANTOM: 250,
|
|
10
|
+
FANTOM_TESTNET: 4002,
|
|
11
|
+
GNOSIS: 100,
|
|
12
|
+
BSC: 56,
|
|
13
|
+
BSC_TESTNET: 97,
|
|
14
|
+
ARBITRUM: 42161,
|
|
15
|
+
ARBITRUM_NOVA: 42170,
|
|
16
|
+
ARBITRUM_TESTNET: 421614,
|
|
17
|
+
AVALANCHE: 43114,
|
|
18
|
+
AVALANCHE_TESTNET: 43113,
|
|
19
|
+
HECO: 128,
|
|
20
|
+
// HECO_TESTNET: 256,
|
|
21
|
+
HARMONY: 1666600000,
|
|
22
|
+
// HARMONY_TESTNET: 1666700000,
|
|
23
|
+
OKEX: 66,
|
|
24
|
+
// OKEX_TESTNET: 65,
|
|
25
|
+
CELO: 42220,
|
|
26
|
+
PALM: 11297108109,
|
|
27
|
+
MOONRIVER: 1285,
|
|
28
|
+
FUSE: 122,
|
|
29
|
+
TELOS: 40,
|
|
30
|
+
MOONBEAM: 1284,
|
|
31
|
+
OPTIMISM: 10,
|
|
32
|
+
KAVA: 2222,
|
|
33
|
+
METIS: 1088,
|
|
34
|
+
BOBA: 288,
|
|
35
|
+
BOBA_AVAX: 43288,
|
|
36
|
+
BOBA_BNB: 56288,
|
|
37
|
+
BTTC: 199,
|
|
38
|
+
SEPOLIA: 11155111,
|
|
39
|
+
// CONSENSUS_ZKEVM_TESTNET: 59140,
|
|
40
|
+
// SCROLL_ALPHA_TESTNET: 534353,
|
|
41
|
+
// BASE_TESTNET: 84531,
|
|
42
|
+
POLYGON_ZKEVM: 1101,
|
|
43
|
+
THUNDERCORE: 108,
|
|
44
|
+
FILECOIN: 314,
|
|
45
|
+
HAQQ: 11235,
|
|
46
|
+
CORE: 1116,
|
|
47
|
+
ZKSYNC_ERA: 324,
|
|
48
|
+
LINEA: 59144,
|
|
49
|
+
BASE: 8453,
|
|
50
|
+
SCROLL: 534352,
|
|
51
|
+
ZETACHAIN: 7000,
|
|
52
|
+
CRONOS: 25,
|
|
53
|
+
BLAST: 81457,
|
|
54
|
+
SKALE_EUROPA: 2046399126,
|
|
55
|
+
ROOTSTOCK: 30,
|
|
56
|
+
MANTLE: 5000,
|
|
57
|
+
// RONIN: 2020,
|
|
58
|
+
CURTIS: 33111,
|
|
59
|
+
MANTA: 169,
|
|
60
|
+
MODE: 34443,
|
|
61
|
+
TAIKO: 167000,
|
|
62
|
+
ZKLINK: 810180,
|
|
63
|
+
APE: 33139,
|
|
64
|
+
SONIC: 146,
|
|
65
|
+
HEMI: 43111,
|
|
66
|
+
} as const
|
|
67
|
+
|
|
68
|
+
export type EvmChainId = (typeof EvmChainId)[keyof typeof EvmChainId]
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import raw from './generated-chain-data.js'
|
|
2
|
+
import { EvmChainId } from './id.js'
|
|
3
|
+
|
|
4
|
+
export * from './id.js'
|
|
5
|
+
|
|
6
|
+
const additional = [] as const
|
|
7
|
+
|
|
8
|
+
const RAW = [...raw, ...additional] as const
|
|
9
|
+
|
|
10
|
+
const EIP3091_OVERRIDE = [
|
|
11
|
+
EvmChainId.OPTIMISM,
|
|
12
|
+
EvmChainId.BOBA,
|
|
13
|
+
EvmChainId.BASE,
|
|
14
|
+
EvmChainId.FILECOIN,
|
|
15
|
+
] as number[]
|
|
16
|
+
|
|
17
|
+
type Data = (typeof RAW)[number]
|
|
18
|
+
|
|
19
|
+
export interface EvmChainBase {
|
|
20
|
+
name: string
|
|
21
|
+
nativeCurrency: NativeCurrency
|
|
22
|
+
shortName: string
|
|
23
|
+
chainId: number
|
|
24
|
+
explorers?: Explorer[]
|
|
25
|
+
parent?: Parent
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface Explorer {
|
|
29
|
+
name: string
|
|
30
|
+
url: string
|
|
31
|
+
standard: Standard
|
|
32
|
+
icon?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const Standard = {
|
|
36
|
+
Eip3091: 'EIP3091',
|
|
37
|
+
None: 'none',
|
|
38
|
+
} as const
|
|
39
|
+
|
|
40
|
+
type Standard = (typeof Standard)[keyof typeof Standard]
|
|
41
|
+
|
|
42
|
+
interface NativeCurrency {
|
|
43
|
+
name: string
|
|
44
|
+
symbol: string
|
|
45
|
+
decimals: number
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface Parent {
|
|
49
|
+
type: Type
|
|
50
|
+
chain: string
|
|
51
|
+
bridges?: Bridge[]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface Bridge {
|
|
55
|
+
url: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const Type = {
|
|
59
|
+
L2: 'L2',
|
|
60
|
+
Shard: 'shard',
|
|
61
|
+
} as const
|
|
62
|
+
type Type = (typeof Type)[keyof typeof Type]
|
|
63
|
+
|
|
64
|
+
export class EvmChain implements EvmChainBase {
|
|
65
|
+
public static fromRaw(data: Data) {
|
|
66
|
+
return new EvmChain(data)
|
|
67
|
+
}
|
|
68
|
+
public static from(chainId: number) {
|
|
69
|
+
return evmChains[chainId]
|
|
70
|
+
}
|
|
71
|
+
public static fromShortName(shortName: string) {
|
|
72
|
+
const chainId = evmChainShortNameToChainId[shortName]
|
|
73
|
+
if (!chainId) throw new Error(`Unknown chain short name: ${shortName}`)
|
|
74
|
+
return EvmChain.from(chainId)
|
|
75
|
+
}
|
|
76
|
+
public static fromChainId(chainId: number) {
|
|
77
|
+
return EvmChain.from(chainId)
|
|
78
|
+
}
|
|
79
|
+
public static txUrl(chainId: number, txHash: string): string {
|
|
80
|
+
return EvmChain.fromChainId(chainId)?.getTxUrl(txHash) ?? ''
|
|
81
|
+
}
|
|
82
|
+
public static blockUrl(chainId: number, blockHashOrHeight: string): string {
|
|
83
|
+
return EvmChain.fromChainId(chainId)?.getBlockUrl(blockHashOrHeight) ?? ''
|
|
84
|
+
}
|
|
85
|
+
public static tokenUrl(chainId: number, tokenAddress: string): string {
|
|
86
|
+
return EvmChain.fromChainId(chainId)?.getTokenUrl(tokenAddress) ?? ''
|
|
87
|
+
}
|
|
88
|
+
public static accountUrl(chainId: number, accountAddress: string): string {
|
|
89
|
+
return EvmChain.fromChainId(chainId)?.getAccountUrl(accountAddress) ?? ''
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare chainId: EvmChainBase['chainId']
|
|
93
|
+
declare name: EvmChainBase['name']
|
|
94
|
+
declare nativeCurrency: EvmChainBase['nativeCurrency']
|
|
95
|
+
declare shortName: EvmChainBase['shortName']
|
|
96
|
+
explorers: NonNullable<EvmChainBase['explorers']> = []
|
|
97
|
+
|
|
98
|
+
constructor(data: Data) {
|
|
99
|
+
Object.assign(this, data)
|
|
100
|
+
|
|
101
|
+
// process name overrides
|
|
102
|
+
const targets = ['Mainnet', 'Opera', 'Mainnet Shard 0']
|
|
103
|
+
for (const target of targets) {
|
|
104
|
+
if (data.name.includes(target)) {
|
|
105
|
+
this.name = data.name.replace(target, '').trim()
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (data.name === 'Boba Network') {
|
|
110
|
+
this.name = 'Boba Eth'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// process explorer overrides etc...
|
|
114
|
+
if (data.chainId === EvmChainId.SCROLL) {
|
|
115
|
+
this.explorers?.sort((explorer) =>
|
|
116
|
+
explorer.name === 'Scrollscan' ? -1 : 1,
|
|
117
|
+
)
|
|
118
|
+
} else if (data.chainId === EvmChainId.ARBITRUM_NOVA) {
|
|
119
|
+
this.explorers = [
|
|
120
|
+
{
|
|
121
|
+
name: 'Arbitrum Nova Explorer',
|
|
122
|
+
url: 'https://nova.arbiscan.io',
|
|
123
|
+
standard: 'EIP3091',
|
|
124
|
+
},
|
|
125
|
+
...(this.explorers ?? []),
|
|
126
|
+
]
|
|
127
|
+
} else if (data.chainId === EvmChainId.FILECOIN) {
|
|
128
|
+
this.name = 'Filecoin'
|
|
129
|
+
this.explorers?.sort((explorer) => (explorer.name === 'Filfox' ? -1 : 1))
|
|
130
|
+
} else if (data.chainId === EvmChainId.ZETACHAIN) {
|
|
131
|
+
this.name = 'ZetaChain'
|
|
132
|
+
this.explorers = [
|
|
133
|
+
{
|
|
134
|
+
name: 'ZetaChain Mainnet Explorer',
|
|
135
|
+
url: 'https://zetachain.blockscout.com',
|
|
136
|
+
standard: 'EIP3091',
|
|
137
|
+
},
|
|
138
|
+
]
|
|
139
|
+
} else if (data.chainId === EvmChainId.BLAST) {
|
|
140
|
+
this.explorers = [
|
|
141
|
+
{
|
|
142
|
+
name: 'Blast Explorer',
|
|
143
|
+
url: 'https://blastscan.io',
|
|
144
|
+
standard: 'EIP3091',
|
|
145
|
+
},
|
|
146
|
+
]
|
|
147
|
+
} else if (data.chainId === EvmChainId.SKALE_EUROPA) {
|
|
148
|
+
this.name = 'SKALE Europa'
|
|
149
|
+
} else if (data.chainId === EvmChainId.ROOTSTOCK) {
|
|
150
|
+
this.explorers?.sort((explorer) =>
|
|
151
|
+
explorer.name === 'blockscout' ? -1 : 1,
|
|
152
|
+
)
|
|
153
|
+
} else if (data.chainId === EvmChainId.MOONBEAM) {
|
|
154
|
+
this.explorers = [
|
|
155
|
+
{
|
|
156
|
+
name: 'Moonscan',
|
|
157
|
+
url: 'https://moonscan.io',
|
|
158
|
+
standard: 'EIP3091',
|
|
159
|
+
},
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
getTxUrl(txHash: string): string {
|
|
164
|
+
if (!this.explorers) return ''
|
|
165
|
+
for (const explorer of this.explorers) {
|
|
166
|
+
if (
|
|
167
|
+
explorer.standard === Standard.Eip3091 ||
|
|
168
|
+
EIP3091_OVERRIDE.includes(this.chainId)
|
|
169
|
+
) {
|
|
170
|
+
return `${explorer.url}/tx/${txHash}`
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return ''
|
|
174
|
+
}
|
|
175
|
+
getBlockUrl(blockHashOrHeight: string): string {
|
|
176
|
+
if (!this.explorers) return ''
|
|
177
|
+
for (const explorer of this.explorers) {
|
|
178
|
+
if (explorer.standard === Standard.Eip3091) {
|
|
179
|
+
return `${explorer.url}/block/${blockHashOrHeight}`
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return ''
|
|
183
|
+
}
|
|
184
|
+
getTokenUrl(tokenAddress: string): string {
|
|
185
|
+
if (!this.explorers) return ''
|
|
186
|
+
for (const explorer of this.explorers) {
|
|
187
|
+
if (
|
|
188
|
+
explorer.standard === Standard.Eip3091 ||
|
|
189
|
+
EIP3091_OVERRIDE.includes(this.chainId)
|
|
190
|
+
) {
|
|
191
|
+
return `${explorer.url}/token/${tokenAddress}`
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return ''
|
|
195
|
+
}
|
|
196
|
+
getAccountUrl(accountAddress: string): string {
|
|
197
|
+
if (!this.explorers) return ''
|
|
198
|
+
for (const explorer of this.explorers) {
|
|
199
|
+
if (
|
|
200
|
+
explorer.standard === Standard.Eip3091 ||
|
|
201
|
+
EIP3091_OVERRIDE.includes(this.chainId)
|
|
202
|
+
) {
|
|
203
|
+
return `${explorer.url}/address/${accountAddress}`
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return ''
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export const evmNatives = Object.fromEntries(
|
|
211
|
+
RAW.map((data): [EvmChainId, NativeCurrency] => [
|
|
212
|
+
data.chainId,
|
|
213
|
+
data.nativeCurrency,
|
|
214
|
+
]),
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
// Chain Id => Chain mapping
|
|
218
|
+
export const evmChains = Object.fromEntries(
|
|
219
|
+
RAW.map((data): [EvmChainId, EvmChain] => [data.chainId, new EvmChain(data)]),
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
// Chain Id => Chain mapping
|
|
223
|
+
export const evmChainsL2 = Object.fromEntries(
|
|
224
|
+
RAW.filter((data) => 'parent' in data && data.parent.type === Type.L2).map(
|
|
225
|
+
(data): [EvmChainId, EvmChain] => [data.chainId, new EvmChain(data)],
|
|
226
|
+
),
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
// EvmChainId array
|
|
230
|
+
export const evmChainIds = RAW.map((chain) => chain.chainId)
|
|
231
|
+
|
|
232
|
+
// Chain Short Name => Chain Id mapping
|
|
233
|
+
export const evmChainShortNameToChainId = Object.fromEntries(
|
|
234
|
+
RAW.map((data): [string, number] => [data.shortName, data.chainId]),
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
// Chain Id => Short Name mapping
|
|
238
|
+
export const evmChainShortName = Object.fromEntries(
|
|
239
|
+
RAW.map((data): [number, string] => [
|
|
240
|
+
data.chainId,
|
|
241
|
+
EvmChain.fromRaw(data).shortName,
|
|
242
|
+
]),
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
// Chain Id => Chain Name mapping
|
|
246
|
+
export const evmChainName = Object.fromEntries(
|
|
247
|
+
RAW.map((data): [number, string] => [
|
|
248
|
+
data.chainId,
|
|
249
|
+
EvmChain.fromRaw(data).name,
|
|
250
|
+
]),
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
export const getEvmChainInfo = (
|
|
254
|
+
input: string,
|
|
255
|
+
):
|
|
256
|
+
| { chainId: EvmChainId; networkName: EvmChainKey }
|
|
257
|
+
| { chainId: undefined; networkName: undefined } => {
|
|
258
|
+
const _networkName = input.toLowerCase()
|
|
259
|
+
const _chainId = Number.parseInt(input)
|
|
260
|
+
|
|
261
|
+
if (isEvmChainId(_chainId)) {
|
|
262
|
+
const networkName = EvmChainKey[_chainId]
|
|
263
|
+
return { chainId: _chainId, networkName }
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (isEvmNetworkNameKey(_networkName)) {
|
|
267
|
+
const chainId = EvmNetworkNameKey[_networkName]
|
|
268
|
+
return { chainId, networkName: _networkName }
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return { chainId: undefined, networkName: undefined }
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export const EVM_TESTNET_CHAIN_IDS = [
|
|
275
|
+
EvmChainId.ARBITRUM_TESTNET,
|
|
276
|
+
EvmChainId.AVALANCHE_TESTNET,
|
|
277
|
+
EvmChainId.BSC_TESTNET,
|
|
278
|
+
EvmChainId.FANTOM_TESTNET,
|
|
279
|
+
// EvmChainId.HECO_TESTNET,
|
|
280
|
+
// EvmChainId.HARMONY_TESTNET,
|
|
281
|
+
// EvmChainId.OKEX_TESTNET,
|
|
282
|
+
EvmChainId.POLYGON_TESTNET,
|
|
283
|
+
EvmChainId.SEPOLIA,
|
|
284
|
+
// EvmChainId.ROPSTEN,
|
|
285
|
+
// EvmChainId.RINKEBY,
|
|
286
|
+
// EvmChainId.GÖRLI,
|
|
287
|
+
// EvmChainId.KOVAN,
|
|
288
|
+
EvmChainId.CURTIS,
|
|
289
|
+
] as const
|
|
290
|
+
export type EvmTestnetChainId = (typeof EVM_TESTNET_CHAIN_IDS)[number]
|
|
291
|
+
|
|
292
|
+
export const isEvmChainId = (chainId: number): chainId is EvmChainId =>
|
|
293
|
+
Object.values(EvmChainId).includes(chainId as EvmChainId)
|
|
294
|
+
|
|
295
|
+
export const EvmChainKey = {
|
|
296
|
+
[EvmChainId.ARBITRUM]: 'arbitrum',
|
|
297
|
+
[EvmChainId.ARBITRUM_NOVA]: 'arbitrum-nova',
|
|
298
|
+
[EvmChainId.ARBITRUM_TESTNET]: 'arbitrum-testnet',
|
|
299
|
+
[EvmChainId.AVALANCHE]: 'avalanche',
|
|
300
|
+
[EvmChainId.AVALANCHE_TESTNET]: 'avalance-testnet',
|
|
301
|
+
[EvmChainId.BSC]: 'bsc',
|
|
302
|
+
[EvmChainId.BSC_TESTNET]: 'bsc-testnet',
|
|
303
|
+
[EvmChainId.CELO]: 'celo',
|
|
304
|
+
[EvmChainId.ETHEREUM]: 'ethereum',
|
|
305
|
+
[EvmChainId.FANTOM]: 'fantom',
|
|
306
|
+
[EvmChainId.FANTOM_TESTNET]: 'fantom-testnet',
|
|
307
|
+
[EvmChainId.FUSE]: 'fuse',
|
|
308
|
+
[EvmChainId.GÖRLI]: 'goerli',
|
|
309
|
+
[EvmChainId.HARMONY]: 'harmony',
|
|
310
|
+
// [EvmChainId.HARMONY_TESTNET]: 'harmony-testnet',
|
|
311
|
+
[EvmChainId.HECO]: 'heco',
|
|
312
|
+
// [EvmChainId.HECO_TESTNET]: 'heco-testnet',
|
|
313
|
+
// [EvmChainId.KOVAN]: 'kovan',
|
|
314
|
+
// [EvmChainId.ROPSTEN]: 'ropsten',
|
|
315
|
+
[EvmChainId.POLYGON]: 'polygon',
|
|
316
|
+
[EvmChainId.POLYGON_TESTNET]: 'matic-testnet',
|
|
317
|
+
[EvmChainId.MOONBEAM]: 'moonbeam',
|
|
318
|
+
// [EvmChainId.MOONBEAM_TESTNET]: 'moonbeam-testnet',
|
|
319
|
+
[EvmChainId.MOONRIVER]: 'moonriver',
|
|
320
|
+
[EvmChainId.OKEX]: 'okex',
|
|
321
|
+
// [EvmChainId.OKEX_TESTNET]: 'okex-testnet',
|
|
322
|
+
[EvmChainId.PALM]: 'palm',
|
|
323
|
+
// [EvmChainId.PALM_TESTNET]: 'palm-testnet',
|
|
324
|
+
// [EvmChainId.RINKEBY]: 'rinkeby',
|
|
325
|
+
[EvmChainId.TELOS]: 'telos',
|
|
326
|
+
[EvmChainId.GNOSIS]: 'gnosis',
|
|
327
|
+
[EvmChainId.OPTIMISM]: 'optimism',
|
|
328
|
+
[EvmChainId.KAVA]: 'kava',
|
|
329
|
+
[EvmChainId.METIS]: 'metis',
|
|
330
|
+
[EvmChainId.BOBA]: 'boba',
|
|
331
|
+
[EvmChainId.BOBA_AVAX]: 'boba-avax',
|
|
332
|
+
[EvmChainId.BOBA_BNB]: 'boba-bnb',
|
|
333
|
+
[EvmChainId.BTTC]: 'bttc',
|
|
334
|
+
// [EvmChainId.CONSENSUS_ZKEVM_TESTNET]: 'consensus-zkevm-testnet',
|
|
335
|
+
// [EvmChainId.SCROLL_ALPHA_TESTNET]: 'scroll-alpha-testnet',
|
|
336
|
+
// [EvmChainId.BASE_TESTNET]:'base-testnet',
|
|
337
|
+
[EvmChainId.POLYGON_ZKEVM]: 'polygon-zkevm',
|
|
338
|
+
[EvmChainId.THUNDERCORE]: 'thundercore',
|
|
339
|
+
[EvmChainId.HAQQ]: 'haqq',
|
|
340
|
+
[EvmChainId.CORE]: 'core',
|
|
341
|
+
[EvmChainId.ZKSYNC_ERA]: 'zksync-era',
|
|
342
|
+
[EvmChainId.LINEA]: 'linea',
|
|
343
|
+
[EvmChainId.BASE]: 'base',
|
|
344
|
+
[EvmChainId.FILECOIN]: 'filecoin',
|
|
345
|
+
[EvmChainId.SEPOLIA]: 'sepolia',
|
|
346
|
+
[EvmChainId.SCROLL]: 'scroll',
|
|
347
|
+
[EvmChainId.ZETACHAIN]: 'zetachain',
|
|
348
|
+
[EvmChainId.CRONOS]: 'cronos',
|
|
349
|
+
[EvmChainId.BLAST]: 'blast',
|
|
350
|
+
[EvmChainId.SKALE_EUROPA]: 'skale-europa',
|
|
351
|
+
[EvmChainId.ROOTSTOCK]: 'rootstock',
|
|
352
|
+
[EvmChainId.MANTLE]: 'mantle',
|
|
353
|
+
[EvmChainId.CURTIS]: 'curtis',
|
|
354
|
+
[EvmChainId.MANTA]: 'manta',
|
|
355
|
+
[EvmChainId.MODE]: 'mode',
|
|
356
|
+
[EvmChainId.TAIKO]: 'taiko',
|
|
357
|
+
[EvmChainId.ZKLINK]: 'zklink',
|
|
358
|
+
[EvmChainId.APE]: 'ape',
|
|
359
|
+
[EvmChainId.SONIC]: 'sonic',
|
|
360
|
+
[EvmChainId.HEMI]: 'hemi',
|
|
361
|
+
} as const satisfies Record<EvmChainId, string>
|
|
362
|
+
export type EvmChainKey = (typeof EvmChainKey)[keyof typeof EvmChainKey]
|
|
363
|
+
|
|
364
|
+
export const EvmNetworkNameKey = Object.fromEntries(
|
|
365
|
+
Object.entries(EvmChainKey).map(([key, value]) => [value, Number(key)]),
|
|
366
|
+
) as { [key in EvmChainKey]: EvmChainId }
|
|
367
|
+
|
|
368
|
+
export const isEvmNetworkNameKey = (key: string): key is EvmChainKey =>
|
|
369
|
+
Object.keys(EvmNetworkNameKey).includes(key)
|
|
370
|
+
|
|
371
|
+
export default evmChains
|
package/chain/id.ts
CHANGED
|
@@ -1,67 +1,11 @@
|
|
|
1
|
+
import { EvmChainId } from './evm/id.js'
|
|
2
|
+
import { AptosChainId } from './non-evm/aptos/id.js'
|
|
3
|
+
import { TronChainId } from './non-evm/tron/id.js'
|
|
4
|
+
|
|
1
5
|
export const ChainId = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
GÖRLI: 5,
|
|
6
|
-
// KOVAN: 42,
|
|
7
|
-
POLYGON: 137,
|
|
8
|
-
POLYGON_TESTNET: 80001,
|
|
9
|
-
FANTOM: 250,
|
|
10
|
-
FANTOM_TESTNET: 4002,
|
|
11
|
-
GNOSIS: 100,
|
|
12
|
-
BSC: 56,
|
|
13
|
-
BSC_TESTNET: 97,
|
|
14
|
-
ARBITRUM: 42161,
|
|
15
|
-
ARBITRUM_NOVA: 42170,
|
|
16
|
-
ARBITRUM_TESTNET: 421614,
|
|
17
|
-
AVALANCHE: 43114,
|
|
18
|
-
AVALANCHE_TESTNET: 43113,
|
|
19
|
-
HECO: 128,
|
|
20
|
-
// HECO_TESTNET: 256,
|
|
21
|
-
HARMONY: 1666600000,
|
|
22
|
-
// HARMONY_TESTNET: 1666700000,
|
|
23
|
-
OKEX: 66,
|
|
24
|
-
// OKEX_TESTNET: 65,
|
|
25
|
-
CELO: 42220,
|
|
26
|
-
PALM: 11297108109,
|
|
27
|
-
MOONRIVER: 1285,
|
|
28
|
-
FUSE: 122,
|
|
29
|
-
TELOS: 40,
|
|
30
|
-
MOONBEAM: 1284,
|
|
31
|
-
OPTIMISM: 10,
|
|
32
|
-
KAVA: 2222,
|
|
33
|
-
METIS: 1088,
|
|
34
|
-
BOBA: 288,
|
|
35
|
-
BOBA_AVAX: 43288,
|
|
36
|
-
BOBA_BNB: 56288,
|
|
37
|
-
BTTC: 199,
|
|
38
|
-
SEPOLIA: 11155111,
|
|
39
|
-
// CONSENSUS_ZKEVM_TESTNET: 59140,
|
|
40
|
-
// SCROLL_ALPHA_TESTNET: 534353,
|
|
41
|
-
// BASE_TESTNET: 84531,
|
|
42
|
-
POLYGON_ZKEVM: 1101,
|
|
43
|
-
THUNDERCORE: 108,
|
|
44
|
-
FILECOIN: 314,
|
|
45
|
-
HAQQ: 11235,
|
|
46
|
-
CORE: 1116,
|
|
47
|
-
ZKSYNC_ERA: 324,
|
|
48
|
-
LINEA: 59144,
|
|
49
|
-
BASE: 8453,
|
|
50
|
-
SCROLL: 534352,
|
|
51
|
-
ZETACHAIN: 7000,
|
|
52
|
-
CRONOS: 25,
|
|
53
|
-
BLAST: 81457,
|
|
54
|
-
SKALE_EUROPA: 2046399126,
|
|
55
|
-
ROOTSTOCK: 30,
|
|
56
|
-
MANTLE: 5000,
|
|
57
|
-
// RONIN: 2020,
|
|
58
|
-
CURTIS: 33111,
|
|
59
|
-
MANTA: 169,
|
|
60
|
-
MODE: 34443,
|
|
61
|
-
TAIKO: 167000,
|
|
62
|
-
ZKLINK: 810180,
|
|
63
|
-
APE: 33139,
|
|
64
|
-
SONIC: 146,
|
|
65
|
-
HEMI: 43111,
|
|
6
|
+
...EvmChainId,
|
|
7
|
+
...AptosChainId,
|
|
8
|
+
...TronChainId,
|
|
66
9
|
} as const
|
|
10
|
+
|
|
67
11
|
export type ChainId = (typeof ChainId)[keyof typeof ChainId]
|