@arkade-os/sdk Documentation - v0.5.0-rc.11
    Preparing search index...

    Interface IWallet

    Core 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.

    IReadonlyWallet

    interface IWallet {
        activity: ActivityRegistry;
        assetManager: IAssetManager;
        identity: Identity;
        clear(): Promise<void>;
        getActivityHistory(): Promise<Activity[]>;
        getAddress(): Promise<string>;
        getArkadeBroadcaster(): Promise<ArkadeBroadcaster>;
        getArkadeInfo(opts?: GetArkadeInfoOptions): Promise<ArkadeInfo>;
        getArkadeReader(): Promise<ArkadeReader>;
        getBalance(): Promise<WalletBalance>;
        getBoardingAddress(): Promise<string>;
        getBoardingUtxos(): Promise<ExtendedCoin[]>;
        getContractManager(): Promise<IContractManager>;
        getDelegateManager(): Promise<IDelegateManager | undefined>;
        getSpendableVtxos(
            filter?: GetVtxosFilter,
        ): Promise<NormalizedExtendedVirtualCoin[]>;
        getTransactionHistory(): Promise<ArkTransaction[]>;
        getVtxos(filter?: GetVtxosFilter): Promise<NormalizedExtendedVirtualCoin[]>;
        send(...args: [SendParams] | [Recipient, ...Recipient[]]): Promise<string>;
        settle(
            params?: SettleParams,
            eventCallback?: (event: SettlementEvent) => void,
        ): Promise<string>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    Resolvers that group/label getActivityHistory rows.

    assetManager: IAssetManager

    Asset manager bound to this wallet instance.

    identity: Identity

    Signing identity associated with the wallet.

    A real signer, not a ReadonlyIdentity that structurally fits: contract corridors need all four members — sign, signMessage, signerSession and xOnlyPublicKey — and signerSession is the one a watch-only identity lacks. isSigningIdentity is the check; a wallet that fails it is refused as WalletCannotSignError before anything is funded, rather than at the push that discovers there is no signer.

    Methods

    • Server info for the Arkade server this wallet is connected to — network, signer key, delays, dust, fees and limits.

      The wallet is the single place that knows which server it speaks to, so a plugin needs only the wallet, never a server URL of its own. Live info wins; when the server is unreachable this falls back to the snapshot persisted at construction, so an offline wallet still answers.

      With requireLive, that fallback is off: the read throws when the operator is unreachable instead of answering from cache. For callers about to bind signerPubkey or a delay into a covenant — a stale snapshot there derives an address the operator may no longer co-sign for, so failing closed is the correct shape.

      Parameters

      Returns Promise<ArkadeInfo>

      The Arkade server's info

      ArkadeInfo

    • Send bitcoin and/or assets to one or more Arkade recipients, passed either as variadic Recipients or as a single SendParams object — the latter also carries the inputs to spend.

      Parameters

      Returns Promise<string>

      Arkade transaction id

      SendParams

      await wallet.send({ address: 'ark1q...', amount: 1000 })

      // choosing the inputs as well as the outputs
      await wallet.send({
      recipients: [{ address: 'ark1q...', amount: 1000 }],
      selectedVtxos: mine,
      })
    • Settle boarding inputs and/or preconfirmed virtual outputs into settled virtual outputs.

      Parameters

      • Optionalparams: SettleParams

        Optional explicit settlement inputs and outputs

      • OptionaleventCallback: (event: SettlementEvent) => void

        Optional callback that receives settlement events

      Returns Promise<string>

      Arkade transaction id

      SettleParams