tradeExchangeTokens

在基于 Bancor 协议的交易所上进行代币交易。

用法

tronWeb.transactionBuilder.tradeExchangeTokens(exchangeID, tokenName, tokenAmountSold, tokenAmountExpected, ownerAddress, options)

参数

exchangeID

非负整数交换 ID

integer

tokenID

代币ID

string

tokenAmountSold

实际售出的代币数量

integer

tokenAmountExpected

预期的代币数量

integer

ownerAddress

代币所有者地址十六进制

hexString

options

Permission Id

integer

返回

Object

示例

tronWeb.transactionBuilder.tradeExchangeTokens(1, "1000003",1000,1000,"410ca7c49aa44d26aabfe7f594c645cf9f17a4ff70",1).then(result => console.log(result));
>{
    "visible": false,
    "txID": "545ed6a5eb793fe5903ec177761b2504147e010875644fce321f0dbb28799456",
    "raw_data": {
        "contract": [
            {
                "parameter": {
                    "value": {
                        "exchange_id": 1,
                        "token_id": "31303030303033",
                        "expected": 1000,
                        "owner_address": "410ca7c49aa44d26aabfe7f594c645cf9f17a4ff70",
                        "quant": 1000
                    },
                    "type_url": "type.googleapis.com/protocol.ExchangeTransactionContract"
                },
                "type": "ExchangeTransactionContract"
            }
        ],
        "ref_block_bytes": "c778",
        "ref_block_hash": "db086b31f0f10f69",
        "expiration": 1581650238000,
        "timestamp": 1581650180365
    },
    "raw_data_hex": "0a02c7782208db086b31f0f10f6940b0b4cd8d842e5a68082c12640a38747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e45786368616e67655472616e73616374696f6e436f6e747261637412280a15410ca7c49aa44d26aabfe7f594c645cf9f17a4ff7010011a073130303030303320e80728e807708df2c98d842e"
}