The Wasm module manages contract state and info.

Example

To use Wasm methods, initialise a ChainGrpcWasmApi object to with a gRPC endpoint. An endpoint can be retrieved by using networkEndpoints.

const endpoint =  getEndpointsForNetwork(Network.Devnet).grpcEndpoint;
const client = new ChainGrpcWasmApi(endpoint);
const response = await client.fetchContractInfo(<contract-address>);

Hierarchy

  • default
    • ChainGrpcWasmApi

Methods

  • Get balance of a contract.

    Returns

    balance.

    Parameters

    • contractAddress: {
          contractAddress: string;
          pagination?: PaginationOption;
      }

      contract address.

      • contractAddress: string
      • Optional pagination?: PaginationOption

    Returns Promise<ContractAccountsBalanceWithPagination>

  • Get contract's history.

    Returns

    contract history.

    Parameters

    • contractAddress: string

      contract address.

    Returns Promise<{
        entriesList: ContractCodeHistoryEntry[];
        pagination: AsObject;
    }>

  • Get contract info.

    Returns

    contract info.

    Parameters

    • contractAddress: string

      contract address.

    Returns Promise<undefined | ContractInfo>

  • Returns

    raw contract state data.

    Parameters

    • contractAddress: string

      contract address.

    • Optional query: string | Uint8Array

    Returns Promise<AsObject>

  • Get contract's state of the query made.

    Returns

    smart contract state data.

    Parameters

    • contractAddress: string

      contract address.

    • Optional query: string | Uint8Array

    Returns Promise<{
        data: Record<string, any>;
    }>

Generated using TypeDoc