Staking API - Avalanche
API AuthenticationClick to view API Authentication details
API calls require authentication with API key via
For example:
Here's some boilerplate to get you started. Authorization
request header or URL
property. Calls are made to one of the Avalanche Staking API endpoints found in your app's dashboard. For example:
https://avalanche-slate.datahub.figment.io
- Fetch with Header
- Fetch with Parameter
- CURL with Header
- CURL with Parameter
fetch("https://avalanche-slate.datahub.figment.io/api/v1/flows", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Authorization" : "<api_key>",
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})
fetch("https://avalanche-slate.datahub.figment.io/apikey/{{apikey}}/api/v1/flows", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})
curl -X POST 'https://avalanche-slate.datahub.figment.io/api/v1/flows' \
--header 'Content-Type: application/json' \
--header 'Authorization: <api_key>' \
--data '{
// JSON Payload
}'
curl -X POST 'https://avalanche-slate.datahub.figment.io/apikey/{{apikey}}/api/v1/flows' \
--header 'Content-Type: application/json' \
--data '{
// JSON Payload
}'
Available Methods
Create New Delegation Flow
To initiate the staking process, create a new flow with a POST
request to /api/v1/flows
.
Request Body
Example Response
{
"id": "ffa614e2-b50c-4d97-9e9d-de2a0413e363",
"state": "initialized",
"actions": [
{
"name": "create_delegate_tx",
"inputs": [
{
"name": "delegator_address",
"display": "Delegator Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "validator_address",
"display": "Validator Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "is_node_address",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "amount",
"display": "Amount",
"description": "in AVAX",
"type": "decimal",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "start_time",
"display": "Start Time",
"description": "Defaults to 5 minutes from when the transaction is generated",
"type": "timestamp",
"validations": [],
"array": false,
"default_value": null
},
{
"name": "end_time",
"display": "End Time",
"description": "Defaults to the end time of the validator",
"type": "timestamp",
"validations": [],
"array": false,
"default_value": null
},
{
"name": "memo",
"display": "Memo",
"description": "",
"type": "string",
"validations": [],
"array": false,
"default_value": null
}
]
}
],
"data": {
"delegator_address": null,
"validator_address": null,
"amount": null,
"start_time": null,
"end_time": null,
"memo": null,
"delegate_transaction": null
},
"network_code": "avalanche",
"chain_code": "testnet",
"created_at": "2023-02-27T20:55:38.690Z",
"updated_at": "2023-02-27T20:55:38.690Z"
}
SpecificationView Specification
Parameters
flow
—object
network_code
—string
Network this flow operates on (ex.avalanche
) (required).chain_code
—string
Chain this flow operates on (ex.testnet
) (required).operation
—string
The operation to perform (ex.staking
) (required).version
—string
API version to use (ex.v1
) (optional).
Response
id
—string
ID of the flow.operation
—string
The Staking API operation being performed by this flow.state
—string
The current state of the flow.actions
—array
It includes thename
&inputs
of all next possible actions.create_delegate_tx
— Use this action to generate a delegation transaction to stake AVAX.delegator_address
— The delegating address, where AVAX is being staked from. This must be a P-chain address.validator_address
— Figment's validator address.amount
— The amount of AVAX to be delegated.start_time
— Optional timestamp for when the delegation will be active.end_time
— Optional timestamp for when the delegation will end.memo
— A plaintext memo to identify the transaction.
data
—object
Delegation flow & transaction data.
Submit Delegate Data
After creating a new staking flow, submit the staking account data. Collect the required inputs. Send a PUT
request to /api/v1/flows/[:flow_id]/next
to proceed to the next step.
Request Body
Example Response
{
"id": "ffa614e2-b50c-4d97-9e9d-de2a0413e363",
"state": "delegate_tx_signature",
"actions": [
{
"name": "refresh_delegate_tx",
"inputs": [
{
"name": "delegator_address",
"display": "Delegator Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3"
},
{
"name": "validator_address",
"display": "Validator Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "is_node_address",
"options": {}
}
],
"array": false,
"default_value": "NodeID-PPoRxaftnXBv7Egx2f4ts7GFNRv4J1vwQ"
},
{
"name": "amount",
"display": "Amount",
"description": "in AVAX",
"type": "decimal",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "2.0"
},
{
"name": "start_time",
"display": "Start Time",
"description": "Defaults to 5 minutes from when the transaction is generated",
"type": "timestamp",
"validations": [],
"array": false,
"default_value": null
},
{
"name": "end_time",
"display": "End Time",
"description": "Defaults to the end time of the validator",
"type": "timestamp",
"validations": [],
"array": false,
"default_value": null
},
{
"name": "memo",
"display": "Memo",
"description": "",
"type": "string",
"validations": [],
"array": false,
"default_value": null
}
]
},
{
"name": "sign_delegate_tx",
"inputs": [
{
"name": "transaction_payload",
"display": "Transaction Payload",
"description": "",
"type": "signed_transaction",
"validations": [
{
"type": "sign_payload",
"options": {}
}
],
"array": false,
"default_value": null,
"signers": [
"P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3"
],
"transaction_payload": "7b225f747970654e616d65223a22556e7369676e65645478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22636f6465634944223a2230303030222c227472616e73616374696f6e223a7b225f747970654e616d65223a2241646444656c656761746f725478222c225f747970654944223a31342c225f636f6465634944223a6e756c6c2c226e6574776f726b4944223a223030303030303035222c22626c6f636b636861696e4944223a2230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c226f757473223a5b5d2c22696e73223a5b7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2262346361386635626433636238366666643235633030653863363163383964363038366433396637386262386232393232373639386662303231303435653761222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d2c7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2266643434613464386639336665616430386535633232373634663162336633626662343433373863313839323736623465393861353365363636643565633334222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c226d656d6f223a22222c226e6f64654944223a2266356132616432646136343430323237653235303537356161663166383964316538333236323966222c22737461727454696d65223a2230303030303030303633666432306166222c22656e6454696d65223a2230303030303030303635643566343562222c22776569676874223a2230303030303030303737333539343030222c227374616b654f757473223a5b7b225f747970654e616d65223a225472616e7366657261626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543505472616e736665724f7574707574222c225f747970654944223a372c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303737333539343030227d2c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c227265776172644f776e657273223a7b225f747970654e616d65223a22506172736561626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543504f776e65724f7574707574222c225f747970654944223a31312c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d7d7d7d7d"
},
{
"name": "signatures",
"display": "Signatures",
"description": "",
"type": "array_of_signatures",
"validations": [],
"array": true,
"default_value": null,
"element_type": "signature_data",
"signers": [
"P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3"
],
"transaction_payload": "7b225f747970654e616d65223a22556e7369676e65645478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22636f6465634944223a2230303030222c227472616e73616374696f6e223a7b225f747970654e616d65223a2241646444656c656761746f725478222c225f747970654944223a31342c225f636f6465634944223a6e756c6c2c226e6574776f726b4944223a223030303030303035222c22626c6f636b636861696e4944223a2230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c226f757473223a5b5d2c22696e73223a5b7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2262346361386635626433636238366666643235633030653863363163383964363038366433396637386262386232393232373639386662303231303435653761222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d2c7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2266643434613464386639336665616430386535633232373634663162336633626662343433373863313839323736623465393861353365363636643565633334222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c226d656d6f223a22222c226e6f64654944223a2266356132616432646136343430323237653235303537356161663166383964316538333236323966222c22737461727454696d65223a2230303030303030303633666432306166222c22656e6454696d65223a2230303030303030303635643566343562222c22776569676874223a2230303030303030303737333539343030222c227374616b654f757473223a5b7b225f747970654e616d65223a225472616e7366657261626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543505472616e736665724f7574707574222c225f747970654944223a372c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303737333539343030227d2c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c227265776172644f776e657273223a7b225f747970654e616d65223a22506172736561626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543504f776e65724f7574707574222c225f747970654944223a31312c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d7d7d7d7d",
"signing_payload": null,
"inputs": {
"input_klass": "Workflows::Signature",
"input_instance": {
"account_address": null,
"signature": null
},
"flow": {
"workflow_state": "delegate_tx_signature",
"id": 3811,
"customer_id": 36,
"chain_id": 10,
"data": {
"delegator_address": "P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3",
"validator_address": "NodeID-PPoRxaftnXBv7Egx2f4ts7GFNRv4J1vwQ",
"amount": "2.0",
"start_time": null,
"end_time": null,
"memo": null,
"delegate_transaction": {
"raw": "7b225f747970654e616d65223a22556e7369676e65645478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22636f6465634944223a2230303030222c227472616e73616374696f6e223a7b225f747970654e616d65223a2241646444656c656761746f725478222c225f747970654944223a31342c225f636f6465634944223a6e756c6c2c226e6574776f726b4944223a223030303030303035222c22626c6f636b636861696e4944223a2230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c226f757473223a5b5d2c22696e73223a5b7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2262346361386635626433636238366666643235633030653863363163383964363038366433396637386262386232393232373639386662303231303435653761222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d2c7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2266643434613464386639336665616430386535633232373634663162336633626662343433373863313839323736623465393861353365363636643565633334222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c226d656d6f223a22222c226e6f64654944223a2266356132616432646136343430323237653235303537356161663166383964316538333236323966222c22737461727454696d65223a2230303030303030303633666432306166222c22656e6454696d65223a2230303030303030303635643566343562222c22776569676874223a2230303030303030303737333539343030222c227374616b654f757473223a5b7b225f747970654e616d65223a225472616e7366657261626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543505472616e736665724f7574707574222c225f747970654944223a372c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303737333539343030227d2c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c227265776172644f776e657273223a7b225f747970654e616d65223a22506172736561626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543504f776e65724f7574707574222c225f747970654944223a31312c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d7d7d7d7d",
"signing_payload": null,
"signed": null,
"hash": null,
"status": null,
"error": null,
"signatures": null
}
},
"created_at": "2023-02-27T20:55:38.690Z",
"updated_at": "2023-02-27T21:24:19.926Z",
"id_public": "ffa614e2-b50c-4d97-9e9d-de2a0413e363",
"supported_operation_id": 32
},
"flow_attributes": {},
"empty_input": {
"account_address": null,
"signature": null
}
}
}
]
},
{
"name": "confirm_delegate_tx_by_hash",
"inputs": [
{
"name": "hash",
"display": "Hash",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "block_number",
"display": "Block Number",
"description": "",
"type": "integer",
"validations": [],
"array": false,
"default_value": null
}
]
}
],
"data": {
"delegator_address": "P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3",
"validator_address": "NodeID-BGrjjjfPCWR6pGWNTN7YcW1XtUKofMQsL",
"amount": "2.0",
"start_time": null,
"end_time": null,
"memo": null,
"delegate_transaction": {
"raw": "7b225f747970654e616d65223a22556e7369676e65645478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22636f6465634944223a2230303030222c227472616e73616374696f6e223a7b225f747970654e616d65223a2241646444656c656761746f725478222c225f747970654944223a31342c225f636f6465634944223a6e756c6c2c226e6574776f726b4944223a223030303030303035222c22626c6f636b636861696e4944223a2230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c226f757473223a5b5d2c22696e73223a5b7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2262346361386635626433636238366666643235633030653863363163383964363038366433396637386262386232393232373639386662303231303435653761222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d2c7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2266643434613464386639336665616430386535633232373634663162336633626662343433373863313839323736623465393861353365363636643565633334222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c226d656d6f223a22222c226e6f64654944223a2266356132616432646136343430323237653235303537356161663166383964316538333236323966222c22737461727454696d65223a2230303030303030303633666432306166222c22656e6454696d65223a2230303030303030303635643566343562222c22776569676874223a2230303030303030303737333539343030222c227374616b654f757473223a5b7b225f747970654e616d65223a225472616e7366657261626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543505472616e736665724f7574707574222c225f747970654944223a372c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303737333539343030227d2c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c227265776172644f776e657273223a7b225f747970654e616d65223a22506172736561626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543504f776e65724f7574707574222c225f747970654944223a31312c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d7d7d7d7d",
"signing_payload": null,
"signed": null,
"hash": null,
"status": null,
"error": null,
"signatures": null
}
},
"network_code": "avalanche",
"chain_code": "testnet",
"created_at": "2023-02-27T20:55:38.690Z",
"updated_at": "2023-02-27T21:24:19.926Z"
}
SpecificationView Specification
Parameters
name
—string
Name of the action to execute (required).inputs
—object
delegator_address
—string
The delegating address (P-chain) (required).validator_address
—string
Address of the validator (required).amount
—number
The amount of AVAX to be delegated (required).start_time
—number
Adjust if you wish to set a specific delegation start time. Unix Epoch Timestamp, defaults to five minutes from when the transaction is generated (optional).end_time
—number
Adjust if you wish to set a specific delegation end time. Unix Epoch Timestamp, defaults to the end time of the validator (optional).memo
—string
Include a memo with the transaction (optional).
Response
id
—string
ID of the flow.operation
—string
The Staking API operation being performed by this flow.state
—string
The current state of the flow.actions
—array
It includes thename
&inputs
of all next possible actions.refresh_delegate_tx
— If you need to get a fresh version of the transaction Payload (i.e., the nonce has increased).sign_delegate_tx
— Submit a signed transaction Payload ready to be broadcast to the network.confirm_delegate_tx_by_hash
— Submit a previously completed transaction hash to continue the flow.
data
—object
Delegation flow & transaction data.
Submit Signed Delegate Transaction for Broadcast
Before broadcasting the transaction, you must sign the transaction_payload
you received in the previous step. After signing the transaction, send a PUT
request to /api/v1/flows/[:flow_id]/next
with the signed payload.
Request Body
Example Response
{
"id": "a634dcee-f444-461d-89a0-59cf97eee2ad",
"state": "delegate_tx_broadcasting",
"actions": [
{
"name": "wait",
"estimated_state_change_at": "2023-02-27T21:37:00.968Z",
"inputs": []
}
],
"data": {
"delegator_address": "P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3",
"validator_address": "NodeID-BGrjjjfPCWR6pGWNTN7YcW1XtUKofMQsL",
"amount": "2.0",
"start_time": null,
"end_time": null,
"memo": null,
"delegate_transaction": {
"raw": "7b225f747970654e616d65223a22556e7369676e65645478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22636f6465634944223a2230303030222c227472616e73616374696f6e223a7b225f747970654e616d65223a2241646444656c656761746f725478222c225f747970654944223a31342c225f636f6465634944223a6e756c6c2c226e6574776f726b4944223a223030303030303035222c22626c6f636b636861696e4944223a2230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c226f757473223a5b5d2c22696e73223a5b7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2262346361386635626433636238366666643235633030653863363163383964363038366433396637386262386232393232373639386662303231303435653761222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d2c7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2266643434613464386639336665616430386535633232373634663162336633626662343433373863313839323736623465393861353365363636643565633334222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c226d656d6f223a22222c226e6f64654944223a2237306231303366373161353465316666633638353761633237616266336534353135633962626366222c22737461727454696d65223a2230303030303030303633666432333339222c22656e6454696d65223a2230303030303030303635643537376465222c22776569676874223a2230303030303030303737333539343030222c227374616b654f757473223a5b7b225f747970654e616d65223a225472616e7366657261626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543505472616e736665724f7574707574222c225f747970654944223a372c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303737333539343030227d2c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c227265776172644f776e657273223a7b225f747970654e616d65223a22506172736561626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543504f776e65724f7574707574222c225f747970654944223a31312c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d7d7d7d7d",
"signing_payload": null,
"signed": "00000000000e0000000500000000000000000000000000000000000000000000000000000000000000000000000000000002b4ca8f5bd3cb86ffd25c00e8c61c89d6086d39f78bb8b29227698fb021045e7a000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000005000000003b9aca000000000100000000fd44a4d8f93fead08e5c22764f1b3f3bfb44378c189276b4e98a53e666d5ec34000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000005000000003b9aca0000000001000000000000000070b103f71a54e1ffc6857ac27abf3e4515c9bbcf0000000063fd23390000000065d577de0000000077359400000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa000000070000000077359400000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee0000000b000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee00000002000000090000000196b842c2634b87c163d694ee9fa291c4d572cbaa7aa289e0c9d4d298963873c50bd76129cc5c50cf7b2b1a7dff2787ff257743951a20637ac41946f5ce01a0ac00000000090000000196b842c2634b87c163d694ee9fa291c4d572cbaa7aa289e0c9d4d298963873c50bd76129cc5c50cf7b2b1a7dff2787ff257743951a20637ac41946f5ce01a0ac00",
"hash": "2aJkc7U3BJzcPXXm5uR9sKjeEaRfaAnhsmoFujCYnZCEbe19RD",
"status": null,
"error": null,
"signatures": []
}
},
"network_code": "avalanche",
"chain_code": "testnet",
"created_at": "2023-02-27T21:34:47.579Z",
"updated_at": "2023-02-27T21:36:00.848Z"
}
SpecificationView Specification
The Staking API will broadcast the transaction to the Avalanche network.
Parameters
name
—string
Name of the action to execute (required).inputs
—object
transaction_payload
— Signed transaction payload from the previous step's response.
Response
id
—string
ID of the flow.operation
—string
The Staking API operation being performed by this flow.state
—string
The current state of the flow.delegate_tx_broadcasting
— Transaction has been broadcast and is confirming.completed
— Transaction has been confirmed and stake is delegated.
actions
—array
It includes thename
&inputs
of all next possible actions.data
—object
Delegation flow & transaction data.
Get Flow Status
To get the current state of the existing flow, send a GET
request to /api/v1/flows/[:flow_id]
using the flow ID from the previous step.
Request Query
Example Response
{
"id": "a634dcee-f444-461d-89a0-59cf97eee2ad",
"state": "completed",
"actions": [],
"data": {
"delegator_address": "P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3",
"validator_address": "NodeID-BGrjjjfPCWR6pGWNTN7YcW1XtUKofMQsL",
"amount": "2.0",
"start_time": null,
"end_time": null,
"memo": null,
"delegate_transaction": {
"raw": "7b225f747970654e616d65223a22556e7369676e65645478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22636f6465634944223a2230303030222c227472616e73616374696f6e223a7b225f747970654e616d65223a2241646444656c656761746f725478222c225f747970654944223a31342c225f636f6465634944223a6e756c6c2c226e6574776f726b4944223a223030303030303035222c22626c6f636b636861696e4944223a2230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030222c226f757473223a5b5d2c22696e73223a5b7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2262346361386635626433636238366666643235633030653863363163383964363038366433396637386262386232393232373639386662303231303435653761222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d2c7b225f747970654e616d65223a225472616e7366657261626c65496e707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c22696e707574223a7b225f747970654e616d65223a22534543505472616e73666572496e707574222c225f747970654944223a352c225f636f6465634944223a6e756c6c2c2273696749647873223a5b7b225f747970654e616d65223a22536967496478222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303034222c226279746573223a223030303030303030222c22736f75726365223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303362396163613030227d2c2274786964223a2266643434613464386639336665616430386535633232373634663162336633626662343433373863313839323736623465393861353365363636643565633334222c226f7574707574696478223a223030303030303031222c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c226d656d6f223a22222c226e6f64654944223a2237306231303366373161353465316666633638353761633237616266336534353135633962626366222c22737461727454696d65223a2230303030303030303633666432333339222c22656e6454696d65223a2230303030303030303635643537376465222c22776569676874223a2230303030303030303737333539343030222c227374616b654f757473223a5b7b225f747970654e616d65223a225472616e7366657261626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543505472616e736665724f7574707574222c225f747970654944223a372c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d2c22616d6f756e74223a2230303030303030303737333539343030227d2c2261737365744944223a2233643962646163306564316437363133333063663638306566646562316134323135396562333837643664323935306339366637643238663631626265326161227d5d2c227265776172644f776e657273223a7b225f747970654e616d65223a22506172736561626c654f7574707574222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226f7574707574223a7b225f747970654e616d65223a22534543504f776e65724f7574707574222c225f747970654944223a31312c225f636f6465634944223a6e756c6c2c226c6f636b74696d65223a2230303030303030303030303030303030222c227468726573686f6c64223a223030303030303031222c22616464726573736573223a5b7b225f747970654e616d65223a2241646472657373222c225f747970654944223a6e756c6c2c225f636f6465634944223a6e756c6c2c226273697a65223a223030303030303134222c226279746573223a2237623263356363653535333232336338663535396163643735663037663864363932323032616565227d5d7d7d7d7d",
"signing_payload": null,
"signed": "00000000000e0000000500000000000000000000000000000000000000000000000000000000000000000000000000000002b4ca8f5bd3cb86ffd25c00e8c61c89d6086d39f78bb8b29227698fb021045e7a000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000005000000003b9aca000000000100000000fd44a4d8f93fead08e5c22764f1b3f3bfb44378c189276b4e98a53e666d5ec34000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000005000000003b9aca0000000001000000000000000070b103f71a54e1ffc6857ac27abf3e4515c9bbcf0000000063fd23390000000065d577de0000000077359400000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa000000070000000077359400000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee0000000b000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee00000002000000090000000196b842c2634b87c163d694ee9fa291c4d572cbaa7aa289e0c9d4d298963873c50bd76129cc5c50cf7b2b1a7dff2787ff257743951a20637ac41946f5ce01a0ac00000000090000000196b842c2634b87c163d694ee9fa291c4d572cbaa7aa289e0c9d4d298963873c50bd76129cc5c50cf7b2b1a7dff2787ff257743951a20637ac41946f5ce01a0ac00",
"hash": "2aJkc7U3BJzcPXXm5uR9sKjeEaRfaAnhsmoFujCYnZCEbe19RD",
"status": "confirmed",
"error": null,
"signatures": []
}
},
"network_code": "avalanche",
"chain_code": "testnet",
"created_at": "2023-02-27T21:34:47.579Z",
"updated_at": "2023-02-27T21:36:15.469Z"
}
SpecificationView Specification
Parameters
- None
Response
id
—string
ID of the flow.operation
—string
The Staking API operation being performed by this flow.state
—string
The current state of the flow.delegate_tx_broadcasting
— Transaction has been broadcast and is confirming.completed
— Transaction has been confirmed and stake is delegated.
actions
—array
It includes thename
&inputs
of all next possible actions.data
—object
Delegation flow & transaction data.