Stratos-chain REST APIs

A REST interface to communicate with Stratos-chain for state queries and transaction operations.

Overview

Generally, all the APIs provided here could be grouped into HTTP GET and POST requests. We classified these APIs into sections based on their modules or their operations for an in-depth analysis.

GET Request

The response content type is application/json

POST Request

The response content type is application/json. If it has a request body, the request content is also in application/json format.

A POST request will return an unsigned transaction, which equals to its equivalent stchaincli command with a --generate-only flag.

Comparison between REST API and its equivalent stchaincli` command

Suppose a send transaction that transfers tokens from one account to another. The following comparison demonstrates we can get the same response in both methods.

REST API

Http POST request

http://127.0.0.1:1317/bank/accounts/st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6/transfers

Request body

{
  "base_req": {
    "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
    "memo": "Send Tx Example",
    "chain_id": "test-chain",
    "account_number": "0",
    "gas": "200000",
    "gas_adjustment": "1.2",
    "fees": [
      {
        "denom": "ustos",
        "amount": "100"
      }
    ],
    "simulate": false
  },
  "amount": [
    {
      "denom": "ustos",
      "amount": "1000000"
    }
  ]
}

Response

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgSend",
                "value": {
                    "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
                    "amount": [
                        {
                            "denom": "ustos",
                            "amount": "1000000"
                        }
                    ]
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Send Tx Example"
    }
}

stchaincli command

$ ./build/stchaincli tx send st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2 st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6 1000000ustos --fees 100ustos --chain-id=test-chain --keyring-backend=test --memo "Send Tx Example" --generate-only --gas=auto

Output

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgSend",
                "value": {
                    "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
                    "amount": [
                        {
                            "denom": "ustos",
                            "amount": "1000000"
                        }
                    ]
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Send Tx Example"
    }
}

Stratos-chain REST APIs

As usual, for ease of use, these APIs have been classified by the following modules

Auth

Get the account information on blockchain

GET http://127.0.0.1:1317/auth/accounts/{address}

Example: http://127.0.0.1:1317/auth/accounts/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s

Path Parameters

NameTypeDescription

address*

String

wallet address

{
  "height": "2536",
  "result": {
    "type": "cosmos-sdk/Account",
    "value": {
      "address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
      "coins": [
        {
          "denom": "ustos",
          "amount": "999500000000000"
        }
      ],
      "public_key": {
        "type": "tendermint/PubKeySecp256k1",
        "value": "A4oRGeSYDImfg5OhXPPOQ1p0Sepc5PkxhCV3sDe5uNao"
      },
      "account_number": "0",
      "sequence": "1"
    }
  }
}

Bank

Get the account balances

GET http://127.0.0.1:1317/bank/balances/{address}

Example:

http://127.0.0.1:1317/bank/balances/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s

Path Parameters

NameTypeDescription

address*

String

wallet address

{
    // Response
}{
  "height": "614",
  "result": [
    {
      "denom": "ustos",
      "amount": "999500000000000"
    }
  ]
}

Send coins from one account to another

POST http://127.0.0.1:1317/bank/accounts/{address}/transfers

Example:

http://127.0.0.1:1317/bank/accounts/st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6/transfers

Path Parameters

NameTypeDescription

address*

String

wallet address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Send Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "amount": [ { "denom": "ustos", "amount": "1000000" } ] }

{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSend",
        "value": {
          "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
          "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
          "amount": [
            {
              "denom": "ustos",
              "amount": "1000000"
            }
          ]
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Send Tx Example"
  }
}

Distribution

Get the total rewards balance from all delegations

GET http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards

Example:

http://127.0.0.1:1317/bank/accounts/st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6/transfers

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

{
  "height": "2267",
  "result": {
    "rewards": [
      {
        "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
        "reward": [
          {
            "denom": "ustos",
            "amount": "41192446491.504000000000000000"
          }
        ]
      }
    ],
    "total": [
      {
        "denom": "ustos",
        "amount": "41192446491.504000000000000000"
      }
    ]
  }
} 

Query a delegation reward

GET http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards/{validatorAddr}

Example:

http://127.0.0.1:1317/distribution/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/rewards/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

validatorAddr*

String

validator address

{
    "height": "2304",
    "result": [
        {
            "denom": "ustos",
            "amount": "41864892292.314000000000000000"
        }
    ]
}

Get the rewards withdrawal address

GET http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/withdraw_address

Example:

http://127.0.0.1:1317/distribution/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/withdraw_address

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

{
    "height": "2327",
    "result": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
}

Get validator distribution information

GET http://127.0.0.1:1317/distribution/validators/{validatorAddr}

Example:

http://127.0.0.1:1317/distribution/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

{
    "height": "2368",
    "result": {
        "operator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
        "self_bond_rewards": [
            {
                "denom": "ustos",
                "amount": "43028052291.252000000000000000"
            }
        ],
        "val_commission": [
            {
                "denom": "ustos",
                "amount": "4780894699.028000000000000000"
            }
        ]
    }
}

Fee distribution outstanding rewards of a single validator

GET http://127.0.0.1:1317/distribution/validators/{validatorAddr}/outstanding_rewards

Example:

http://127.0.0.1:1317/distribution/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm/outstanding_rewards

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

{
    "height": "2392",
    "result": [
        {
            "denom": "ustos",
            "amount": "48293600804.120000000000000000"
        }
    ]
}

Commission and self-delegation rewards of a single validator

GET http://127.0.0.1:1317/distribution/validators/{validatorAddr}/rewards

Example:

http://127.0.0.1:1317/distribution/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm/rewards

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

{
    "height": "2445",
    "result": [
        {
            "denom": "ustos",
            "amount": "44427496811.796000000000000000"
        }
    ]
}

Community pool parameters

GET http://127.0.0.1:1317/distribution/community_pool

Example:

http://127.0.0.1:1317/distribution/community_pool{ "height": "2479", "result": [ { "denom": "ustos", "amount": "1021438537.140000000000000000" } ] } GET /distribution/community_pool Community pool parameters

{
    "height": "2479",
    "result": [
        {
            "denom": "ustos",
            "amount": "1021438537.140000000000000000"
        }
    ]
}

Fee distribution parameters

GET http://127.0.0.1:1317/distribution/parameters

Example:

http://127.0.0.1:1317/distribution/parameters

{
    "height": "2496",
    "result": {
        "community_tax": "0.020000000000000000",
        "base_proposer_reward": "0.010000000000000000",
        "bonus_proposer_reward": "0.040000000000000000",
        "withdraw_addr_enabled": true
    }
}

Withdraw all the delegator's delegation rewards

POST http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards

Example:

http://127.0.0.1:1317/distribution/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/rewards

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Withdraw Rewards Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "1000" } ], "simulate": false } }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgWithdrawDelegationReward",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "1000"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Withdraw Rewards Tx Example"
    }
}

Withdraw a delegator's delegation reward from a single validator

POST http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards/{validatorAddr}

Example:

http://127.0.0.1:1317/distribution/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/rewards/stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

validatorAddr*

String

validator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Withdraw Rewards From a Single Validator Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false } }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgWithdrawDelegationReward",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Withdraw Rewards From a Single Validator Tx Example"
    }
}

Replace the delegations' rewards withdrawal address for a new one

POST http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/withdraw_address

Example:

http://127.0.0.1:1317/distribution/delegators/st1wkya79c9dvqrwc7um4n9vljc0duds3z5y56j7f/withdraw_address

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

*

json

{ "base_req": { "from": "st1wkya79c9dvqrwc7um4n9vljc0duds3z5y56j7f", "memo": "Replace the Rewards Withdrawal Address Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "withdraw_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2" }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgModifyWithdrawAddress",
                "value": {
                    "delegator_address": "st1wkya79c9dvqrwc7um4n9vljc0duds3z5y56j7f",
                    "withdraw_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Replace the Rewards Withdrawal Address Tx Example"
    }
}

Withdraw the validator's self-delegation and commissions rewards

POST http://127.0.0.1:1317/distribution/validators/{validatorAddr}/rewards

Example:

http://127.0.0.1:1317/distribution/validators/stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p/rewards

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Withdraw the Validator's Rewards Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false } }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgWithdrawValidatorCommission",
                "value": {
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            },
            {
                "type": "cosmos-sdk/MsgWithdrawDelegationReward",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Withdraw the Validator's Rewards Tx Example"
    }
}

Gov

Query proposals information with parameters

GET http://127.0.0.1:1317/gov/proposals

Example:

http://127.0.0.1:1317/gov/proposals?status=passed

Query Parameters

NameTypeDescription

voter

String

voter address

depositor

String

depositor address

status

String

proposal status, valid values: "deposit_period", "voting_period", "passed", "rejected"

page

int

page number

limit

int

maximum number of items per page

tx.minheight

int64

transactions on blocks with height greater or equal this value

tx.maxheight

int64

transactions on blocks with height less than or equal this value

{
  "height": "42",
  "result": [
    {
      "content": {
        "type": "cosmos-sdk/ParameterChangeProposal",
        "value": {
          "title": "Param-Change Staking MaxValidators to 100",
          "description": "This is a test to update MaxValidators to 100 in staking Module",
          "changes": [
            {
              "subspace": "staking",
              "key": "MaxValidators",
              "value": "100"
            }
          ]
        }
      },
      "id": "1",
      "proposal_status": "Passed",
      "final_tally_result": {
        "yes": "500000000000",
        "abstain": "0",
        "no": "0",
        "no_with_veto": "0"
      },
      "submit_time": "2021-08-05T20:09:08.402925192Z",
      "deposit_end_time": "2021-08-05T20:10:48.402925192Z",
      "total_deposit": [
        {
          "denom": "ustos",
          "amount": "12010000"
        }
      ],
      "voting_start_time": "2021-08-05T20:09:43.640293657Z",
      "voting_end_time": "2021-08-05T20:11:23.640293657Z"
    }
  ]
}

Query a proposal by id

GET http://127.0.0.1:1317/gov/proposals/{proposalId}

Example:

http://127.0.0.1:1317/gov/proposals/1

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

{
  "height": "57",
  "result": {
    "content": {
      "type": "cosmos-sdk/ParameterChangeProposal",
      "value": {
        "title": "Param-Change Staking MaxValidators to 100",
        "description": "This is a test to update MaxValidators to 100 in staking Module",
        "changes": [
          {
            "subspace": "staking",
            "key": "MaxValidators",
            "value": "100"
          }
        ]
      }
    },
    "id": "1",
    "proposal_status": "Passed",
    "final_tally_result": {
      "yes": "500000000000",
      "abstain": "0",
      "no": "0",
      "no_with_veto": "0"
    },
    "submit_time": "2021-08-05T20:09:08.402925192Z",
    "deposit_end_time": "2021-08-05T20:10:48.402925192Z",
    "total_deposit": [
      {
        "denom": "ustos",
        "amount": "12010000"
      }
    ],
    "voting_start_time": "2021-08-05T20:09:43.640293657Z",
    "voting_end_time": "2021-08-05T20:11:23.640293657Z"
  }
}

Query for the proposer for a proposal

GET http://127.0.0.1:1317/gov/proposals/{proposalId}/proposer

Example:

http://127.0.0.1:1317/gov/proposals/1/proposer

Path Parameters

NameTypeDescription

proposalId

int

proposal Id

{
    "height": "0",
    "result": {
        "proposal_id": "1",
        "proposer": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
    }
}

Query deposits by proposal-id

GET http://127.0.0.1:1317/gov/proposals/{proposalId}/deposits

Example:

http://127.0.0.1:1317/gov/proposals/1/deposits

Path Parameters

NameTypeDescription

proposalId

int

proposal Id

{
  "height": "0",
  "result": [
    {
      "proposal_id": "1",
      "depositor": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
      "amount": [
        {
          "denom": "ustos",
          "amount": "12000000"
        }
      ]
    }
  ]
}

Query deposit by proposal-id and depositor address

GET http://127.0.0.1:1317/gov/proposals/{proposalId}/deposits/{depositor}

Example:

http://127.0.0.1:1317/gov/proposals/1/deposits/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

depositor*

String

depositor address

{
    "height": "0",
    "result": {
        "proposal_id": "1",
        "depositor": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
        "amount": [
            {
                "denom": "ustos",
                "amount": "12000000"
            }
        ]
    }
}

Query voters information by proposal-id

GET http://127.0.0.1:1317/gov/proposals/{proposalId}/votes

Example:

http://127.0.0.1:1317/gov/proposals/1/votes

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

{
    "height": "0",
    "result": []
}

Reported bug:

  • The Governance API for votes(/gov/proposals/{proposalId}/votes) on a proposal returns null after voting period closes.

  • This bug has been reported here. A workaround is to use /gov/proposals/{proposalId}.

  • Block log:

[2021-08-12|21:35:59.001] Served RPC HTTP response module=rest-server method=GET url=/gov/proposals/1/votes status=200 duration=2 remoteAddr=127.0.0.1:55878

Query vote information by proposal Id and voter address

GET http://127.0.0.1:1317/gov/proposals/{proposalId}/votes/{voter}

Example:

http://127.0.0.1:1317/gov/proposals/1/votes/st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

voter*

String

voter address

{
    "error": "'' is not a valid vote option"
}

Reported bug:

  • The Governance API for voter(/gov/proposals/{proposalId}/votes/{voter}) on a proposal Always return "'' is not a valid vote option" after voting period closes.

  • This bug has been reported here. A workaround is to use /gov/proposals/{proposalId}

  • Block log

[2021-08-12|21:35:45.288] Served RPC HTTP response module=rest-server method=GET url=/gov/proposals/1/votes/st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh status=400 duration=1 remoteAddr=127.0.0.1:55872

Get a proposal's tally result at the current time

GET http://127.0.0.1:1317/gov/proposals/{proposalId}/tally

Example:

http://127.0.0.1:1317/gov/proposals/1/tally

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

{
  "height": "211",
  "result": {
    "yes": "500000000000",
    "abstain": "0",
    "no": "0",
    "no_with_veto": "0"
  }
} 

If the proposal is pending deposits (i.e status 'DepositPeriod') it returns an empty tally result

Query gov deposit parameters

GET http://127.0.0.1:1317/gov/parameters/deposit

Example:

http://127.0.0.1:1317/gov/parameters/deposit

{
  "height": "217",
  "result": {
    "min_deposit": [
      {
        "denom": "ustos",
        "amount": "10000000"
      }
    ],
    "max_deposit_period": "100000000000"
  }
}

Query governance tally parameters

GET http://127.0.0.1:1317/gov/parameters/tallying

Example:

http://127.0.0.1:1317/gov/parameters/tallying

{
  "height": "222",
  "result": {
    "quorum": "0.334000000000000000",
    "threshold": "0.500000000000000000",
    "veto": "0.334000000000000000"
  }
}

Query governance voting parameters

GET http://127.0.0.1:1317/gov/parameters/voting

Example:

http://127.0.0.1:1317/gov/parameters/voting

{
  "height": "227",
  "result": {
    "voting_period": "100000000000"
  }
}

Send transaction to submit a proposal

POST http://127.0.0.1:1317/gov/proposals

Example:

http://127.0.0.1:1317/gov/proposals

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Submit Proposal Tx Example", "chain_id": "test-chain", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "title": "Text Proposal", "description": "This is a text proposal example", "proposal_type": "text", "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "initial_deposit": [ { "denom": "ustos", "amount": "1000000" } ] }

{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSubmitProposal",
        "value": {
          "content": {
            "type": "cosmos-sdk/TextProposal",
            "value": {
              "title": "Text Proposal",
              "description": "This is a text proposal example"
            }
          },
          "initial_deposit": [
            {
              "denom": "ustos",
              "amount": "1000000"
            }
          ],
          "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr"
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Submit Proposal Tx Example"
  }
}

Generate a parameter change proposal transaction

POST http://127.0.0.1:1317/gov/proposals/param_change

Example:

http://127.0.0.1:1317/gov/proposals/param_change

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Generate a parameter-change proposal Tx Example", "chain_id": "test-chain", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "title": "Param-Change Staking MaxValidators to 100", "description": "This is a test to update MaxValidators to 100 in staking Module", "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "deposit": [ { "denom": "ustos", "amount": "10000000" } ], "changes": [ { "subspace": "staking", "key": "MaxValidators", "value": 100 } ] }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgSubmitProposal",
                "value": {
                    "content": {
                        "type": "cosmos-sdk/ParameterChangeProposal",
                        "value": {
                            "title": "Param-Change Staking MaxValidators to 100",
                            "description": "This is a test to update MaxValidators to 100 in staking Module",
                            "changes": [
                                {
                                    "subspace": "staking",
                                    "key": "MaxValidators",
                                    "value": "100"
                                }
                            ]
                        }
                    },
                    "initial_deposit": [
                        {
                            "denom": "ustos",
                            "amount": "10000000"
                        }
                    ],
                    "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Generate a parameter-change proposal Tx Example"
    }
}

Deposit tokens to a proposal

POST http://127.0.0.1:1317/gov/proposals/{proposalId}/deposits

Example:

http://127.0.0.1:1317/gov/proposals/1/deposits

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Deposit tokens to Proposal 1 Tx Example", "chain_id": "test-chain", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "depositor": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "amount": [ { "denom": "ustos", "amount": "10000000" } ] }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgDeposit",
                "value": {
                    "proposal_id": "1",
                    "depositor": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr",
                    "amount": [
                        {
                            "denom": "ustos",
                            "amount": "10000000"
                        }
                    ]
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Deposit tokens to Proposal 1 Tx Example"
    }
}

Send transaction to vote a proposal

POST http://127.0.0.1:1317/gov/proposals/{proposalId}/votes

Example:

http://127.0.0.1:1317/gov/proposals/1/votes

Path Parameters

NameTypeDescription

proposalId*

int

proposal Id

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Vote Proposal 1 Tx Example", "chain_id": "test-chain", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "voter": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "option": "yes" }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgVote",
                "value": {
                    "proposal_id": "1",
                    "voter": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr",
                    "option": "Yes"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Vote Proposal 1 Tx Example"
    }
}

Mint

Get mint module parameters

GET http://127.0.0.1:1317/minting/parameters

Example:

http://127.0.0.1:1317/minting/inflation

{
  "height": "783",
  "result": {
    "mint_denom": "ustos",
    "inflation_rate_change": "0.130000000000000000",
    "inflation_max": "0.200000000000000000",
    "inflation_min": "0.070000000000000000",
    "goal_bonded": "0.670000000000000000",
    "blocks_per_year": "6311520"
  }
}

Get current minting inflation value

GET http://127.0.0.1:1317/minting/inflation

Example:

http://127.0.0.1:1317/minting/inflation

{
  "height": "800",
  "result": "0.130016465508894587"
}

Get current minting annual provisions value

GET http://127.0.0.1:1317 /minting/annual-provisions

Example:

http://127.0.0.1:1317/minting/annual-provisions

{
  "height": "818",
  "result": "130019024060848.545708142618272810"
}

Slashing

Get signing info of all validators

GET http://127.0.0.1:1317/slashing/signing_infos

Example:

http://127.0.0.1:1317/slashing/signing_infos

{
  "height": "1379",
  "result": [
    {
      "address": "stvalcons18vm93nhrl8rx6ve22k5jqm9xzxk82fthchs2u0",
      "start_height": "0",
      "index_offset": "1378",
      "jailed_until": "1970-01-01T00:00:00Z",
      "tombstoned": false,
      "missed_blocks_counter": "0"
    }
  ]
}

Get the current slashing parameters

GET http://127.0.0.1:1317/slashing/parameters

Example:

http://127.0.0.1:1317/slashing/parameters

{
  "height": "1398",
  "result": {
    "signed_blocks_window": "100",
    "min_signed_per_window": "0.500000000000000000",
    "downtime_jail_duration": "600000000000",
    "slash_fraction_double_sign": "0.050000000000000000",
    "slash_fraction_downtime": "0.010000000000000000"
  }
}

Send transaction to unjail a jailed validator

POST http://127.0.0.1:1317/slashing/validators/{validatorAddr}/unjail

Example:

http://127.0.0.1:1317/slashing/validators/stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p/unjail

Path Parameters

NameTypeDescription

validatorAddr*

Sring

validator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Unjail a Jailed Validator Tx Example", "chain_id": "test-chain", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false } }

{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgUnjail",
        "value": {
          "address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Unjail a Jailed Validator Tx Example"
  }
}

Staking

Get all delegations from a delegator

GET http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/delegations

Example:

http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/delegations

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

{
  "height": "1441",
  "result": [
    {
      "delegator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
      "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "shares": "500000000000.000000000000000000",
      "balance": {
        "denom": "ustos",
        "amount": "500000000000"
      }
    }
  ]
}

Query the current delegation between a delegator and a validator

GET http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/delegations/{validatorAddr}

Example:

http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/delegations/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

validatorAddr*

String

validator address

{
  "height": "1556",
  "result": {
    "delegator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
    "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
    "shares": "500000000000.000000000000000000",
    "balance": {
      "denom": "ustos",
      "amount": "500000000000"
    }
  }
}

Get all redelegations

GET http://127.0.0.1:1317/staking/redelegations

Example:

http://127.0.0.1:1318/staking/redelegations

{
  "height": "2823",
  "result": [
    {
      "delegator_address": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76",
      "validator_src_address": "stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj",
      "validator_dst_address": "stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq",
      "entries": [
        {
          "creation_height": 1909,
          "completion_time": "2021-09-02T19:33:26.890343914Z",
          "initial_balance": "10000",
          "shares_dst": "10000.000000000000000000",
          "balance": "10000"
        }
      ]
    }
  ]
}

Get all unbonding delegations from a delegator

GET http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/unbonding_delegations

Example:

http://127.0.0.1:1317/staking/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/unbonding_delegations

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

{
  "height": "6033",
  "result": [
    {
      "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
      "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p",
      "entries": [
        {
          "creation_height": "5805",
          "completion_time": "2021-08-30T19:53:31.144199109Z",
          "initial_balance": "10000",
          "balance": "10000"
        }
      ]
    }
  ]
}

Query all unbonding delegations between a delegator and a validator

GET http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr}

Example:

http://127.0.0.1:1317/staking/delegators/st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh/unbonding_delegations/stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

validatorAddr*

String

validator address

{
    "height": "2742",
    "result": {
        "delegator_address": "st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh",
        "validator_address": "stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u",
        "entries": [
            {
                "creation_height": "2739",
                "completion_time": "2021-09-03T00:26:44.825391686Z",
                "initial_balance": "10000",
                "balance": "10000"
            }
        ]
    }
}

Query all validators that a delegator is bonded to

GET http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/validators

Example:

http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/validators

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

{
  "height": "1739",
  "result": [
    {
      "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
      "jailed": false,
      "status": 2,
      "tokens": "500000000000",
      "delegator_shares": "500000000000.000000000000000000",
      "description": {
        "moniker": "node",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "unbonding_height": "0",
      "unbonding_time": "1970-01-01T00:00:00Z",
      "commission": {
        "commission_rates": {
          "rate": "0.100000000000000000",
          "max_rate": "0.200000000000000000",
          "max_change_rate": "0.010000000000000000"
        },
        "update_time": "2021-08-03T18:57:24.382040932Z"
      },
      "min_self_delegation": "1"
    }
  ]
}

Query a validator that a delegator is bonded to

GET http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/validators/{validatorAddr}

Example:

http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

validatorAddr*

String

validator address

{
  "height": "1937",
  "result": {
    "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
    "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
    "jailed": false,
    "status": 2,
    "tokens": "500000000000",
    "delegator_shares": "500000000000.000000000000000000",
    "description": {
      "moniker": "node",
      "identity": "",
      "website": "",
      "security_contact": "",
      "details": ""
    },
    "unbonding_height": "0",
    "unbonding_time": "1970-01-01T00:00:00Z",
    "commission": {
      "commission_rates": {
        "rate": "0.100000000000000000",
        "max_rate": "0.200000000000000000",
        "max_change_rate": "0.010000000000000000"
      },
      "update_time": "2021-08-03T18:57:24.382040932Z"
    },
    "min_self_delegation": "1"
  }
}

Get all validator candidates

GET http://127.0.0.1:1317/staking/validators

Example:

http://127.0.0.1:1317/staking/validators

{
  "height": "1523",
  "result": [
    {
      "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
      "jailed": false,
      "status": 2,
      "tokens": "500000000000",
      "delegator_shares": "500000000000.000000000000000000",
      "description": {
        "moniker": "node",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "unbonding_height": "0",
      "unbonding_time": "1970-01-01T00:00:00Z",
      "commission": {
        "commission_rates": {
          "rate": "0.100000000000000000",
          "max_rate": "0.200000000000000000",
          "max_change_rate": "0.010000000000000000"
        },
        "update_time": "2021-08-03T18:57:24.382040932Z"
      },
      "min_self_delegation": "1"
    }
  ]
}

By default it returns only the bonded validators

Query the information from a single validator

GET http://127.0.0.1:1317/staking/validators/{validatorAddr}

Example:

http://127.0.0.1:1317/staking/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

{
  "height": "1974",
  "result": {
    "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
    "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
    "jailed": false,
    "status": 2,
    "tokens": "500000000000",
    "delegator_shares": "500000000000.000000000000000000",
    "description": {
      "moniker": "node",
      "identity": "",
      "website": "",
      "security_contact": "",
      "details": ""
    },
    "unbonding_height": "0",
    "unbonding_time": "1970-01-01T00:00:00Z",
    "commission": {
      "commission_rates": {
        "rate": "0.100000000000000000",
        "max_rate": "0.200000000000000000",
        "max_change_rate": "0.010000000000000000"
      },
      "update_time": "2021-08-03T18:57:24.382040932Z"
    },
    "min_self_delegation": "1"
  }
}

Get all delegations from a validator

GET http://127.0.0.1:1317/staking/validators/{validatorAddr}/delegations

Example:

http://127.0.0.1:1317/staking/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm/delegations

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

{
  "height": "2040",
  "result": [
    {
      "delegator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
      "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "shares": "500000000000.000000000000000000",
      "balance": {
        "denom": "ustos",
        "amount": "500000000000"
      }
    }
  ]
}

Get all unbonding delegations from a validator

GET http://127.0.0.1:1317/staking/validators/{validatorAddr}/unbonding_delegations

Example:

http://127.0.0.1:1318/staking/validators/stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u/unbonding_delegations

Path Parameters

NameTypeDescription

validatorAddr*

String

validator address

{
  "height": "2920",
  "result": [
    {
      "delegator_address": "st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh",
      "validator_address": "stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u",
      "entries": [
        {
          "creation_height": "2739",
          "completion_time": "2021-09-03T00:26:44.825391686Z",
          "initial_balance": "10000",
          "balance": "10000"
        }
      ]
    }
  ]
}

Get the current state of the staking pool

GET http://127.0.0.1:1317/staking/pool

Example:

http://127.0.0.1:1317/staking/pool

 {
  "height": "2070",
  "result": {
    "not_bonded_tokens": "0",
    "bonded_tokens": "500000000000"
  }
}

Get the current staking parameter values

GET http://127.0.0.1:1317/staking/parameters

Example:

http://127.0.0.1:1317/staking/parameters

{
  "height": "2108",
  "result": {
    "unbonding_time": "1814400000000000",
    "max_validators": 100,
    "max_entries": 7,
    "historical_entries": 0,
    "bond_denom": "ustos"
  }
}

Submit a delegation from a delegator

POST http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/delegations

Example:

http://127.0.0.1:1317/staking/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/delegations

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Submit Delegation Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p", "amount": { "denom": "ustos", "amount": "10000" } }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgDelegate",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p",
                    "amount": {
                        "denom": "ustos",
                        "amount": "10000"
                    }
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Submit Delegation Tx Example"
    }
}

Submit an unbonding delegation

POST http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/unbonding_delegations

Example:

http://127.0.0.1:1317/staking/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/unbonding_delegations

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Submit Unbonding-delegation Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p", "amount": { "denom": "ustos", "amount": "10000" } }

{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgUndelegate",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p",
                    "amount": {
                        "denom": "ustos",
                        "amount": "10000"
                    }
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Submit Unbonding-delegation Tx Example"
    }
}

Submit a redelegation

POST http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/redelegations

Example:

http://127.0.0.1:1318/staking/delegators/st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76/redelegations

Path Parameters

NameTypeDescription

delegatorAddr*

String

delegator address

Request Body

NameTypeDescription

*

json

{ "base_req": { "from": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76", "memo": "Submit Re-delegation Tx Example", "chain_id": "test-chain", "account_number": "0", "gas": "200000", "gas_adjustment": "1.2", "fees": [ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "delegator_address": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76", "validator_src_address": "stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj", "validator_dst_address": "stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq", "amount": { "denom": "ustos", "amount": "10000" } }

{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgBeginRedelegate",
        "value": {
          "delegator_address": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76",
          "validator_src_address": "stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj",
          "validator_dst_address": "stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq",
          "amount": {
            "denom": "ustos",
            "amount": "10000"
          }
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Submit Re-delegation Tx Example"
  }
}

Supply

Get total supply of coins in the chain

GET http://127.0.0.1:1317/supply/total

Example:

http://127.0.0.1:1317/supply/total

{
  "height": "670",
  "result": [
    {
      "denom": "ustos",
      "amount": "1000013800990024"
    }
  ]
}

Get total supply of a single coin denomination

GET http://127.0.0.1:1317/supply/total/{denomination}

Example:

http://127.0.0.1:1317/supply/total/ustos

Path Parameters

NameTypeDescription

denomination*

String

coin demon

{
  "height": "696",
  "result": "1000014336584175"
}

Register

Query total staking state of all registered resource nodes and indexing nodes

GET http://127.0.0.1:1317/register/staking

Example:

http://127.0.0.1:1317/register/staking

{
    "height": "89",
    "result": {
        "TotalStakeOfResourceNodes": {
            "denom": "ustos",
            "amount": "200000000000"
        },
        "TotalStakeOfIndexingNodes": {
            "denom": "ustos",
            "amount": "200000000000"
        },
        "TotalBondedStake": {
            "denom": "ustos",
            "amount": "400000000000"
        },
        "TotalUnbondedStake": {
            "denom": "ustos",
            "amount": "0"
        },
        "TotalUnbondingStake": {
            "denom": "ustos",
            "amount": "0"
        }
    }
}

Get params of registered module

GET http://127.0.0.1:1317/register/params

Example:

http://127.0.0.1:1317/register/params

{
    "height": "157",
    "result": {
        "bond_denom": "ustos",
        "unbonding_threashold_time": "15552000000000000",
        "unbonding_completion_time": "1209600000000000",
        "max_entries": 16
    }
}

Get info of all registered resource nodes

GET http://127.0.0.1:1317/register/resource-nodes

Example:

http://127.0.0.1:1317/register/resource-nodes

{
    "height": "69",
    "result": [
        {
            "network_id": "sdm://resourceNode_2@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_2",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "7",
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sdm://resourceNode_1@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeyEd25519",
                "value": "mAaIUxt077UhHvGNEiL2gd9kW8puqIj4+qhh7nf40mA="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "4",
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}

Get info of all registered indexing nodes

GET http://127.0.0.1:1317/register/indexing-nodes

Example:

http://127.0.0.1:1317/register/indexing-nodes

{
    "height": "79",
    "result": [
        {
            "network_id": "sdm://indexingNode_1@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeyEd25519",
                "value": "CFAvlMr4y3bw7AFDqRjk1oyYCqOw9Cv/m+uFXmw6aGo="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "indexingNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sdm://stsdsp2p1rxus8f86eqmssqu8vlpj50gd7pqe0r5y6ss923@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeyEd25519",
                "value": "RHK84zZvN8VNe8iAOtLtUcrgyNAGWqKn5vQ4tOY4JAM="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "stratos-foundation",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}

Get staking info of a specific node

GET http://127.0.0.1:1317/register/staking/address/{nodeAddress}

Example:

http://127.0.0.1:1317/register/staking/address/st162xm62m75cjv2529p7yydkxmqfwhknsl60cmu4

Path Parameters

NameTypeDescription

nodeAddress*

String

node address

Query Parameters

NameTypeDescription

query_type

int64

query type number

{
    "height": "125",
    "result": {
        "network_id": "sdm://resourceNode_1@54.212.112.93:8888",
        "pub_key": {
            "type": "tendermint/PubKeyEd25519",
            "value": "mAaIUxt077UhHvGNEiL2gd9kW8puqIj4+qhh7nf40mA="
        },
        "suspend": false,
        "status": 2,
        "tokens": "100000000000",
        "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
        "description": {
            "moniker": "resourceNode_1",
            "identity": "",
            "website": "",
            "security_contact": "",
            "details": ""
        },
        "node_type": "4",
        "creation_time": "0001-01-01T00:00:00Z",
        "bonded_stake": {
            "denom": "ustos",
            "amount": "100000000000"
        },
        "un_bonding_stake": {
            "denom": "ustos",
            "amount": "0"
        },
        "un_bonded_stake": {
            "denom": "ustos",
            "amount": "0"
        }
    }
}

Get all staking info of a specific owner

GET http://127.0.0.1:1317/register/staking/owner/{ownerAddress}

Example:

http://127.0.0.1:1317/register/staking/owner/st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua

Path Parameters

NameTypeDescription

ownerAddress*

String

owner address

{
    "height": "145",
    "result": [
        {
            "network_id": "sdm://indexingNode_1@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "CFAvlMr4y3bw7AFDqRjk1oyYCqOw9Cv/m+uFXmw6aGo="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "indexingNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "SP",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        },
        {
            "network_id": "sdm://stsdsp2p1rxus8f86eqmssqu8vlpj50gd7pqe0r5y6ss923@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "RHK84zZvN8VNe8iAOtLtUcrgyNAGWqKn5vQ4tOY4JAM="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "stratos-foundation",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "SP",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        },
        {
            "network_id": "sdm://resourceNode_2@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_2",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "7",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        },
        {
            "network_id": "sdm://resourceNode_1@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "mAaIUxt077UhHvGNEiL2gd9kW8puqIj4+qhh7nf40mA="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "4",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        }
    ]
}

Proof of Traffic (PoT)

Query Pot rewards info of all wallet addresses at a specific epoch

GET http://127.0.0.1:1317/pot/rewards/epoch/{epoch}

Example:

http://127.0.0.1:1317/pot/rewards/epoch/1

Path Parameters

NameTypeDescription

epoch*

int64

epoch number

{
    "height": "15",
    "result": [
        {
            "wallet_address": "st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz",
            "reward_from_mining_pool": "24000000000",
            "reward_from_traffic_pool": "18900288"
        },
        {
            "wallet_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "reward_from_mining_pool": "23111111108",
            "reward_from_traffic_pool": "18200276"
        },
        {
            "wallet_address": "st1se0hwymfz353xqj4nmxhrqz6g3qzeng5d9mjf4",
            "reward_from_mining_pool": "24000000000",
            "reward_from_traffic_pool": "18900288"
        }
    ]
}

Query Pot rewards info of a wallet_address at a specific epoch

GET http://127.0.0.1:1317/pot/rewards/epoch/{epoch}

Example:

http://127.0.0.1:1317/pot/rewards/epoch/1?wallet_address=st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua

Path Parameters

NameTypeDescription

epoch*

int64

epoch number

Query Parameters

NameTypeDescription

wallet_address

String

wallet address

{
    "height": "18",
    "result": [
        {
            "wallet_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "reward_from_mining_pool": "23111111108",
            "reward_from_traffic_pool": "18200276"
        }
    ]
}

Query owner's Pot rewards info at a specific height

GET http://127.0.0.1:1317/pot/rewards/wallet/{walletAddress}

Example:

http://127.0.0.1:1317/pot/rewards/wallet/st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua?height=218

Path Parameters

NameTypeDescription

walletAddress*

String

owner's wallet address

Query Parameters

NameTypeDescription

height

int64

block search height/default: latest height

{
    "height": "218",
    "result": {
        "WalletAddress": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
        "MatureTotalReward": {
            "denom": "reward",
            "amount": "23129311384"
        },
        "ImmatureTotalReward": {
            "denom": "reward",
            "amount": "23129311372"
        }
    }
}

SDS

Get a simulated prepay result

GET http://127.0.0.1:1317/sds/simulatePrepay/{amtToPrepay}

Example:

http://127.0.0.1:1317/sds/simulatePrepay/8000000000

Path Parameters

NameTypeDescription

amtToPrepay*

int64

prepay amount

{
    "height": "194",
    "result": "126972073"
}

Get current uozPrice

GET http://127.0.0.1:1317/sds/uozPrice

Example:

http://127.0.0.1:1317/sds/uozPrice

{
    "height": "174",
    "result": "63.000960466897594981"
}

Get current uozSupply

GET http://127.0.0.1:1317sds/uozSupply

Example:

http://127.0.0.1:1317/sds/uozSupply

{
    "height": "183",
    "result": {
        "Remaining": "1593625498008",
        "Total": "-1"
    }
}

Tendermint RPC

Tendermint APIs, such as query blocks, transactions and validator set

Get information about the connected node

GET http://127.0.0.1:1317/node_info

Example:

http://127.0.0.1:1317/node_info

{
    "node_info": {
        "protocol_version": {
            "p2p": "7",
            "block": "10",
            "app": "0"
        },
        "id": "eacd50530e1ded18b556e230f45e04c9d7dd60bb",
        "listen_addr": "tcp://0.0.0.0:26656",
        "network": "test-chain",
        "version": "0.33.9",
        "channels": "4020212223303800",
        "moniker": "node",
        "other": {
            "tx_index": "on",
            "rpc_address": "tcp://127.0.0.1:26657"
        }
    },
    "application_version": {
        "name": "",
        "server_name": "<appd>",
        "client_name": "<appcli>",
        "version": "v0.3.0",
        "commit": "",
        "build_tags": "",
        "go": "go version go1.15.11 linux/amd64",
        "build_deps": [
            "github.com/99designs/keyring@v1.1.6",
            "github.com/ChainSafe/go-schnorrkel@v0.0.0-20200405005733-88cbf1b4c40d",
            "github.com/Workiva/go-datastructures@v1.0.52",
            "..."
        ]
    }
}

Get a block at a specific {height | latest}

GET http://127.0.0.1:1317/blocks/{height | latest}

Example:

http://127.0.0.1:1317/blocks/latest

{
    "block_id": {
        "hash": "962CA04FCF30EB1C9E1D13DEA62D6001FA19585E80F1E1C52719EBABD138C998",
        "parts": {
            "total": "1",
            "hash": "6FA93CE6D82B772EBA62278B33D9731C87A31271636442900EB87A48F14D7F23"
        }
    },
    "block": {
        "header": {
            "version": {
                "block": "10",
                "app": "0"
            },
            "chain_id": "test-chain",
            "height": "141",
            "time": "2021-08-04T17:47:23.200191253Z",
            "last_block_id": {
                "hash": "1B438DB7C3F558D0130FFBEE622A9898FDFE01BBE6FF1CD42C91FCCE4D19B33C",
                "parts": {
                    "total": "1",
                    "hash": "494E4EBF671133F9E4B0ED0588951FE98F5F1C17795E015F728AFEA0E3FF23A9"
                }
            },
            "last_commit_hash": "E9C54C235CE0608D877F4B9563196A9209069224A9F2FF3CE3A8E5D9CEBE9C85",
            "data_hash": "",
            "validators_hash": "1D91595E4BC95AF074614D180AA4FEC18E914712AB4CA78CE7819F735BB9C45D",
            "next_validators_hash": "1D91595E4BC95AF074614D180AA4FEC18E914712AB4CA78CE7819F735BB9C45D",
            "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F",
            "app_hash": "6009E75DC5210BB09BABF7B9F1F8A9207A65CC9E83E0167F33C1749A0547EEB9",
            "last_results_hash": "",
            "evidence_hash": "",
            "proposer_address": "3B3658CEE3F9C66D332A55A9206CA611AC752577"
        },
        "data": {
            "txs": null
        },
        "evidence": {
            "evidence": null
        },
        "last_commit": {
            "height": "140",
            "round": "0",
            "block_id": {
                "hash": "1B438DB7C3F558D0130FFBEE622A9898FDFE01BBE6FF1CD42C91FCCE4D19B33C",
                "parts": {
                    "total": "1",
                    "hash": "494E4EBF671133F9E4B0ED0588951FE98F5F1C17795E015F728AFEA0E3FF23A9"
                }
            },
            "signatures": [
                {
                    "block_id_flag": 2,
                    "validator_address": "3B3658CEE3F9C66D332A55A9206CA611AC752577",
                    "timestamp": "2021-08-04T17:47:23.200191253Z",
                    "signature": "W8JjwsGOvjJD8T4iH/L7kvTP5PNzbCPKXWTqtn80uSOKEppKPmG5AerUOZ0D6F1QSjWlQS9EqVQnUbvPAYSQBw=="
                }
            ]
        }
    }
}

Get validator set at certain {height | latest}

GET http://127.0.0.1:1317/validatorsets/{height | latest}

Example:

http://127.0.0.1:1317/validatorsets/28

{
  "height": "0",
  "result": {
    "block_height": "28",
    "validators": [
      {
        "address": "stvalcons18vm93nhrl8rx6ve22k5jqm9xzxk82fthchs2u0",
        "pub_key": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
        "proposer_priority": "0",
        "voting_power": "500000"
      }
    ]
  }
}

Syncing state of node

GET http://127.0.0.1:1317/syncing

Example:

http://127.0.0.1:1317/syncing

{
  "syncing": false
}

Transactions

Search, encode, or broadcast transactions.

Retrieve a transaction using its hash

GET http://127.0.0.1:1317/txs/{hash}

Example:

http://127.0.0.1:1317/txs/0CA946EBB823903004056BEA3CFAFE4F184EF616D72F38433763006534AA0E2E

Path Parameters

NameTypeDescription

hash*

Hash String

tx hash

{
  "height": "18",
  "txhash": "0CA946EBB823903004056BEA3CFAFE4F184EF616D72F38433763006534AA0E2E",
  "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"amount\",\"value\":\"1000000ustos\"}]}]}]",
  "logs": [
    {
      "msg_index": 0,
      "log": "",
      "events": [
        {
          "type": "message",
          "attributes": [
            {
              "key": "action",
              "value": "send"
            },
            {
              "key": "sender",
              "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
            },
            {
              "key": "module",
              "value": "bank"
            }
          ]
        },
        {
          "type": "transfer",
          "attributes": [
            {
              "key": "recipient",
              "value": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h"
            },
            {
              "key": "sender",
              "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
            },
            {
              "key": "amount",
              "value": "1000000ustos"
            }
          ]
        }
      ]
    }
  ],
  "gas_wanted": "200000",
  "gas_used": "65927",
  "tx": {
    "type": "cosmos-sdk/StdTx",
    "value": {
      "msg": [
        {
          "type": "cosmos-sdk/MsgSend",
          "value": {
            "from_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
            "to_address": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h",
            "amount": [
              {
                "denom": "ustos",
                "amount": "1000000"
              }
            ]
          }
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "ustos",
            "amount": "100"
          }
        ],
        "gas": "200000"
      },
      "signatures": [
        {
          "pub_key": {
            "type": "tendermint/PubKeySecp256k1",
            "value": "A4oRGeSYDImfg5OhXPPOQ1p0Sepc5PkxhCV3sDe5uNao"
          },
          "signature": "0NOxqgG7s7v54lnwkRJfDGV2SZrWhmE7M2A2lQs4T2le3WOnYrdF8LXrVGR06uwhBRNcwQE4kZxxHeYbZjUXhQ=="
        }
      ],
      "memo": ""
    }
  },
  "timestamp": "2021-08-05T03:16:39Z"
}

Search transactions using params

GET http://127.0.0.1:1317/txs

Example:

http://127.0.0.1:1317/txs?message.action=send&message.sender=st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s

Query Parameters

NameTypeDescription

message.action

String

message action type('send')

message.sender

String

message sender address

page

int

page number

limit

int

maximum number of items per page

tx.minheight

int64

transactions on blocks with height greater or equal this value

tx.maxheight

int64

transactions on blocks with height less than or equal this value

{
  "total_count": "1",
  "count": "1",
  "page_number": "1",
  "page_total": "1",
  "limit": "30",
  "txs": [
    {
      "height": "18",
      "txhash": "0CA946EBB823903004056BEA3CFAFE4F184EF616D72F38433763006534AA0E2E",
      "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"amount\",\"value\":\"1000000ustos\"}]}]}]",
      "logs": [
        {
          "msg_index": 0,
          "log": "",
          "events": [
            {
              "type": "message",
              "attributes": [
                {
                  "key": "action",
                  "value": "send"
                },
                {
                  "key": "sender",
                  "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
                },
                {
                  "key": "module",
                  "value": "bank"
                }
              ]
            },
            {
              "type": "transfer",
              "attributes": [
                {
                  "key": "recipient",
                  "value": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h"
                },
                {
                  "key": "sender",
                  "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
                },
                {
                  "key": "amount",
                  "value": "1000000ustos"
                }
              ]
            }
          ]
        }
      ],
      "gas_wanted": "200000",
      "gas_used": "65927",
      "tx": {
        "type": "cosmos-sdk/StdTx",
        "value": {
          "msg": [
            {
              "type": "cosmos-sdk/MsgSend",
              "value": {
                "from_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
                "to_address": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h",
                "amount": [
                  {
                    "denom": "ustos",
                    "amount": "1000000"
                  }
                ]
              }
            }
          ],
          "fee": {
            "amount": [
              {
                "denom": "ustos",
                "amount": "100"
              }
            ],
            "gas": "200000"
          },
          "signatures": [
            {
              "pub_key": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A4oRGeSYDImfg5OhXPPOQ1p0Sepc5PkxhCV3sDe5uNao"
              },
              "signature": "0NOxqgG7s7v54lnwkRJfDGV2SZrWhmE7M2A2lQs4T2le3WOnYrdF8LXrVGR06uwhBRNcwQE4kZxxHeYbZjUXhQ=="
            }
          ],
          "memo": ""
        }
      },
      "timestamp": "2021-08-05T03:16:39Z"
    }
  ]
}

Broadcast a signed tx to a full node

POST http://127.0.0.1:1317/txs

Example:

http://127.0.0.1:1317/txs

Request Body

NameTypeDescription

*

json

{ "tx": { "msg": [ { "type": "cosmos-sdk/MsgSend", "value": { "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6", "amount": [ { "denom": "ustos", "amount": "2000000" } ] } } ], "fee": { "amount": [ { "denom": "ustos", "amount": "100" } ], "gas": "200000" }, "signatures": [ { "pub_key": { "type": "tendermint/PubKeySecp256k1", "value": "AolrbtnyTqnxmIjQJTmQfo/Gb2LlN9XPO/Qb2tSI/eRh" }, "signature": "THrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWw==" } ], "memo": "Send Tx Example" }, "mode": "block" }

{
    "height": "3495",
    "txhash": "3F96F021622ED95820D425522319FBE9C4510200FB18A2E18D75A209ABF05323",
    "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"amount\",\"value\":\"2000000ustos\"}]}]}]",
    "logs": [
        {
            "msg_index": 0,
            "log": "",
            "events": [
                {
                    "type": "message",
                    "attributes": [
                        {
                            "key": "action",
                            "value": "send"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "module",
                            "value": "bank"
                        }
                    ]
                },
                {
                    "type": "transfer",
                    "attributes": [
                        {
                            "key": "recipient",
                            "value": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "amount",
                            "value": "2000000ustos"
                        }
                    ]
                }
            ]
        }
    ],
    "gas_wanted": "200000",
    "gas_used": "63379"
}

The tx must be a signed StdTx. The supported broadcast modes include "block"(return after tx commit), "sync"(return after CheckTx) and "async"(return right away)

Block log

I[2021-08-08|14:53:19.215] Executed block                               module=state height=3495 validTxs=1 invalidTxs=0
I[2021-08-08|14:53:19.220] Committed state                              module=state height=3495 txs=1 appHash=FA3D11545126DED06F31890C4B0E83B985AEB54DE7FC2

Check this Tx

http://127.0.0.1:1317/txs/3F96F021622ED95820D425522319FBE9C4510200FB18A2E18D75A209ABF05323

Response

{
    "height": "3495",
    "txhash": "3F96F021622ED95820D425522319FBE9C4510200FB18A2E18D75A209ABF05323",
    "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"amount\",\"value\":\"2000000ustos\"}]}]}]",
    "logs": [
        {
            "msg_index": 0,
            "log": "",
            "events": [
                {
                    "type": "message",
                    "attributes": [
                        {
                            "key": "action",
                            "value": "send"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "module",
                            "value": "bank"
                        }
                    ]
                },
                {
                    "type": "transfer",
                    "attributes": [
                        {
                            "key": "recipient",
                            "value": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "amount",
                            "value": "2000000ustos"
                        }
                    ]
                }
            ]
        }
    ],
    "gas_wanted": "200000",
    "gas_used": "63379",
    "tx": {
        "type": "cosmos-sdk/StdTx",
        "value": {
            "msg": [
                {
                    "type": "cosmos-sdk/MsgSend",
                    "value": {
                        "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                        "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
                        "amount": [
                            {
                                "denom": "ustos",
                                "amount": "2000000"
                            }
                        ]
                    }
                }
            ],
            "fee": {
                "amount": [
                    {
                        "denom": "ustos",
                        "amount": "100"
                    }
                ],
                "gas": "200000"
            },
            "signatures": [
                {
                    "pub_key": {
                        "type": "tendermint/PubKeySecp256k1",
                        "value": "AolrbtnyTqnxmIjQJTmQfo/Gb2LlN9XPO/Qb2tSI/eRh"
                    },
                    "signature": "THrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWw=="
                }
            ],
            "memo": "Send Tx Example"
        }
    },
    "timestamp": "2021-08-08T18:53:14Z"
}

Check this block

http://127.0.0.1:1317/blocks/3495

Response

{
    "block_id": {
        "hash": "082FD6C7397FD7F298D36289678242F0CDE2737DB4D9630B1AE62919A08057D0",
        "parts": {
            "total": "1",
            "hash": "DFB4268FAB528270752EB30FC3A8FFD67BB87B46856B3596A57057E01254A2DF"
        }
    },
    "block": {
        "header": {
            "version": {
                "block": "10",
                "app": "0"
            },
            "chain_id": "test-chain",
            "height": "3495",
            "time": "2021-08-08T18:53:14.172144192Z",
            "last_block_id": {
                "hash": "AE9834662BBEE22FC3C5E4F10CEEC64564AB9401A950BCC3AA795EA42F7612C0",
                "parts": {
                    "total": "1",
                    "hash": "AA0A15014CAE1BC085E104EEEDB06399205932B2E82551477EB10D8BF33190FE"
                }
            },
            "last_commit_hash": "EBB097637FF021777AAAA233064FE0E2B3F5BF1E63FF2D92DC06C8422F6441E6",
            "data_hash": "86B32C45FDF5B55C1B4BD6B943AE7BA86B1D03E4B7220280A51918389B6CD097",
            "validators_hash": "46DA95672ADBB099305219FB1C2B4A07A536984F94B9FD800DE0E3216ED375E5",
            "next_validators_hash": "46DA95672ADBB099305219FB1C2B4A07A536984F94B9FD800DE0E3216ED375E5",
            "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F",
            "app_hash": "5FFFD8BD063FBFDD6F3C30D75212AC4E13527948E757F491BF1488E396B5E217",
            "last_results_hash": "",
            "evidence_hash": "",
            "proposer_address": "38DD39B8E028C18399B21BD8CE78B433D3B61C0D"
        },
        "data": {
            "txs": [
                "2QEoKBapCkKoo2GaChQ07pN7D55YXeTxpV5cplLzrt15RhIUklkfkbrzqcI4RHfgxEybfe5YA/waEAoFdXN0b3MSBzIwMDAwMDASEgoMCgV1c3RvcxIDMTAwEMCaDBpqCibrWumHIQKJa27Z8k6p8ZiI0CU5kH6Pxm9i5TfVzzv0G9rUiP3kYRJATHrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWyIPU2VuZCBUeCBFeGFtcGxl"
            ]
        },
        "evidence": {
            "evidence": null
        },
        "last_commit": {
            "height": "3494",
            "round": "0",
            "block_id": {
                "hash": "AE9834662BBEE22FC3C5E4F10CEEC64564AB9401A950BCC3AA795EA42F7612C0",
                "parts": {
                    "total": "1",
                    "hash": "AA0A15014CAE1BC085E104EEEDB06399205932B2E82551477EB10D8BF33190FE"
                }
            },
            "signatures": [
                {
                    "block_id_flag": 2,
                    "validator_address": "38DD39B8E028C18399B21BD8CE78B433D3B61C0D",
                    "timestamp": "2021-08-08T18:53:14.172144192Z",
                    "signature": "MSNnYWdyczRWkYGuuoiD4G2XaezOzJZfsfNQsh/yfEI+ky191BSDj/Avn1gGEJIZ9k66lHCy+krqp8YyUX9LAw=="
                }
            ]
        }
    }
}

Decode a transaction from the Amino wire format

POST http://127.0.0.1:1317/txs/decode

Example:

http://127.0.0.1:1317/txs/decode

Request Body

NameTypeDescription

*

json

{"tx":"3QEoKBapCkKoo2GaChQ07pN7D55YXeTxpV5cplLzrt15RhIUklkfkbrzqcI4RHfgxEybfe5YA/waEAoFdXN0b3MSBzIwMDAwMDASEgoMCgV1c3RvcxIDMTAwEMCaDBpqCibrWumHIQKJa27Z8k6p8ZiI0CU5kH6Pxm9i5TfVzzv0G9rUiP3kYRJATHrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWyITRW5jb2RpbmcgVHggRXhhbXBsZQ=="}

{
  "height": "0",
  "result": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSend",
        "value": {
          "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
          "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
          "amount": [
            {
              "denom": "ustos",
              "amount": "2000000"
            }
          ]
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": [
      {
        "pub_key": {
          "type": "tendermint/PubKeySecp256k1",
          "value": "AolrbtnyTqnxmIjQJTmQfo/Gb2LlN9XPO/Qb2tSI/eRh"
        },
        "signature": "THrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWw=="
      }
    ],
    "memo": "Encoding Tx Example"
  }
}

Last updated