Transfer
Transfer DOT
Transferring DOT is a simple process. We will collect:
- The address from which DOT is transferred.
- The account that will sign the transaction.
- The address to which DOT is transferred.
- Amount of DOT to be transferred.
In the following guide we will illustrate how to transfer DOT 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* :stringProtocol this flow operates on (ex.polkadot).network* :stringNetwork this flow operates on (ex.westend).operation* :stringThe operation to perform (ex.transfer).
JSON
{
"protocol": "polkadot",
"network": "westend",
"operation": "transfer"
}
Response
id:stringID of the flow.operation:stringThe Staking API operation being performed by this flow.state:stringThe current state of the flow.actions:arrayIt includes thename&inputsof all next possible actions.create_transfer_tx: Use this action to create a transfer transaction to send DOT between accounts.from_account_address: The address from which DOT will be transferred.to_account_address: The address to which DOT will be transferred.amount: The amount of DOT to be transferred.
data:objectFlow & transaction data.
JSON
{
"id": "7d022b7b-b509-4abc-94f1-e1e16c32b0bc",
"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": "in DOT",
"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": "polkadot",
"network": "westend",
"created_at": "2023-02-28T19:41:47.212Z",
"updated_at": "2023-02-28T19:41:47.212Z"
}
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_txinputs* :objectfrom_account_address* :stringthe address from which DOT will be transferred.to_account_address* :stringThe address to which DOT will be transferred.amount* :numberThe amount of DOT to be transferred.
JSON
{
"name": "create_transfer_tx",
"inputs": {
"from_account_address": "5GQmooiNwLwjXnsNp3woVDD3xhkHzcifVVAmdWcb6FaRVA4L",
"to_account_address": "5GNhcVwpjND83kk6uqMeCjXNUnTSdz84SFyJmd3NmZe4uvrC",
"amount": 1
}
}
refresh_transfer_tx: If you need to get a fresh version of the transaction payload (i.e., the nonce has increased).sign_transfer_tx: Submit a signed transaction payload or an array of signatures to continue the flow.confirm_transfer_tx_by_hash: Submit a previously completed transaction hash to continue the flow.
data:objectFlow & transaction data.
JSON
{
"id": "7d022b7b-b509-4abc-94f1-e1e16c32b0bc",
"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": "5E1VnXHKaKVYrq9wjNj6RKHNn8VpMfKRar9RAXEdKxKfTeV6"
},
{
"name": "to_account_address",
"display": "To Account Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "5FNVfA6qhVJBKrG4KCo6CLzvcXVRRdiGpsYHbkzujMUG6JJG"
},
{
"name": "amount",
"display": "Amount",
"description": "in DOT",
"type": "decimal",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "numericality",
"options": {
"greater_than": 0
}
}
],
"array": false,
"default_value": "1.0"
}
]
},
{
"name": "sign_transfer_tx",
"inputs": [
{
"name": "transaction_payload",
"display": "Transaction Payload",
"description": "",
"type": "signed_transaction",
"validations": [
{
"type": "sign_payload",
"options": {}
}
],
"array": false,
"default_value": null,
"signers": [
"5E1VnXHKaKVYrq9wjNj6RKHNn8VpMfKRar9RAXEdKxKfTeV6"
],
"transaction_payload": "0x0008000000000000000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e0000000000000000000000000000000000000000000000000000000000000000000000000004000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e81c77657374656e64387061726974792d77657374656e6402000000a42400000000000040df6acb689907609b0400000037e397fc7c91f5e40100000040fe3ad401f8959a06000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0300000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a803000000f3ff14d5ab5270590300000017a6bc0d0062aeb30100000013000000010004"
},
{
"name": "signatures",
"display": "Signatures",
"description": "",
"type": "array_of_signatures",
"validations": [],
"array": true,
"default_value": null,
"element_type": "signature_data",
"signers": [
"5E1VnXHKaKVYrq9wjNj6RKHNn8VpMfKRar9RAXEdKxKfTeV6"
],
"transaction_payload": "0x0008000000000000000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e0000000000000000000000000000000000000000000000000000000000000000000000000004000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e81c77657374656e64387061726974792d77657374656e6402000000a42400000000000040df6acb689907609b0400000037e397fc7c91f5e40100000040fe3ad401f8959a06000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0300000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a803000000f3ff14d5ab5270590300000017a6bc0d0062aeb30100000013000000010004"
}
]
},
{
"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": "5E1VnXHKaKVYrq9wjNj6RKHNn8VpMfKRar9RAXEdKxKfTeV6",
"to_account_address": "5FNVfA6qhVJBKrG4KCo6CLzvcXVRRdiGpsYHbkzujMUG6JJG",
"amount": "1.0",
"transfer_transaction": {
"raw": "0x0008000000000000000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e0000000000000000000000000000000000000000000000000000000000000000000000000004000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e81c77657374656e64387061726974792d77657374656e6402000000a42400000000000040df6acb689907609b0400000037e397fc7c91f5e40100000040fe3ad401f8959a06000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0300000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a803000000f3ff14d5ab5270590300000017a6bc0d0062aeb30100000013000000010004",
"signing_payload": "0x04000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e8000800a424000013000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e",
"signed": null,
"hash": null,
"status": null,
"error": null,
"signatures": null,
"block_time": null,
"block_number": null,
"proxy": null
}
},
"protocol": "polkadot",
"network": "westend",
"created_at": "2023-02-28T19:41:47.212Z",
"updated_at": "2023-02-28T19:45:19.210Z"
}
# Submit Signed Transfer 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 Polkadot network.
### URL
`https://api.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.
JSON
```json
{
"name": "sign_transfer_tx",
"inputs": {
"transaction_payload": "0x3d028400c03f2415e59cb6f46d85837762060744fdc67e71dce6426b0ef3347c6f3ac25301c8fabe0ccafba4725082416d985669e9eff5b8eb96a5829727ea8f3ab5f21d28dfed7582018b7c17b51a5281e3c27cf23bc8dee002a43ece83ad1efe6ddc7d8d000800040000beaa875b14abaeae2d1a55193ba6f175aa846b7e624dce1514fbf043638aa858070010a5d4e8"
}
}
Response
id:stringID of the flow.operation:stringThe Staking API operation being performed by this flow.state:stringThe current state of the flow.transfer_tx_broadcasting: Transaction has been broadcast and is waiting for confirmation.transferred: Transaction has been confirmed and the transfer is complete.
actions:arrayIt includes thename&inputsof all next possible actions.data:objectFlow & transaction data.
JSON
{
"id": "7d022b7b-b509-4abc-94f1-e1e16c32b0bc",
"operation": "transfer",
"state": "transfer_tx_broadcasting",
"actions": [
{
"name": "wait",
"estimated_state_change_at": "2023-02-28T19:49:33.939Z",
"inputs": []
}
],
"data": {
"from_account_address": "5E1VnXHKaKVYrq9wjNj6RKHNn8VpMfKRar9RAXEdKxKfTeV6",
"to_account_address": "5FNVfA6qhVJBKrG4KCo6CLzvcXVRRdiGpsYHbkzujMUG6JJG",
"amount": "1.0",
"transfer_transaction": {
"raw": "0x0008000000000000000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e0000000000000000000000000000000000000000000000000000000000000000000000000004000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e81c77657374656e64387061726974792d77657374656e6402000000a42400000000000040df6acb689907609b0400000037e397fc7c91f5e40100000040fe3ad401f8959a06000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0300000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a803000000f3ff14d5ab5270590300000017a6bc0d0062aeb30100000013000000010004",
"signing_payload": "0x04000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e8000800a424000013000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e",
"signed": "0x3d0284005606182f1a01b77f9914856c907ddf4279018e96537be51c2d29834d93dfdf7a01eecedc5d94f01d7ee336be33dcad5cc37c3f734a2806ec7ca2620fe5643c1856ff9e15ae8f23d078605aad930f441912b320a314dc53ebdba7a655580549ff8300080004000092460dcf0b9ae6cabf654c1b33f02f52934d1ae262f8db733b470b631c587165070010a5d4e8",
"hash": "0x82664a2937586c2f072d4fecb05d28e64ea4b530d63a4dca97fe5b962f5ae5a2",
"status": null,
"error": null,
"signatures": [],
"block_time": null,
"block_number": 14838667,
"proxy": null
}
},
"protocol": "polkadot",
"network": "westend",
"created_at": "2023-02-28T19:41:47.212Z",
"updated_at": "2023-02-28T19:48:33.926Z"
}
# 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
- `transfer_tx_broadcasting` : Broadcasting transaction
- `transferred` : Transaction broadcasted & confirmed
- `actions` : `array` It includes the `name` & `inputs` of all next possible actions.
- `data` : `object` Flow & transaction data.
JSON
```json
{
"id": "90a28f6e-09b4-4fe1-aeb4-c8e3720933ab",
"operation": "staking",
"state": "bonding_complete",
"actions": [
{
"name": "create_nomination_tx",
"inputs": [
{
"name": "validator_addresses",
"display": "Validator Addresses",
"description": "",
"type": "array_of_strings",
"validations": [
{
"type": "array",
"options": {
"allow_empty": false,
"allow_duplicates": false
}
},
{
"type": "length",
"options": {
"maximum": 16,
"message": "Cannot have more than 16 validators"
}
}
],
"array": false,
"default_value": null
}
]
},
{
"name": "create_bond_more_tx",
"inputs": [
{
"name": "amount",
"display": "Amount",
"description": "in DOT",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
},
{
"type": "numericality",
"options": {
"greater_than": 0
}
}
],
"array": false,
"default_value": "1.0"
}
]
},
{
"name": "complete",
"inputs": []
},
{
"name": "assign_stash_and_controller_account",
"inputs": [
{
"name": "controller_account_address",
"display": "Controller Account Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "5CtTpJSdf13cbBZU4RX7EHkEaJ53pVaAF5XJosmusXJ5gdDg"
},
{
"name": "controller_proxy_account_address",
"display": "Controller Proxy Account Address",
"description": "",
"type": "string",
"validations": [],
"array": false,
"default_value": null
},
{
"name": "stash_account_address",
"display": "Stash Account Address",
"description": "",
"type": "string",
"validations": [
{
"type": "presence",
"options": {}
}
],
"array": false,
"default_value": "5HRJp9zQzMTjyv7skG3gnWwopPgFfc5FNwyNtEsmLHLyRK8t"
},
{
"name": "stash_proxy_account_address",
"display": "Stash Proxy Account Address",
"description": "",
"type": "string",
"validations": [],
"array": false,
"default_value": null
}
]
}
],
"data": {
"controller_account_address": "5CtTpJSdf13cbBZU4RX7EHkEaJ53pVaAF5XJosmusXJ5gdDg",
"controller_proxy_account_address": null,
"stash_account_address": "5HRJp9zQzMTjyv7skG3gnWwopPgFfc5FNwyNtEsmLHLyRK8t",
"stash_proxy_account_address": null,
"validator_addresses": null,
"reward_destination": "5HRJp9zQzMTjyv7skG3gnWwopPgFfc5FNwyNtEsmLHLyRK8t",
"amount": "1.0",
"bonding_transaction": {
"raw": "0x0000000000000000000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e00000000000000000000000000000000000000000000000000000000000000000000000000060000246c8389743df168ed8f55e531a31e55d5d3ac774d8f7efe626d46c2c433e679070010a5d4e803ece3c0004ffa0c55acd1bb2ec951f24d6b898fbafee6520dab3022fe12bec7451c77657374656e64387061726974792d77657374656e6402000000a42400000000000040df6acb689907609b0400000037e397fc7c91f5e40100000040fe3ad401f8959a06000000d2bc9897eed08f1503000000f78b278be53f454c02000000af2c0297a23e6d3d0300000049eaaf1b548a0cb00100000091d5df18b0d2cf5801000000ed99c5acb25eedf503000000cbca25e39f14238702000000687ad44ad37f03c201000000ab3c0572291feb8b01000000bc9d89904f5b923f0100000037c8bb1350a9a2a803000000f3ff14d5ab5270590300000017a6bc0d0062aeb30100000013000000010004",
"signing_payload": "0x060000246c8389743df168ed8f55e531a31e55d5d3ac774d8f7efe626d46c2c433e679070010a5d4e803ece3c0004ffa0c55acd1bb2ec951f24d6b898fbafee6520dab3022fe12bec745000000a424000013000000e143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423ee143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e",
"signed": "0xc1028400ece3c0004ffa0c55acd1bb2ec951f24d6b898fbafee6520dab3022fe12bec745017e6fb8557959f7c8806aee19a18b54f42336f0f7c814514f66d8fa788b32902722ea6dc1bfe66cf6e402b8f139137900e63e20e72951b780abd3a6d80e640f8b000000060000246c8389743df168ed8f55e531a31e55d5d3ac774d8f7efe626d46c2c433e679070010a5d4e803ece3c0004ffa0c55acd1bb2ec951f24d6b898fbafee6520dab3022fe12bec745",
"hash": "0xed90569932c9897bd0defbf763d8e9ab24fd849f9c627a5a50d6d622b3f37449",
"status": "confirmed",
"error": null,
"signatures": [],
"block_time": "2023-02-28T18:42:42.254Z",
"block_number": 14838035,
"proxy": false
},
"nomination_transaction": null,
"bond_more_transaction": null
},
"protocol": "polkadot",
"network": "westend",
"created_at": "2023-02-28T17:41:14.880Z",
"updated_at": "2023-02-28T18:42:42.261Z"
}