Skip to main content
Staking in the Cosmos network using the Staking API consists of several main steps:
  1. Create a staking request.
  2. Sign and send the transaction to the network.
Get an authentication token to start using Staking API. Request examples are provided using cURL.
1

Create staking request

Send a POST request to /api/v1/cosmos/{network}/staking/stake.Example request:
  • stashAccountAddress stash account address which keeps tokens.
  • memo — arbitrary text data to add to the transactions.
  • amount — amount of tokens to stake in ATOM.
Example response:
  • amount — amount of tokens to stake.
  • currency — currency of tokens:
    • atom — ATOM, Cosmos native staking token.
    • uatom — 1 ATOM = 10⁶ uATOM,
    • matom — 1 ATOM = 10³ mATOM.
  • validatorAddress address to which tokens are delegated.
  • stashAccountAddress — delegator stash account address which keeps tokens.
  • rewardDestinationAddress — reward destination account address.
  • createdAt — timestamp of the transaction in the ISO 8601 format.
transactionData is the list of data fields to be used to construct the staking transactions:
  • messages:
    • typeUrl — Cosmos network operation type.
    • delegatorAddress — delegator address.
    • validatorAddress — validator address.
    • amount — amount of tokens to stake.
    • currency — currency of tokens.
  • fee — fee charged for the transaction.
    • amount — amount of tokens.
    • denom — currency of tokens: atom, uatom, or matom.
    • gas — amount of spent for the transaction.
  • memo — arbitrary text data to add to the transactions.
  • encodedBody — processable transaction data encoded in the hexadecimal format.
  • encodedAuthInfo — authorization data, including fee, encoded in the hexadecimal format.
2

Sign and Send Transaction

Use transactionData to sign and send the signed transaction to the Cosmos network.To check the transaction status, send a GET request to /api/v1/cosmos/{network}/transaction/status/{transactionHash}.Example request:
  • transactionHash — hash of the transaction.
Example response:
  • status — transaction status: success, failed.
  • blockId — unique identifier of the block in which the transaction has been included.
  • fee — total fee in ATOM charged for processing the transaction.
  • gas — computational effort required to execute the transaction, measured in gas units.
    • used — amount of gas spent for the transaction.
    • wanted — maximum gas limit that the transaction initiator was willing to consume for the transaction.
  • transactionHash — hash of the transaction.