资源加载中... loading...

调用以太坊RPC方法

使用exchange.IO()函数调用以太坊RPC方法。 - 查询钱包中ETH的余额

  exchange.IO("api", "eth", "eth_getBalance", owner, "latest")   // owner为具体钱包地址
  • ETH转账
    
    exchange.IO("api", "eth", "send", toAddress, toAmount)   // toAddress为转账时,接收ETH的钱包地址,toAmount为数量
    
  • 查询gasPrice
    
    exchange.IO("api", "eth", "eth_gasPrice")
    
  • 查询eth_estimateGas
    
    exchange.IO("api", "eth", "eth_estimateGas", data)
    
注册ABI 支持encode