StaticcreateCreate a browser RailgunClient around injected storage contracts.
Required { chainStorages, walletStorage } plus optional
PPOI node URLs. Storages are caller-owned and never closed by the client.
Ready-to-use client.
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 storage.
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?, chainId? }. The 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.
Drain the supplied data source into chain storage for network.
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, or undefined when the source had
nothing to yield.
Decrypt the wallet's notes from chain storage into wallet storage.
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 storage (scan) then
decrypt the wallet's notes into wallet storage (decrypt), optionally
refreshing PPOI status on PPOI networks.
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.
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.
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: drops every event subscriber. The injected storage contracts and every caller data source are caller-owned. Close or delete the storage through the adapter that created it.
Browser entry point for @railgun-reloaded/wallet-sdk.
Mirrors the Node
RailgunClientAPI where practical, but never touches a filesystem or opens databases: chain and wallet storage contracts are injected at construction and remain caller-owned.close()tears down the data source only.