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

    Class ServiceWorkerWallet

    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

    Hierarchy (View Summary)

    Implements

    Index

    Properties

    contractRepository: ContractRepository
    identity: Identity

    Signing identity associated with the wallet.

    serviceWorker: ServiceWorker
    walletRepository: WalletRepository

    Accessors

    Methods

    • Return service-worker wallet status, including connectivity and sync state.

      Returns Promise<
          {
              walletInitialized: boolean;
              xOnlyPublicKey: Uint8Array<ArrayBufferLike>
              | undefined;
          },
      >

      Current service-worker wallet status payload including walletInitalized and xOnlyPublicKey

    • Explicitly recover this wallet's contracts and balance on a fresh repo. Mirrors Wallet.restore but drives the scan inside the service worker — the materialize() callback used by scanContracts cannot cross the postMessage boundary, so the entire flow runs worker-side and only the gapLimit / outcome cross the wire.

      Uses the streaming send path so the bus deadline does not race a long indexer-bound scan. AggregateError thrown by the worker is reconstructed here so callers can inspect .errors.

      Parameters

      • Optionalopts: { gapLimit?: number }

      Returns Promise<void>

    • Simplified setup method that handles service worker registration and wallet initialization automatically.

      Parameters

      • options: ServiceWorkerWalletSetupOptions

      Returns Promise<ServiceWorkerWallet>

      const wallet = await ServiceWorkerWallet.setup({
      serviceWorkerPath: '/service-worker.js',
      arkServerUrl: 'https://arkade.computer',
      identity: MnemonicIdentity.fromMnemonic('abandon abandon...')
      });