@arkade-os/sdk Documentation - v0.4.54
    Preparing search index...

    Class ArkadeContract<P>

    A resolved, instantiated Arkade contract.

    Type Parameters

    Index

    Constructors

    Properties

    args: Record<string, ArkadeParamValue> = {}
    client: Arkade

    The signer keys the program was compiled against.

    program: P
    tapTree: Uint8Array

    Encoded taproot tree (shared spend context for every path).

    The compiled taproot tree of spending-path leaves.

    Accessors

    Methods

    • Total spendable balance (requires an indexer).

      Returns Promise<bigint>

    • Spendable VTXOs locked by this contract.

      When a contractManager is configured and this contract is registered, reads the repository-backed state (offline-first, kept fresh by the contract watcher). Otherwise falls back to a direct indexer query.

      Returns Promise<VirtualCoin[]>

    • Persist this contract through the wallet's IContractManager so it is tracked like any other contract type: stored in the contract repository, watched for VTXO events, counted in repository-backed balances, and re-derivable offline via the "arkade" contract handler. Idempotent — re-registering the same script is a no-op.

      Parameters

      • Optionaloptions: { label?: string; metadata?: Record<string, unknown> }

      Returns Promise<Contract>

    • The createContract payload for this contract — the serialized program, args and keys plus the derived script/address. Useful when registering through a manager the client does not hold.

      Returns {
          address: string;
          params: Record<string, string>;
          script: string;
          type: string;
      }