Skip to main content

Solana / Unstaking

In order to unStaking SOL, we will:

  • Deactivate a given stake account
  • Wait for the stake to become inactive (generally at the next epoch boundary)
  • Withdraw the inactive SOL back to the funding account

Flow Diagram

Below is a complete diagram for the Solana Undelegation flow:

Solana Undelegation Flow Diagram

Actions


Create New Unstaking Flow

To initiate the undelegation process, create a new flow with a POST request to /api/v1/flows.

URL

https://solana-slate.datahub.figment.io/api/v1/flows

Request

  • flow : object
    • network_code* : string Network on which this flow operates (ex. solana).
    • chain_code* : string Chain on which this flow operates (ex. mainnet, testnet).
    • operation* : string The operation to perform (ex. unstaking).

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 the name & inputs of all next possible actions.
    • create_deactivate_tx : Use this action to generate a stake deactivation transaction.
    • create_withdraw_tx : Use this action to generate a withdrawal transaction. This can be used to withdraw any deactivated stake or any balance in excess of the desired staking amount.
  • data : object Flow & transaction data.
Request
Example Response
{
"id": "0e42073a-1f7d-4997-a4f0-cab1130a9521",
"operation": "unstaking",
"state": "initialized",
"actions": [
{
"name": "create_deactivate_tx",
"inputs": [
{
"name": "stake_account_pubkey",
"display": "Stake Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "funding_account_pubkey",
"display": "Funding Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
}
]
},
{
"name": "create_withdraw_tx",
"inputs": [
{
"name": "stake_account_pubkey",
"display": "Stake Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "amount",
"display": "Amount",
"description": "in SOL",
"type": "decimal",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "funding_account_pubkey",
"display": "Funding Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "recipient_pubkey",
"display": "Recipient Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
}
]
}
],
"data": {
"funding_account_pubkey": null,
"stake_account_pubkey": null,
"stake_authority_pubkey": null,
"withdraw_authority_pubkey": null,
"deactivate_transaction": null,
"delegation_active_amount": null,
"delegation_inactive_amount": null,
"delegation_status": null,
"delegation_status_error": null,
"recipient_pubkey": null,
"withdraw_amount": null,
"withdraw_transaction": null,
"withdraw_transaction_funding_account_pubkey": null,
"estimated_inactive_at": null
},
"network_code": "solana",
"chain_code": "devnet",
"created_at": "2023-03-02T08:28:38.784Z",
"updated_at": "2023-03-02T08:28:38.784Z"
}


Submit Deactivate Transaction Data

After collecting the required inputs, send a PUT request to /api/v1/flows/[:flow_id]/next to proceed to the next step.

URL

https://solana-slate.datahub.figment.io/api/v1/flows/[:flow_id]/next

Request

  • name* : create_deactivate_tx
  • inputs* : object
    • funding_account_pubkey* : string The address of the stake account to be deactivated.
    • stake_account_pubkey* : string The address of the wallet with signing rights to deactivate the stake account.

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 the name & inputs of all next possible actions.
  • data : object Flow & transaction data.
Request
Example Response
{
"id": "0e42073a-1f7d-4997-a4f0-cab1130a9521",
"operation": "unstaking",
"state": "deactivate_tx_signature",
"actions": [
{
"name": "refresh_deactivate_tx",
"inputs": [
{
"name": "stake_account_pubkey",
"display": "Stake Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x"
},
{
"name": "funding_account_pubkey",
"display": "Funding Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
}
]
},
{
"name": "sign_deactivate_tx",
"inputs": [
{
"name": "transaction_payload",
"display": "Transaction Payload",
"description": "",
"type": "signed_transaction",
"validations": [
{
"type": "sign_payload",
"options": {}
}
],
"array": false,
"default_value": null,
"signers": [
"Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
],
"transaction_payload": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000"
},
{
"name": "signatures",
"display": "Signatures",
"description": "",
"type": "array_of_signatures",
"validations": [],
"array": true,
"default_value": null,
"element_type": "signature_data",
"signers": [
"Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
],
"transaction_payload": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signing_payload": "01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"inputs": [
{
"name": "account_address",
"display": "Account Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "signature",
"display": "Signature",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
}
]
}
]
},
{
"name": "confirm_deactivate_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": {
"funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"stake_account_pubkey": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x",
"stake_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"deactivate_transaction": {
"raw": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signing_payload": "01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signed": null,
"hash": null,
"status": null,
"error": null,
"signatures": null,
"block_time": null
},
"delegation_active_amount": null,
"delegation_inactive_amount": null,
"delegation_status": null,
"delegation_status_error": null,
"recipient_pubkey": null,
"withdraw_amount": null,
"withdraw_transaction": null,
"withdraw_transaction_funding_account_pubkey": null,
"estimated_inactive_at": null
},
"network_code": "solana",
"chain_code": "devnet",
"created_at": "2023-03-02T08:28:38.784Z",
"updated_at": "2023-03-02T08:30:09.009Z"
}


Submit Signed Deactivate 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 and the Staking API will broadcast the transaction to the Solana network.

URL

https://solana-slate.datahub.figment.io/api/v1/flows/[:flow_id]/next

Request

  • name* : sign_deactivate_tx
  • inputs* : object
    • transaction_payload* : Signed transaction payload from the previous step's response.
    • signatures : array of object 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.

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.
    • deactivate_tx_broadcasting : Transaction has been broadcast but not confirmed.
    • cool_down : Transaction is under cool-down period.
  • actions : array It includes the name & inputs of all next possible actions.
  • data : object Flow & transaction data.
Request
Example Response
{
"id": "0e42073a-1f7d-4997-a4f0-cab1130a9521",
"operation": "unstaking",
"state": "deactivate_tx_broadcasting",
"actions": [
{
"name": "wait",
"estimated_state_change_at": "2023-03-02T08:31:46.969Z",
"inputs": []
}
],
"data": {
"funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"stake_account_pubkey": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x",
"stake_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"deactivate_transaction": {
"raw": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signing_payload": "01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signed": "0108b202d6415b02cf9db966eccf11da492a79d343de947b7e0775168e938eb43fdb6263ffb6dec528bd71c0d753833afa7eec1ef1a1603e4bdc26f1c6d9f8420a01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"hash": "B5pqLyY3Wo8C3StMeqXSJZL8rxXLodr3sVvRqfeudGc87xNpiaB9GAcKVCBpBYpFeDk3SNUUFeZ8sejPPKNRCjj",
"status": null,
"error": null,
"signatures": [
{
"account_address": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"signature": ""
}
],
"block_time": null
},
"delegation_active_amount": null,
"delegation_inactive_amount": null,
"delegation_status": null,
"delegation_status_error": null,
"recipient_pubkey": null,
"withdraw_amount": null,
"withdraw_transaction": null,
"withdraw_transaction_funding_account_pubkey": null,
"estimated_inactive_at": null
},
"network_code": "solana",
"chain_code": "devnet",
"created_at": "2023-03-02T08:28:38.784Z",
"updated_at": "2023-03-02T08:30:46.246Z"
}


Submit Withdrawal Transaction Data

After collecting the required inputs, send a PUT request to /api/v1/flows/[:flow_id]/next to move on to the next step.

URL

https://solana-slate.datahub.figment.io/api/v1/flows/[:flow_id]/next

Request

  • name* : create_withdraw_tx
  • inputs* : object
    • amount* : string The number of SOL to be withdrawn. Partial withdrawal is possible.
    • funding_account_pubkey* : string The address of the account paying the transaction fee.
    • recipient_pubkey* : string The address of the account which will receive the withdrawal.
    • stake_account_pubkey : The public key of the stake account from which to withdraw. Note that the recipient of the withdrawal is not the originating address by default!

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 the name & inputs of all next possible actions.
  • data : object Flow & transaction data.
Request
Example Response
{
"id": "0e42073a-1f7d-4997-a4f0-cab1130a9521",
"operation": "unstaking",
"state": "withdraw_tx_signature",
"actions": [
{
"name": "refresh_withdraw_tx",
"inputs": [
{
"name": "stake_account_pubkey",
"display": "Stake Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x"
},
{
"name": "amount",
"display": "Amount",
"description": "in SOL",
"type": "decimal",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "5.9"
},
{
"name": "funding_account_pubkey",
"display": "Funding Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
},
{
"name": "recipient_pubkey",
"display": "Recipient Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
}
]
},
{
"name": "sign_withdraw_tx",
"inputs": [
{
"name": "transaction_payload",
"display": "Transaction Payload",
"description": "",
"type": "signed_transaction",
"validations": [],
"array": false,
"default_value": null,
"signers": [
"Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
],
"transaction_payload": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000"
},
{
"name": "signatures",
"display": "Signatures",
"description": "",
"type": "array_of_signatures",
"validations": [],
"array": true,
"default_value": null,
"element_type": "signature_data",
"signers": [
"Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
],
"transaction_payload": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"signing_payload": "01000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"inputs": [
{
"name": "account_address",
"display": "Account Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
},
{
"name": "signature",
"display": "Signature",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
}
]
}
]
},
{
"name": "confirm_withdraw_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": {
"funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"stake_account_pubkey": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x",
"stake_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"deactivate_transaction": {
"raw": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signing_payload": "01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signed": "0108b202d6415b02cf9db966eccf11da492a79d343de947b7e0775168e938eb43fdb6263ffb6dec528bd71c0d753833afa7eec1ef1a1603e4bdc26f1c6d9f8420a01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"hash": "B5pqLyY3Wo8C3StMeqXSJZL8rxXLodr3sVvRqfeudGc87xNpiaB9GAcKVCBpBYpFeDk3SNUUFeZ8sejPPKNRCjj",
"status": "confirmed",
"error": null,
"signatures": [
{
"account_address": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"signature": ""
}
],
"block_time": "2023-03-02T08:30:46.000Z"
},
"delegation_active_amount": "0.0",
"delegation_inactive_amount": "5997717120.0",
"delegation_status": "inactive",
"delegation_status_error": null,
"recipient_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_amount": "5.9",
"withdraw_transaction": {
"raw": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"signing_payload": "01000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"signed": null,
"hash": null,
"status": null,
"error": null,
"signatures": null,
"block_time": null
},
"withdraw_transaction_funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"estimated_inactive_at": "2023-03-04T03:25:51.870Z"
},
"network_code": "solana",
"chain_code": "devnet",
"created_at": "2023-03-02T08:28:38.784Z",
"updated_at": "2023-03-06T04:28:09.951Z"
}


Submit Signed Withdrawal 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 and the Staking API will broadcast the transaction to the Solana network.

URL

https://solana-slate.datahub.figment.io/api/v1/flows/[:flow_id]/next

Request

  • name* : sign_withdraw_tx
  • inputs* : object
    • transaction_payload* : Signed transaction payload from the previous step's response.
    • signatures : array of object 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.

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.
    • withdraw_tx_broadcasting : Transaction broadcasting
    • withdrawn : Transaction is confirmed and tokens are withdrawn
  • actions : array It includes the name & inputs of all next possible actions.
  • data : object Flow & transaction data.
Request
Example Response
{
"id": "0e42073a-1f7d-4997-a4f0-cab1130a9521",
"operation": "unstaking",
"state": "withdraw_tx_broadcasting",
"actions": [
{
"name": "wait",
"estimated_state_change_at": "2023-03-06T04:29:51.974Z",
"inputs": []
}
],
"data": {
"funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"stake_account_pubkey": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x",
"stake_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"deactivate_transaction": {
"raw": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signing_payload": "01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"signed": "0108b202d6415b02cf9db966eccf11da492a79d343de947b7e0775168e938eb43fdb6263ffb6dec528bd71c0d753833afa7eec1ef1a1603e4bdc26f1c6d9f8420a01000204f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000023652dc33a447d52fa6da4e090bb2c792e8bcff1a7af9a2d3ce91a994c8779e90102030103000405000000",
"hash": "B5pqLyY3Wo8C3StMeqXSJZL8rxXLodr3sVvRqfeudGc87xNpiaB9GAcKVCBpBYpFeDk3SNUUFeZ8sejPPKNRCjj",
"status": "confirmed",
"error": null,
"signatures": [
{
"account_address": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"signature": ""
}
],
"block_time": "2023-03-02T08:30:46.000Z"
},
"delegation_active_amount": "0.0",
"delegation_inactive_amount": "5997717120.0",
"delegation_status": "inactive",
"delegation_status_error": null,
"recipient_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_amount": "5.9",
"withdraw_transaction": {
"raw": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"signing_payload": "01000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"signed": "012fd92132f4cd3e1fe8339f3aece9a757da1e7277d6c2cc10919c882d7c8aff03c123d3e720755c8a996919e127e219e31e268277019ee53d5dc24e0cecff960d01000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f06a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff40000005d9445ea22a4f27189c9c66f69d4469f9fa6d5fc304aea386e1cf4fe5f30508d01020501000304000c0400000000dbaa5f01000000",
"hash": "xV8ZSsWE4qRmW7Eu52xZCfLM1S5xjezjHDh7TP1FGTwTrQiTw9a6tfS8sKYmn6XKuxdnmPHrmKGVgxWQMg6BVV6",
"status": null,
"error": null,
"signatures": [
{
"account_address": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"signature": ""
}
],
"block_time": null
},
"withdraw_transaction_funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"estimated_inactive_at": "2023-03-04T03:25:51.870Z"
},
"network_code": "solana",
"chain_code": "devnet",
"created_at": "2023-03-02T08:28:38.784Z",
"updated_at": "2023-03-06T04:28:51.327Z"
}


Get Unstaking 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.

URL

https://solana-slate.datahub.figment.io/api/v1/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.
    • deactivate_tx_broadcasting : Transaction has been broadcast but not confirmed.
    • cool_down : Transaction broadcasted and confirmed.
    • deactivated : The deactivation is complete.
    • withdraw_tx_broadcasting : The transaction has been broadcast to the network and is awaiting confirmation.
    • withdrawn : The transaction is confirmed and the stake account has been withdrawn.
  • actions : array It includes the name & inputs of all next possible actions.
  • data : object Flow & transaction data.

Notes

While the flow state is cool_down, the stake account is in the process of deactivating.

  • This generally happens at the next epoch boundary (max 2.5 days), but if there is a large change in network wide delegation levels it is possible it will be subjected to a multi-epoch cooldown period.
  • This would mean that a portion of the stake will deactivate at each epoch boundary for a few epochs, until it is fully deactivated.

Read more about the warmup and cooldown period. At each epoch, a Staking API webhook can be used to notify you about how much of the stake has deactivated, until it is fully deactivated.

Request
Example Response
{
"id": "e2285668-f6ab-4b77-9e96-edbcca63cd24",
"operation": "staking",
"state": "stake_account",
"actions": [
{
"name": "create_delegate_tx",
"inputs": [
{
"name": "validator_address",
"display": "Vote Account Public Key",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": null
}
]
},
{
"name": "assign_stake_account",
"inputs": [
{
"name": "stake_account_pubkey",
"display": "Stake Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x"
},
{
"name": "funding_account_pubkey",
"display": "Funding Account Pubkey",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy"
}
]
}
],
"data": {
"stake_account_pubkey": "9UPYJp5pApSEaeCizrvqe6vx7hSj3ZPzVDLZHG4hxk3x",
"create_stake_account_transaction": {
"raw": "020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009a17014be532f0085f0ffb9e98911d86f2e19539d8c2f97b47e1974e0a3d9d28d149448f401776e1e4fa25b7523e18a680bf153468df782af75f59c7ff0580d02000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f000000000000000000000000000000000000000000000000000000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000026288b8d1932a012665045867e29aaaff8a08b472849903582e42b994b45203f0202020001340000000000286bee00000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc000000000030201047400000000f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a534f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a53400000000000000000000000000000000f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a534",
"signing_payload": "02000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f000000000000000000000000000000000000000000000000000000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000026288b8d1932a012665045867e29aaaff8a08b472849903582e42b994b45203f0202020001340000000000286bee00000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc000000000030201047400000000f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a534f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a53400000000000000000000000000000000f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a534",
"signed": "0238e01c7c328cf82967071dda5d3eefb445bca087b967955c3ffd53a2a3ea0999a0aca1dddcb556a9df7e1316460e3f10cfa66c7ad90b685eacf39ab4f816500609a17014be532f0085f0ffb9e98911d86f2e19539d8c2f97b47e1974e0a3d9d28d149448f401776e1e4fa25b7523e18a680bf153468df782af75f59c7ff0580d02000305f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a5347de1a9be894d367a1544b885b2e3c4f9f7e79728ae5177f7b39c76a35112136f000000000000000000000000000000000000000000000000000000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000026288b8d1932a012665045867e29aaaff8a08b472849903582e42b994b45203f0202020001340000000000286bee00000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc000000000030201047400000000f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a534f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a53400000000000000000000000000000000f8c4898641adada76eeeee2de872d931bc58bfb2ce5b79734e32808cc501a534",
"hash": "28xHAnmmVY6A2wfwe4v1LeoeS3qPBYL4haajmswwfVZ4JVsobeTCzoksVjZjgzzKtbJpCnraCquUwTiYRvkXpoKb",
"status": "confirmed",
"error": null,
"signatures": [
{
"account_address": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"signature": ""
}
],
"block_time": "2023-02-28T07:55:33.000Z"
},
"funding_account_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"stake_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"withdraw_authority_pubkey": "Hk5voGB7wh9HtXTeszbW7AFm3A4B94xWkXeeaqTYspqy",
"amount": "4.0",
"validator_address": null,
"delegate_transaction": null,
"delegation_active_amount": null,
"delegation_inactive_amount": null,
"delegation_status": null,
"delegation_status_error": null,
"estimated_active_at": null
},
"network_code": "solana",
"chain_code": "devnet",
"created_at": "2023-02-28T07:04:33.714Z",
"updated_at": "2023-02-28T07:55:56.620Z"
}