出售(委托)订单

说明

接口地址

POST /v2/order/delegate

请求参数

名称位置类型必选说明
order_nobodystringtrue订单号
settle_addressbodystringtrue收益收款钱包地址
resource_valuebodyintegertrue出售资源数
signed_txnbodySignedTransactiontrue已签名交易

参数示例

{
	"order_no": "2304177020986224644402",
	"settle_address": "THm1oFPxG8PLVg31wpjZiYg8nkvEbUDeUS",
	"resource_value": 8220000,
	"signed_txn": {
		"visible": false,
		"txID": "f9a4122de21a8071ee1c5bb673d09373c01ed432428b8bf476ef93cfa3c7bd55",
		"raw_data": {
			"contract": [{
				"parameter": {
					"value": {
						"balance": 488768000000,
						"resource": "ENERGY",
						"receiver_address": "41b36efab2013f6211bd7fc95e78eb13806fbfb820",
						"lock": true,
						"lock_period": 403200,
						"owner_address": "415572a99430cd7d13219013e7c1921d70418c29d3"
					},
					"type_url": "type.googleapis.com/protocol.DelegateResourceContract"
				},
				"type": "DelegateResourceContract"
			}],
			"ref_block_bytes": "dac4",
			"ref_block_hash": "1ad5a51debe627dd",
			"expiration": 1681776240000,
			"timestamp": 1681776182655
		},
		"raw_data_hex": "0a02dac422081ad5a51debe627dd4080cbb38df9305a76083912720a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412390a15415572a99430cd7d13219013e7c1921d70418c29d310011880a0dfe69c0e221541b36efab2013f6211bd7fc95e78eb13806fbfb820280170ff8ab08df930",
		"useTronHeader": true,
		"signature": ["xxxxxxxxx"],
		"signType": 0
	}
}

接口返回

名称类型必选说明
codeintegertrue状态码
msgstringtrue状态说明
request_idstringtrue
dataObjectfalse
» txObjectfalse
» » transaction_hashstringfalse委托交易hash
» » bandwidth_pointintegerfalse消耗带宽
» » resultObjectfalse广播结果
» » » resultboolfalse
» » » codeintegerfalse
» orderSellerOrderDetailfalse卖家订单详情

返回示例

{
    "code": 0,
    "msg": "ok",
    "request_id": "2a27fb90-3a8a-4c27-8d8d-eef27a35f160",
    "data": {
        "tx": {
            "transaction_hash": "2beda6734f433181c84a29b1529d885de0f8fe3bf3be4febfd3a2cb144eb0384",
            "bandwidth_point": 281,
            "result": {
                "result": true
            }
        },
        "order": {
            "order_no": "2304190664759388169206",
            "order_type": 0,
            "resource_type": 1,
            "owner_address": "",
            "receive_address": "TGGnzPi2DST6aeZPcKeLaqVKuFCj777777",
            "price_in_sun": 105,
            "min_amount": 100000,
            "min_payout": 23.625,
            "min_freeze": 484,
            "max_amount": 399989,
            "max_payout": 94.497401,
            "max_freeze": 1936,
            "freeze_time": 1681913707,
            "unfreeze_time": 0,
            "create_time": 1681911320,
            "resource_value": 500000,
            "resource_split_value": 100000,
            "frozen_resource_value": 100011,
            "rent_duration": 3,
            "rent_time_unit": "d",
            "rent_expire_time": 1682172907,
            "frozen_balance": 2420,
            "frozen_tx_id": "",
            "settle_amount": 0,
            "settle_address": "",
            "settle_time": 0,
            "status": 15
        }
    }
}

代码示例

curl --location --request POST 'https://feee.io/open/v2/order/delegate' \
--header 'key: <key>' \
--header 'User-Agent: Feee.io Client/1.0.0 (https://feee.io)' \
--header 'Content-Type: application/json' \
--data-raw '<body data here>'
package main

import (
   "fmt"
   "strings"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://feee.io/open/v2/order/delegate"
   method := "POST"

   payload := strings.NewReader(`<body data here>`)

   client := &http.Client {
   }
   req, err := http.NewRequest(method, url, payload)

   if err != nil {
      fmt.Println(err)
      return
   }
   req.Header.Add("key", "<key>")
   req.Header.Add("User-Agent", "Feee.io Client/1.0.0 (https://feee.io)")
   req.Header.Add("Content-Type", "application/json")

   res, err := client.Do(req)
   if err != nil {
      fmt.Println(err)
      return
   }
   defer res.Body.Close()

   body, err := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://feee.io/open/v2/order/delegate',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'POST',
   CURLOPT_POSTFIELDS =>'<body data here>',
   CURLOPT_HTTPHEADER => array(
      'key: <key>',
      'User-Agent: Feee.io Client/1.0.0 (https://feee.io)',
      'Content-Type: application/json'
   ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;


import http.client
import json

conn = http.client.HTTPSConnection("feee.io")
payload = "<body data here>"
headers = {
   'key': '<key>',
   'User-Agent': 'Feee.io Client/1.0.0 (https://feee.io)',
   'Content-Type': 'application/json'
}
conn.request("POST", "/open/v2/order/delegate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "<body data here>");
Request request = new Request.Builder()
   .url("https://feee.io/open/v2/order/delegate")
   .method("POST", body)
   .addHeader("key", "<key>")
   .addHeader("User-Agent", "Feee.io Client/1.0.0 (https://feee.io)")
   .addHeader("Content-Type", "application/json")
   .build();
Response response = client.newCall(request).execute();
上次更新: