使用exchange.IO()
函数调用以太坊RPC方法。
- 查询钱包中ETH的余额
exchange.IO("api", "eth", "eth_getBalance", owner, "latest") // owner为具体钱包地址
exchange.IO("api", "eth", "send", toAddress, toAmount) // toAddress为转账时,接收ETH的钱包地址,toAmount为数量
exchange.IO("api", "eth", "eth_gasPrice")
exchange.IO("api", "eth", "eth_estimateGas", data)