@arkade-os/sdk Documentation - v0.4.21
    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

    contractRepository: ContractRepository

    Readonly 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

    • 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')
      });