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

    Class ReadonlyWallet

    Readonly wallet interface for Bitcoin transactions with Arkade protocol support.

    This interface defines the contract that all wallet implementations must follow. It provides methods for address management, balance checking, virtual output operations, and transaction management including sending, settling, and unrolling.

    IWallet

    Hierarchy (View Summary)

    Implements

    Index

    Properties

    arkServerPublicKey: Bytes
    boardingTapscript: DefaultVtxo.Script
    contractRepository: ContractRepository
    delegatorProvider?: DelegatorProvider
    dustAmount: bigint

    Readonly identity associated with the wallet.

    indexerProvider: IndexerProvider
    network: Network
    offchainTapscript: DefaultVtxo.Script | DelegateVtxo.Script
    onchainProvider: OnchainProvider
    walletContractTimelocks: RelativeTimelock[]
    walletRepository: WalletRepository

    Accessors

    • get defaultContractScript(): string

      Get the pkScript hex for the wallet's primary offchain address. For the full wallet-owned script set registered in ContractManager, use getWalletScripts().

      Returns string

    Methods

    • Async-dispose hook that forwards to dispose().

      Returns Promise<void>

    • Clear the global VTXO sync cursor, forcing a full re-bootstrap on next sync. Useful for recovery after indexer reprocessing or debugging.

      Returns Promise<void>

    • Dispose wallet-owned managers and release background resources.

      Returns Promise<void>

    • Fetch Arkade transaction ids that are still pending final settlement.

      Returns Promise<string[]>

    • Build a transaction history view for the wallet's boarding address.

      Returns Promise<{ boardingTxs: ArkTransaction[]; commitmentsToIgnore: Set<string> }>

    • Get the ContractManager for managing contracts including the wallet's default address.

      The ContractManager handles:

      • The wallet's default receiving address (as a "default" contract)
      • External contracts (Boltz swaps, HTLCs, etc.)
      • Multi-contract watching with resilient connections

      Returns Promise<ContractManager>

      const manager = await wallet.getContractManager();

      // Create a contract for a Boltz swap
      const contract = await manager.createContract({
      label: "Boltz Swap",
      type: "vhtlc",
      params: { ... },
      script: swapScript,
      address: swapAddress,
      });

      // Start watching for events (includes wallet's default address)
      const stop = await manager.onContractEvent((event) => {
      console.log(`${event.type} on ${event.contractScript}`);
      });
    • Get all pkScript hex strings for the wallet's own addresses (both delegate and non-delegate, current and historical).

      Returns Promise<string[]>

    • Subscribe to onchain and offchain notifications for newly received funds.

      Parameters

      • eventCallback: (coins: IncomingFunds) => void

        Callback invoked when matching funds are detected

      Returns Promise<() => void>

      A function that stops the subscriptions