Interface: WasmQueryExtensionMethods
@shareledgerjs/client.wasm.WasmQueryExtensionMethods
Methods
allContractState
▸ allContractState(address, paginationKey?): Promise<QueryAllContractStateResponse>
Returns all contract state. This is an empty array if no such contract, or contract has no data.
Parameters
| Name | Type |
|---|---|
address | string |
paginationKey? | Uint8Array |
Returns
Promise<QueryAllContractStateResponse>
code
▸ code(id): Promise<QueryCodeResponse>
Downloads the original wasm bytecode by code ID.
Throws an error if no code with this id
Parameters
| Name | Type |
|---|---|
id | number |
Returns
Promise<QueryCodeResponse>
codes
▸ codes(paginationKey?): Promise<QueryCodesResponse>
Parameters
| Name | Type |
|---|---|
paginationKey? | Uint8Array |
Returns
Promise<QueryCodesResponse>
contractHistory
▸ contractHistory(address, paginationKey?): Promise<QueryContractHistoryResponse>
Returns null when contract history was not found for this address.
Parameters
| Name | Type |
|---|---|
address | string |
paginationKey? | Uint8Array |
Returns
Promise<QueryContractHistoryResponse>
contractInfo
▸ contractInfo(address): Promise<QueryContractInfoResponse>
Returns null when contract was not found at this address.
Parameters
| Name | Type |
|---|---|
address | string |
Returns
Promise<QueryContractInfoResponse>
contractsByCode
▸ contractsByCode(id, paginationKey?): Promise<QueryContractsByCodeResponse>
Parameters
| Name | Type |
|---|---|
id | number |
paginationKey? | Uint8Array |
Returns
Promise<QueryContractsByCodeResponse>
rawContractState
▸ rawContractState(address, key): Promise<QueryRawContractStateResponse>
Returns the data at the key if present (unknown decoded json), or null if no data at this (contract address, key) pair
Parameters
| Name | Type |
|---|---|
address | string |
key | Uint8Array |
Returns
Promise<QueryRawContractStateResponse>
smartContractState
▸ smartContractState<R, Q>(address, query): Promise<R>
Makes a smart query on the contract and parses the response as JSON. Throws error if no such contract exists, the query format is invalid or the response is invalid.
Type parameters
| Name | Type |
|---|---|
R | extends unknown |
Q | extends unknown = any |
Parameters
| Name | Type |
|---|---|
address | string |
query | Q |
Returns
Promise<R>