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

    Class ServiceWorkerReadonlyWallet

    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

    activity: ActivityRegistry = ...

    Resolvers that group/label getActivityHistory rows.

    contractRepository: ContractRepository

    Readonly identity associated with the wallet.

    serviceWorker: ServiceWorker
    walletRepository: WalletRepository

    Accessors

    Methods

    • Wallet-level provider-connection freshness, delegated to the worker via GET_STATUS. Async by necessity (the worker boundary is asynchronous); no synchronous variant is offered because it would have the same transport mismatch as the contract-manager proxy's cached getSyncState().

      Returns Promise<ProviderConnectionState>

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

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

      Current service-worker wallet status payload including walletInitalized and xOnlyPublicKey

    • Get virtual outputs tracked by the wallet.

      Parameters

      Returns Promise<NormalizedExtendedVirtualCoin[]>

      virtual outputs with tapscript and witness data, normalized: every canonical fact the capability predicates read is populated, whatever the underlying repository stored

      GetVtxosFilter

    • Trigger a wallet reload inside the service worker.

      Returns Promise<boolean>

      true when the wallet was reloaded

    • Create a readonly service-worker wallet bound to an already-registered worker.

      Parameters

      • options: ServiceWorkerWalletCreateOptions

        Service worker, identity, and backend configuration

      Returns Promise<ServiceWorkerReadonlyWallet>

      Initialized readonly service-worker wallet

      Error if service-worker initialization fails

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

      Parameters

      • options: ServiceWorkerWalletSetupOptions

      Returns Promise<ServiceWorkerReadonlyWallet>

      ServiceWorkerReadonlyWallet.create

      const wallet = await ServiceWorkerReadonlyWallet.setup({
      serviceWorkerPath: '/service-worker.js',
      arkServerUrl: 'https://arkade.computer',
      identity: ReadonlySingleKey.fromPublicKey('your_public_key_hex')
      });