A representation of a ContractInvocation, which calls a smart contract method onchain. The fee is assumed to be paid in the native Asset of the Network.

Properties

Methods

  • Returns the ABI of the ContractInvocation, if specified.

    Returns undefined | object

    The ABI as an object, or undefined if not available.

  • Returns the amount of the native asset sent to a payable contract method, if applicable.

    Returns Decimal

    The amount in atomic units of the native asset.

  • Returns the Arguments of the ContractInvocation.

    Returns object

    The arguments object passed to the contract invocation. The key is the argument name and the value is the argument value.

  • Returns the Transaction of the ContractInvocation.

    Returns Transaction

    The ethers.js Transaction object.

    Throws

    (InvalidUnsignedPayload) If the Unsigned Payload is invalid.

  • Returns the Transaction Hash of the ContractInvocation.

    Returns undefined | string

    The Transaction Hash as a Hex string, or undefined if not yet available.

  • Returns the link to the Transaction on the blockchain explorer.

    Returns string

    The link to the Transaction on the blockchain explorer.

  • Reloads the ContractInvocation model with the latest data from the server.

    Returns Promise<void>

    Throws

    if the API request to get a ContractInvocation fails.

  • Signs the ContractInvocation with the provided key and returns the hex signature required for broadcasting the ContractInvocation.

    Parameters

    • key: Wallet

      The key to sign the ContractInvocation with

    Returns Promise<string>

    The hex-encoded signed payload

  • Waits for the ContractInvocation to be confirmed on the Network or fail on chain. Waits until the ContractInvocation is completed or failed on-chain by polling at the given interval. Raises an error if the ContractInvocation takes longer than the given timeout.

    Parameters

    • options: {
          intervalSeconds: undefined | number;
          timeoutSeconds: undefined | number;
      } = {}

      The options to configure the wait function.

      • intervalSeconds: undefined | number

        The interval to check the status of the ContractInvocation.

      • timeoutSeconds: undefined | number

        The maximum time to wait for the ContractInvocation to be confirmed.

    Returns Promise<ContractInvocation>

    The ContractInvocation object in a terminal state.

    Throws

    if the ContractInvocation times out.