Cosmwasm

Codes gets the metadata for all stored wasm codes

get
Query parameters
pagination.keyanyOptional

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offsetanyOptional

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limitanyOptional

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_totalanyOptional

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverseanyOptional

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/code HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "code_infos": [
    {
      "code_id": "text",
      "creator": "text",
      "data_hash": "Ynl0ZXM=",
      "instantiate_permission": {
        "permission": "ACCESS_TYPE_UNSPECIFIED",
        "addresses": [
          "text"
        ]
      }
    }
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

Code gets the binary code and metadata for a singe wasm code

get
Path parameters
code_idanyRequired
Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/code/{code_id} HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "code_info": {
    "code_id": "text",
    "creator": "text",
    "data_hash": "Ynl0ZXM=",
    "instantiate_permission": {
      "permission": "ACCESS_TYPE_UNSPECIFIED",
      "addresses": [
        "text"
      ]
    }
  },
  "data": "Ynl0ZXM="
}

ContractsByCode lists all smart contracts for a code id

get
Path parameters
code_idanyRequired
Query parameters
pagination.keyanyOptional

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offsetanyOptional

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limitanyOptional

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_totalanyOptional

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverseanyOptional

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/code/{code_id}/contracts HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "contracts": [
    "text"
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

Params gets the module params

get
Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/codes/params HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "params": {
    "code_upload_access": {
      "permission": "ACCESS_TYPE_UNSPECIFIED",
      "addresses": [
        "text"
      ]
    },
    "instantiate_default_permission": "ACCESS_TYPE_UNSPECIFIED"
  }
}

PinnedCodes gets the pinned code ids

get
Query parameters
pagination.keyanyOptional

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offsetanyOptional

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limitanyOptional

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_totalanyOptional

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverseanyOptional

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/codes/pinned HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "code_ids": [
    "text"
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

BuildAddress builds a contract address

get
Query parameters
code_hashanyOptional

CodeHash is the hash of the code.

creator_addressanyOptional

CreatorAddress is the address of the contract instantiator.

saltanyOptional

Salt is a hex encoded salt.

init_argsanyOptional

InitArgs are optional json encoded init args to be used in contract address building if provided.

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contract/build_address HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "address": "text"
}

ContractInfo gets the contract meta data

get
Path parameters
addressanyRequired

address is the address of the contract to query

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contract/{address} HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "address": "text",
  "contract_info": {
    "code_id": "text",
    "creator": "text",
    "admin": "text",
    "label": "text",
    "created": {
      "block_height": "text",
      "tx_index": "text"
    },
    "ibc_port_id": "text",
    "extension": {
      "type_url": "text",
      "value": "Ynl0ZXM="
    }
  }
}

ContractHistory gets the contract code history

get
Path parameters
addressanyRequired

address is the address of the contract to query

Query parameters
pagination.keyanyOptional

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offsetanyOptional

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limitanyOptional

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_totalanyOptional

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverseanyOptional

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contract/{address}/history HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "entries": [
    {
      "operation": "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED",
      "code_id": "text",
      "updated": {
        "block_height": "text",
        "tx_index": "text"
      },
      "msg": "Ynl0ZXM="
    }
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

RawContractState gets single key from the raw store data of a contract

get
Path parameters
addressanyRequired

address is the address of the contract

query_dataanyRequired
Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contract/{address}/raw/{query_data} HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "data": "Ynl0ZXM="
}

SmartContractState get smart query result from the contract

get
Path parameters
addressanyRequired

address is the address of the contract

query_dataanyRequired

QueryData contains the query data passed to the contract

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contract/{address}/smart/{query_data} HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "data": "Ynl0ZXM="
}

AllContractState gets all raw store data for a single contract

get
Path parameters
addressanyRequired

address is the address of the contract

Query parameters
pagination.keyanyOptional

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offsetanyOptional

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limitanyOptional

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_totalanyOptional

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverseanyOptional

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contract/{address}/state HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "models": [
    {
      "key": "Ynl0ZXM=",
      "value": "Ynl0ZXM="
    }
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

ContractsByCreator gets the contracts by creator

get
Path parameters
creator_addressanyRequired

CreatorAddress is the address of contract creator

Query parameters
pagination.keyanyOptional

key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set.

pagination.offsetanyOptional

offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.

pagination.limitanyOptional

limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.

pagination.count_totalanyOptional

count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set.

pagination.reverseanyOptional

reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43

Responses
200
A successful response.
application/json
get
GET /cosmwasm/wasm/v1/contracts/creator/{creator_address} HTTP/1.1
Host: lcd.uno.sentry.testnet.v3.kiivalidator.com
Accept: */*
{
  "contract_addresses": [
    "text"
  ],
  "pagination": {
    "next_key": "Ynl0ZXM=",
    "total": "text"
  }
}

Last updated

Was this helpful?