Skip to main content

Delegate Resource

You need to start Freezing $TRX before you can Delegate Resource BANDWIDTH or ENERGY to other accounts.

warning

You need to complete signing tx in 1 minute after tx generated

In the following guide we will illustrate how to delegate bandwidth $TRX.

Step 1 - Initiate Flow

Endpoint : flow

Method : POST

Request

Body

  • service_code* - string : Service code, use service endpoint to get the service code.
  • flow* - string : The operation to perform delegate.
  • callback_url - string : Your callback url endpoint to get update of state from our systems.
Request Sample
{
"service_code": "staking-tron",
"flow": "delegate"
}

Response

  • id - string : Flow ID.
  • service_code - string : Current flow service code.
  • flow - string : Current flow name.
  • inquiry_id - string : ID For next Request Step Inquiry.
  • inquiry_identifier - string : Next step identifier name.
    • create-delegate-tx : Next you need to assign the delegate data within the tx creation.
  • state - string : Current state of your flow.
  • inputs - Array<Object> : Next step inputs.
  • data - Object : Stored data of your flow.
  • created_at - Timestamp RFC3339 : Time when flow created.
  • updated_at - Timestamp RFC3339 : Last flow updated.
  • expired_at - Timestamp RFC3339 : Maximum time you have to finish the process before flow dropped by system, will always increment by your last action + 2 hours.
Success Sample
{
"status": 1,
"status_service": "00",
"status_number": "F000001",
"status_code": "SSSSSS",
"message": "success",
"data": {
"id": "d6165cac-8bdd-4749-aa57-d3ab8b46e0fc",
"service_code": "staking-tron",
"flow": "delegate",
"inquiry_id": "e3992bc3-90cb-420f-b7f3-e2a109a5f42b",
"inquiry_identifier": "create-delegate-tx",
"state": "initialized",
"inputs": [
{
"type": "string",
"name": "from_address",
"display": "From Address",
"description": "Owner Address",
"validations": [
{
"type": "string",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "string",
"name": "to_address",
"display": "To Address",
"description": "Recipient Address",
"validations": [
{
"type": "string",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "string",
"name": "resource",
"display": "Resource",
"description": "Resource can be bandwidth or energy",
"validations": [
{
"type": "string",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "decimal",
"name": "amount",
"display": "Amount",
"description": "Amount",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "numericality",
"options": {
"greater_than": "0"
}
}
],
"array": 0,
"default_val": null,
"visibility": 1
},
{
"type": "string",
"name": "lock_period",
"display": "Lock Period",
"description": "Lock Period of delegate",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "timestamp",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
}
],
"data": {
"amount": "",
"callback_url": "",
"delegate_tx": "",
"from_address": "",
"lock_period": "",
"resource": "",
"signed_delegate_tx": "",
"to_address": ""
},
"created_at": "2025-03-19T16:53:41Z",
"updated_at": "2025-03-19T16:53:41Z",
"expired_at": "2025-03-20T16:53:41Z"
}
}

Step 2 - Create Delegate Tx

Endpoint : flow/{:id}/next

Method : POST

Request

Body

  • inquiry_id* - string : Your inquiry id from step 1
  • data - object* : Wrapped data object
    • from_address* - string : Address which you want to use to delegate resource.
    • to_address* - string : Recipient Address of resource.
    • amount* - float64 : Amount of $TRX resource you want to delegate.
    • resource - string : The resource to delegate $TRX, you can choose between BANDWIDTH or ENERGY.
    • lock_period - Timestamp RFC3339 : Optional. Until when you want to lock the resource at the target address.
      warning

      Please note, if you have previously delegated to a recipient address, and it has a lock period that has not expired, and then you want to do an additional delegate by locking it as well, the value of the lock period must be greater than the previous lock period. Or You can leave this empty so the following resource can be undelegate anytime.

Sample Endpoint Request : flow/d6165cac-8bdd-4749-aa57-d3ab8b46e0fc/next

Request Sample
{
"inquiry_id": "e3992bc3-90cb-420f-b7f3-e2a109a5f42b",
"data": {
"from_address": "TTQL7uYtjHpbzpayLUJCZsKBMMpFCw5rKB",
"to_address": "TDoAQGrJ6wUaYBaWF8jNE76u2YYWCnnPDi",
"resource": "bandwidth",
"amount": 100,
"lock_period": "2025-03-20T00:10:00+07:00"
}
}

Response

  • id - string : Flow ID.
  • service_code - string : Current flow service code.
  • flow - string : Current flow name.
  • inquiry_id - string : ID For next Request Step Inquiry.
  • inquiry_identifier - string : Next step identifier name.
    • delegate-sign : Signing and broadcast the delegate tx.
  • state - string : Current state of your flow.
  • inputs - Array<Object> : Next step inputs.
  • data - Object : Stored data of your flow.
  • created_at - Timestamp RFC3339 : Time when flow created.
  • updated_at - Timestamp RFC3339 : Last flow updated.
  • expired_at - Timestamp RFC3339 : Maximum time you have to finish the process before flow dropped by system, will always increment by your last action + 2 hours.
Success Sample
{
"status": 1,
"status_service": "00",
"status_number": "F000001",
"status_code": "SSSSSS",
"message": "success create data",
"data": {
"id": "023172e2-8fed-4395-80d3-bb2ec3026de9",
"service_code": "staking-tron",
"flow": "delegate",
"inquiry_id": "69c07f9c-2426-41bf-82f5-c72bac0be573",
"inquiry_identifier": "delegate-sign",
"state": "initialized",
"inputs": [
{
"type": "string",
"name": "signed_delegate_tx",
"display": "Signed Delegate Tx",
"description": "",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "signed_transaction",
"options": {}
}
],
"array": 0,
"default_val": null,
"visibility": 1
}
],
"data": {
"amount": "100",
"callback_url": "",
"delegate_tx": "9f0918d95ee0dd5f2633b6aee1040f36d1cb374eec3a6e2df263dbcff74422cd",
"from_address": "TTQL7uYtjHpbzpayLUJCZsKBMMpFCw5rKB",
"lock_period": "2025-03-20T00:10:00+07:00",
"resource": "bandwidth",
"signed_delegate_tx": "",
"to_address": "TDoAQGrJ6wUaYBaWF8jNE76u2YYWCnnPDi"
},
"created_at": "2025-03-19T17:06:22Z",
"updated_at": "2025-03-19T17:06:27Z",
"expired_at": "2025-03-20T17:06:28Z"
}
}

Step 3 - Submit Signed Delegate Transaction

Endpoint : flow/{:id}/next

Method : POST

Request

Body

  • inquiry_id* - string : Your inquiry id from step 1
  • data* - object : Wrapped data object
    • signed_delegate_tx* - string : Signed transaction payload

Sample Endpoint Request : flow/023172e2-8fed-4395-80d3-bb2ec3026de9/next

Request Sample
{
"inquiry_id": "69c07f9c-2426-41bf-82f5-c72bac0be573",
"data": {
"signed_delegate_tx": "2e60012d6285bc31de1f96eef111226d696b98b74c3d499c0f9bac26cc7dbe3f26869d5075c52bbe3f51363939df81e0d58fe5de87264275ae343d0e80dc133200"
}
}

Response

  • id - string : Flow ID.
  • service_code - string : Current flow service code.
  • flow - string : Current flow name.
  • state - string : Current state of your flow.
  • data - Object : Stored data of your flow.
  • created_at - Timestamp RFC3339 : Time when flow created.
  • updated_at - Timestamp RFC3339 : Last flow updated.
  • expired_at - Timestamp RFC3339 : Maximum time you have to finish the process before flow dropped by system, will always increment by your last action + 2 hours.
Success Sample
{
"status": 1,
"status_service": "00",
"status_number": "F000001",
"status_code": "SSSSSS",
"message": "success create data",
"data": {
"id": "6c9436d1-804e-43ee-b1e3-1b395c30e181",
"service_code": "staking-tron",
"flow": "delegate",
"state": "initialized",
"data": {
"amount": "100",
"callback_url": "",
"delegate_tx": "ae058201b0c2cb559ced12f144a3960c994f08dae309abf3cd4f3ebf9ab7917f",
"from_address": "TTQL7uYtjHpbzpayLUJCZsKBMMpFCw5rKB",
"lock_period": "2025-03-20T00:30:00+07:00",
"resource": "bandwidth",
"signed_delegate_tx": "",
"to_address": "TDoAQGrJ6wUaYBaWF8jNE76u2YYWCnnPDi"
},
"created_at": "2025-03-19T17:16:32Z",
"updated_at": "2025-03-19T17:16:38Z",
"expired_at": "2025-03-20T17:16:39Z"
}
}

After success delegate to other accounts, You can check your detail resource at Get Delegated Resources