查询租赁能量所需费用
接口调用
POST
https://open.tronify.io/api/tronRent/queryPreorderInfo
以下参数带*字段为必填,不带*号为选填
Request Body
Name
Type
Description
fromAddress*
String
用户地址(创建买单的钱包地址)
pledgeAddress*
String
能量/带宽接收地址
pledgeNum*
int
能量数量(需大于32000)
tradeType*
String
fastTrade
sourceFlag*
String
渠道来源(需要双方约定一个名称来代表三方的渠道)
orderType*
String
ENERGY
pledgeDay*
String
租用时长,单位(天)
支持0-30天
(pledgeDay
, pledgeHour
,pledgeMinute
不能同时为0)
pledgeHour*
String
租用时长,单位(小时)
取值0、1、3
pledgeMinute*
String
租用时长,单位(分钟)
取值0、10
extraTrxNum
String
用户想要额外接收到的trx数量 取值范围(0.5, 500](usdt租赁模式)
pledgeBandwidthNum
String
用户想要额外接收到的带宽数量 传0或者不传,表示不需要租赁带宽(usdt租赁模式)
{
"resCode": 100,
"resMsg": "Success",
"data": {
"fromAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",//用户钱包地址
"pledgeAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",//用户接收能量地址
"pledgeDay": "0",
"pledgeHour": "0",
"pledgeMinute": "10",
"source": "tronLink",
"orderType": "ENERGY",
"orderPrice": 90,
"pledgeNum": 96400,
"pledgeTrxNum": "10.512",//trx模式支付数量
"usdtModeAvailable": true,
"payCoinCode": "USDT", //支付币种
"payCoinAmt": "3.124527",//usdt模式支付数量
"extraTrxNum": "0.8",//usdt模式用户想要额外得到的trx数量
"pledgeBandwidthNum": "0",//usdt模式用户想要额度得到的带宽数量
"activeAccountFee": "0",//usdt模式激活地址费用
"purchaseTRXFee": "0.397105",//usdt模式用户想要额外得到trx的费用
"purchaseBandwidthFee": "0",//usdt模式用户想要额度得到带宽的费用
"purchaseEnergyFee": "2.727422"//usdt模式用户租赁能量的费用
}
}
调用示例
// example
const params = {
fromAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
pledgeAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
tradeType: 'fastTrade',
pledgeDay: '0',
pledgeHour: '0',
pledgeMinute: '10',
orderType: 'ENERGY',
pledgeNum: 32000,
sourceFlag: 'tronLink',
extraTrxNum: '0.8',
pledgeBandwidthNum: '0'
}
const res = await axios.post('https://open.tronify.io/api/tronRent/queryPreorderInfo',params)
console.log(res)
if(res.resCode === '100'){
//...
}
Postman 示例

Last updated