sendAsset

创建一个未签名的交易,用于 vrc10 代币转账。(与 sendToken 一致)

用法

visionWeb.transactionBuilder.sendAsset(to, amount, tokenId, from, options);

入参

参数描述类型默认值
to转入账户地址string-
amount转账数量number0
tokenId代币 idstring|number-
from转出账户地址string默认账户地址
options可选参数,具体参数见下方object-

options 参数

参数描述类型默认值
permissionId设置多重签名时使用number-

返回值

object,创建的 transaction 对象。

示例

visionWeb.transactionBuilder.sendAsset("4653cd48c2723cb985679f4e44d99c64d22d89f41d",1000,"1000001");
> {
  visible: false,
  txID: '0ba97f68c86b68ada9a3c15e58336f9f220252f6f90b5abf93290c9d3ec57948',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: '4940',
    ref_block_hash: '560c5c46ec1f0fdf',
    expiration: 1608468924000,
    timestamp: 1608468866616
  },
  raw_data_hex: '0a0249402208560c5c46ec1f0fdf40e08ce081e82e5a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a154653cd48c2723cb985679f4e44d99c64d22d89f41d1215462d7a77f8bef6fe225bf5e353dd6a380f588a1496180a70b8ccdc81e82e'
}