injectExchangeTokens

创建将代币注入基于 Bancor 协议的交易对的交易。

用法

tronWeb.transactionBuilder.injectExchangeTokens(exchangeID, tokenID, tokenAmount, ownerAddress, options);

参数类型

参数

描述

数据类型

exchangeID

非负整数交易对的ID。

Integer

tokenID

注资代币的ID。

Integer

tokenAmount

注资代币数量。

Integer

ownerAddress

交易对创建者的地址。

String

options

可选参数,多重签名时使用,设置交易多重签名时使用的permissionId。

Integer

返回值类型
Object

示例

// 示例 1
> tronWeb.transactionBuilder.injectExchangeTokens(1, "1000003",10000,"410ca7c49aa44d26aabfe7f594c645cf9f17a4ff70",1).then(result => console.log(result));
Promise { <pending> }
> {
  visible: false,
  txID: 'cdac0a375d5042042aef204301d67181bb83390ba060b11033a7913221af0ebb',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: 'ce03',
    ref_block_hash: '620c5f8f84ac6944',
    expiration: 1581261939000,
    timestamp: 1581261879534
  },
  raw_data_hex: '0a02ce032208620c5f8f84ac694440b8c2b9d4822e5a60082a125c0a33747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e45786368616e6765496e6a656374436f6e747261637412250a15410ca7c49aa44d26aabfe7f594c645cf9f17a4ff7010011a073130303030303320904e70eef1b5d4822e'
}        

//示例 2
> tronWeb.transactionBuilder.injectExchangeTokens(1, "1000003",10000,"TB8865sqTQ3qxWqhNQRCBov3KtPXFRPccK",1).then(result => console.log(result));
Promise { <pending> }
> {
  visible: false,
  txID: 'a05cace199e2a1d39410adfac5f17a18e63f43bdc78b5840f63a083cbcfa6cb9',
  raw_data: {
    contract: [ [Object] ],
    ref_block_bytes: '72a2',
    ref_block_hash: 'd85b910374acd2ed',
    expiration: 1581388404000,
    timestamp: 1581388345878
  },
  raw_data_hex: '0a0272a22208d85b910374acd2ed40a0aae090832e5a60082a125c0a33747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e45786368616e6765496e6a656374436f6e747261637412250a15410ca7c49aa44d26aabfe7f594c645cf9f17a4ff7010011a073130303030303320904e7096e4dc90832e'
}