createTokenExchange

创建一个未签名的交易,用于创建 vrc10 和 vrc10 的交易对。

用法

visionWeb.transactionBuilder.createTokenExchange(
  firstTokenName,
  firstTokenBalance,
  secondTokenName,
  secondTokenBalance
  ownerAddress,
  options
);

入参

参数描述类型默认值
firstTokenNamevrc10 代币名称string-
firstTokenBalancevrc10 数量number-
secondTokenNamevrc10 代币名称string-
secondTokenBalancevrc10 数量number-
ownerAddress交易对拥有者账户地址string默认账户地址
options可选参数,具体参数见下方object-

options 参数

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

返回值

object,创建的 transaction 对象。

示例

visionWeb.transactionBuilder.createTokenExchange("1000001",1000,"1000002",1000);
> {
  visible: false,
  txID: '0f6a4552273dc22dd07332034cd529382a2a3d47eadc0c4b22c181f8b96e9c36',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: '50a8',
    ref_block_hash: 'aa1cbccf14841e87',
    expiration: 1608561360000,
    timestamp: 1608561304113
  },
  raw_data_hex: '0a0250a82208aa1cbccf14841e874080f9e9ade82e5a68082912640a33747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e45786368616e6765437265617465436f6e7472616374122d0a1541401a8da8a7fc86f0087f8c62e630d10df10a963b120731303030303031180a220731303030303034280a70b1c4e6ade82e'
}