From 011e61a8def6131033a2b3d40fd1fde63d5c55e7 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Tue, 21 Aug 2018 16:00:43 +0200 Subject: [PATCH] Merge PR #2066: Rename LCD endpoints (Docs) --- docs/light/api.md | 1024 +++++++++++++++++++++++++-------------------- 1 file changed, 581 insertions(+), 443 deletions(-) diff --git a/docs/light/api.md b/docs/light/api.md index d4e66eaf1..4507c9eb8 100644 --- a/docs/light/api.md +++ b/docs/light/api.md @@ -1,39 +1,42 @@ -# Cosmos Hub (Gaia) LCD API +# Cosmos Hub (Gaia-Lite) LCD API -This document describes the API that is exposed by the specific LCD implementation of the Cosmos -Hub (Gaia). Those APIs are exposed by a REST server and can easily be accessed over HTTP/WS(websocket) +This document describes the API that is exposed by the specific Light Client Daemon (LCD) implementation of the Cosmos Hub (Gaia). Those APIs are exposed by a REST server and can easily be accessed over HTTP/WS (websocket) connections. -The complete API is comprised of the sub-APIs of different modules. The modules in the Cosmos Hub -(Gaia) API are: +The complete API is comprised of the sub-APIs of different modules. The modules in the Cosmos Hub (Gaia-Lite) API are: -* ICS0 (TendermintAPI) -* ICS1 (KeyAPI) -* ICS20 (TokenAPI) -* ICS21 (StakingAPI) - not yet implemented -* ICS22 (GovernanceAPI) - not yet implemented +- ICS0 ([TendermintAPI](api.md#ics0---tendermintapi)) +- ICS1 ([KeyAPI](api.md#ics1---keyapi)) +- ICS20 ([TokenAPI](api.md#ics20---tokenapi)) +- ICS21 ([StakingAPI](api.md#ics21---stakingapi)) +- ICS22 ([GovernanceAPI](api.md#ics22---governanceapi)) +- ICS23 ([SlashingAPI](api.md#ics23---slashingapi)) Error messages my change and should be only used for display purposes. Error messages should not be used for determining the error type. -## ICS0 - TendermintAPI - not yet implemented +## ICS0 - TendermintAPI -Exposes the same functionality as the Tendermint RPC from a full node. It aims to have a very -similar API. +Exposes the same functionality as the Tendermint RPC from a full node. It aims to have a very similar API. -### /broadcast_tx_sync - POST +### POST /txs -url: /broadcast_tx_sync +- **URL**: `/txs` +- Query Parameters: + - `?return={sync|async|block}`: + - `return=sync`: Waits for the transaction to pass `CheckTx` + - `return=async`: Returns the request immediately after it is received by the server + - `return=block`: waits for for the transaction to be committed in a block +- POST Body: -Functionality: Submit a signed transaction synchronously. This returns a response from CheckTx. +```json +{ + "transaction": "string", + "return": "string", +} +``` -Parameters: - -| Parameter | Type | Default | Required | Description | -| ----------- | ------ | ------- | -------- | --------------- | -| transaction | string | null | true | signed tx bytes | - -Returns on success: +- Returns on success: ```json { @@ -49,121 +52,23 @@ Returns on success: } ``` -Returns on failure: - -```json -{ - "rest api":"2.0", - "code":500, - "error":"Could not submit the transaction synchronously.", - "result":{} -} -``` - -### /broadcast_tx_async - POST - -url: /broadcast_tx_async - -Functionality: Submit a signed transaction asynchronously. This does not return a response from CheckTx. - -Parameters: - -| Parameter | Type | Default | Required | Description | -| ----------- | ------ | ------- | -------- | --------------- | -| transaction | string | null | true | signed tx bytes | - -Returns on success: - -```json -{ - "rest api":"2.0", - "code":200, - "error":"", - "result": { - "code":0, - "hash":"E39AAB7A537ABAA237831742DCE1117F187C3C52", - "data":"", - "log":"" - } -} -``` - -Returns on failure: - -```json -{ - "rest api":"2.0", - "code":500, - "error":"Could not submit the transaction asynchronously.", - "result":{} -} -``` - -### /broadcast_tx_commit - POST - -url: /broadcast_tx_commit - -Functionality: Submit a signed transaction and waits for it to be committed in a block. - -Parameters: - -| Parameter | Type | Default | Required | Description | -| ----------- | ------ | ------- | -------- | --------------- | -| transaction | string | null | true | signed tx bytes | - -Returns on success: - -```json -{ - "rest api":"2.0", - "code":200, - "error":"", - "result":{ - "height":26682, - "hash":"75CA0F856A4DA078FC4911580360E70CEFB2EBEE", - "deliver_tx":{ - "log":"", - "data":"", - "code":0 - }, - "check_tx":{ - "log":"", - "data":"", - "code":0 - } -} -``` - -Returns on failure: - -```json -{ - "rest api":"2.0", - "code":500, - "error":"Could not commit the transaction.", - "result":{} -} -``` - ## ICS1 - KeyAPI This API exposes all functionality needed for key creation, signing and management. -### /keys - GET +### GET /keys -url: /keys - -Functionality: Gets a list of all the keys. - -Returns on success: +- **URL**: `/keys` +- **Functionality**: Gets a list of all the keys. +- Returns on success: ```json { - "rest api":"2.0", + "rest api":"1.0", "code":200, "error":"", "result":{ - "keys":[ + "account":[ { "name":"monkey", "address":"cosmosaccaddr1fedh326uxqlxs8ph9ej7cf854gz7fd5zlym5pd", @@ -180,73 +85,25 @@ Returns on success: } ``` -Returns on failure: +### POST /keys + +- **URL**: `/keys` +- **Functionality**: Create a new key. +- POST Body: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not retrieve the keys.", - "result":{} + "name": "string", + "password": "string", + "seed": "string", } ``` -### /keys/recover - POST - -url: /keys/recover - -Functionality: Recover your key from seed and persist it encrypted with the password. - -Parameter: - -| Parameter | Type | Default | Required | Description | -| --------- | ------ | ------- | -------- | ---------------- | -| name | string | null | true | name of key | -| password | string | null | true | password of key | -| seed | string | null | true | seed of key | - Returns on success: ```json { - "rest api":"2.0", - "code":200, - "error":"", - "result":{ - "address":"BD607C37147656A507A5A521AA9446EB72B2C907" - } -} -``` - -Returns on failure: - -```json -{ - "rest api":"2.0", - "code":500, - "error":"Could not recover the key.", - "result":{} -} -``` - -### /keys/create - POST - -url: /keys/create - -Functionality: Create a new key. - -Parameter: - -| Parameter | Type | Default | Required | Description | -| --------- | ------ | ------- | -------- | ---------------- | -| name | string | null | true | name of key | -| password | string | null | true | password of key | - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"1.0", "code":200, "error":"", "result":{ @@ -255,28 +112,15 @@ Returns on success: } ``` -Returns on failure: +### GET /keys/{name} + +- **URL** : `/keys/{name}` +- **Functionality**: Get the information for the specified key. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create new key.", - "result":{} -} -``` - -### /keys/{name} - GET - -url: /keys/{name} - -Functionality: Get the information for the specified key. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"1.0", "code":200, "error":"", "result":{ @@ -287,31 +131,20 @@ Returns on success: } ``` -Returns on failure: +### PUT /keys/{name} + +- **URL** : `/keys/{name}` +- **Functionality**: Change the encryption password for the specified key. +- PUT Body: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not find information on the specified key.", - "result":{} + "old_password": "string", + "new_password": "string", } ``` -### /keys/{name} - PUT - -url: /keys/{name} - -Functionality: Change the encryption password for the specified key. - -Parameters: - -| Parameter | Type | Default | Required | Description | -| --------------- | ------ | ------- | -------- | --------------- | -| old_password | string | null | true | old password | -| new_password | string | null | true | new password | - -Returns on success: +- Returns on success: ```json { @@ -322,48 +155,77 @@ Returns on success: } ``` -Returns on failure: +### DELETE /keys/{name} + +- **URL**: `/keys/{name}` +- **Functionality**: Delete the specified key. +- DELETE Body: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not update the specified key.", - "result":{} + "password": "string", } ``` -### /keys/{name} - DELETE - -url: /keys/{name} - -Functionality: Delete the specified key. - -Parameters: - -| Parameter | Type | Default | Required | Description | -| --------- | ------ | ------- | -------- | ---------------- | -| password | string | null | true | password of key | - -Returns on success: +- Returns on success: ```json { - "rest api":"2.0", + "rest api":"1.0", "code":200, "error":"", "result":{} } ``` -Returns on failure: +### POST /keys/{name}/recover + +- **URL**: `/keys/{name}/recover` +- **Functionality**: Recover your key from seed and persist it encrypted with the password. +- POST Body: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not delete the specified key.", - "result":{} + "password": "string", + "seed": "string", +} +``` + +- Returns on success: + +```json +{ + "rest api":"1.0", + "code":200, + "error":"", + "result":{ + "address":"BD607C37147656A507A5A521AA9446EB72B2C907" + } +} +``` + +### GET /auth/accounts/{address} + +- **URL**: `/auth/accounts/{address}` +- **Functionality**: Query the information of an account . +- Returns on success: + +```json +{ + "rest api":"1.0", + "code":200, + "error":"", + "result":{ + "address": "82A57F8575BDFA22F5164C75361A21D2B0E11089", + "public_key": "PubKeyEd25519{A0EEEED3C9CE1A6988DEBFE347635834A1C0EBA0B4BB1125896A7072D22E650D}", + "coins": [ + {"atom": 300}, + {"photon": 15} + ], + "account_number": 1, + "sequence": 7 + } +} } ``` @@ -371,13 +233,11 @@ Returns on failure: The TokenAPI exposes all functionality needed to query account balances and send transactions. -### /bank/balance/{account} - GET +### GET /bank/balance/{account} -url: /bank/balance/{account} - -Functionality: Query the specified account. - -Returns on success: +- **URL**: `/bank/balance/{account}` +- **Functionality**: Query the specified account's balance. +- Returns on success: ```json { @@ -392,34 +252,30 @@ Returns on success: } ``` -Returns on error: +### POST /bank/transfers + +- **URL**: `/bank/transfers` +- **Functionality**: Create a transfer in the bank module. +- POST Body: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not find any balance for the specified account.", - "result":{} + "amount": [ + { + "denom": "string", + "amount": 64, + } + ], + "name": "string", + "password": "string", + "chain_id": "string", + "account_number": 64, + "sequence": 64, + "gas": 64, } ``` -### /bank/create_transfer - POST - -url: /bank/create_transfer - -Functionality: Create a transfer in the bank module. - -Parameters: - -| Parameter | Type | Default | Required | Description | -| ------------ | ------ | ------- | -------- | ------------------------- | -| sender | string | null | true | Address of sender | -| receiver | string | null | true | address of receiver | -| chain_id | string | null | true | chain id | -| amount | int | null | true | amount of the token | -| denomonation | string | null | true | denomonation of the token | - -Returns on success: +- Returns on success: ```json { @@ -432,32 +288,19 @@ Returns on success: } ``` -Returns on failure: - -```json -{ - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} -} -``` - ## ICS21 - StakingAPI The StakingAPI exposes all functionality needed for validation and delegation in Proof-of-Stake. -### /stake/delegators/{delegatorAddr} - GET +### GET /stake/delegators/{delegatorAddr} -url: /stake/delegators/{delegatorAddr} - -Functionality: Get all delegations (delegation, undelegation) from a delegator. - -Returns on success: +- **URL**: `/stake/delegators/{delegatorAddr}` +- **Functionality**: Get all delegations (delegation, undelegation) from a delegator. +- Returns on success: ```json { - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result": { @@ -468,84 +311,45 @@ Returns on success: } ``` -Returns on error: +### GET /stake/delegators/{delegatorAddr}/validators + +- **URL**: `/stake/delegators/{delegatorAddr}/validators` +- **Functionality**: Query all validators that a delegator is bonded to. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not find any balance for the specified account.", - "result":{} -} -``` - -### /stake/delegators/{delegatorAddr}/validators - GET - -url: /stake/delegators/{delegatorAddr}/validators - -Functionality: Query all validators that a delegator is bonded to. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{} } ``` -Returns on failure: +### GET /stake/delegators/{delegatorAddr}/validators/{validatorAddr} + +- **URL**: `/stake/delegators/{delegatorAddr}/validators/{validatorAddr}` +- **Functionality**: Query a validator that a delegator is bonded to +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"TODO", - "result":{} -} -``` - -### /stake/delegators/{delegatorAddr}/validators/{validatorAddr} - GET - -url: /stake/delegators/{delegatorAddr}/validators/{validatorAddr} - -Functionality: Query a validator that a delegator is bonded to - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{} } ``` -Returns on failure: +### GET /stake/delegators/{delegatorAddr}/txs + +- **URL**: `/stake/delegators/{delegatorAddr}/txs` +- **Functionality**: Get all staking txs (i.e msgs) from a delegator. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"TODO", - "result":{} -} -``` - -### /stake/delegators/{delegatorAddr}/txs - GET - -url: /stake/delegators/{delegatorAddr}/txs - -Functionality: Get all staking txs (i.e msgs) from a delegator. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{ @@ -554,28 +358,68 @@ Returns on success: } ``` -Returns on failure: +### POST /stake/delegators/{delegatorAddr}/delegations + +- **URL**: `/stake/delegators/{delegatorAddr}/delegations` +- **Functionality**: Submit or edit a delegation. + +- POST Body: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} + "name": "string", + "password": "string", + "chain_id": "string", + "account_number": 64, + "sequence": 64, + "gas": 64, + "delegations": [ + { + "delegator_addr": "string", + "validator_addr": "string", + "delegation": { + "denom": "string", + "amount": 1234 + } + } + ], + "begin_unbondings": [ + { + "delegator_addr": "string", + "validator_addr": "string", + "shares": "string", + } + ], + "complete_unbondings": [ + { + "delegator_addr": "string", + "validator_addr": "string", + } + ], + "begin_redelegates": [ + { + "delegator_addr": "string", + "validator_src_addr": "string", + "validator_dst_addr": "string", + "shares": "string", + } + ], + "complete_redelegates": [ + { + "delegator_addr": "string", + "validator_src_addr": "string", + "validator_dst_addr": "string", + } + ] } + ``` -### /stake/delegators/{delegatorAddr}/delegations - POST - -url: /stake/delegators/{delegatorAddr}/delegations - -Functionality: Submit a delegation. - -Returns on success: +- Returns on success: ```json { - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{ @@ -584,28 +428,15 @@ Returns on success: } ``` -Returns on failure: +### GET /stake/delegators/{delegatorAddr}/delegations/{validatorAddr} + +- **URL**: `/stake/delegators/{delegatorAddr}/delegations/{validatorAddr}` +- **Functionality**: Query the current delegation status between a delegator and a validator. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} -} -``` - -### /stake/delegators/{delegatorAddr}/delegations/{validatorAddr} - GET - -url: /stake/delegators/{delegatorAddr}/delegations/{validatorAddr} - -Functionality: Query the current delegation status between a delegator and a validator. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{ @@ -614,28 +445,15 @@ Returns on success: } ``` -Returns on failure: +### GET /stake/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr} + +- **URL**: `/stake/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr}` +- **Functionality**: Query all unbonding delegations between a delegator and a validator. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} -} -``` - -### /stake/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr} - GET - -url: /stake/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr} - -Functionality: Query all unbonding delegations between a delegator and a validator. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{ @@ -644,28 +462,15 @@ Returns on success: } ``` -Returns on failure: +### GET /stake/validators + +- **URL**: `/stake/validators` +- **Functionality**: Get all validator candidates. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} -} -``` - -### /stake/validators - GET - -url: /stake/validators - -Functionality: Get all validator candidates. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{ @@ -674,28 +479,15 @@ Returns on success: } ``` -Returns on failure: +### GET /stake/validators/{validatorAddr} + +- **URL**: `/stake/validators/{validatorAddr}` +- **Functionality**: Query the information from a single validator. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} -} -``` - -### /stake/validators/{validatorAddr} - GET - -url: /stake/validators/{validatorAddr} - -Functionality: Query the information from a single validator. - -Returns on success: - -```json -{ - "rest api":"2.0", + "rest api":"2.1", "code":200, "error":"", "result":{ @@ -704,13 +496,359 @@ Returns on success: } ``` -Returns on failure: +### GET /stake/parameters + +- **URL**: `/stake/parameters` +- **Functionality**: Get the current value of staking parameters. +- Returns on success: ```json { - "rest api":"2.0", - "code":500, - "error":"Could not create the transaction.", - "result":{} + "rest api":"2.1", + "code":200, + "error":"", + "result":{ + "inflation_rate_change": 1300000000, + "inflation_max": 2000000000, + "inflation_min": 700000000, + "goal_bonded": 6700000000, + "unbonding_time": "72h0m0s", + "max_validators": 100, + "bond_denom": "atom" + } +} +``` + +### GET /stake/pool + +- **URL**: `/stake/pool` +- **Functionality**: Get the current value of the dynamic parameters of the current state (*i.e* `Pool`). +- Returns on success: + +```json +{ + "rest api":"2.1", + "code":200, + "error":"", + "result":{ + "loose_tokens": 0, + "bonded_tokens": 0, + "inflation_last_time": "1970-01-01 01:00:00 +0100 CET", + "inflation": 700000000, + "date_last_commission_reset": 0, + "prev_bonded_shares": 0, + } +} +``` + +## ICS22 - GovernanceAPI + +The GovernanceAPI exposes all functionality needed for casting votes on plain text, software upgrades and parameter change proposals. + +### GET /gov/proposals + +- **URL**: `/gov/proposals` +- **Functionality**: Query all submited proposals +- Response on Success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "proposals":[ + "TODO" + ] + } +} +``` + +### POST /gov/proposals + +- **URL**: `/gov/proposals` +- **Functionality**: Submit a proposal +- POST Body: + +```js +{ + "base_req": { + // Name of key to use + "name": "string", + // Password for that key + "password": "string", + "chain_id": "string", + "account_number": 64, + "sequence": 64, + "gas": 64 + }, + // Title of the proposal + "title": "string", + // Description of the proposal + "description": "string", + // PlainTextProposal supported now. SoftwareUpgradeProposal and other types may be supported soon + "proposal_type": "string", + // A cosmosaccaddr address + "proposer": "string", + "initial_deposit": [ + { + "denom": "string", + "amount": 64, + } + ] +} +``` + +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "TODO": "TODO", + } +} +``` + +### GET /gov/proposals/{proposal-id} + +- **URL**: `/gov/proposals/{proposal-id}` +- **Functionality**: Query a proposal +- Response on Success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "proposal_id": 1, + "title": "Example title", + "description": "a larger description with the details of the proposal", + "proposal_type": "Text", + "proposal_status": "DepositPeriod", + "tally_result": { + "yes": 0, + "abstain": 0, + "no": 0, + "no_with_veto": 0 + }, + "submit_block": 5238512, + "total_deposit": {"atom": 50}, + "voting_start_block": -1 + } +} +``` + +### POST /gov/proposals/{proposal-id}/deposits + +- **URL**: `/gov/proposals/{proposal-id}/deposits` +- **Functionality**: Submit or rise a deposit to a proposal in order to make it active +- POST Body: + +```json +{ + "base_req": { + "name": "string", + "password": "string", + "chain_id": "string", + "account_number": 0, + "sequence": 0, + "gas": 0 + }, + "depositer": "string", + "amount": 0, +} +``` + +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "TODO": "TODO", + } +} +``` + +### GET /gov/proposals/{proposal-id}/deposits/{address} + +- **URL**: `/gov/proposals/{proposal-id}/deposits/{address}` +- **Functionality**: Query a validator's deposit to submit a proposal +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "amount": {"atom": 150}, + "depositer": "cosmosaccaddr1fedh326uxqlxs8ph9ej7cf854gz7fd5zlym5pd", + "proposal-id": 16 + } +} +``` + +### GET /gov/proposals/{proposal-id}/tally + +- **URL**: `/gov/proposals/{proposal-id}/tally` +- **Functionality**: Get the tally of a given proposal. +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result": { + "yes": 0, + "abstain": 0, + "no": 0, + "no_with_veto": 0 + } +} +``` + + + +### GET /gov/proposals/{proposal-id}/votes + +- **URL**: `/gov/proposals/{proposal-id}/votes` +- **Functionality**: Query all votes from a specific proposal +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result": [ + { + "proposal-id": 1, + "voter": "cosmosaccaddr1fedh326uxqlxs8ph9ej7cf854gz7fd5zlym5pd", + "option": "no_with_veto" + }, + { + "proposal-id": 1, + "voter": "cosmosaccaddr1849m9wncrqp6v4tkss6a3j8uzvuv0cp7f75lrq", + "option": "yes" + }, + ] +} +``` + + + +### POST /gov/proposals/{proposal-id}/votes + +- **URL**: `/gov/proposals/{proposal-id}/votes` +- **Functionality**: Vote for a specific proposal +- POST Body: + +```js +{ + "base_req": { + "name": "string", + "password": "string", + "chain_id": "string", + "account_number": 0, + "sequence": 0, + "gas": 0 + }, + // A cosmosaccaddr address + "voter": "string", + // Value of the vote option `Yes`, `No` `Abstain`, `NoWithVeto` + "option": "string", +} +``` + +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "TODO": "TODO", + } +} +``` + +### GET /gov/proposals/{proposal-id}/votes/{address} + +- **URL** : `/gov/proposals/{proposal-id}/votes/{address}` +- **Functionality**: Get the current `Option` submited by an address +- Returns on success: + +```json +{ + "rest api":"2.2", + "code":200, + "error":"", + "result":{ + "proposal-id": 1, + "voter": "cosmosaccaddr1fedh326uxqlxs8ph9ej7cf854gz7fd5zlym5pd", + "option": "no_with_veto" + } +} +``` + +## ICS23 - SlashingAPI + +The SlashingAPI exposes all functionalities needed to slash (*i.e* penalize) validators and delegators in Proof-of-Stake. The penalization is a fine of the staking coin and jail time, defined by governance parameters. During the jail period, the penalized validator is `Revoked`. + +### GET /slashing/validator/{validatorAddr}/signing-info + +- **URL**: `/slashing/validator/{validatorAddr}/signing-info` +- **Functionality**: Query the information from a single validator. +- Returns on success: + +```json +{ + "rest api":"2.3", + "code":200, + "error":"", + "result":{ + "transaction":"TODO" + } +} +``` + +### POST /slashing/validators/{validatorAddr}/unjail + +- **URL**: `/slashing/validators/{validatorAddr}/unjail` +- **Functionality**: Submit a message to unjail a validator after it has been penalized. +- POST Body: + +```js +{ + // Name of key to use + "name": "string", + // Password for that key + "password": "string", + "chain_id": "string", + "account_number": 64, + "sequence": 64, + "gas": 64, +} +``` + +- Returns on success: + +```json +{ + "rest api":"2.3", + "code":200, + "error":"", + "result":{ + "transaction":"TODO" + } } ```