token列表
POST https://api.trustwallet.com/v3/tokens?version=1 HTTP/1.1
client: com.wallet.crypto.trustapp
client-build: 5005
client-version: 1.11.1
client-locale: zh
client-id: 9cacd8e8a6dd7e65
User-Agent: (com.wallet.crypto.trustapp; build:5005; Android: SDK-23 OS-REL-6.0.1) OkHttp
x-api-key: d3713699c4ff91bc2e834c5e36aea57c
Content-Type: application/json; charset=utf-8
Content-Length: 577
Host: api.trustwallet.com
Connection: Keep-Alive
Accept-Encoding: gzip
{"60":["0xcece9a72cD8ef15070FB944f958d413206222Fe8"],"820":["0x43edB0E49E6eC898963d76313D6b43c62E8a93eD"],"6060":["0xA42E820DB9A516aCb08Be5AfcBE0125295ed27Eb"],"61":["0x0295D78dAC2A2cA79A517312f0482c3F3678AD4D"],"178":["0x8bc5526Bf569fAf6AAd8bb58201691D329Dc6606"],"5718350":["0x86ccf6d7894593c33a3c90dd0d16d94db1c8858f"],"195":["TJDFkbGGnT7bk1HKuNcJShcRwSRB8ApaN5"],"889":["0x7d83E96B504f93512F6B624fCEb2C9627FeBC2E6"],"714":["bnb129ene9pqznrrvd0yv7snlr3jmacrpwrmuzael7"],"1001":["0xa84464c6D7f5D7d95ee1586e63e55215346591EB"],"5741564":["3PGunvfFZTn1ygSwPZaDpvGSna4XRLMADF9"]}
{"total":4,"docs":[{"address":"0x4CC19356f2D37338b9802aa8E8fc58B0373296E7","name":"SelfKey","symbol":"KEY","type":"ERC20","decimals":18,"coin":60,"token_id":"0x4CC19356f2D37338b9802aa8E8fc58B0373296E7","asset_id":"c60_t0x4CC19356f2D37338b9802aa8E8fc58B0373296E7"},{"address":"0xDF2C7238198Ad8B389666574f2d8bc411A4b7428","name":"Mainframe Token","symbol":"MFT","type":"ERC20","decimals":18,"coin":60,"token_id":"0xDF2C7238198Ad8B389666574f2d8bc411A4b7428","asset_id":"c60_t0xDF2C7238198Ad8B389666574f2d8bc411A4b7428"},{"address":"0xC12D1c73eE7DC3615BA4e37E4ABFdbDDFA38907E","name":"KickToken","symbol":"KICK","type":"ERC20","decimals":8,"coin":60,"token_id":"0xC12D1c73eE7DC3615BA4e37E4ABFdbDDFA38907E","asset_id":"c60_t0xC12D1c73eE7DC3615BA4e37E4ABFdbDDFA38907E"},{"address":"0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39","name":"HEX","symbol":"HEX","type":"ERC20","decimals":8,"coin":60,"token_id":"0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39","asset_id":"c60_t0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39"}]}
以太坊jsonrpc接口
POST https://ethereum-rpc.trustwalletapp.com/
{"id":1,"jsonrpc":"2.0","method":"eth_getBalance","params":["0xcece9a72cd8ef15070fb944f958d413206222fe8","latest"]}
{"jsonrpc":"2.0","id":1,"result":"0x2385cc785f7f9e6"}
eth_call多个一块查询的示例
POST https://ethereum-rpc.trustwalletapp.com/ HTTP/1.1
client: com.wallet.crypto.trustapp
client-build: 5005
client-version: 1.11.1
client-locale: zh
client-id: 9cacd8e8a6dd7e65
User-Agent: (com.wallet.crypto.trustapp; build:5005; Android: SDK-23 OS-REL-6.0.1) OkHttp
x-api-key: d3713699c4ff91bc2e834c5e36aea57c
Content-Type: application/json; charset=utf-8
Content-Length: 1017
Host: ethereum-rpc.trustwalletapp.com
Connection: Keep-Alive
Accept-Encoding: gzip
[{"id":11,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000cece9a72cd8ef15070fb944f958d413206222fe8","from":"0xcece9a72cd8ef15070fb944f958d413206222fe8","to":"0x4cc19356f2d37338b9802aa8e8fc58b0373296e7"},"latest"]},{"id":12,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000cece9a72cd8ef15070fb944f958d413206222fe8","from":"0xcece9a72cd8ef15070fb944f958d413206222fe8","to":"0xc12d1c73ee7dc3615ba4e37e4abfdbddfa38907e"},"latest"]},{"id":13,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000cece9a72cd8ef15070fb944f958d413206222fe8","from":"0xcece9a72cd8ef15070fb944f958d413206222fe8","to":"0x2b591e99afe9f32eaa6214f7b7629768c40eeb39"},"latest"]},{"id":14,"jsonrpc":"2.0","method":"eth_call","params":[{"data":"0x70a08231000000000000000000000000cece9a72cd8ef15070fb944f958d413206222fe8","from":"0xcece9a72cd8ef15070fb944f958d413206222fe8","to":"0xdf2c7238198ad8b389666574f2d8bc411a4b7428"},"latest"]}]
[{"jsonrpc":"2.0","id":11,"result":"0x00000000000000000000000000000000000000000000004419f88a8e053fb000"},{"jsonrpc":"2.0","id":12,"result":"0x000000000000000000000000000000000000000000000000000050d809593800"},{"jsonrpc":"2.0","id":13,"result":"0x00000000000000000000000000000000000000000000000000000002540be400"},{"jsonrpc":"2.0","id":14,"result":"0x000000000000000000000000000000000000000000000031b5ecaac746d0c000"}]
bnb rpc接口
GET https://binance-rpc.trustwalletapp.com/v1/account/bnb129ene9pqznrrvd0yv7snlr3jmacrpwrmuzael7
{"code":404,"message":"account not found"}
币种汇率接口
POST https://blockatlas.trustwallet.com/v1/market/ticker HTTP/1.1
client: com.wallet.crypto.trustapp
client-build: 5005
client-version: 1.11.1
client-locale: zh
client-id: 9cacd8e8a6dd7e65
User-Agent: (com.wallet.crypto.trustapp; build:5005; Android: SDK-23 OS-REL-6.0.1) OkHttp
x-api-key: d3713699c4ff91bc2e834c5e36aea57c
Content-Type: application/json; charset=UTF-8
Content-Length: 1810
Host: blockatlas.trustwallet.com
Connection: Keep-Alive
Accept-Encoding: gzip
{"assets":[{"coin":60,"type":"coin"},{"coin":820,"type":"coin"},{"coin":6060,"type":"coin"},{"coin":61,"type":"coin"},{"coin":178,"type":"coin"},{"coin":818,"token_id":"0x0000000000000000000000000000456E65726779","type":"token"},{"coin":818,"type":"coin"},{"coin":5718350,"type":"coin"},{"coin":195,"type":"coin"},{"coin":74,"type":"coin"},{"coin":889,"type":"coin"},{"coin":0,"type":"coin"},{"coin":2,"type":"coin"},{"coin":145,"type":"coin"},{"coin":5,"type":"coin"},{"coin":136,"type":"coin"},{"coin":133,"type":"coin"},{"coin":714,"type":"coin"},{"coin":144,"type":"coin"},{"coin":1729,"type":"coin"},{"coin":148,"type":"coin"},{"coin":2017,"type":"coin"},{"coin":425,"type":"coin"},{"coin":242,"type":"coin"},{"coin":1001,"type":"coin"},{"coin":118,"type":"coin"},{"coin":459,"type":"coin"},{"coin":3,"type":"coin"},{"coin":500,"token_id":"tfuel","type":"token"},{"coin":500,"type":"coin"},{"coin":1024,"token_id":"ong","type":"token"},{"coin":1024,"type":"coin"},{"coin":17,"type":"coin"},{"coin":14,"type":"coin"},{"coin":2301,"type":"coin"},{"coin":19167,"type":"coin"},{"coin":313,"type":"coin"},{"coin":304,"type":"coin"},{"coin":175,"type":"coin"},{"coin":5741564,"type":"coin"},{"coin":457,"type":"coin"},{"coin":2718,"type":"coin"},{"coin":235,"type":"coin"},{"coin":42,"type":"coin"},{"coin":283,"type":"coin"},{"coin":165,"type":"coin"},{"coin":20,"type":"coin"},{"coin":1023,"type":"coin"},{"coin":397,"type":"coin"},{"coin":501,"type":"coin"},{"coin":60,"token_id":"0xC12D1c73eE7DC3615BA4e37E4ABFdbDDFA38907E","type":"token"},{"coin":60,"token_id":"0xDF2C7238198Ad8B389666574f2d8bc411A4b7428","type":"token"},{"coin":60,"token_id":"0x4CC19356f2D37338b9802aa8E8fc58B0373296E7","type":"token"},{"coin":60,"token_id":"0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39","type":"token"}],"currency":"USD"}
{"currency":"USD","docs":[{"coin":60,"token_id":"0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39","type":"token","price":{"change_24h":1.96974,"provider":"coinmarketcap","value":0.00352322201708}},{"coin":459,"type":"coin","price":{"change_24h":12.7586,"provider":"coinmarketcap","value":1.84117930046}},...]}
比特币余额同步
GET https://bitcoin-rpc.trustwalletapp.com/v2/xpub/zpub6rfFWvovFe2XoRAiM389SH1aLVbqJQz8M4EuQ9B2ApytF3hndrwfx3XytCr9xgN8Lz2r7eMSjFXdPvhGbYoQPTrpKENy6CwzHKpBzjWJ1Gf?tokens=derived HTTP/1.1
client: com.wallet.crypto.trustapp
client-build: 5005
client-version: 1.11.1
client-locale: zh
client-id: 9cacd8e8a6dd7e65
User-Agent: (com.wallet.crypto.trustapp; build:5005; Android: SDK-23 OS-REL-6.0.1) OkHttp
x-api-key: d3713699c4ff91bc2e834c5e36aea57c
Host: bitcoin-rpc.trustwalletapp.com
Connection: Keep-Alive
Accept-Encoding: gzip
{
"page":1,
"totalPages":1,
"itemsOnPage":1000,
"address":"zpub6rfFWvovFe2XoRAiM389SH1aLVbqJQz8M4EuQ9B2ApytF3hndrwfx3XytCr9xgN8Lz2r7eMSjFXdPvhGbYoQPTrpKENy6CwzHKpBzjWJ1Gf",
"balance":"29518",
"totalReceived":"7256201",
"totalSent":"7226683",
"unconfirmedBalance":"0",
"unconfirmedTxs":0,
"txs":63,
"txids":[
"abfc090d8281c026ea43794471dcc17c18a50dd0c15831eb974ae2b28462166b",
...
"523bce5a63ebcf28ce7b0816cd7f153bb282be34a0dcb8f35396916fe25601a7"],
"usedTokens":44,
"tokens":[
{
"type":"XPUBAddress",
"name":"bc1q0hwcnp2adlam0zt4esv90lmt83arkncq4l6sck",
"path":"m/84'/0'/0'/0/0",
"transfers":2,
"decimals":8,
"balance":"0",
"totalReceived":"5460",
"totalSent":"5460"
},
...
{
"type":"XPUBAddress",
"name":"bc1qs8ukyfua65u30efmv3n5ls5haps0k4n9ervsqd",
"path":"m/84'/0'/0'/1/58",
"transfers":0,
"decimals":8
}]
}
文档信息
- 本文作者:itlgl
- 本文链接:https://itlgl.com/note/2020/07/25/issues-43/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)