Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/capi/mod.ts>known.ContractResult

[WIP] A framework for crafting interactions with Substrate chains
Latest
interface known.ContractResult
import { type known } from "https://deno.land/x/capi@v0.1.1-beta.1/mod.ts";
const { ContractResult } = known;

Result type of a bare_call or bare_instantiate call.

It contains the execution result together with some auxiliary information.

Properties

gasConsumed: number

How much gas was consumed during execution.

gasRequired: number

How much gas is required as gas limit in order to execute this call.

This value should be used to determine the gas limit for on-chain execution.

Note

This can only different from [Self::gas_consumed] when weight pre charging is used. Currently, only seal_call_runtime makes use of pre charging. Additionally, any seal_call or seal_instantiate makes use of pre-charging when a non-zero gas_limit argument is supplied.

storageDeposit: StorageDeposit

How much balance was deposited and reserved during execution in order to pay for storage.

The storage deposit is never actually charged from the caller in case of [Self::result] is Err. This is because on error all storage changes are rolled back.

debugMessage: string

An optional debug message. This message is only filled when explicitly requested by the code that calls into the contract. Otherwise it is empty.

The contained bytes are valid UTF-8. This is not declared as String because this type is not allowed within the runtime.

Clients should not make any assumptions about the format of the buffer. They should just display it as-is. It is not only a collection of log lines provided by a contract but a formatted buffer with different sections.

Note

The debug message is never generated during on-chain execution. It is reserved for RPC calls.

result: R

The execution result of the wasm code.