sendTransaction

进行 vs 代币转账,如果提供私钥,将创建交易并进行签名广播。

用法

visionWeb.vs.sendTransaction(to, amount, privateKey);

入参

参数描述类型默认值
to目标账户地址string-
amount转账数量number-
privateKey私钥string-

返回值

object,交易对象。

示例

visionWeb.vs.sendTransaction("VEoh3WDXviqcPZ1qVNCQpqLHYzigrQWTPL",1000,"private key");
> {
  result: true,
  txid: 'd9113ee5296a889a3422574a56225700aee9ee1c74c9c35c48b97a8f2f8bb3fa',
  transaction: {
    visible: false,
    txID: 'd9113ee5296a889a3422574a56225700aee9ee1c74c9c35c48b97a8f2f8bb3fa',
    raw_data: {
      contract: [Array],
      ref_block_bytes: '63f4',
      ref_block_hash: 'e189960318516b6f',
      expiration: 1608375864000,
      timestamp: 1608375806197
    },
    raw_data_hex: '0a0263f42208e189960318516b6f40c095b0d5e72e5a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541401a8da8a7fc86f0087f8c62e630d10df10a963b121541934a8d6e5c47f83ae9742a1cdd94fd681fce3ef518e80770f5d1acd5e72e',
    signature: [
      '9afd23851facc4f93da59f1b140d33ef19d6c15f4d725e3dc8af2b0d0f4e374f55e8958265bcd5be5b6c189d5af4715cfc76d44869b7626f3e04e62af2582ddc01'
    ]
  }
}