创建一个未签名的交易,用于市场交易。
用法
visionWeb.transactionBuilder.createMarketSellAsset(
ownerAddress,
sellTokenName,
sellTokenQuantity,
buyTokenName,
buyTokenQuantity
);
入参
参数 | 描述 | 类型 | 默认值 |
---|---|---|---|
ownerAddress | 拥有者账户地址 | string | 登录账户 |
sellTokenName | 出售的代币名称 | number|string | - |
sellTokenQuantity | 出售的代币数量 | number | - |
buyTokenName | 购买的代币名称 | number|string | - |
buyTokenQuantity | 购买的代币数据 | number | - |
返回值
object,创建的 transaction 对象。
示例
visionWeb.transactionBuilder.createMarketSellAsset("1000003", 100, "1000004", 100);
> {
visible: false,
txID: '46310a36eacb148f02073ba1c132edcde9067870fdb816ba5549d882999578bc',
raw_data: {
contract: [ [Object] ],
ref_block_bytes: '4e4c',
ref_block_hash: 'ab481782b77da60b',
expiration: 1609677084000,
timestamp: 1609677025309
},
raw_data_hex: '0a024e4c2208ab481782b77da60b40e0aaecc1ec2e5a69083412650a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4d61726b657453656c6c4173736574436f6e7472616374122d0a1546b03b026cdeb86dc1c50d13f55a8ff5650eb252ad12073130303030303318642207313030303030342864709de0e8c1ec2e'
}