API Reference

Transferring ADA requires:

  • The account from which ADA to be transferred, which will sign the transaction.
  • The address to which ADA is transferred.
  • Amount of ADA to be transferred.

❗️

Blockfrost Projects

To use Cardano with the Staking API, you must first add a Blockfrost Project ID to your account using the Blockfrost Projects endpoint.

In the following guide we will illustrate how to transfer ADA between accounts.

Create New Transfer Flow

To initiate the transfer 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. cardano).
  • network* : string Network this flow operates on (ex. preprod).
  • operation* : string The operation to perform (ex. transfer).
{
  "protocol": "cardano",
  "network": "preprod",
  "operation": "transfer"
}

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_transfer_tx : Use this action to transfer ADA.
      • from_account_address : The address from which ADA will be transferred.
      • to_account_address : The address to which ADA will be transferred.
      • amount : The amount of ADA to be transferred.
  • data : object Flow & transaction data.
{
  "id": "55fcfcdd-b1f5-460c-bce9-8b8864461315",
  "operation": "transfer",
  "state": "initialized",
  "actions": [
    {
      "name": "create_transfer_tx",
      "inputs": [
        {
          "name": "from_account_address",
          "display": "From Account Address",
          "description": "",
          "type": "string",
          "validations": [
            {
              "type": "presence",
              "options": {}
            }
          ],
          "array": false,
          "default_value": null
        },
        {
          "name": "to_account_address",
          "display": "To Account Address",
          "description": "",
          "type": "string",
          "validations": [
            {
              "type": "presence",
              "options": {}
            }
          ],
          "array": false,
          "default_value": null
        },
        {
          "name": "amount",
          "display": "Amount",
          "description": "",
          "type": "decimal",
          "validations": [
            {
              "type": "presence",
              "options": {}
            },
            {
              "type": "numericality",
              "options": {
                "greater_than": 0
              }
            }
          ],
          "array": false,
          "default_value": null
        }
      ]
    }
  ],
  "data": {
    "from_account_address": null,
    "to_account_address": null,
    "amount": null,
    "transfer_transaction": null
  },
  "protocol": "cardano",
  "network": "preprod",
  "created_at": "2023-03-07T19:18:01.189Z",
  "updated_at": "2023-03-07T19:18:01.189Z"
}

Submit Transfer Data

After collecting 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_transfer_tx
  • inputs* : object
    • from_account_address* : string The address from which ADA will be transferred.
    • to_account_address* : string The address to which ADA will be transferred.
    • amount* : number The amount of ADA to be transferred.
{
  "name": "create_transfer_tx",
  "inputs": {
    "from_account_address": "addr_test1qq37lp9qu5xnh45glqmhwx585kguz3k8jsqe95grjs6zp23j9mvvj53acfrj5mtsn2f5qp258uyrfvzrrrww409nxf3svhyew8",
    "to_account_address": "addr_test1qpr0vyprum2feg2340lmtx0gs3ye0qwnsagwqfhy5pfd5glrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rsvy9lvz",
    "amount": 10
  }
}

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.

{
  "id": "55fcfcdd-b1f5-460c-bce9-8b8864461315",
  "operation": "transfer",
  "state": "transfer_tx_signature",
  "actions": [
    {
      "name": "refresh_transfer_tx",
      "inputs": [
        {
          "name": "from_account_address",
          "display": "From Account Address",
          "description": "",
          "type": "string",
          "validations": [
            {
              "type": "presence",
              "options": {}
            }
          ],
          "array": false,
          "default_value": "addr_test1qpspgu485kwfvhvpnk3mpvxr8vzvhnvw0jcsckcnw6rafklrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rs0ekrpd"
        },
        {
          "name": "to_account_address",
          "display": "To Account Address",
          "description": "",
          "type": "string",
          "validations": [
            {
              "type": "presence",
              "options": {}
            }
          ],
          "array": false,
          "default_value": "addr_test1qzsv3unnn5gwnqzccf4gk9mmnh5nmfcyjcckhzxjfpv59q9xfu7p7cvhrg6eh374ps852jxq7qzgfjwgknn36ggkdwrsc945zx"
        },
        {
          "name": "amount",
          "display": "Amount",
          "description": "",
          "type": "decimal",
          "validations": [
            {
              "type": "presence",
              "options": {}
            },
            {
              "type": "numericality",
              "options": {
                "greater_than": 0
              }
            }
          ],
          "array": false,
          "default_value": "10.0"
        }
      ]
    },
    {
      "name": "sign_transfer_tx",
      "inputs": [
        {
          "name": "transaction_payload",
          "display": "Transaction Payload",
          "description": "",
          "type": "signed_transaction",
          "validations": [],
          "array": false,
          "default_value": null,
          "signers": [
            "addr_test1qpspgu485kwfvhvpnk3mpvxr8vzvhnvw0jcsckcnw6rafklrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rs0ekrpd"
          ],
          "transaction_payload": "84a30081825820409f739d3afb030a23e68ac4506dc3ca8bc646474ea4450568e7dad51fd38b3600018282583900a0c8f2739d10e98058c26a8b177b9de93da70496316b88d248594280a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871a0098968082583900601472a7a59c965d819da3b0b0c33b04cbcd8e7cb10c5b137687d4dbe3bc1d4228d3b40b729a96d7fce249aee6c0842e6c1ce2d2496b51c71a05370815021a00029075a0f5f6"
        },
        {
          "name": "signatures",
          "display": "Signatures",
          "description": "",
          "type": "array_of_signatures",
          "validations": [],
          "array": true,
          "default_value": null,
          "element_type": "signature_data",
          "signers": [
            "addr_test1qpspgu485kwfvhvpnk3mpvxr8vzvhnvw0jcsckcnw6rafklrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rs0ekrpd"
          ],
          "transaction_payload": "84a30081825820409f739d3afb030a23e68ac4506dc3ca8bc646474ea4450568e7dad51fd38b3600018282583900a0c8f2739d10e98058c26a8b177b9de93da70496316b88d248594280a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871a0098968082583900601472a7a59c965d819da3b0b0c33b04cbcd8e7cb10c5b137687d4dbe3bc1d4228d3b40b729a96d7fce249aee6c0842e6c1ce2d2496b51c71a05370815021a00029075a0f5f6",
          "signing_payload": "b097030f88413f546c2188e1f2ab9e6407f653a18153a501f1d05b062538be6e",
          "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_transfer_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": {
    "from_account_address": "addr_test1qpspgu485kwfvhvpnk3mpvxr8vzvhnvw0jcsckcnw6rafklrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rs0ekrpd",
    "to_account_address": "addr_test1qzsv3unnn5gwnqzccf4gk9mmnh5nmfcyjcckhzxjfpv59q9xfu7p7cvhrg6eh374ps852jxq7qzgfjwgknn36ggkdwrsc945zx",
    "amount": "10.0",
    "transfer_transaction": {
      "raw": "84a30081825820409f739d3afb030a23e68ac4506dc3ca8bc646474ea4450568e7dad51fd38b3600018282583900a0c8f2739d10e98058c26a8b177b9de93da70496316b88d248594280a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871a0098968082583900601472a7a59c965d819da3b0b0c33b04cbcd8e7cb10c5b137687d4dbe3bc1d4228d3b40b729a96d7fce249aee6c0842e6c1ce2d2496b51c71a05370815021a00029075a0f5f6",
      "signing_payload": "b097030f88413f546c2188e1f2ab9e6407f653a18153a501f1d05b062538be6e",
      "signed": null,
      "hash": null,
      "status": null,
      "error": null,
      "signatures": [
        {
          "account_address": "addr_test1qpspgu485kwfvhvpnk3mpvxr8vzvhnvw0jcsckcnw6rafklrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rs0ekrpd",
          "signature": ""
        }
      ],
      "block_time": null
    }
  },
  "protocol": "cardano",
  "network": "preprod",
  "created_at": "2023-03-07T20:48:36.827Z",
  "updated_at": "2023-03-07T20:50:34.377Z"
}

Submit Signed Transfer Transaction for Broadcast

After signing the transaction, send a PUT request to /flows/[:flow_id]/next and the Staking API will broadcast the transaction to the network.

URL

https://api.datahub.figment.io/flows/[:flow_id]/next

Request

  • name* : sign_transfer_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.
{
  "name": "sign_transfer_tx",
  "inputs": {
    "transaction_payload": "84a30081825820a4cf432a8f3f0fe44ffdd9775ae55b2bd419c4652fb96cdeaaa27c6e0f83ea5f0001828258390046f61023e6d49ca151abffb599e884499781d38750e026e4a052da23e3bc1d4228d3b40b729a96d7fce249aee6c0842e6c1ce2d2496b51c71a009896808258390023ef84a0e50d3bd688f837771a87a591c146c7940192d103943420aa322ed8c9523dc2472a6d709a934005543f0834b04318dceabcb332631a3affa30b021a00029075a10081825820002d9a48169c6d508699b7aaaa360cc38cb1f3b771444451d38cd0f901ac139d5840285bbda669d5e3805d0e81596271546f070be66c55eb30a03c2b98892b57cb99b9eb2ad4c08181d1d2ca7d84dca876bfad6756d1be68eaa99df127fe5c2aa403f5f6"
  }
}

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.
    • transfer_tx_broadcasting : Transaction has been broadcast and is waiting for confirmation.
    • completed : Transaction has been confirmed and the transfer is complete.
  • actions : array It includes the name & inputs of all next possible actions.
  • data : object Flow & transaction data.
{
  "id": "55fcfcdd-b1f5-460c-bce9-8b8864461315",
  "operation": "transfer",
  "state": "transfer_tx_broadcasting",
  "actions": [
    {
      "name": "wait",
      "estimated_state_change_at": "2023-03-07T21:36:20.230Z",
      "inputs": []
    }
  ],
  "data": {
    "from_account_address": "addr_test1qq37lp9qu5xnh45glqmhwx585kguz3k8jsqe95grjs6zp23j9mvvj53acfrj5mtsn2f5qp258uyrfvzrrrww409nxf3svhyew8",
    "to_account_address": "addr_test1qpr0vyprum2feg2340lmtx0gs3ye0qwnsagwqfhy5pfd5glrhsw5y2xnks9h9x5k6l7wyjdwumqggtnvrn3dyjtt28rsvy9lvz",
    "amount": "10.0",
    "transfer_transaction": {
      "raw": "84a30081825820701e79cd816d453ac93018e9550b63c52b394808cfaf011f5b0c180793e4f7f70101828258390046f61023e6d49ca151abffb599e884499781d38750e026e4a052da23e3bc1d4228d3b40b729a96d7fce249aee6c0842e6c1ce2d2496b51c71a009896808258390023ef84a0e50d3bd688f837771a87a591c146c7940192d103943420aa322ed8c9523dc2472a6d709a934005543f0834b04318dceabcb332631a3a647c16021a00029075a0f5f6",
      "signing_payload": "2800f50ddc0a4ddf1a50b93015d47d2201926310c29aa7e1645ea429d7ba61cf",
      "signed": "84a30081825820701e79cd816d453ac93018e9550b63c52b394808cfaf011f5b0c180793e4f7f70101828258390046f61023e6d49ca151abffb599e884499781d38750e026e4a052da23e3bc1d4228d3b40b729a96d7fce249aee6c0842e6c1ce2d2496b51c71a009896808258390023ef84a0e50d3bd688f837771a87a591c146c7940192d103943420aa322ed8c9523dc2472a6d709a934005543f0834b04318dceabcb332631a3a647c16021a00029075a10081825820002d9a48169c6d508699b7aaaa360cc38cb1f3b771444451d38cd0f901ac139d5840b37def2a690fbf3f8cd3aadb2d9507d428772e1b2415366761584010bccead1e75369532df49bf265aeac6684fd4decba93eb8f6a87fa98dbdf01bc78b890001f5f6",
      "hash": "2800f50ddc0a4ddf1a50b93015d47d2201926310c29aa7e1645ea429d7ba61cf",
      "status": null,
      "error": null,
      "signatures": [
        {
          "account_address": "addr_test1qq37lp9qu5xnh45glqmhwx585kguz3k8jsqe95grjs6zp23j9mvvj53acfrj5mtsn2f5qp258uyrfvzrrrww409nxf3svhyew8",
          "signature": ""
        }
      ],
      "block_time": null
    }
  },
  "protocol": "cardano",
  "network": "preprod",
  "created_at": "2023-03-07T21:34:06.674Z",
  "updated_at": "2023-03-07T21:35:19.456Z"
}

Get Transfer 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 waiting for confirmation.
    • completed : Transaction has been confirmed and the transfer is complete.
  • actions : array It includes the name & inputs of all next possible actions.
  • data : object Flow & transaction data.
{
  "id": "6f995c8a-08b7-43ff-9275-0ef8fc94bc26",
  "operation": "staking",
  "state": "completed",
  "actions": [],
  "data": {
    "delegator_address": "addr_test1qrwsyak374wzmdakesg8wl8r0feucetatxuqz8s2csqzradxfu7p7cvhrg6eh374ps852jxq7qzgfjwgknn36ggkdwrsu6ae9x",
    "validator_address": "pool1wn6a6f23ctq06udwhw27ravdpd6zcr7jlut3yez0wzdackz3222",
    "registered": null,
    "register_transaction": {
      "raw": "84a40081825820dac094796df4319dba24ecb71d109a274f7f4b96ada5eb2b5282f47027b0707700018182583900dd0276d1f55c2db7b6cc10777ce37a73cc657d59b8011e0ac40021f5a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871b0000000253db9117021a00028c29048182008200581ca64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b87a0f5f6",
      "signing_payload": "33f750583301f5b298e7a4d9d42cd950be86ecd018f8df37e4fb58640d39e997",
      "signed": "84a40081825820dac094796df4319dba24ecb71d109a274f7f4b96ada5eb2b5282f47027b0707700018182583900dd0276d1f55c2db7b6cc10777ce37a73cc657d59b8011e0ac40021f5a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871b0000000253db9117021a00028c29048182008200581ca64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b87a10081825820e64c0674e648699f8fa225632bfa1402d09dc3aa2e1f2b523702d2faac9d67d558403adfc52b66d1ceaba7372563d0572ea66c41c40973848a66044768ec81d41ddaf36149d38617db8f02f6c5a0c351d10a8b134e512aed2ca75bcb7b155c298807f5f6",
      "hash": "33f750583301f5b298e7a4d9d42cd950be86ecd018f8df37e4fb58640d39e997",
      "status": "confirmed",
      "error": null,
      "signatures": [
        {
          "account_address": "addr_test1qrwsyak374wzmdakesg8wl8r0feucetatxuqz8s2csqzradxfu7p7cvhrg6eh374ps852jxq7qzgfjwgknn36ggkdwrsu6ae9x",
          "signature": ""
        }
      ],
      "block_time": "2023-02-24T17:09:47.000Z"
    },
    "delegate_transaction": {
      "raw": "84a4008182582033f750583301f5b298e7a4d9d42cd950be86ecd018f8df37e4fb58640d39e99700018182583900dd0276d1f55c2db7b6cc10777ce37a73cc657d59b8011e0ac40021f5a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871b0000000253d8ee6a021a0002a2ad048183028200581ca64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b87581c74f5dd2551c2c0fd71aebb95e1f58d0b742c0fd2ff1712644f709bdca0f5f6",
      "signing_payload": "689c8172693b66d5a649d1bb8e7df8b5a83c828022910602c1e7815b88c1597a",
      "signed": "84a4008182582033f750583301f5b298e7a4d9d42cd950be86ecd018f8df37e4fb58640d39e99700018182583900dd0276d1f55c2db7b6cc10777ce37a73cc657d59b8011e0ac40021f5a64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b871b0000000253d8ee6a021a0002a2ad048183028200581ca64f3c1f61971a359bc7d50c0f4548c0f00484c9c8b4e71d21166b87581c74f5dd2551c2c0fd71aebb95e1f58d0b742c0fd2ff1712644f709bdca10082825820e64c0674e648699f8fa225632bfa1402d09dc3aa2e1f2b523702d2faac9d67d558401b5c035fa577f743dcc5f0b500d9a3c621aa17297d7a5824671be13c35f764c5e70ccd5d1cb26cb942d5f967214f0f8e1a5853b1c18e7fc6ac90b714a579ab0a8258208e1bdf6b1776a3cac2686e14130029b4544b9f004faa67992b107001b67dd993584027152598680a9e251bec230aca563f34aaf6e8403b630a395b2b62d35b873bc7121d4c026e3cff32c44194202003c3fc350753548645946baf61e65cbbd31003f5f6",
      "hash": "689c8172693b66d5a649d1bb8e7df8b5a83c828022910602c1e7815b88c1597a",
      "status": "confirmed",
      "error": null,
      "signatures": [
        {
          "account_address": "addr_test1qrwsyak374wzmdakesg8wl8r0feucetatxuqz8s2csqzradxfu7p7cvhrg6eh374ps852jxq7qzgfjwgknn36ggkdwrsu6ae9x",
          "signature": ""
        }
      ],
      "block_time": "2023-02-24T17:13:01.000Z"
    }
  },
  "protocol": "cardano",
  "network": "preprod",
  "created_at": "2023-02-24T17:06:06.083Z",
  "updated_at": "2023-02-24T17:13:21.307Z"
}