Client: interface to the API of a particular contract instance. Has an address on a specific chain, usually also an agent. Subclass this to add the contract's methods.

Hierarchy

Constructors

Properties

address?: string

Address of the contract on the chain.

agent?: Agent

Agent that will interact with the contract.

codeHash?: string

Code hash confirming the contract's integrity.

codeId?: string

Code ID for the contract's code.

fee?: IFee

Default fee for all contract transactions.

fees: Record<string, IFee> = {}

Default fee for specific transactions.

log: Console = ...
meta: Contract<any>

Contract metadata.

Accessors

Methods

  • Execute a transaction on the specified contract as the specified Agent.

    Parameters

    Returns Promise<unknown>

  • Fetch code hash from address.

    Parameters

    • expected: undefined | string = ...

    Returns Promise<Client>

    Promise

  • Get the recommended fee for a specific transaction.

    Parameters

    • Optional msg: string | Record<string, unknown>

    Returns undefined | IFee

  • Execute a query on the specified contract as the specified Agent.

    Type Parameters

    • U

    Parameters

    Returns Promise<U>

  • Throw if fetched metadata differs from configured.

    Parameters

    • kind: string
    • expected: any
    • actual: any

    Returns void

Generated using TypeDoc