Skip to main content

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

NameType
addressstring
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

NameType
idnumber

Returns

Promise<QueryCodeResponse>


codes

codes(paginationKey?): Promise<QueryCodesResponse>

Parameters

NameType
paginationKey?Uint8Array

Returns

Promise<QueryCodesResponse>


contractHistory

contractHistory(address, paginationKey?): Promise<QueryContractHistoryResponse>

Returns null when contract history was not found for this address.

Parameters

NameType
addressstring
paginationKey?Uint8Array

Returns

Promise<QueryContractHistoryResponse>


contractInfo

contractInfo(address): Promise<QueryContractInfoResponse>

Returns null when contract was not found at this address.

Parameters

NameType
addressstring

Returns

Promise<QueryContractInfoResponse>


contractsByCode

contractsByCode(id, paginationKey?): Promise<QueryContractsByCodeResponse>

Parameters

NameType
idnumber
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

NameType
addressstring
keyUint8Array

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

NameType
Rextends unknown
Qextends unknown = any

Parameters

NameType
addressstring
queryQ

Returns

Promise<R>