小蜜锋 - 云代码空间
—— 技术宅拯救世界!
https://walletapi.onethingpcs.com
POST
Content-Type:application/json
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xe6637d20b74b7cce17d8eacf8516e85ee646fe74", "latest"], "id": 1 } //0xe6637d20b74b7cce17d8eacf8516e85ee646fe74 为钱包地址
{ "jsonrpc": "2.0", "id": 1, "result": "0x0" } //result 为16进制余额,需要处理,祥见代码
https://walletapi.onethingpcs.com
POST
Content-Type:application/json
["0xe6637d20b74b7cce17d8eacf8516e85ee646fe74", "0", "0", "1", "10"] //0xe6637d20b74b7cce17d8eacf8516e85ee646fe74 为钱包地址
Response
{ "totalnum": 73646, "result": [{ "timestamp": "1517381448", "type": 1, "tradeAccount": "0x625251ec47f46e35edb1c2dde31c1711d7c3e4ce", "amount": "0xa80d24677efef00000", "cost": "0x0", "hash": "0x5c9d52cba04dce07fa7fe63a9d7c1fd50bf0f72392309fb1d44dd9a3de4797a7", "title": "", "extra": "", "order_id": "20180131145048tppfbj0qty8odx5v" }] } //result 为每条交易记录
https://walletapi.onethingpcs.com
POST
Content-Type:application/json
{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0xe6637d20b74b7cce17d8eacf8516e85ee646fe74", "pending"], "id": 1 } //0xe6637d20b74b7cce17d8eacf8516e85ee646fe74 为钱包地址
Response
{ "jsonrpc": "2.0", "id": 1, "result": "0x9" }
https://walletapi.onethingpcs.com
POST
Content-Type: application/json
NC: IN
{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0xf86d0985174876e...c3a7753869946bfe21ef822ee72d3a8218d4"], "id": 1, "Nc": "IN" } //0xf86d0985174876e...c3a7753869946bfe21ef822ee72d3a8218d4 一次交易的hash值
{ "jsonrpc": "2.0", "id": 1, "result": "0x****" }//成功后返回 交易成功的hash值