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

    Class Wallet

    Main wallet implementation for Bitcoin transactions with Ark protocol support. The wallet does not store any data locally and relies on Ark and onchain providers to fetch UTXOs and VTXOs.

    // Create a wallet with URL configuration
    const wallet = await Wallet.create({
    identity: SingleKey.fromHex('your_private_key'),
    arkServerUrl: 'https://ark.example.com',
    esploraUrl: 'https://mempool.space/api'
    });

    // Or with custom provider instances (e.g., for Expo/React Native)
    const wallet = await Wallet.create({
    identity: SingleKey.fromHex('your_private_key'),
    arkProvider: new ExpoArkProvider('https://ark.example.com'),
    indexerProvider: new ExpoIndexerProvider('https://ark.example.com'),
    esploraUrl: 'https://mempool.space/api'
    });

    // Get addresses
    const arkAddress = await wallet.getAddress();
    const boardingAddress = await wallet.getBoardingAddress();

    // Send bitcoin
    const txid = await wallet.sendBitcoin({
    address: 'tb1...',
    amount: 50000
    });

    Hierarchy (View Summary)

    Implements

    Index

    Properties

    arkProvider: ArkProvider
    arkServerPublicKey: Bytes
    boardingTapscript: DefaultVtxo.Script
    contractRepository: ContractRepository
    dustAmount: bigint
    forfeitOutputScript: Bytes
    forfeitPubkey: Bytes
    identity: Identity
    indexerProvider: IndexerProvider
    network: Network
    networkName: NetworkName
    offchainTapscript: DefaultVtxo.Script
    onchainProvider: OnchainProvider
    renewalConfig: Required<Omit<RenewalConfig | undefined, "enabled">> & {
        enabled: boolean;
        thresholdMs: number;
    }
    serverUnrollScript: CSVMultisigTapscript.Type
    walletRepository: WalletRepository
    MIN_FEE_RATE: number = 1

    Accessors

    Methods

    • Finalizes pending transactions by retrieving them from the server and finalizing each one.

      Parameters

      • Optionalvtxos: ExtendedVirtualCoin[]

        Optional list of VTXOs to use instead of retrieving them from the server

      Returns Promise<{ finalized: string[]; pending: string[] }>

      Array of transaction IDs that were finalized

    • Convert this wallet to a readonly wallet.

      Returns Promise<ReadonlyWallet>

      A readonly wallet with the same configuration but readonly identity

      const wallet = await Wallet.create({ identity: SingleKey.fromHex('...'), ... });
      const readonlyWallet = await wallet.toReadonly();

      // Can query balance and addresses
      const balance = await readonlyWallet.getBalance();
      const address = await readonlyWallet.getAddress();

      // But cannot send transactions (type error)
      // readonlyWallet.sendBitcoin(...); // TypeScript error