0x
可通過 Ox API (Avalanche) 交易的代幣列表
我正在嘗試通過 0x 在 Avalanche 上交易 TEDDY,當我呼叫令牌 API
curl -X 'GET' 'https://avalanche.api.0x.org/swap/v1/tokens' -H 'accept: application/json'
時,我只得到 AVAX、WAVAX 和 WETH,這些是目前唯一支持的 Avalanche 令牌嗎?{"records":[{"symbol":"AVAX","address":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","name":"AVAX","decimals":18},{"symbol":"WAVAX","address":"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7","name":"WAVAX","decimals":18},{"symbol":"WETH","address":"0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab","name":"Wrapped Ether","decimals":18}]}
端點的響應
/tokens
並非詳盡無遺,0x API 支持任何符合 ERC20 標準的代幣(不收取轉賬費用)。只需將您要交易的代幣地址
sellToken
和buyToken
參數傳遞給/swap/v1/quote
請求即可。這是為 AVAX 出售 1000 DAI 的範例請求:https ://avalanche.api.0x.org/swap/v1/quote?buyToken=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&sellAmount=1000000000000000000000&sellToken=0xd586e7f844cea2f87f50159267cbc27cb .
請參閱https://0x.org/docs/api了解更多資訊。
乾杯!