-
-
Notifications
You must be signed in to change notification settings - Fork 280
correct list of codefi assets #8887
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
Open
bergarces
wants to merge
3
commits into
main
Choose a base branch
from
correct-price-api-list
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24
−11
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,11 +228,11 @@ export const ZERO_ADDRESS: Hex = | |
| */ | ||
| const chainIdToNativeTokenAddress: Record<Hex, Hex> = { | ||
| '0x89': '0x0000000000000000000000000000000000001010', // Polygon | ||
| '0x440': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda | ||
| '0x1388': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle | ||
| '0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis | ||
| '0x1e': '0x542fda317318ebf1d3deaf76e0b632741a7e677d', // Rootstock Mainnet - Native symbol: RBTC | ||
| '0x64': '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d', // Gnosis | ||
| '0x3dc': '0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0 | ||
| '0x440': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda | ||
| '0x1388': '0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -247,7 +247,10 @@ export const getNativeTokenAddress = (chainId: Hex): Hex => | |
| chainIdToNativeTokenAddress[chainId] ?? ZERO_ADDRESS; | ||
|
|
||
| // Source: https://github.com/consensys-vertical-apps/va-mmcx-price-api/blob/main/src/constants/slip44.ts | ||
| // We can only support PricesAPI V3 for EVM chains that have a CAIP-19 native asset mapping. | ||
| // This list is ONLY for chains that are supported by the Price API v3/spot-prices endpoint. | ||
| // Please check that endpoint returns a price for the given assetId before including it in this list. | ||
| // Please include a comment with the name of the chain and the native symbol. | ||
| // Please keep the list sorted by chain ID. | ||
| export const SPOT_PRICES_SUPPORT_INFO = { | ||
| '0x1': 'eip155:1/slip44:60', // Ethereum Mainnet - Native symbol: ETH | ||
| '0xa': 'eip155:10/slip44:60', // OP Mainnet - Native symbol: ETH | ||
|
|
@@ -270,13 +273,13 @@ export const SPOT_PRICES_SUPPORT_INFO = { | |
| '0xe8': 'eip155:232/erc20:0x0000000000000000000000000000000000000000', // Lens Mainnet - Native symbol: GHO | ||
| '0xfa': 'eip155:250/slip44:1007', // Fantom Opera - Native symbol: FTM | ||
| '0xfc': 'eip155:252/erc20:0x0000000000000000000000000000000000000000', // Fraxtal - native symbol: FRAX | ||
| '0x10b3e': 'eip155:68414/erc20:0x0000000000000000000000000000000000000000', // MapleStory Universe - no slip44 | ||
| '0x120': 'eip155:288/slip44:60', // Boba Network (Ethereum L2) - Native symbol: ETH | ||
| '0x141': 'eip155:321/slip44:641', // KCC Mainnet - Native symbol: KCS | ||
| '0x144': 'eip155:324/slip44:60', // zkSync Era Mainnet (Ethereum L2) - Native symbol: ETH | ||
| '0x150': 'eip155:336/slip44:809', // Shiden - Native symbol: SDN | ||
| '0x169': 'eip155:361/slip44:589', // Theta Mainnet - Native symbol: TFUEL | ||
| '0x2eb': 'eip155:747/slip44:539', // Flow evm - Native symbol: Flow | ||
| '0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0 | ||
| '0x3e7': 'eip155:999/slip44:2457', // HyperEVM - Native symbol: HYPE | ||
| '0x440': 'eip155:1088/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Metis Andromeda Mainnet (Ethereum L2) - Native symbol: METIS | ||
| '0x44d': 'eip155:1101/slip44:60', // Polygon zkEVM mainnet - Native symbol: ETH | ||
|
|
@@ -285,11 +288,12 @@ export const SPOT_PRICES_SUPPORT_INFO = { | |
| '0x531': 'eip155:1329/slip44:19000118', // Sei Mainnet - Native symbol: SEI | ||
| '0x6f0': 'eip155:1776/slip44:22000119', // Injective Mainnet - Native symbol: INJ | ||
| '0x74c': 'eip155:1868/erc20:0x0000000000000000000000000000000000000000', // Soneium - Native symbol: ETH | ||
| '0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2) | ||
| '0x9dd': 'eip155:2525/erc20:0x0000000000000000000000000000000000000000', // inEVM Mainnet - Native symbol: INV | ||
| '0xab5': 'eip155:2741/erc20:0x0000000000000000000000000000000000000000', // Abstract - Native symbol: ETH | ||
| '0x1079': 'eip155:4217/slip44:60', // Tempo Mainnet - No native asset | ||
| '0x10e6': 'eip155:4326/erc20:0x0000000000000000000000000000000000000000', // MegaETH Mainnet - Native symbol: ETH | ||
| '0x1388': 'eip155:5000/erc20:0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000', // Mantle - Native symbol: MNT | ||
| '0x1b58': 'eip155:7000/slip44:7000', // ZetaChain - Native symbol: ZETA | ||
| '0x2105': 'eip155:8453/slip44:60', // Base - Native symbol: ETH | ||
| '0x2611': 'eip155:9745/erc20:0x0000000000000000000000000000000000000000', // Plasma mainnet - native symbol: XPL | ||
| '0x2710': 'eip155:10000/slip44:145', // Smart Bitcoin Cash - Native symbol: BCH | ||
|
|
@@ -298,13 +302,17 @@ export const SPOT_PRICES_SUPPORT_INFO = { | |
| '0xa4b1': 'eip155:42161/slip44:60', // Arbitrum One - Native symbol: ETH | ||
| '0xa4ec': 'eip155:42220/slip44:52752', // Celo Mainnet - Native symbol: CELO | ||
| '0xa516': 'eip155:42262/slip44:474', // Oasis Emerald - Native symbol: ROSE | ||
| '0xa729': 'eip155:42793/erc20:0x0000000000000000000000000000000000000000', // Etherlink - Native symbol: XTZ (Tezos L2) | ||
| '0xa867': 'eip155:43111/erc20:0x0000000000000000000000000000000000000000', // Hemi - Native symbol: ETH | ||
| '0xa86a': 'eip155:43114/slip44:9005', // Avalanche C-Chain - Native symbol: AVAX | ||
| '0xa5bf': 'eip155:42431/slip44:60', // Tempo Testnet Moderato - No native asset | ||
| '0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH | ||
| '0xe708': 'eip155:59144/slip44:60', // Linea Mainnet - Native symbol: ETH | ||
| '0xed88': 'eip155:60808/erc20:0x0000000000000000000000000000000000000000', // BOB - Native symbol: ETH | ||
| '0x10b3e': 'eip155:68414/erc20:0x0000000000000000000000000000000000000000', // MapleStory Universe - no slip44 | ||
| '0x11d9b': 'eip155:73115/erc20:0x0000000000000000000000000000000000000000', // ICB Network - Native symbol: ICBX, | ||
| '0x138de': 'eip155:80094/erc20:0x0000000000000000000000000000000000000000', // Berachain - Native symbol: Bera', | ||
| '0x13c31': 'eip155:81457/slip44:60', // Blast Mainnet - Native symbol: ETH | ||
| '0x13e31': 'eip155:81457/slip44:60', // Blast Mainnet - Native symbol: ETH | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one had a typo in the key. |
||
| '0x15b38': 'eip155:88888/erc20:0x0000000000000000000000000000000000000000', // Chiliz Chain - Native symbol: CHZ | ||
| '0x17dcd': 'eip155:97741/erc20:0x0000000000000000000000000000000000000000', // Pepe Unchained Mainnet - Native symbol: PEPU | ||
| '0x18232': 'eip155:98866/erc20:0x0000000000000000000000000000000000000000', // Plume Mainnet - Narive symbol: Plume | ||
|
|
@@ -315,10 +323,6 @@ export const SPOT_PRICES_SUPPORT_INFO = { | |
| '0x15f900': 'eip155:1440000/erc20:0x0000000000000000000000000000000000000000', // xrpl-evm - native symbol: XRP | ||
| '0x4e454152': 'eip155:1313161554/slip44:60', // Aurora Mainnet (Ethereum L2 on NEAR) - Native symbol: ETH | ||
| '0x63564c40': 'eip155:1666600000/slip44:1023', // Harmony Mainnet Shard 0 - Native symbol: ONE | ||
| '0xdef1': 'eip155:57073/slip44:60', // Ink Mainnet - Native symbol: ETH | ||
| '0x3dc': 'eip155:988/erc20:0x779ded0c9e1022225f8e0630b35a9b54be713736', // Stable - Native symbol: USDT0 | ||
| '0xf043a': 'eip155:984122/slip44:984122', // Forma - Native symbol: TIA (Celestia) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed Forma as it is not supported by price api. Reordered the other keys. |
||
| '0x1b58': 'eip155:7000/slip44:7000', // ZetaChain - Native symbol: ZETA | ||
| } as const; | ||
|
|
||
| // MISSING CHAINS WITH NO NATIVE ASSET PRICES | ||
|
|
@@ -569,10 +573,9 @@ export function resetSupportedCurrenciesCache(): void { | |
| * This version of the token prices service uses V2 of the Codefi Price API to | ||
| * fetch token prices. | ||
| */ | ||
| export class CodefiTokenPricesServiceV2 implements AbstractTokenPricesService< | ||
| SupportedChainId, | ||
| SupportedCurrency | ||
| > { | ||
| export class CodefiTokenPricesServiceV2 | ||
| implements AbstractTokenPricesService<SupportedChainId, SupportedCurrency> | ||
| { | ||
| readonly #policy: ServicePolicy; | ||
|
|
||
| /** | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reordered the object keys, added a couple of missing chains for which we have support and removed one that had no prices (other than Tempo, which is a valid exception as there's no native asset).