aisland-dao / dex

Crosschain Dex
MIT License
4 stars 0 forks source link

Token Metadata #15

Closed poseidon-aisland closed 1 year ago

poseidon-aisland commented 1 year ago

add Token Metadata from https://coinmarketcap.com/api/documentation/v1/#operation/getV2CryptocurrencyInfo

poseidon-aisland commented 1 year ago

{ "status": { "timestamp": "2023-06-04T03:13:00.256Z", "error_code": 0, "error_message": null, "elapsed": 40, "credit_count": 1, "notice": null }, "data": { "3890": { "id": 3890, "name": "Polygon", "symbol": "MATIC", "category": "coin", "description": "Polygon (MATIC) is a cryptocurrency . Polygon has a current supply of 10,000,000,000 with 9,279,469,069.28493 in circulation. The last known price of Polygon is 0.90340961 USD and is up 0.65 over the last 24 hours. It is currently trading on 728 active market(s) with $166,429,505.03 traded over the last 24 hours. More information can be found at https://polygon.technology/.", "slug": "polygon", "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png", "subreddit": "0xPolygon", "notice": "", "tags": ["pos", "platform", "enterprise-solutions", "zero-knowledge-proofs", "scaling", "state-channel", "coinbase-ventures-portfolio", "layer-2", "binance-launchpad", "binance-labs-portfolio", "polygon-ecosystem", "moonriver-ecosystem", "injective-ecosystem"], "tag-names": ["PoS", "Platform", "Enterprise Solutions", "Zero Knowledge Proofs", "Scaling", "State Channel", "Coinbase Ventures Portfolio", "Layer 2", "Binance Launchpad", "Binance Labs Portfolio", "Polygon Ecosystem", "Moonriver Ecosystem", "Injective Ecosystem"], "tag-groups": ["ALGORITHM", "CATEGORY", "INDUSTRY", "CATEGORY", "CATEGORY", "CATEGORY", "CATEGORY", "CATEGORY", "CATEGORY", "CATEGORY", "PLATFORM", "PLATFORM", "PLATFORM"], "urls": { "website": ["https://polygon.technology/"], "twitter": ["https://twitter.com/0xPolygon"], "message_board": ["https://blog.polygon.technology/"], "chat": ["https://t.me/polygonofficial", "https://open.kakao.com/o/gUpfOhmb"], "facebook": [], "explorer": ["https://polygonscan.com/", "https://www.oklink.com/polygon", "https://etherscan.io/token/0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0", "https://explorer.solana.com/address/C7NNPWuZCNjZBfW5p6JvGsR8pUdsRpEdP1ZAhnoDwj7h"], "reddit": ["https://reddit.com/r/0xPolygon"], "technical_doc": ["https://polygon.technology/papers/"], "source_code": ["https://github.com/maticnetwork/contracts"], "announcement": [] }, "platform": { "id": "1027", "name": "Ethereum", "slug": "ethereum", "symbol": "ETH", "token_address": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0" }, "date_added": "2019-04-28T00:00:00.000Z", "twitter_username": "0xPolygon", "is_hidden": 0, "date_launched": null, "contract_address": [{ "contract_address": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0", "platform": { "name": "Ethereum", "coin": { "id": "1027", "name": "Ethereum", "symbol": "ETH", "slug": "ethereum" } } }, { "contract_address": "0xcc42724c6683b7e57334c4e856f4c9965ed682bd", "platform": { "name": "BNB Smart Chain (BEP20)", "coin": { "id": "1839", "name": "BNB", "symbol": "BNB", "slug": "bnb" } } }, { "contract_address": "C7NNPWuZCNjZBfW5p6JvGsR8pUdsRpEdP1ZAhnoDwj7h", "platform": { "name": "Solana", "coin": { "id": "5426", "name": "Solana", "symbol": "SOL", "slug": "solana" } } }, { "contract_address": "0x0000000000000000000000000000000000001010", "platform": { "name": "Polygon", "coin": { "id": "3890", "name": "Polygon", "symbol": "MATIC", "slug": "polygon" } } }, { "contract_address": "0x3405a1bd46b85c5c029483fbecf2f3e611026e45", "platform": { "name": "Moonbeam", "coin": { "id": "6836", "name": "Moonbeam", "symbol": "GLMR", "slug": "moonbeam" } } }, { "contract_address": "0xa2036f0538221a77a3937f1379699f44945018d0", "platform": { "name": "Polygon zkEVM", "coin": { "id": "3890", "name": "Polygon", "symbol": "MATIC", "slug": "polygon" } } }], "self_reported_circulating_supply": null, "self_reported_tags": null, "self_reported_market_cap": null, "infinite_supply": false } } }

poseidon-aisland commented 1 year ago

curl 'http://localhost:3000/tokenmetadata/?token=MATIC'

poseidon-aisland commented 1 year ago

Actually the server component is caching the data for 24 hours

poseidon-aisland commented 1 year ago

you 1000 calls per month with the free account of coinmarket cap. if the traffic increase for many different tokens you may need to switch to a paid plan.