To delegate AVAX you will need:
- The delegating address
- The signing public key
- The validator address
- The amount of AVAX to be staked
- Optionally, a max gas amount (upper limit of the transaction fee to be paid)
Once the delegating transaction is confirmed on-chain, the delegation will immediately be active and earning staking rewards.
Note
Please note that there is no concept of unstaking or undelegating on Avalanche.
Delegations are active until the end time specified at delegation creation, and automatically deactivate and become liquid at that specified time. If no end time is specified, it will default to the end time of the validator.
This can not be changed once the delegation transaction is confirmed on-chain.
In the following guide we will illustrate how to stake AVAX.
Create New Staking Flow
To initiate the staking process, create a new flow with a POST
request to /flows
.
URL
https://api.figment.io/flows
Request
protocol
* :string
Protocol this flow operates on (ex.avalanche
).network
* :string
Network this flow operates on (ex.testnet
).operation
* :string
The operation to perform (ex.staking
).
{
"protocol": "avalanche",
"network": "testnet",
"operation": "staking"
}
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
Flow & transaction data.
{
"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
},
"protocol": "avalanche",
"network": "testnet",
"created_at": "2023-02-27T20:55:38.690Z",
"updated_at": "2023-02-27T20:55:38.690Z"
}
Submit Delegate Data
After creating a new staking flow, submit the staking account data. Collect the required inputs. Send a PUT
request to /flows/[:flow_id]/next
to proceed to the next step.
URL
https://api.figment.io/flows/[:flow_id]/next
Request
name
* :create_delegate_transaction
.inputs
* :object
delegator_address
* :string
The delegating address (P-chain).validator_address
* :string
Address of the validator.amount
* :number
The amount of AVAX to be delegated.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.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.memo
:string
Include a memo with the transaction.
{
"name": "create_delegate_tx",
"inputs": {
"delegator_address": "P-fuji10vk9enj4xg3u3a2e4nt47plc66fzq2hwgwgma3",
"validator_address": "NodeID-DjFNyubFMz8GfEqXs8KuGt43ftVzABtdw",
"amount": 1
}
}
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 or an array of signatures to continue the flow. Refer to the guides Signing Transactions with Figment's npm Package and Signing Transactions with the Fireblocks API for details.confirm_delegate_tx_by_hash
: Submit a previously completed transaction hash to continue the flow. Refer to the guide Advance Flows Using a Transaction Hash.
data
:object
Flow & transaction data.
{
"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
}
},
"protocol": "avalanche",
"network": "testnet",
"created_at": "2023-02-27T20:55:38.690Z",
"updated_at": "2023-02-27T21:24:19.926Z"
}
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 /flows/[:flow_id]/next
with the signed payload.
The Staking API will broadcast the transaction to the Avalanche network.
URL
https://api.figment.io/flows/[:flow_id]/next
Request
name
* :sign_delegate_tx
inputs
* :object
transaction_payload
* : Signed transaction payload from the previous step's response.signatures
:array
ofobject
The signatures array can be used instead of sending a transaction payload when the signing keys are kept in a custodial solution, such as Fireblocks. Refer to the guide Signing Transactions with the Fireblocks API for details.
{
"name": "sign_delegate_tx",
"inputs": {
"transaction_payload": "00000000000e000000050000000000000000000000000000000000000000000000000000000000000000000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa0000000700000000b2bbc0e7000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee00000001cfc3e77b66a86e568cd61ddcbb1c29052872f3c73924aa50d8ce95010ce05a72000000003d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa0000000500000000ee568ae70000000100000000000000008b9efb9702b7e2b2deaaa5677ef1076825af207a00000000633ee7270000000063bdfab3000000003b9aca00000000013d9bdac0ed1d761330cf680efdeb1a42159eb387d6d2950c96f7d28f61bbe2aa00000007000000003b9aca00000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee0000000b000000000000000000000001000000017b2c5cce553223c8f559acd75f07f8d692202aee00000001000000090000000106affa1e3aa29ba136f79dca1f8ab87449462c730a7e65e9127dd485628bf388076fedb7bb75260abb18d8eddd030cb06eb750e09716e8ff2c0d7d9c95930c2e01"
}
}
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.wait
: Provides anestimated_state_change_at
timestamp, indicating approximately when the broadcasting transaction will be confirmed. This action has no inputs.
data
:object
Flow & transaction data.
{
"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": []
}
},
"protocol": "avalanche",
"network": "testnet",
"created_at": "2023-02-27T21:34:47.579Z",
"updated_at": "2023-02-27T21:36:00.848Z"
}
Get Staking Flow Status
To get the current state of the existing flow, send a GET
request to /flows/[:flow_id]
using the flow ID from the previous step.
URL
https://api.figment.io/flows/[:flow_id]
Request
- 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
Flow & transaction data.
{
"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": []
}
},
"protocol": "avalanche",
"network": "testnet",
"created_at": "2023-02-27T21:34:47.579Z",
"updated_at": "2023-02-27T21:36:15.469Z"
}