AlphaWallet / alpha-wallet-ios

An advanced Ethereum/EVM mobile wallet
https://www.alphawallet.com
MIT License
598 stars 373 forks source link

Multi chain price oracles #3172

Open JamesSmartCell opened 3 years ago

JamesSmartCell commented 3 years ago

Coingekko now supports tickers for lots of chains.

If you use this API:

https://api.coingecko.com/api/v3/simple/token_price/[chain name]?contract_addresses=[list of CSV token addresses] &vs_currencies=USD&include_24hr_change=true";

You can replace the [chain name] with any of these:

1 - "ethereum"
100 -  "xdai"
56 - "binance-smart-chain"
137 - "polygon-pos"
61 - "ethereum-classic"
250 - "fantom"
43114 - "avalanche"
128 - "huobi-token" (HECO)
JamesSmartCell commented 3 years ago

https://api.coingecko.com/api/v3/asset_platforms

Gives the supported chains. If there's a 'chain_identifier' in the JSON then it's an ethereum chain. We can just use this list then every time we add a new chain if it's supported the tickers will automatically be set.

JamesSmartCell commented 3 years ago

I found these additional chains which I added in case we support them in the future:

        put(66, "okex-chain");
        put(1666600000, "harmony-shard-0");
        put(321, "kucoin-community-chain");
        put(88, "tomochain");
        put(42220, "celo");
hboon commented 1 year ago

Closing for now