Applesauce
    Preparing search index...

    Interface NutWalletOptions

    Options for constructing a NutWallet

    interface NutWalletOptions {
        autoUnlock?: boolean;
        couch: Couch;
        decryptionCache?: EncryptedContentCache;
        eventStore: EventStore;
        logger?: Debugger;
        pool: RelayPool;
        pubkey: string;
        relays?: string[] | Observable<string[]>;
        signer: ISigner;
        useDeleteEvents?: boolean;
    }
    Index

    Properties

    autoUnlock?: boolean

    Automatically unlock the wallet, tokens and history as they load

    couch: Couch

    A couch used to keep tokens safe during multi-step operations

    decryptionCache?: EncryptedContentCache

    An optional persistent cache of decrypted event content keyed by event id. When provided, the wallet restores encrypted content from the cache before decrypting and persists newly decrypted content back to it, avoiding repeated expensive NIP-44 decryptions across sessions.

    eventStore: EventStore

    The event store that holds all wallet, token and history events

    logger?: Debugger

    A custom debug logger (defaults to the "applesauce:nut-wallet" namespace)

    pool: RelayPool

    The relay pool used for loading, syncing and publishing wallet events

    pubkey: string

    The pubkey of the wallet owner

    relays?: string[] | Observable<string[]>

    Override the relay set used for loading and publishing. When omitted, the relays are derived from the wallet's own relay list plus the user's outbox relays.

    signer: ISigner

    A signer used to sign events and decrypt the wallet (must support NIP-44 to unlock)

    useDeleteEvents?: boolean

    Whether to load, subscribe to and publish NIP-09 delete events for the wallet's events (default false). When false the wallet completely ignores kind-5 delete events: the loader never fetches or subscribes to them (so the event store never applies a delete to a wallet, token or history event), and spend/rollover/consolidate operations rely on each new token event's del field to reconcile the balance instead of publishing a delete. NutWallet.cleanupDeletedTokens still publishes a delete event when called explicitly. The publishing half can be toggled at runtime with NutWallet.setUseDeleteEvents; the loading half is fixed when the wallet starts and only changes on the next NutWallet.resync.