StaticcreateCreate a RailgunClient.
Optional RailgunClientOptions. Injected DBs are not
owned by the client and won't be closed by close(). When omitted, DBs
are created under dataDir (default: ./.railgun).
Ready-to-use client with its wallet DB opened and migrated.
Eagerly initialize the cryptography libraries this client depends on.
A promise that resolves once the cryptography libraries are ready.
Create and persist an encrypted wallet. Delegates to WalletService.
Mnemonic + encryption key + optional index/name.
Decrypt-free WalletInfo.
Load a wallet by ID. Delegates to WalletService.
Wallet to load.
32-byte key used at creation time.
Full WalletContext (minus spending key).
List all stored wallets (decrypt-free). Delegates to WalletService.
Array of WalletInfo sorted by createdAt ASC.
Delete a wallet by ID. Idempotent. Delegates to WalletService.
Wallet to remove.
Resolves when the delete completes.
Read ERC-20 balances for a wallet on a given chain from live unspent notes.
Wallet ID returned from createWallet/listWallets.
Network whose deployment to scope the lookup to.
Optionalmode: BalanceMode
Balance mode: default spendable, all unspent, or one bucket.
Token balances grouped by token.
Read unspent ERC-20 balances grouped by legacy flat balance bucket.
Wallet ID returned from createWallet/listWallets.
Network whose deployment to scope the lookup to.
Token balances keyed by WalletBalanceBucket.
Read unspent private ERC-721 holdings for a wallet on a given chain.
Wallet ID returned from createWallet/listWallets.
Network whose deployment to scope the lookup to.
ERC-721 contract addresses and token sub-IDs.
Read decrypted notes with protocol and optional POI spend state.
Wallet ID returned from createWallet/listWallets.
Network whose deployment to scope the lookup to.
Optionaloptions: { unspent?: boolean }
Optional note filtering.
Optionalunspent?: booleanWhen true, only return unspent notes.
Decrypted notes from wallet.db.notes.
Record a confirmed shield in wallet-scoped transaction history.
Wallet that received the shield.
Network on which the shield confirmed.
Confirmed shield receipt returned by shield().
Timestamp of the confirmed shield block.
Resolves once the history row is stored.
Read stored transaction history for one wallet and chain, newest first.
Wallet whose history should be returned.
Network whose deployment to scope the history query to.
Optionallimit: number
Optional maximum number of rows to return.
Stored wallet transaction history.
Read the persisted chain-ingestion cursor without accessing the engine.
Network whose persisted cursor should be returned.
Explicit synced or never-synced state.
Subscribe to a Railgun event.
Event name from RailgunEventMap.
Synchronous handler. Throws are caught and re-emitted as 'error'; the originating method is unaffected.
Optionalfilter: EventFilter
Optional { walletId?, network? }. Handler fires only
when every provided field matches the event payload.
Idempotent unsubscribe function.
Remove every subscriber, or every subscriber for one event. Called automatically by close().
Optionalevent: keyof RailgunEventMap
Optional event name to scope the clear.
Refresh persisted PPOI for received notes, sent outputs, and wallet unshields.
Wallet ID returned from createWallet / listWallets.
Network to scope the refresh to.
Counters for received notes and outputs checked, updated, skipped, and failed.
Prove a confirmed RAILGUN transaction and submit the POI proof to each
list provider. Run sync() first: it stores the transaction and decrypts
its sent commitments. scan() does not decrypt. Sending the transaction
and submitting its POI are separate steps, so a failed submit can be
retried alone.
Wallet, transaction, list keys, and POI prover.
Network the transaction ran on.
Resolves when every list provider has accepted its proof.
Drain the data source into chain.db for network. Returns when
the source reaches its current tip (or endBlock, when set).
Calls for the same chain in this client run in order, including calls
from sync(). Different chains can scan at the same time. A failed scan
rejects its caller and does not block the next scan.
Direct RailgunEngine.scan() calls do not use this client's queue.
Sync target plus optional bounds.
Last block number written to chain.db, or undefined when the
source had nothing to yield.
Decrypt the wallet's notes from chain.db into wallet.db. Pure consumer
of chain state — call scan() first to populate chain.db.
Wallet ID returned from createWallet/listWallets.
Same 32-byte key used at wallet creation time.
Decryption target plus optional bounds.
Summary of blocks scanned and notes added/spent.
Convenience composer: drain chain state into chain.db (scan) then
decrypt the wallet's notes from chain.db into wallet.db (decrypt).
Wallet ID to decrypt for.
32-byte key used at wallet creation time.
Network + data source + optional bounds.
Combined summary: last scanned block + decryption counters.
Build an unsigned shield transaction without signing or network access.
Token, recipient, and caller-derived shield private key.
Network whose RAILGUN contract receives the shield.
The unsigned shield transaction.
Derive a shield key, approve the token, submit, and parse the receipt.
Token, recipient, signer, and execution options.
Network whose RAILGUN contract receives the shield.
Parsed shield result for the confirmed transaction.
Select notes, prove, and build the unsigned unshield call. Does not sign or send.
The recipient is a public 0x address. The client needs a prover, and the
caller supplies the circuit artifacts through params.loadArtifact.
Wallet, token, amount, recipient, transport, artifacts, and public client.
Network whose RAILGUN contract runs the unshield.
The proven, unsigned transaction.
Build the unshield, send it with params.signer, and parse the receipt.
Build inputs plus the signer and execution options.
Network whose RAILGUN contract runs the unshield.
Parsed unshield result for the confirmed transaction.
Select notes, prove, and build the unsigned transact call that pays each
recipient a private note. Does not sign or send. Each recipient is a 0zk
address. The client needs a prover, and the caller supplies the circuit
artifacts through params.loadArtifact.
Wallet, recipients, memo, sender visibility, transport, artifacts, and public client.
Network whose RAILGUN contract runs the transfer.
The proven, unsigned transaction.
Build the transfer, send it with params.signer, and parse the receipt.
Build inputs plus the signer and execution options.
Network whose RAILGUN contract runs the transfer.
Parsed transfer result for the confirmed transaction.
Release resources owned by this client: tears down the engine of every
chain (each closes its chain DB only when it owns it) and closes the
wallet DB only when it was created internally. Injected DBs and every
caller data source remain the caller's responsibility. A pending scan()
fails when its engine-owned chain DB closes, so await scan() before
close().
Top-level entry point for @railgun-reloaded/wallet-sdk.
Composes shared wallet, sync, and event behavior with Node-specific database ownership.