Wallet class is the main coordinator that manages integrated wallet operations.

The Wallet class encapsulates UtxoProcessor and provides internal account management using UtxoContext instances. It acts as a bridge between the integrated Wallet subsystem providing a high-level interface for wallet key and account management.

The Rusty Kaspa is developed in Rust, and the Wallet class is a Rust implementation exposed to the JavaScript/TypeScript environment using the WebAssembly (WASM32) interface. As such, the Wallet implementation can be powered up using native Rust or built as a WebAssembly module and used in the browser or Node.js environment.

When using Rust native or NodeJS environment, all wallet data is stored on the local filesystem. When using WASM32 build in the web browser, the wallet data is stored in the browser's localStorage and transaction records are stored in the IndexedDB.

The Wallet API can create multiple wallet instances, however, only one wallet instance can be active at a time.

The wallet implementation is designed to be efficient and support a large number of accounts. Accounts reside in storage and can be loaded and activated as needed. A loaded account contains all account information loaded from the permanent storage whereas an active account monitors the UTXO set and provides notifications for incoming and outgoing transactions as well as balance updates.

The Wallet API communicates with the client using resource identifiers. These include account IDs, private key IDs, transaction IDs, etc. It is the responsibility of the client to track these resource identifiers at runtime.

Constructors

Properties

descriptor: WalletDescriptor
isOpen: boolean

Remarks

This is a local property indicating if the wallet is currently open.

isSynced: boolean

Remarks

This is a local property indicating if the node is currently synced.

Methods

  • Parameters

    Returns void

  • Type Parameters

    Parameters

    • event: M
    • Optional callback: ((eventData) => void)

    Returns any

  • Parameters

    Returns Promise<void>

  • Returns Promise<void>

  • Check if a wallet with a given name exists.

    Parameters

    • Optional name: string

    Returns Promise<boolean>

  • Returns void

  • Returns Promise<void>

  • Returns Promise<void>

    • Return copy of self without private attributes.

    Returns Object

  • Return stringified version of self.

    Returns string

Generated using TypeDoc