租赁能量

接口调用

POST https://open.tronify.io/api/tronRent/addTronRentRecord

Headers

Name
Type
Description

api-key*

String

访问tronify.io买家管理平台获取。tradeType是userTrade时必传

Request Body

Name
Type
Description

fromAddress*

String

用户地址(创建买单的钱包地址)

sourceFlag*

String

渠道来源(需要双方约定一个名称来代表三方的渠道)

pledgeNum*

String

能量数量

orderType*

String

ENERGY

pledgeHour*

String

目前支持0、1、3

pledgeDay*

String

传值整数,如:0、1、2、3

tradeType*

String

userTrade

pledgeAddress*

String

能量/带宽接收地址。 可以传多个地址批量租赁,地址间用,分割

pledgeMinute*

String

目前支持0、10

{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "orderId": "16zi4ynw_sdvn_qv8h_ujfc_crfsgyi07zat",
        "fromAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",//钱包地址
        "pledgeAddress": "TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k",//接收能量地址
        "pledgeDay": 3,
        "source": "tronLink",
        "orderType": "ENERGY",
        "orderPrice": 110,
        "pledgeNum": 500,
        "pledgeTrxNum": 0.165
    }
}

调用示例

// example
const params = {
    fromAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
    pledgeAddress: 'TKghVbeEzvrV8GLK3YE1gRrjVHSf8rGB6k',
    pledgeDay: 3,
    pledgeHour: 0,
    pledgeMinute: 0,
    orderType: 'ENERGY',
    pledgeNum: 500,
    sourceFlag: 'tronLink',
    tradeType: 'userTrade'
}
const headers = {
  'api-key': 'your-api-key'
};
 const res = await axios.post('https://open.tronify.io/api/tronRent/addTronRentRecord',params, { headers })
 console.log(res)
 if(res.resCode === '100'){
   //...  
 }

Postman 示例

Last updated