Class ContractDryRun<E>

Defines methods for performing dry-run invocations of updates on a Contract with entrypoints E

Type Parameters

  • E extends string = string

    union of entrypoints

Hierarchy

  • ContractDryRun

Constructors

Properties

contractAddress: ContractAddress
contractName: ContractName

Methods

  • Performs a dry-run of a contract entrypoint invocation. Useful for getting an indication of the result of an invocation of the entrypoint (e.g. getting a cost estimate).

    Returns

    the contract invocation result, which includes whether or not the invocation succeeded along with the energy spent.

    Type Parameters

    • T

      The type of the input given

    Parameters

    • entrypoint: EntrypointName.Type<E>

      The name of the receive function to invoke.

    • metaOrInvoker: AccountAddress | ContractAddress | ContractInvokeMetadata

      Metadata for contract invocation of the address of the invoker.

    • serializer: ((input: T) => ArrayBuffer)

      A function for serializing the input to bytes.

        • (input: T): ArrayBuffer
        • Parameters

          • input: T

          Returns ArrayBuffer

    • input: T

      Input for for contract function.

    • Optional blockHash: BlockHash

      The hash of the block to perform the invocation of. Defaults to the latest finalized block on chain.

    Returns Promise<InvokeContractResult>

Generated using TypeDoc