> For AI agents: the documentation index is at https://sdk.nimbusprivacy.xyz/llms.txt, and every page is available as Markdown at its URL with .md appended.

# Types (/reference/types)

Every type `@umbra/nimbus-solana-web` exports is listed here once, in alphabetical order. Each entry
is generated from the SDK's own declarations and TSDoc when this site is built. Hover over a type
in any code block on this site to see the same information.

The SDK also exports `Wallet`, which is the
[Wallet Standard's own type](https://github.com/wallet-standard/wallet-standard) and is not listed
here. `NimbusSdkError` is a class, listed with the [errors](https://sdk.nimbusprivacy.xyz/reference/errors#nimbussdkerror). The
four types `ProverWorkerAnswer`, `ProverWorkerDeps`, `ProverWorkerRequest` and
`WitnessGraphHandle`, come from the `./prover-worker` entry.

## Balance

One balance a session's identity holds: what its notes of one mint in one zone come to, in one
state.

| Property | Type                                                  | Description                                                                                                                                                                                                       |
| -------- | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mint?`  | `Address \| undefined`                                | The mint; absent when the preset lists no mint with the notes' mint identifier.                                                                                                                                   |
| `zone`   | `number`                                              | The zone the notes are in; 0 for the zone every deposit goes to by default.                                                                                                                                       |
| `state`  | `"available" \| "expired" \| "pending" \| "reserved"` | `available` to spend; `pending` until their notes are final and past their valid-after slot; `reserved` by a spend or a deposit that leased them and has not settled; or `expired`, past their valid-before slot. |
| `total`  | `bigint`                                              | The notes' amounts summed, in the mint's base units.                                                                                                                                                              |
| `count`  | `bigint`                                              | How many notes.                                                                                                                                                                                                   |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reads.ts`.

## BeginAttemptRefusal

Why an attempt was refused.

```ts
type BeginAttemptRefusal =
  | { readonly kind: "unknown-intent" }
  | { readonly kind: "intent-settled"; readonly intent: Intent }
  | { readonly kind: "not-held"; readonly intent: Intent }
  | { readonly kind: "pool-frozen"; readonly intent: Intent }
  | { readonly kind: "append-pool-full"; readonly pool: number }
  | {
      readonly kind: "append-pool-not-open";
      readonly pool: number;
      readonly status: Exclude<PoolStatus, "open">;
    }
  | { readonly kind: "input-invalid"; readonly leaf: LeafId }
  | { readonly kind: "would-pay-twice"; readonly attempt: Attempt }
  | {
      readonly kind: "padding-of-another-intent";
      readonly nullifier: Uint8Array;
      readonly intentId: Uint8Array;
    };
```

Generated from the TSDoc in `sdks/typescript/nimbus-storage-solana/src/notes/attempts.ts`.

## ConfirmationCommitment

The commitment a flow waits for before it reports a transaction landed: `confirmed`, by a
supermajority, or `finalized`, which no fork reverts.

Not `processed`: a version 0 deposit is simulated at `confirmed` once its funding has landed, so a
funding reported at `processed` could leave the deposit simulating against a platform wallet
that does not hold it yet.

```ts
type ConfirmationCommitment = Extract<
  SolanaCommitment,
  "confirmed" | "finalized"
>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/transaction.ts`.

## ConnectedWallet

A connected wallet: the signer the SDK takes, and the transaction version the wallet signs.

| Property             | Type                   | Description                                                                                                                                             |
| -------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `wallet`             | `Wallet`               | The wallet connected, as the registry lists it.                                                                                                         |
| `signer`             | `WalletStandardSigner` | The wallet's first account on the SDK's cluster, for `openNimbusSession`.                                                                               |
| `transactionVersion` | `TransactionVersion`   | `1` when the wallet signs version 1 transactions, which the flows send by default; else `0`, which a flow's `transactionVersion` option must then name. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/wallets.ts`.

## DepositContext

The context `deposit`, `refundStrandedDeposit` and `resolvePendingDeposit` run in.

| Property  | Type                | Description                                                      |
| --------- | ------------------- | ---------------------------------------------------------------- |
| `flow`    | `"deposit"`         |                                                                  |
| `session` | `NimbusSession`     | The opened session the flow runs for.                            |
| `routing` | `NimbusFlowRouting` | The pool, committee nodes and guardian cluster the deposit uses. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## DepositOptions

How `deposit` runs.

| Property               | Type                                                          | Description                                                                                                                                                                                                           |
| ---------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onProgress?`          | `((event: DepositStage \| SyncedStage) => void) \| undefined` | Called once per stage with what it produced; its throw is dropped.                                                                                                                                                    |
| `fees?`                | `"added" \| "deducted" \| undefined`                          | `deducted`, the default: the protocol fee comes out of `amount`; `added`: it is paid on top, from the session's notes of the mint the deposit merges, and refused with `amount-unfundable` when they cannot cover it. |
| `submitterFee?`        | `bigint \| undefined`                                         | What the payload pays the submitter, in base units; `0n` when omitted.                                                                                                                                                |
| `submitterFeeMint?`    | `Address \| undefined`                                        | The mint the submitter's fee is paid in; the deposited mint when omitted.                                                                                                                                             |
| `zone?`                | `NimbusZone \| undefined`                                     | The zone the deposit's notes go to; zone 0 when omitted.                                                                                                                                                              |
| `sync?`                | `boolean \| undefined`                                        | `true`, the default: sync the note store until it is caught up before starting, so the flow sees every note and spend the indexer has; `false` when the caller has just synced.                                       |
| `priorityFeeLamports?` | `bigint \| undefined`                                         | The priority fee, in lamports for the whole transaction; `0n` when omitted.                                                                                                                                           |
| `transactionVersion?`  | `TransactionVersion \| undefined`                             | `1`, one version 1 transaction, when omitted; `0` for a wallet that cannot sign version 1, which needs the deployment's lookup table.                                                                                 |
| `commitment?`          | `ConfirmationCommitment \| undefined`                         | What the flow waits for before it reports success; `confirmed` when omitted.                                                                                                                                          |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## DepositResult

What depositing came to:

- `submitted`: the deposit was sent; `submission.submission` says where it ended up. Only
  `landed` deposited; `unknown` may still land, which [`resolvePendingDeposit`](https://sdk.nimbusprivacy.xyz/reference/deposit#resolvependingdeposit) settles;
  `failed`, `expired` or `refused` deposited nothing.
- `declined`: the wallet declined to sign; nothing was sent.
- `store-refused`, `intent-refused`, `attempt-refused`: the note store would not open, begin the
  deposit or record its attempt; nothing was deposited. Read `detail` or `refusal` for why.
- Version 0 only: `funding-failed`, the funding transaction did not land, nothing moved;
  `funding-unknown`, it may still land, so wait before retrying, which then funds only what is
  missing; `deposit-unsendable`, the funding landed but the deposit could not be sent, its value
  now in the platform wallet, which a retried deposit counts or [`refundStrandedDeposit`](https://sdk.nimbusprivacy.xyz/reference/deposit#refundstrandeddeposit)
  returns.

```ts
type DepositResult = DepositOutcome<IndexedDbBackend>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## DepositStage

One stage of a one-call deposit, as its `observe` hook is handed it: what the stage produced since
the hook was last called, public values only.

- `prepared`: the wallet store has begun the deposit's intent and leased any notes it merges.
  `intentId` is the store's 16-byte id for it, `executionSlot` the slot the proofs bind,
  `proofWindow` the slots the proofs stay valid for after it, and `funding` what the connected
  wallet moves to the platform wallet, in lamports and in base units of the mint.
- `endorsed`: the committee's summed signature, 32 bytes; `proved`: the transaction proof and the
  absence proof, 128 bytes each, compressed. Each arrives as it completes, so they come in either
  order unless `serialise` proves first.
- Version 0 only, when the platform wallet lacks what the deposit moves and pays:
  `funding-signed`, `funding-sent` and `funding-confirmed`, the funding transaction's own
  stages, before the deposit is signed.
- `signed`: the store has begun the attempt and every signer has signed; nothing is sent.
- `sent`: the store has marked the attempt sent and the RPC took the transaction, or answered
  without settling whether it did.
- `confirmed`: it landed without error at `opts.commitment`, which the stage reports, as
  `funding-confirmed` does for the funding.

A transaction that failed, expired or is still unknown stops at its `sent` stage, and the outcome
says where it ended up.

```ts
type DepositStage =
  | {
      readonly stage: "prepared";
      readonly intentId: Uint8Array;
      readonly mint: Uint8Array;
      readonly recipient: Uint8Array;
      readonly amounts: DepositAmounts;
      readonly contextDigest: Uint8Array;
      readonly executionSlot: bigint;
      readonly proofWindow: bigint;
      readonly transactionVersion: TransactionVersion;
      readonly funding: { readonly lamports: bigint; readonly tokens: bigint };
    }
  | { readonly stage: "endorsed"; readonly committeeSignature: Uint8Array }
  | {
      readonly stage: "proved";
      readonly proof: Uint8Array;
      readonly nullifierProof: Uint8Array;
    }
  | SignedTransactionStage<"funding-signed">
  | SentTransactionStage<"funding-sent">
  | ConfirmedTransactionStage<"funding-confirmed">
  | (SignedTransactionStage<"signed"> & { readonly attempt: number })
  | SentTransactionStage<"sent">
  | ConfirmedTransactionStage<"confirmed">;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/deposit/types.ts`.

## DepositSubmission

Where a deposit's transaction ended up.

| Property              | Type                          | Description                                                                                                                                                          |
| --------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `intentId`            | `Uint8Array<ArrayBufferLike>` | The wallet store's 16-byte id for the deposit's intent.                                                                                                              |
| `attempt`             | `number`                      | The attempt's number within the intent, from 0.                                                                                                                      |
| `submission`          | `TransactionSubmission`       | Where the deposit's transaction ended up.                                                                                                                            |
| `priorityFeeLamports` | `bigint`                      | The priority fee the transaction pays, in lamports: the one asked for, or at version 0 none when the deposit fits its packet only without its `SetComputeUnitPrice`. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/deposit/types.ts`.

## HistoryPage

One page of the wallet's history.

| Property     | Type                                                                                        | Description                                                                                                                                                                            |
| ------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `kind`       | `"page"`                                                                                    |                                                                                                                                                                                        |
| `pendingOwn` | `readonly ExpectedRecord[]`                                                                 | What the wallet's own attempts built that the store has not yet kept from the stream, an attempt held dead among them, since it may still land; `listAttempts` gives each one's phase. |
| `items`      | `readonly HistoryItem[]`                                                                    | The transactions, newest first.                                                                                                                                                        |
| `next`       | `{ readonly kind: "done"; } \| { readonly kind: "more"; readonly position: ListPosition; }` | `done` when no older transaction remains, or `more` with the position the next page starts from.                                                                                       |
| `coverage`   | `readonly HistoryCoverage[]`                                                                | One per records stream asked about, in the order asked.                                                                                                                                |

Generated from the TSDoc in `sdks/typescript/nimbus-storage-solana/src/records/history.ts`.

## HistoryPosition

Where a page of [`readHistory`](https://sdk.nimbusprivacy.xyz/reference/reads#readhistory) starts, as the note store lists its rows: `from-start`, the
newest, as when `options.after` is omitted; or `after` a row's key, as a page's
`next.position` names it when another page follows, to be passed back unchanged.

```ts
type HistoryPosition = ListPosition;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reads.ts`.

## LeaseRefusal

Why a lease was refused.

```ts
type LeaseRefusal =
  | { readonly kind: "unknown-intent" }
  | { readonly kind: "intent-settled"; readonly intent: Intent }
  | { readonly kind: "held"; readonly intent: Intent }
  | { readonly kind: "inputs-frozen"; readonly intent: Intent }
  | { readonly kind: "not-registered"; readonly registration: Registration }
  | { readonly kind: "two-owner-addresses"; readonly leaf: LeafId }
  | { readonly kind: "two-zones"; readonly leaf: LeafId }
  | {
      readonly kind: "note-unavailable";
      readonly leaf: LeafId;
      readonly reason:
        | "absent"
        | "other-mint"
        | "nullifier-unknown"
        | "not-selectable"
        | "invalid-at-execution-slot"
        | "leased";
    };
```

Generated from the TSDoc in `sdks/typescript/nimbus-storage-solana/src/notes/leases.ts`.

## LoadNimbusSdkOptions

What a caller may add to, or override in, the cluster's preset.

| Property         | Type                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `assetsBaseUrl?` | `string \| undefined`                   | The URL of the directory the application serves this package's `assets/` in, ending with `/`, absolute or relative to the page, such as `/nimbus/`; `nimbus-solana-web copy-assets <dir>` copies them there. The primitives' module is then fetched from it unless `endpoints.primitivesWasm` is given, and each proof runs in a module worker started from its `prover-worker.js` unless `platform.startProverWorker` is given. |
| `endpoints?`     | `Partial<NimbusEndpoints> \| undefined` | Endpoints that replace the preset's, one by one. Each endpoint the preset leaves unconfigured must be given here, `primitivesWasm` unless `assetsBaseUrl` is; `coordinator` only on the `coordinator` route. A replaced gateway-routed endpoint is sent the session's gateway token at its own origin.                                                                                                                           |
| `provingKeys?`   | `NimbusProvingKeys \| undefined`        | The proving keys, replacing the preset's; required while the preset leaves them unconfigured.                                                                                                                                                                                                                                                                                                                                    |
| `route?`         | `NimbusRoute \| undefined`              | How transactions reach the committee and the relayer; `direct` when omitted.                                                                                                                                                                                                                                                                                                                                                     |
| `platform?`      | `Partial<NimbusPlatform> \| undefined`  | Browser functions that replace the browser's own globals, one by one.                                                                                                                                                                                                                                                                                                                                                            |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/load.ts`.

## MarkAttemptSentRefusal

Why marking an attempt sent was refused.

```ts
type MarkAttemptSentRefusal =
  | { readonly kind: "unknown-attempt" }
  | { readonly kind: "not-begun"; readonly attempt: Attempt }
  | { readonly kind: "intent-settled"; readonly intent: Intent }
  | { readonly kind: "not-held"; readonly intent: Intent }
  | { readonly kind: "signature-required"; readonly attempt: Attempt }
  | { readonly kind: "volatile-backend" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-storage-solana/src/notes/attempts.ts`.

## MergeFailureCause

Why merging a wallet's notes stopped before the payment could be made.

- `refused`, `relay-refused`, `unsent`: the failing merge's own outcome, as a spend reports it.
- `failed`: the relayer gave the merge up or it failed on chain, as `followRelay` reports it.
- `timeout`: the merge did not land, or its note did not become spendable in the wallet store,
  within `mergeTimeout` slots; `relayId` names the relay, which may still land, and
  `finalizedSlot` is the last finalized slot read.
- `stale-handle`: the wallet's store was destroyed, replaced or migrated while the merge was
  followed; open it again.

```ts
type MergeFailureCause =
  | Extract<SpendPreparation<unknown>, { readonly kind: "refused" }>
  | Extract<SpendRelay, { readonly kind: "relay-refused" | "unsent" }>
  | Extract<RelayProgress, { readonly kind: "failed" }>
  | {
      readonly kind: "timeout";
      readonly relayId: string;
      readonly finalizedSlot: bigint;
    }
  | { readonly kind: "stale-handle" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/spend/types.ts`.

## NimbusBrowserPlatform

Every browser function the SDK calls: the platform, and the globals that are always the
browser's own.

| Property              | Type                                                                                                                                                                                                                                                                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `keyRange`            | `Pick<{ new (): IDBKeyRange; prototype: IDBKeyRange; bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; lowerBound(lower: any, open?: boolean): IDBKeyRange; only(value: any): IDBKeyRange; upperBound(upper: any, open?: boolean): IDBKeyRange; }, "bound">` | `IDBKeyRange`, which the note store's backend bounds its scans with.                                                                                                                                                                                                                                                                                                                                                                                   |
| `storageManager`      | `Pick<StorageManager, "estimate" \| "persist" \| "persisted">`                                                                                                                                                                                                                                   | `navigator.storage`, which the note store's backend asks for persistence and quota.                                                                                                                                                                                                                                                                                                                                                                    |
| `waitFor`             | `(args: { readonly milliseconds: number; }) => Promise<void>`                                                                                                                                                                                                                                    | Resolves after `milliseconds`.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `fetch`               | `{ (input: RequestInfo \| URL, init?: RequestInit): Promise<Response>; (input: string \| URL \| Request, init?: RequestInit): Promise<Response>; }`                                                                                                                                              | `fetch`, bound to its global: `(input, init) => fetch(input, init)`.                                                                                                                                                                                                                                                                                                                                                                                   |
| `getRandomValues`     | `(bytes: Uint8Array) => Uint8Array`                                                                                                                                                                                                                                                              | Web Crypto's `getRandomValues`, bound: `(bytes) => crypto.getRandomValues(bytes)`.                                                                                                                                                                                                                                                                                                                                                                     |
| `computeSha256Digest` | `(bytes: Uint8Array) => Promise<Uint8Array>`                                                                                                                                                                                                                                                     | Web Crypto's SHA-256, bound: `(bytes) => crypto.subtle.digest("SHA-256", bytes)`, resolving to the 32-byte digest. It checks a shipped file against the digest this package pins before the primitives, which could otherwise hash it, are loaded.                                                                                                                                                                                                     |
| `locks`               | `Pick<LockManager, "request"> & Partial<Pick<LockManager, "query">>`                                                                                                                                                                                                                             | `navigator.locks`, which holds a flow's exclusive lock while it runs: one lock per wallet and account for a registration, so two tabs never register at once, and a lock of its own, freshly named, for each deposit and spend, so a sync can tell one whose tab has gone. `query`, when the platform gives it, tells a sync which stopped spends to release.                                                                                          |
| `indexedDB`           | `IDBFactory`                                                                                                                                                                                                                                                                                     | The `IDBFactory` the note store and the artifact cache open their databases with.                                                                                                                                                                                                                                                                                                                                                                      |
| `startProverWorker`   | `() => Worker \| Promise<Worker>`                                                                                                                                                                                                                                                                | Starts a worker running a prover worker module, which answers each message with `@umbra/nimbus-solana-web/prover-worker`'s `proveWorkerRequest`, or resolves to one. It defaults to a module worker started from the `prover-worker.js` under `loadNimbusSdk`'s `assetsBaseUrl`, once that script's bytes are found to be the ones this package pins; without either, a flow that proves fails with `misconfigured` before it signs or sends anything. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusCluster

A cluster the SDK ships a preset for.

```ts
type NimbusCluster = "mainnet" | "devnet";
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/presets.ts`.

## NimbusContextOptions

What a context may route differently from the defaults.

| Property                 | Type                  | Description                                                   |
| ------------------------ | --------------------- | ------------------------------------------------------------- |
| `poolIndex?`             | `number \| undefined` | The pool; the highest pool the chain shows open when omitted. |
| `screenerNodeIndex?`     | `number \| undefined` | The screener node; the preset's when omitted.                 |
| `dataEndorserNodeIndex?` | `number \| undefined` | The data endorser node; the preset's when omitted.            |
| `guardianCluster?`       | `bigint \| undefined` | The guardian cluster; the preset's when omitted.              |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## NimbusEndpoints

Where each party the SDK reaches answers.

| Property         | Type                            | Description                                                                                                                                               |
| ---------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rpc`            | `string`                        | The Solana JSON-RPC endpoint.                                                                                                                             |
| `indexer`        | `string`                        | The indexer's data API, which serves the notes, spends and records feeds.                                                                                 |
| `context`        | `string`                        | The context API, which answers what a registration or a transaction proves against.                                                                       |
| `guardians`      | `readonly NimbusNodeEndpoint[]` | Every guardian node of the cluster's guardian committee.                                                                                                  |
| `screeners`      | `readonly NimbusNodeEndpoint[]` | The deposit screener nodes a deposit may ask for clearance.                                                                                               |
| `dataEndorsers`  | `readonly NimbusNodeEndpoint[]` | The data endorser nodes a registration or a transaction may ask to endorse it.                                                                            |
| `feeEnclave`     | `string`                        | The fee enclave, which endorses a transaction's fee claim.                                                                                                |
| `relayer`        | `string`                        | The relayer, which submits withdrawals and transfers.                                                                                                     |
| `coordinator`    | `string`                        | The process coordinator, which a `coordinator` route sends a transaction's reads, committee requests and relay through; read only on that route.          |
| `primitivesWasm` | `string`                        | The URL of `nimbus_primitives_wasm_bg.wasm`, the primitives' WebAssembly module this package ships in its `assets/` directory and the application serves. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusFlowRouting

Where a flow's transaction is routed, every value chosen.

| Property                | Type     | Description                                                                        |
| ----------------------- | -------- | ---------------------------------------------------------------------------------- |
| `poolIndex`             | `number` | The pool the transaction appends to and spends from, `0` to `65535`.               |
| `screenerNodeIndex`     | `number` | The deposit screener node whose clearance the transaction carries, `0` to `65535`. |
| `dataEndorserNodeIndex` | `number` | The data endorser node whose endorsement the transaction carries, `0` to `65535`.  |
| `guardianCluster`       | `bigint` | The guardian cluster whose quorum endorses, a u64.                                 |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## NimbusGatewayEndpoint

An endpoint the deployment's gateway fronts, which answers 401 to a request without a gateway
token.

| Property   | Type     | Description                                                                         |
| ---------- | -------- | ----------------------------------------------------------------------------------- |
| `service`  | `string` | The service, as an `unauthorized` error names it: `the relayer`, `guardian node 2`. |
| `endpoint` | `string` | The service's base URL.                                                             |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusGatewayToken

The gateway token a session sends, as `openNimbusSession`'s `gatewayToken` option set it.

```ts
type NimbusGatewayToken =
  | { readonly kind: "none" }
  | { readonly kind: "held"; readonly token: Secret<string> }
  | { readonly kind: "issued"; readonly issue: () => Promise<string> };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/gateway.ts`.

## NimbusMint

A mint the cluster's deployment supports, as `@umbra/solana-deployments`' `mints.json` lists it.

| Property       | Type      | Description                                                                                 |
| -------------- | --------- | ------------------------------------------------------------------------------------------- |
| `mint`         | `Address` | The mint's address.                                                                         |
| `tokenProgram` | `Address` | The token program that owns the mint.                                                       |
| `decimals`     | `number`  | How many decimal places the mint's base units carry: one token is `10 ** decimals` of them. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusNodeEndpoint

One node of a committee and where it answers.

| Property    | Type     | Description                                                                                                         |
| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| `nodeIndex` | `number` | The node's index, as its registry numbers it: from 1 for a guardian node, from 0 for a screener or a data endorser. |
| `endpoint`  | `string` | The node's base URL.                                                                                                |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusPlatform

The browser's functions the SDK calls. Each defaults to the browser's own global.

| Property              | Type                                                                                                                                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `fetch`               | `{ (input: RequestInfo \| URL, init?: RequestInit): Promise<Response>; (input: string \| URL \| Request, init?: RequestInit): Promise<Response>; }` | `fetch`, bound to its global: `(input, init) => fetch(input, init)`.                                                                                                                                                                                                                                                                                                                                                                                   |
| `getRandomValues`     | `(bytes: Uint8Array) => Uint8Array`                                                                                                                 | Web Crypto's `getRandomValues`, bound: `(bytes) => crypto.getRandomValues(bytes)`.                                                                                                                                                                                                                                                                                                                                                                     |
| `computeSha256Digest` | `(bytes: Uint8Array) => Promise<Uint8Array>`                                                                                                        | Web Crypto's SHA-256, bound: `(bytes) => crypto.subtle.digest("SHA-256", bytes)`, resolving to the 32-byte digest. It checks a shipped file against the digest this package pins before the primitives, which could otherwise hash it, are loaded.                                                                                                                                                                                                     |
| `locks`               | `Pick<LockManager, "request"> & Partial<Pick<LockManager, "query">>`                                                                                | `navigator.locks`, which holds a flow's exclusive lock while it runs: one lock per wallet and account for a registration, so two tabs never register at once, and a lock of its own, freshly named, for each deposit and spend, so a sync can tell one whose tab has gone. `query`, when the platform gives it, tells a sync which stopped spends to release.                                                                                          |
| `indexedDB`           | `IDBFactory`                                                                                                                                        | The `IDBFactory` the note store and the artifact cache open their databases with.                                                                                                                                                                                                                                                                                                                                                                      |
| `startProverWorker`   | `() => Worker \| Promise<Worker>`                                                                                                                   | Starts a worker running a prover worker module, which answers each message with `@umbra/nimbus-solana-web/prover-worker`'s `proveWorkerRequest`, or resolves to one. It defaults to a module worker started from the `prover-worker.js` under `loadNimbusSdk`'s `assetsBaseUrl`, once that script's bytes are found to be the ones this package pins; without either, a flow that proves fails with `misconfigured` before it signs or sends anything. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusProving

How the prover runs in its worker.

| Property              | Type      | Description                                                                                                                                                 |
| --------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `threads`             | `number`  | The threads the prover runs on: one per logical core the browser reports.                                                                                   |
| `allowSingleThreaded` | `boolean` | Whether to prove on one thread when the page is not cross-origin isolated, rather than refuse; `false`, since `loadNimbusSdk` loads only on a page that is. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusProvingKeys

Where the circuits' proving keys and witness calculators come from, and what each key proves.

The manifest is configuration, not fetched: it pins each artifact's SHA-256 and each proving
key's verifying key, so the host that serves the bytes cannot also choose what they must hash
to. Every key is further checked against the verifying keys compiled into the deployed pool
program before it is used.

| Property     | Type                                   | Description                                                                                                                                                    |
| ------------ | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `baseUrl`    | `string`                               | The origin every manifest path is relative to, ending with `/`.                                                                                                |
| `manifest`   | `CircuitManifest`                      | The circuits' artifacts, each by its path under `baseUrl` and its SHA-256, and the verifying key each proving key belongs to.                                  |
| `statements` | `readonly NimbusProvingKeyStatement[]` | The statement each of the manifest's proving keys proves, at most one per circuit: a proving key is handed over only for a selection that equals one of these. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusProvingKeyStatement

The statement one of the manifest's proving keys proves, named as the pool program selects its
verifying key: the circuit, and the parameters its circuit fixes.

```ts
type NimbusProvingKeyStatement =
  | {
      readonly circuit: "registration";
      readonly quorumThreshold: number;
      readonly quorumNodes: number;
    }
  | {
      readonly circuit: "transaction";
      readonly quorumThreshold: number;
      readonly quorumNodes: number;
      readonly shape: CircuitShape;
    }
  | { readonly circuit: "nullifier_non_membership"; readonly inputs: number };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusRegistrationStanding

Where a session's identity stands in the identity tree of the pool the context API serves.

```ts
type NimbusRegistrationStanding =
  | { readonly kind: "registered"; readonly poolIndex: number }
  | { readonly kind: "unregistered"; readonly poolIndex: number };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/session.ts`.

## NimbusRoute

How a transaction reaches the committee and the relayer.

- `direct`: the browser asks each committee member, the context API and the relayer itself.
- `coordinator`: a transaction's reads, its committee requests and its relay go through the
  process coordinator, which makes them from beside the services, so a relayed spend's four
  committee requests and its relay become one exchange. Registrations, the relay's progress, the
  RPC, the indexer and the prover are reached directly on both routes.

```ts
type NimbusRoute = "direct" | "coordinator";
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/load.ts`.

## NimbusRoutingDefaults

The committee nodes and guardian cluster a context asks when its options name none.

| Property                | Type     | Description                                                                      |
| ----------------------- | -------- | -------------------------------------------------------------------------------- |
| `screenerNodeIndex`     | `number` | The deposit screener node a deposit asks for clearance.                          |
| `dataEndorserNodeIndex` | `number` | The data endorser node a registration or a transaction asks to endorse it.       |
| `guardianCluster`       | `bigint` | The guardian cluster whose quorum endorses, as the guardian registry numbers it. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/presets.ts`.

## NimbusSdk

A loaded SDK: the cluster's deployment, its mints and routing defaults, the resolved settings,
and the handles every function of this package reads, the primitives' module and the artifact
cache among them.

Pass it to `openNimbusSession`; treat every field as read-only. One SDK serves any number of
sessions, and holds no secret.

| Property     | Type                         | Description                                                                               |
| ------------ | ---------------------------- | ----------------------------------------------------------------------------------------- |
| `cluster`    | `NimbusCluster`              | The cluster the SDK was loaded for.                                                       |
| `route`      | `NimbusRoute`                | How transactions reach the committee and the relayer.                                     |
| `deployment` | `NimbusSolanaFlowDeployment` | The deployment, decoded: what every flow and the note store act on.                       |
| `mints`      | `readonly NimbusMint[]`      | The mints the deployment supports.                                                        |
| `routing`    | `NimbusRoutingDefaults`      | The committee nodes and guardian cluster a context asks when its options name none.       |
| `settings`   | `NimbusSettings`             | Every endpoint, the proving keys and the other values the preset and options resolved to. |
| `platform`   | `NimbusBrowserPlatform`      | The browser functions every call makes, the options' in place of the browser's own.       |
| `primitives` | `PrimitiveDeps`              | Every primitive, filled from the primitives' WebAssembly module.                          |
| `cache`      | `IndexedDbBlobContext`       | The opened IndexedDB blob store circuit artifacts are cached in.                          |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/load.ts`.

## NimbusSdkErrorReason

Why the SDK could not go on.

- `misconfigured`: the cluster's preset leaves an endpoint or the proving keys unconfigured and
  the options did not supply them, or a configured value or an argument is unusable: an
  `assetsBaseUrl` that is not a directory URL, no prover worker, no endpoint for the committee
  node a context names, an address that is not base58, an option outside its range, a mint
  identifier shorter than 32 bytes, a deposit submission whose outcome is settled already, a
  gateway token that is not a bearer token, or no open pool. The message names each one; pass it
  in `loadNimbusSdk`'s options or fix the argument. Not recoverable by retrying.
- `unreadable`: a party answered, or the browser's storage held, something that cannot be read:
  a malformed service answer, a note store another deployment or a newer schema wrote, or a note
  store another tab replaced or kept writing to while it was in use. Retrying the same party is
  unlikely to help, though a call that met a note store being replaced may succeed when made
  again, since each call opens the store afresh.
- `unsupported-browser`: the browser lacks a global the SDK needs (`fetch`, Web Crypto,
  `navigator.locks`, `navigator.storage`, IndexedDB, `IDBKeyRange`, WebAssembly), or refused to
  open its storage, as a private window may; or the page is not cross-origin isolated, which the
  server fixes by sending
  `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp`.
  Not recoverable in this browser or on this page.
- `wallet-unsupported`: the wallet cannot connect, sign messages and sign transactions on the
  cluster's chain, its account's address is not its public key's, or it failed while connecting
  or signing, signed other bytes than it was given, or answered a signature that does not verify.
  A user who declines is not this error: the call answers `declined`. Ask the user to connect
  another wallet.
- `service-unavailable`: a service, the RPC or the artifact host could not be reached or answered
  a failing status. Retry later.
- `unauthorized`: a gateway service answered 401 or 403, because the session was opened without
  a gateway token or the gateway refused it, or the session's token issuer failed. The message
  names the service and never the token. Open a session with a token the gateway accepts, or
  have the issuer return a fresh one.
- `dependency-nonconforming`: a dependency answered against its contract: a proving key or
  witness calculator that is not the one the manifest and the deployed program pin, a prover
  that refused the statement, a file of this package's `assets/` whose SHA-256 is not the one
  the package pins, or primitives that fail their known-answer checks. The value must not be
  used; retrying will not help, and serving the `assets/` packed with this copy of the package
  fixes a mismatched file.
- `recipient-unregistered`: the context API answered that the wallet a deposit or a transfer
  pays has no registration in the pool, so no note can be sealed to it. The message carries the
  API's detail. Nothing was signed or sent. Ask the recipient to register, or pay another
  wallet; a registration that has only just landed is seen once the indexer reaches it.
- `account-unregistered`: the context API answered that the session's own identity, or for a
  withdrawal the connected wallet, has no registration in the pool. The message carries the
  API's detail. Nothing was signed or sent. Run `register` first; a registration that has only
  just landed is seen once the indexer reaches it.

```ts
type NimbusSdkErrorReason =
  | "misconfigured"
  | "unreadable"
  | "unsupported-browser"
  | "wallet-unsupported"
  | "service-unavailable"
  | "unauthorized"
  | "dependency-nonconforming"
  | "recipient-unregistered"
  | "account-unregistered";
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/errors.ts`.

## NimbusSession

An opened session: the connected wallet, the seed and keys derived from its signature, its
identity, its note store, and where it stood when it was opened.

It holds secrets in memory: the wallet seed every key derives from, the keys a sync recognises
notes with, and the gateway token. Close it with [`closeNimbusSession`](https://sdk.nimbusprivacy.xyz/reference/sessions#closenimbussession) when the user is
done; never serialise it.

| Property         | Type                                                                              | Description                                                                                                                                                            |
| ---------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sdk`            | `NimbusSdk`                                                                       | The loaded SDK, its platform's `fetch` sending NimbusSession.gatewayToken to the gateway's origins: what every function taking the session reaches each party through. |
| `gatewayToken`   | `NimbusGatewayToken`                                                              | The gateway token the session's gateway-bound requests carry; never persisted.                                                                                         |
| `wallet`         | `WalletStandardSigner`                                                            | The connected wallet's signer, which signs registrations, deposits and refunds.                                                                                        |
| `walletAddress`  | `Address`                                                                         | The connected wallet's address: it pays, and the user registry names it the owner.                                                                                     |
| `accountIndex`   | `number`                                                                          | The platform wallet's account index, SLIP-0010's `m/44'/501'/accountIndex'/0'`.                                                                                        |
| `platformWallet` | `Address`                                                                         | The platform wallet the identity binds, derived from the seed at `accountIndex`.                                                                                       |
| `walletSession`  | `WalletSession`                                                                   | The connected wallet's 32-byte public key and the 64-byte wallet seed, which is secret.                                                                                |
| `identity`       | `WalletIdentity`                                                                  | The identity's public values: its commitment and the key root a registration publishes.                                                                                |
| `keys`           | `WalletKeys`                                                                      | The keys a sync recognises notes and records with; secret.                                                                                                             |
| `store`          | `{ readonly backend: IndexedDbBackend; readonly choices: WalletStorageChoices; }` | The note store's opened IndexedDB backend and the choices it was created with. Until the identity registers, the store has no birthday and holds nothing.              |
| `registration`   | `NimbusRegistrationStanding`                                                      | Where the identity stood when the session was opened.                                                                                                                  |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/session.ts`.

## NimbusSettings

Everything the fillers are bound to besides the deployment and the platform, every value
resolved from the preset and the options.

| Property           | Type                               | Description                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------ | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `endpoints`        | `NimbusEndpoints`                  | Where each party answers: the preset's endpoints, each replaced by the options' when given.                                                                                                                                                                                                                                                                                                                     |
| `assetPinning`     | `"pinned" \| "unpinned"`           | Whether this copy of the package checks the files it ships in `assets/` against their SHA-256 before running them. A packed package is `pinned`: `prepack` writes the digests of the assets packed with it. `unpinned` means the package runs from source, or from a `dist/` built after its assets, and runs those files unchecked; an application can refuse to go on when it reads `unpinned` in production. |
| `gatewayEndpoints` | `readonly NimbusGatewayEndpoint[]` | Every configured endpoint the preset marks gateway-routed, the coordinator only on the `coordinator` route: the origins a session's gateway token is sent to.                                                                                                                                                                                                                                                   |
| `provingKeys`      | `NimbusProvingKeys`                | The proving keys: the options' when given, else the preset's.                                                                                                                                                                                                                                                                                                                                                   |
| `cacheDatabase`    | `string`                           | The IndexedDB database the downloaded circuit artifacts are cached in.                                                                                                                                                                                                                                                                                                                                          |
| `network`          | `string`                           | The network name the context API reports, such as `mainnet`.                                                                                                                                                                                                                                                                                                                                                    |
| `proving`          | `NimbusProving`                    | How the prover runs in its worker.                                                                                                                                                                                                                                                                                                                                                                              |
| `timing`           | `NimbusTiming`                     | How long the SDK waits on the chain and the relayer, from the preset.                                                                                                                                                                                                                                                                                                                                           |
| `observedPools`    | `number`                           | How many pools, from pool 0, each sync reads the accounts of. Under the pool order the first pool read that is not open proves no later pool exists.                                                                                                                                                                                                                                                            |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusSolanaFlowError

A refusal a caller can act on. Its message is fixed text and its `detail` holds names, counts
and indices, never key material.

| Property  | Type                                | Description                                                                       |
| --------- | ----------------------------------- | --------------------------------------------------------------------------------- |
| `name`    | `"NimbusSolanaFlowError"`           |                                                                                   |
| `reason`  | `NimbusSolanaFlowErrorReason`       | Why the flow refused, which decides what the caller does next.                    |
| `detail`  | `Readonly<Record<string, unknown>>` | Names, counts and indices that locate the refusal, for a log; never key material. |
| `message` | `string`                            |                                                                                   |
| `stack?`  | `string \| undefined`               |                                                                                   |
| `cause?`  | `unknown`                           |                                                                                   |

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/context/errors.ts`.

## NimbusSolanaFlowErrorReason

Why the context derivation or a flow refused to go on.

- `message-altered`: the unlock message in this build does not hash to its pinned digest. Not
  recoverable at run time: the build is wrong, and nothing may be signed from it.
- `signature-invalid`: the wallet's signature is not 64 bytes or does not verify over the unlock
  message for the connected wallet. Ask again; a wallet that wraps the message is unsupported.
- `deployment-invalid`: the deployment in `ctx` contradicts itself, such as a pool program that
  is not `programs.pool`. Fix the configuration.
- `binding-mismatched`: the user registry binds the connected wallet to another platform wallet
  than this account derives. Repair is a new bind both wallets sign, never automatic.
- `standing-mismatched`: the context service's answer does not fit the registration: another pool,
  another cluster, a shape the circuit does not fold, a stale root or an inactive cluster. Fetch
  again later.
- `context-mismatched`: the context service's answer does not fit the deposit or the spend: a
  root the chain has retired, another sender, a payee or recipient of the other kind, witnesses
  that do not pair with what was asked or are of another shape, a rate absence proven against
  another root, or a quorum the circuit does not fold. Fetch again; a persistent refusal means
  the service is wrong.
- `absence-unproven`: the gap the service served does not prove the identity, or an input's
  nullifier, absent from the root it names. Fetch again; a persistent refusal means the service is
  wrong.
- `mint-unsupported`: no mint account exists at the address, a program other than SPL Token or
  Token-2022 owns it, or its bytes are not a mint's. Nothing can be deposited of it; choose
  another mint.
- `fee-changing`: the mint's Token-2022 transfer fee changes at the next epoch, too soon for a
  deposit prepared now to be sure which applies. Retry once the epoch has turned.
- `amount-unfundable`: the amount cannot settle: the mint's transfer fee takes the whole amount,
  so nothing reaches the pool token account; the fee leaves the payee nothing; the merged or
  selected notes cannot pay the amount and its fees; or the policy charges the change. Nothing
  was asked of the committee; choose another amount or fee mode.
- `committee-mismatched`: the guardians', the screener's, the fee enclave's or the data
  endorser's answers cannot be summed into a signature the chain accepts: a node refused, signed
  another digest, or holds a key the cluster does not publish. Nothing was sent. Retry; a
  persistent refusal means a node or the cluster's published keys are wrong.
- `proof-mismatched`: the prover proved another statement than the one prepared. The prover or
  its key is wrong, and retrying with them will not help.
- `transaction-altered`: the connected wallet returned a transaction whose message differs from
  the one built, or whose signature does not verify. Nothing was sent. Ask again; a wallet that
  rewrites what it is asked to sign is unsupported.
- `transaction-unsendable`: the transaction is larger than its version carries, or its simulation
  failed; nothing was signed or sent. A failed simulation may pass on a retry; a size will not.
- `fee-payer-unfunded`: the connected wallet pays for the flow's transaction and has no account
  on the cluster, or holds fewer lamports than paying for it requires: the base fee for each
  signature, the priority fee, the lamports the transaction moves from it, the rent of an
  account it creates, and the rent-exempt minimum it keeps. Raised while the flow is prepared,
  so nothing was proved, asked of the committee, signed or sent. `detail` holds
  `requiredLamports` and `heldLamports` as decimal strings; add SOL to the wallet and retry.
- `relay-unavailable`: the relayer's policy does not carry the spend: another program, another
  pool, a mint it does not relay, a fee it refuses, no tip accrual for the fee's mint, or a
  destination it will not create. Nothing was asked of the committee; choose another relayer.
- `payout-unpayable`: the withdrawal's destination cannot be paid: no account and no owner to
  create it for, an account that is not a token account of the mint, an owner whose associated
  token account it is not, or an owner named for a native SOL wallet other than the wallet. It
  is raised too when no account exists at the mint or a program other than SPL Token or
  Token-2022 owns it, and when a native SOL payout, after every fee, would leave the destination
  below the rent-exempt minimum. Nothing was asked of the committee; name another destination,
  or for native SOL a larger amount.
- `relay-mismatched`: what was admitted is not the relay built: another context digest, or a
  posted payload whose committee signature is not the committee's sum. The relay may still land,
  so its notes stay held until the wallet store sees it land or die; sync to learn which.
- `zone-unauthorised`: a zone signer refused, answered for another zone or side, answered with a
  value outside the field, or with a key the zone's authorised set does not hold at the root the
  statement proves against. Nothing was asked of the committee and the notes are released; ask
  the zone's operator, or use another zone.

```ts
type NimbusSolanaFlowErrorReason =
  | "message-altered"
  | "signature-invalid"
  | "deployment-invalid"
  | "binding-mismatched"
  | "standing-mismatched"
  | "context-mismatched"
  | "absence-unproven"
  | "mint-unsupported"
  | "fee-changing"
  | "amount-unfundable"
  | "committee-mismatched"
  | "proof-mismatched"
  | "transaction-altered"
  | "transaction-unsendable"
  | "fee-payer-unfunded"
  | "relay-unavailable"
  | "payout-unpayable"
  | "relay-mismatched"
  | "zone-unauthorised";
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/context/errors.ts`.

## NimbusTiming

How long the SDK waits on the chain and the relayer.

| Property                   | Type     | Description                                                                           |
| -------------------------- | -------- | ------------------------------------------------------------------------------------- |
| `confirmationPolls`        | `number` | How many times a sent transaction's status is read before the wait ends as `unknown`. |
| `relayPolls`               | `number` | How many times a relay's status is read before the wait ends as `pending`.            |
| `pollIntervalMilliseconds` | `number` | The pause between two status reads, in milliseconds.                                  |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## NimbusZone

A zone other than zone 0 and the signer its authorised set holds.

| Property | Type             | Description                                                    |
| -------- | ---------------- | -------------------------------------------------------------- |
| `id`     | `number`         | The zone, from 1 to 2^20 - 1.                                  |
| `signer` | `ZoneSignerPort` | Signs the zone's authorisation for each side whose gate fires. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## NoteStoreSyncResult

What syncing a session's note store came to.

```ts
type NoteStoreSyncResult =
  | { readonly kind: "unregistered" }
  | {
      readonly kind: "ingested";
      readonly slot: bigint;
      readonly rounds: number;
      readonly caughtUp: boolean;
    }
  | {
      readonly kind: "unavailable";
      readonly step: string;
      readonly detail: Readonly<Record<string, string>>;
    };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reads.ts`.

## NoteStoreSyncRound

One round of [`syncNoteStore`](https://sdk.nimbusprivacy.xyz/reference/reads#syncnotestore), as `onProgress` is handed it.

| Property   | Type      | Description                                                                              |
| ---------- | --------- | ---------------------------------------------------------------------------------------- |
| `round`    | `number`  | The round, from 1.                                                                       |
| `slot`     | `bigint`  | The slot the round read the chain at: the latest confirmed one, as the store decides on. |
| `caughtUp` | `boolean` | Whether every stream the round read has been taken in to the feed's end.                 |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reads.ts`.

## OpenNimbusSessionOptions

How a session is opened.

| Property                | Type                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `signatureSecretStore?` | `SignatureSecretStore \| undefined`              | Where the secret the unlock signature yields is read from and written to; a new `createTabSignatureSecretStore()` when omitted.                                                                                                                                                                                                                                                                                                                                                                                                      |
| `accountIndex?`         | `number \| undefined`                            | The platform wallet's account index, an integer in `[0, 2^31)`; `0`, the one a registration binds by default, when omitted. Each index is a separate identity.                                                                                                                                                                                                                                                                                                                                                                       |
| `gatewayToken?`         | `string \| (() => Promise<string>) \| undefined` | The bearer token every request to the deployment's gateway carries, issued for this session: an RFC 6750 token, held in a `Secret` until the session closes, or an issuer called once for every gateway-bound request, retries included, which should return a cached token until it nears expiry. It is sent only to the origins of the SDK's `settings.gatewayEndpoints`, never stored, logged or put in an error or a progress event. Omitted, the session opens and reads, and every step a gateway serves fails `unauthorized`. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/session.ts`.

## OpenNimbusSessionResult

What opening a session came to.

```ts
type OpenNimbusSessionResult =
  | { readonly kind: "opened"; readonly session: NimbusSession }
  | { readonly kind: "declined" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/session.ts`.

## PendingDepositResolutionResult

What resolving a pending deposit came to:

- `landed`: the deposit landed, at `slot`; its note arrives with the next sync.
- `failed` or `expired`: nothing was deposited, and the note store was told; `report` and
  `intent` are its answers, `abandoned` meaning the notes the deposit merged are free again, and
  `settled` that [`releaseReservedNotes`](https://sdk.nimbusprivacy.xyz/reference/reserved-funds#releasereservednotes) had stopped it, the report freeing them. At
  version 0 a landed funding's value stays in the platform wallet: deposit again, or
  [`refundStrandedDeposit`](https://sdk.nimbusprivacy.xyz/reference/deposit#refundstrandeddeposit).
- `unknown`: the wait ended first; it may still land until its last valid height, so call again.
- `store-refused`: the note store would not open for the identity; nothing was reported.

```ts
type PendingDepositResolutionResult = DepositResolution<IndexedDbBackend>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## ProverWorkerAnswer

The prover worker's answer: the proof as snarkjs writes it, or why it failed.

```ts
type ProverWorkerAnswer =
  | {
      readonly kind: "proved";
      readonly proof: {
        readonly pi_a: readonly string[];
        readonly pi_b: readonly (readonly string[])[];
        readonly pi_c: readonly string[];
      };
      readonly publicSignals: readonly string[];
    }
  | {
      readonly kind: "failed";
      readonly reason: string;
      readonly message: string;
    };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/prover-worker.ts`.

## ProverWorkerDeps

The witness-graph and prover WASM modules, each initialised by the application before the call.

| Property | Type                                                                  | Description                                                              |
| -------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `graph`  | `{ readonly load_graph: (bytes: Uint8Array) => WitnessGraphHandle; }` | The module namespace of the glue `just build-witness-graph-wasm` writes. |
| `wasm`   | `UmbraProverWasm`                                                     | The module namespace of the glue `just build-umbra-prover-wasm` writes.  |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/prover-worker.ts`.

## ProverWorkerRequest

What the main thread asks the prover worker for.

| Property              | Type                                     | Description                                                                                  |
| --------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------- |
| `circuit`             | `string`                                 | The circuit's name, as `@umbra/circuit-artifacts` names it, for the answer's messages.       |
| `provingKey`          | `Uint8Array<ArrayBufferLike>`            | The circuit's proving key, already checked by the main thread.                               |
| `witnessGraph`        | `Uint8Array<ArrayBufferLike>`            | The circuit's witness graph, its `.wcd`, already checked by the main thread.                 |
| `input`               | `Readonly<Record<string, CircuitInput>>` | Every signal the circuit declares, by its own name; secret.                                  |
| `threads`             | `number`                                 | The threads the prover runs on.                                                              |
| `allowSingleThreaded` | `boolean`                                | Whether to prove on one thread when the page is not cross-origin isolated, rather than fail. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/prover-worker.ts`.

## RefundStage

One stage of a one-call refund, as its `observe` hook is handed it: what the stage produced since
the hook was last called, public values only.

- `prepared`: the platform wallet, the mint as read, what the platform wallet held, and how many
  instructions return it. A platform wallet holding nothing stops before this stage.
- `signed`: both wallets signed the transaction; nothing is sent.
- `sent`: the RPC took it, or answered without settling whether it did.
- `confirmed`: it landed without error at `opts.commitment`, which the stage reports. One that failed,
  expired or is still unknown stops at `sent`, and the outcome says where it ended up.

```ts
type RefundStage =
  | {
      readonly stage: "prepared";
      readonly platformWallet: Uint8Array;
      readonly mint: PreparedDepositRefund["mint"];
      readonly holdings: PlatformWalletHoldings;
      readonly instructionCount: number;
    }
  | SignedTransactionStage<"signed">
  | SentTransactionStage<"sent">
  | ConfirmedTransactionStage<"confirmed">;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/deposit/refund.ts`.

## RegisterOptions

How `register` runs.

| Property               | Type                                            | Description                                                                                                                           |
| ---------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `onProgress?`          | `((event: RegisterStage) => void) \| undefined` | Called once per stage with what it produced; its throw is dropped.                                                                    |
| `priorityFeeLamports?` | `bigint \| undefined`                           | The priority fee, in lamports for the whole transaction; `0n` when omitted.                                                           |
| `transactionVersion?`  | `TransactionVersion \| undefined`               | `1`, one version 1 transaction, when omitted; `0` for a wallet that cannot sign version 1, which needs the deployment's lookup table. |
| `commitment?`          | `ConfirmationCommitment \| undefined`           | What the flow waits for before it reports success; `confirmed` when omitted.                                                          |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## RegisterStage

One stage of a one-call registration, as its `observe` hook is handed it: what the stage produced
since the hook was last called, public values only.

- `prepared`: the identity, its platform wallet and pool, whether the bind is still needed, and
  whether the identity is registered already or pending, with the context digest the committee
  signs and the slot the wallet's store was opened at. A registration with nothing left to send
  stops here.
- `endorsed`: the committee's summed signature, 32 bytes; `proved`: the 128-byte compressed proof.
  A pending identity has both, each as it completes, so they arrive in either order unless
  `serialise` proves first; a registered one has neither.
- `signed`: the transaction both wallets signed, before anything is sent, and the instructions it
  carries.
- `sent`: the RPC took it, or answered without settling whether it did.
- `confirmed`: it landed without error at `opts.commitment`, which the stage reports. One that failed,
  expired or is still unknown stops at `sent`, and the outcome says where it ended up.

```ts
type RegisterStage =
  | {
      readonly stage: "prepared";
      readonly identityCommitment: bigint;
      readonly platformWallet: Uint8Array;
      readonly poolIndex: number;
      readonly bind: PlatformWalletBindingPlan;
      readonly identity:
        | { readonly kind: "registered" }
        | {
            readonly kind: "pending";
            readonly contextDigest: Uint8Array;
            readonly birthday: bigint;
          };
    }
  | { readonly stage: "endorsed"; readonly committeeSignature: Uint8Array }
  | { readonly stage: "proved"; readonly proof: Uint8Array }
  | (SignedTransactionStage<"signed"> & {
      readonly wrote: readonly RegistrationWrite[];
    })
  | SentTransactionStage<"sent">
  | ConfirmedTransactionStage<"confirmed">;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/register/types.ts`.

## RegistrationContext

The context `register` runs in.

| Property  | Type                                           | Description                                                              |
| --------- | ---------------------------------------------- | ------------------------------------------------------------------------ |
| `flow`    | `"registration"`                               |                                                                          |
| `session` | `NimbusSession`                                | The opened session the flow runs for.                                    |
| `routing` | `Omit<NimbusFlowRouting, "screenerNodeIndex">` | The pool, data endorser node and guardian cluster the registration uses. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## RegistrationContextOptions

What a registration context may route differently: a registration asks no screener.

```ts
type RegistrationContextOptions = Omit<
  NimbusContextOptions,
  "screenerNodeIndex"
>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## RegistrationResult

What registering came to:

- `complete`: the identity was registered and bound already; nothing was sent.
- `submitted`: the transaction was sent; `submission.submission` says where it ended up. Only
  `landed` registered it: read [`readRegistration`](https://sdk.nimbusprivacy.xyz/reference/registration#readregistration) then. `failed`, `expired` or `refused`
  registered nothing, and `register` may be called again; `unknown` may still land, so read the
  standing again before retrying.
- `declined`: a wallet declined to sign; nothing was sent.
- `store-refused`: the note store would not open for this identity, as `refusal` says; nothing
  was asked of any service.

```ts
type RegistrationResult = RegistrationOutcome<IndexedDbBackend>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## ReleasedNotes

What releasing came to: the spends whose notes are free now, those whose notes free once an
attempt that may have been sent lands or can no longer land, and those left alone because a tab
is still running them.

| Property   | Type                       | Description                                                                               |
| ---------- | -------------------------- | ----------------------------------------------------------------------------------------- |
| `released` | `readonly ReservedSpend[]` | The spends whose notes are free now.                                                      |
| `settling` | `readonly ReservedSpend[]` | The spends now `releasing`, whose notes free once their sent attempt settles.             |
| `running`  | `readonly ReservedSpend[]` | The spends a tab of this origin is still running, left alone because `force` was not set. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reserved.ts`.

## ReservedSpend

One spend holding a session's notes: a withdrawal, a transfer or a merge, which the store does not
tell apart; an escape; or a deposit that merges some of the session's notes, spending them into
one new note beside the one it deposits. A deposit that merges none holds no notes and is not
one.

| Property   | Type                               | Description                                                                                                                                                                                                                                                                                                                                                                                         |
| ---------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`       | `string`                           | The spend's id, 32 lowercase hex characters; releaseReservedNotes takes it.                                                                                                                                                                                                                                                                                                                         |
| `kind`     | `"deposit" \| "escape" \| "spend"` | `spend` for a withdrawal, a transfer or a merge (a step that combines several pieces of the private balance into one, so one payment can cover the amount); `escape` for a withdrawal through the pool's escape hatch, which needs no committee signature, so it works while a service is down, but publishes the note's contents on chain; `deposit` for a deposit that merges the notes it holds. |
| `mint?`    | `Address \| undefined`             | The mint it moves; absent when the preset lists no mint with its identifier.                                                                                                                                                                                                                                                                                                                        |
| `amount`   | `bigint`                           | The amount it moves, in the mint's base units: for a deposit, what it takes from the connected wallet, not what the notes it merges hold.                                                                                                                                                                                                                                                           |
| `state`    | `ReservedSpendState`               | Where it stands, which decides what releasing it does.                                                                                                                                                                                                                                                                                                                                              |
| `attempts` | `number`                           | How many attempts of it have begun.                                                                                                                                                                                                                                                                                                                                                                 |
| `running`  | `boolean`                          | Whether a tab of this origin holds the spend's lock now, so the spend is still running there; false when none does, or when the browser cannot list its locks.                                                                                                                                                                                                                                      |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reserved.ts`.

## ReservedSpendState

Where a spend holding notes stands, which decides what releasing it does:

- `unsent`: nothing of it has left the device; releasing it frees its notes at once.
- `sent`: an attempt of it may have reached the relayer or the chain; releasing it stops any new
  attempt, and its notes free once that attempt lands or can no longer land.
- `releasing`: released while an attempt may still land; its notes free once it lands or can no
  longer land.

```ts
type ReservedSpendState = "unsent" | "sent" | "releasing";
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reserved.ts`.

## SentTransactionOptions

What every flow the connected wallet signs and sends may vary.

| Property               | Type                                  | Description                                                                                                                           |
| ---------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `priorityFeeLamports?` | `bigint \| undefined`                 | The priority fee, in lamports for the whole transaction; `0n` when omitted.                                                           |
| `transactionVersion?`  | `TransactionVersion \| undefined`     | `1`, one version 1 transaction, when omitted; `0` for a wallet that cannot sign version 1, which needs the deployment's lookup table. |
| `commitment?`          | `ConfirmationCommitment \| undefined` | What the flow waits for before it reports success; `confirmed` when omitted.                                                          |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SettledSpendOutcome

What a withdrawal or a transfer came to:

- `relayed`: the relayer admitted it; `settlement` says how following it went, and the payment is
  known made once that is `landed`. A `pending` settlement may still land; a later sync settles
  it, and its notes stay reserved until then.
- `refused`: nothing was asked of the committee; `refusal`, a [`SpendRefusal`](https://sdk.nimbusprivacy.xyz/reference/types#spendrefusal), says why,
  `insufficient` with what the session may spend.
- `relay-refused`: the relayer refused it, with its `code`, creating no relay; its notes are
  released at once, so a retry may spend them.
- `unsent`: the note store would not mark it sent, so nothing was posted.
- `merge-failed`: the notes had to be merged first and a merge did not settle;
  `mergesCompleted` stay merged, so a retry needs fewer, and `cause` says why.

```ts
type SettledSpendOutcome =
  | Exclude<SpendOutcome, { readonly kind: "relayed" }>
  | (Extract<SpendOutcome, { readonly kind: "relayed" }> & {
      readonly settlement: SpendSettlement;
    });
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SettledStage

The stage a withdrawal or a transfer reports once following its relay settled, with how.

| Property     | Type              | Description                      |
| ------------ | ----------------- | -------------------------------- |
| `stage`      | `"settled"`       |                                  |
| `settlement` | `SpendSettlement` | How following the relay settled. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SignatureSecretKey

Which wallet, cluster and chain a stored secret belongs to.

| Property        | Type                        | Description                                                     |
| --------------- | --------------------------- | --------------------------------------------------------------- |
| `walletAddress` | `Address`                   | The connected wallet's address.                                 |
| `cluster`       | `NimbusCluster`             | The cluster the session is opened on.                           |
| `chain`         | `` `${string}:${string}` `` | The CAIP-2 chain the session acts on, such as `solana:mainnet`. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts`.

## SignatureSecretReading

What reading a stored secret came to.

```ts
type SignatureSecretReading =
  | { readonly kind: "found"; readonly signatureSecret: Secret<Uint8Array> }
  | { readonly kind: "absent" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts`.

## SignatureSecretStore

Where the signature secret is kept between page loads: three functions over one place.

`openNimbusSession` reads the secret first, asks the wallet to sign only when it is absent, and
writes what the signature yields. Call `wipeSignatureSecret` when the user signs out; it does not
close a session already open.

| Property               | Type                                                                                                  | Description                                                                           |
| ---------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `readSignatureSecret`  | `(key: SignatureSecretKey) => Promise<SignatureSecretReading>`                                        | Reads the secret stored for a key, if any.                                            |
| `writeSignatureSecret` | `(key: SignatureSecretKey, args: { readonly signatureSecret: Secret<Uint8Array>; }) => Promise<void>` | Stores a key's 64-byte secret, replacing any before it; the caller keeps its carrier. |
| `wipeSignatureSecret`  | `(key: SignatureSecretKey) => Promise<void>`                                                          | Deletes the secret stored for a key; deleting what is absent does nothing.            |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts`.

## SignatureSecretStoreOptions

How a Web Storage store names its entries.

| Property     | Type                  | Description                                                                                                                               |
| ------------ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `keyPrefix?` | `string \| undefined` | What every entry's key starts with, before the cluster, chain and wallet address; `umbra/nimbus-solana-web/account-secret/` when omitted. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/signature-secret-store.ts`.

## SpendOptions

How `withdraw` and `transfer` run. The relayer sends their transaction, so they take no priority
fee, version or commitment.

| Property            | Type                                      | Description                                                                                                                                                                                                                                                                                                                                                             |
| ------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `follow?`           | `boolean \| undefined`                    | `true`, the default: once the relayer admits the spend, follow it until it lands at `commitment`, then sync the note store, so the result says it landed and the spent notes are no longer reserved; `false`: return at the relayer's admission.                                                                                                                        |
| `commitment?`       | `"confirmed" \| "finalized" \| undefined` | What following the relay waits for: `confirmed` when omitted, or `finalized`.                                                                                                                                                                                                                                                                                           |
| `fees?`             | `"added" \| "deducted" \| undefined`      | `deducted`, the default: the fees come out of `amount`; `added`: they are paid on top.                                                                                                                                                                                                                                                                                  |
| `submitterFee?`     | `bigint \| undefined`                     | The submitter's fee: the relayer's floor when omitted, or an amount offered in base units. The floor includes the relayer's published fee for creating a withdrawal's missing token account when it does not sponsor creating it, and shows in the `prepared` stage's `relayerFee`; an offered amount below what creating it costs is refused with `relay-unavailable`. |
| `submitterFeeMint?` | `Address \| undefined`                    | The mint the submitter's fee is paid in; the spent mint when omitted.                                                                                                                                                                                                                                                                                                   |
| `zone?`             | `NimbusZone \| undefined`                 | The zone the spent notes come from and the outputs go to; zone 0 when omitted.                                                                                                                                                                                                                                                                                          |
| `mergeTimeout?`     | `bigint \| undefined`                     | How many slots each merge may take to land and for its note to become spendable in the note store; 300 when omitted.                                                                                                                                                                                                                                                    |
| `sync?`             | `boolean \| undefined`                    | `true`, the default: sync the note store until it is caught up before starting, so the flow sees every note and spend the indexer has; `false` when the caller has just synced.                                                                                                                                                                                         |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SpendRefusal

Why a spend's preparation stopped short, writing nothing to any service.

```ts
type SpendRefusal =
  | { readonly kind: "insufficient"; readonly available: bigint }
  | { readonly kind: "store-refused"; readonly refusal: WalletStoreRefusal }
  | { readonly kind: "not-registered"; readonly registration: Registration }
  | { readonly kind: "lease-refused"; readonly refusal: LeaseRefusal }
  | { readonly kind: "attempt-refused"; readonly refusal: BeginAttemptRefusal }
  | { readonly kind: "stale-handle" }
  | {
      readonly kind: "store-unavailable";
      readonly detail: Readonly<Record<string, string>>;
    };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/spend/types.ts`.

## SpendSettlement

What following a relayed spend came to:

- `landed`: it reached the commitment followed, and the note store was synced after, `sync`
  saying how that went;
- `failed`: the relayer reported it rejected, expired or failed, with its failure code;
- `pending`: the follow's status reads ran out first, with the last state read; a later sync
  still settles it;
- `not-followed`: `follow: false` was passed.

```ts
type SpendSettlement =
  | {
      readonly kind: "landed";
      readonly signature: Uint8Array;
      readonly sync: NoteStoreSyncResult;
    }
  | {
      readonly kind: "failed";
      readonly state: "rejected" | "expired" | "failed";
      readonly failureCode: string;
    }
  | { readonly kind: "pending"; readonly state: string }
  | { readonly kind: "not-followed" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## StrandedDepositRefundOptions

How `refundStrandedDeposit` runs.

| Property               | Type                                          | Description                                                                                                                           |
| ---------------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `onProgress?`          | `((event: RefundStage) => void) \| undefined` | Called once per stage with what it produced; its throw is dropped.                                                                    |
| `closeTokenAccount?`   | `boolean \| undefined`                        | Whether to close the platform wallet's emptied token account; `false` when omitted.                                                   |
| `priorityFeeLamports?` | `bigint \| undefined`                         | The priority fee, in lamports for the whole transaction; `0n` when omitted.                                                           |
| `transactionVersion?`  | `TransactionVersion \| undefined`             | `1`, one version 1 transaction, when omitted; `0` for a wallet that cannot sign version 1, which needs the deployment's lookup table. |
| `commitment?`          | `ConfirmationCommitment \| undefined`         | What the flow waits for before it reports success; `confirmed` when omitted.                                                          |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## StrandedDepositRefundResult

What refunding a stranded deposit came to:

- `nothing-held`: the platform wallet holds nothing of the mint and no lamports; `holdings` says
  what was read. Nothing was sent.
- `declined`: the wallet declined to sign; nothing was sent.
- `submitted`: the refund was sent; `submission` says where it ended up, and only `landed`
  returned the value. A `failed`, `expired` or `refused` refund may be run again.

```ts
type StrandedDepositRefundResult = RefundOutcome;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SyncedStage

The stage a flow reports once it has synced the note store before it starts, with how the sync
went.

| Property | Type                  | Description                                                                                 |
| -------- | --------------------- | ------------------------------------------------------------------------------------------- |
| `stage`  | `"synced"`            |                                                                                             |
| `sync`   | `NoteStoreSyncResult` | How the sync went: `ingested` or `unregistered`, since an `unavailable` one stops the flow. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SyncFirstOptions

Whether a flow first syncs the note store, until it is caught up.

| Property | Type                   | Description                                                                                                                                                                     |
| -------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sync?`  | `boolean \| undefined` | `true`, the default: sync the note store until it is caught up before starting, so the flow sees every note and spend the indexer has; `false` when the caller has just synced. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## SyncNoteStoreOptions

How much [`syncNoteStore`](https://sdk.nimbusprivacy.xyz/reference/reads#syncnotestore) reads, and what it reports as it goes.

| Property      | Type                                                 | Description                                                                                                                                |
| ------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `maxRounds?`  | `number \| undefined`                                | The most rounds it runs, each reading at most one page of every stream; no limit when omitted, so it runs until every stream is caught up. |
| `signal?`     | `AbortSignal \| undefined`                           | Stops the sync between rounds once aborted, rejecting with the signal's reason.                                                            |
| `pageRows?`   | `number \| undefined`                                | The rows asked for in each page, a whole number from 1 to 1000; 1000 when omitted.                                                         |
| `onProgress?` | `((round: NoteStoreSyncRound) => void) \| undefined` | Called after each round; a throw is ignored.                                                                                               |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/reads.ts`.

## TransactionSubmission

Where a sent transaction ended up. Only `landed` applied it; `failed` charged its fee and applied
nothing else; `expired` and `refused` never land from this send; `unknown` may still land until
its last valid block height, so a caller waits it out before sending the same value again.

```ts
type TransactionSubmission =
  | {
      readonly kind: "landed";
      readonly signature: Uint8Array;
      readonly slot: bigint;
    }
  | {
      readonly kind: "failed";
      readonly signature: Uint8Array;
      readonly slot: bigint;
      readonly error: string;
    }
  | { readonly kind: "expired"; readonly signature: Uint8Array }
  | {
      readonly kind: "refused";
      readonly signature: Uint8Array;
      readonly detail: string;
    }
  | {
      readonly kind: "unknown";
      readonly signature: Uint8Array;
      readonly lastValidBlockHeight: bigint;
      readonly detail: string;
    };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/transaction.ts`.

## TransactionVersion

The transaction format a flow compiles: version 1 (SIMD-0385), the default, or version 0, for a
wallet that cannot sign version 1.

```ts
type TransactionVersion = 0 | 1;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/transaction.ts`.

## TransferContext

The context `transfer` runs in.

| Property  | Type                | Description                                                       |
| --------- | ------------------- | ----------------------------------------------------------------- |
| `flow`    | `"transfer"`        |                                                                   |
| `session` | `NimbusSession`     | The opened session the flow runs for.                             |
| `routing` | `NimbusFlowRouting` | The pool, committee nodes and guardian cluster the transfer uses. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## TransferOptions

How `transfer` runs.

| Property            | Type                                                                           | Description                                                                                                                                                                                                                                                                                                                                                             |
| ------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onProgress?`       | `((event: TransferStage \| SyncedStage \| SettledStage) => void) \| undefined` | Called once per stage with what it produced; its throw is dropped.                                                                                                                                                                                                                                                                                                      |
| `sync?`             | `boolean \| undefined`                                                         | `true`, the default: sync the note store until it is caught up before starting, so the flow sees every note and spend the indexer has; `false` when the caller has just synced.                                                                                                                                                                                         |
| `follow?`           | `boolean \| undefined`                                                         | `true`, the default: once the relayer admits the spend, follow it until it lands at `commitment`, then sync the note store, so the result says it landed and the spent notes are no longer reserved; `false`: return at the relayer's admission.                                                                                                                        |
| `commitment?`       | `"confirmed" \| "finalized" \| undefined`                                      | What following the relay waits for: `confirmed` when omitted, or `finalized`.                                                                                                                                                                                                                                                                                           |
| `fees?`             | `"added" \| "deducted" \| undefined`                                           | `deducted`, the default: the fees come out of `amount`; `added`: they are paid on top.                                                                                                                                                                                                                                                                                  |
| `submitterFee?`     | `bigint \| undefined`                                                          | The submitter's fee: the relayer's floor when omitted, or an amount offered in base units. The floor includes the relayer's published fee for creating a withdrawal's missing token account when it does not sponsor creating it, and shows in the `prepared` stage's `relayerFee`; an offered amount below what creating it costs is refused with `relay-unavailable`. |
| `submitterFeeMint?` | `Address \| undefined`                                                         | The mint the submitter's fee is paid in; the spent mint when omitted.                                                                                                                                                                                                                                                                                                   |
| `zone?`             | `NimbusZone \| undefined`                                                      | The zone the spent notes come from and the outputs go to; zone 0 when omitted.                                                                                                                                                                                                                                                                                          |
| `mergeTimeout?`     | `bigint \| undefined`                                                          | How many slots each merge may take to land and for its note to become spendable in the note store; 300 when omitted.                                                                                                                                                                                                                                                    |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## TransferResult

What transferring came to, each variant as [`SettledSpendOutcome`](https://sdk.nimbusprivacy.xyz/reference/types#settledspendoutcome) lists it; a `relayed`
transfer's note is the recipient's once its settlement is `landed`.

```ts
type TransferResult = SettledSpendOutcome;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## TransferStage

One stage of a one-call transfer, as its `observe` hook is handed it; see `SpendStage`.
Its `prepared` stage's `payee` is the recipient's wallet address.

```ts
type TransferStage = SpendStage<Extract<SpendPayee, { readonly kind: "note" }>>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/transfer/types.ts`.

## WalletConnectionResult

What asking a wallet to connect came to.

- `connected`: the wallet connected, with an account on the SDK's cluster.
- `no-account`: the wallet connected but offered no account on the SDK's cluster.
- `declined`: the user refused to connect.

```ts
type WalletConnectionResult =
  | { readonly kind: "connected"; readonly connected: ConnectedWallet }
  | { readonly kind: "no-account" }
  | { readonly kind: "declined" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/wallets.ts`.

## WalletDiscoveryOptions

Where the installed wallets are read from.

| Property   | Type                                        | Description                                                                                                                                                 |
| ---------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `wallets?` | `Pick<Wallets, "get" \| "on"> \| undefined` | The Wallet Standard registry, as `@wallet-standard/app`'s `getWallets()` returns it, which it defaults to: every wallet an extension registers on the page. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/wallets.ts`.

## WalletStandardAccount

The connected wallet's Solana account, as the Wallet Standard's `WalletAccount` describes it.

| Property    | Type                                 | Description                                                                      |
| ----------- | ------------------------------------ | -------------------------------------------------------------------------------- |
| `address`   | `string`                             | The account's base58 address.                                                    |
| `publicKey` | `Uint8Array<ArrayBufferLike>`        | The account's 32-byte Ed25519 public key.                                        |
| `chains`    | ``readonly `${string}:${string}`[]`` | The CAIP-2 chains the account signs for, such as `solana:mainnet`.               |
| `features`  | ``readonly `${string}:${string}`[]`` | The Wallet Standard features the account supports, such as `solana:signMessage`. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## WalletStandardSigner

A Wallet Standard wallet's connected account and the two features the SDK asks it for, each the
feature's own method: `solana:signMessage`'s `signMessage` and `solana:signTransaction`'s
`signTransaction`.

Opening a session asks only for `signMessage`, and only when the signature secret store holds
no secret; registering and depositing ask for `signTransaction`. A wallet that cannot sign a
version 1 transaction can still sign messages; the flows' version 0 route is for it.

| Property          | Type                                                                                                                                                                                                                 | Description                                                                                                                                                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `account`         | `WalletStandardAccount`                                                                                                                                                                                              | The connected account, which signs and pays.                                                                                                                                                                                                         |
| `signMessage`     | `(...inputs: readonly { readonly account: WalletStandardAccount; readonly message: Uint8Array; }[]) => Promise<readonly { readonly signedMessage: Uint8Array; readonly signature: Uint8Array; }[]>`                  | Signs each message with the account, answering one output per input, in order. When the user declines it rejects with code `4001`, or a message saying the user rejected, denied or cancelled, which the SDK reads as declining rather than failing. |
| `signTransaction` | ``(...inputs: readonly { readonly account: WalletStandardAccount; readonly transaction: Uint8Array; readonly chain: `${string}:${string}`; }[]) => Promise<readonly { readonly signedTransaction: Uint8Array; }[]>`` | Signs each serialized transaction with the account, answering one output per input, in order. Declining rejects as for `signMessage`.                                                                                                                |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/config.ts`.

## WalletStoreRefusal

Why a flow's wallet store would not open for the account's identity: the store's own refusal, a
handle gone stale while its header was read, `unbound` when no identity has been bound to it
(registering binds one), or `other-identity` when another identity has.

```ts
type WalletStoreRefusal =
  | Exclude<OpenNoteStoreResult<unknown>, { readonly kind: "opened" }>
  | StaleHandle
  | { readonly kind: "unbound" }
  | { readonly kind: "other-identity" };
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/wallet-store.ts`.

## WithdrawalContext

The context `withdraw` runs in.

| Property  | Type                | Description                                                         |
| --------- | ------------------- | ------------------------------------------------------------------- |
| `flow`    | `"withdrawal"`      |                                                                     |
| `session` | `NimbusSession`     | The opened session the flow runs for.                               |
| `routing` | `NimbusFlowRouting` | The pool, committee nodes and guardian cluster the withdrawal uses. |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/contexts.ts`.

## WithdrawalResult

What withdrawing came to, each variant as [`SettledSpendOutcome`](https://sdk.nimbusprivacy.xyz/reference/types#settledspendoutcome) lists it: `relayed` with
how following it settled, `refused` before anything was asked of the committee, `relay-refused`,
`unsent`, or `merge-failed` when the notes had to be merged first and a merge did not settle.

```ts
type WithdrawalResult = SettledSpendOutcome;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## WithdrawOptions

How `withdraw` runs.

| Property                 | Type                                                                           | Description                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------ | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `onProgress?`            | `((event: WithdrawStage \| SyncedStage \| SettledStage) => void) \| undefined` | Called once per stage with what it produced; its throw is dropped.                                                                                                                                                                                                                                                                                                      |
| `recipientTokenAccount?` | `Address \| undefined`                                                         | The token account paid; the recipient's associated token account for the mint when omitted, which the relayer creates if missing.                                                                                                                                                                                                                                       |
| `sync?`                  | `boolean \| undefined`                                                         | `true`, the default: sync the note store until it is caught up before starting, so the flow sees every note and spend the indexer has; `false` when the caller has just synced.                                                                                                                                                                                         |
| `follow?`                | `boolean \| undefined`                                                         | `true`, the default: once the relayer admits the spend, follow it until it lands at `commitment`, then sync the note store, so the result says it landed and the spent notes are no longer reserved; `false`: return at the relayer's admission.                                                                                                                        |
| `commitment?`            | `"confirmed" \| "finalized" \| undefined`                                      | What following the relay waits for: `confirmed` when omitted, or `finalized`.                                                                                                                                                                                                                                                                                           |
| `fees?`                  | `"added" \| "deducted" \| undefined`                                           | `deducted`, the default: the fees come out of `amount`; `added`: they are paid on top.                                                                                                                                                                                                                                                                                  |
| `submitterFee?`          | `bigint \| undefined`                                                          | The submitter's fee: the relayer's floor when omitted, or an amount offered in base units. The floor includes the relayer's published fee for creating a withdrawal's missing token account when it does not sponsor creating it, and shows in the `prepared` stage's `relayerFee`; an offered amount below what creating it costs is refused with `relay-unavailable`. |
| `submitterFeeMint?`      | `Address \| undefined`                                                         | The mint the submitter's fee is paid in; the spent mint when omitted.                                                                                                                                                                                                                                                                                                   |
| `zone?`                  | `NimbusZone \| undefined`                                                      | The zone the spent notes come from and the outputs go to; zone 0 when omitted.                                                                                                                                                                                                                                                                                          |
| `mergeTimeout?`          | `bigint \| undefined`                                                          | How many slots each merge may take to land and for its note to become spendable in the note store; 300 when omitted.                                                                                                                                                                                                                                                    |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/flows.ts`.

## WithdrawStage

One stage of a one-call withdrawal, as its `observe` hook is handed it; see `SpendStage`.
Its `prepared` stage's `payee` is the token account paid and, when the relayer creates it, its
owner.

```ts
type WithdrawStage = SpendStage<
  Extract<SpendPayee, { readonly kind: "payout" }>
>;
```

Generated from the TSDoc in `sdks/typescript/nimbus-solana/src/flows/withdraw/types.ts`.

## WitnessGraphHandle

One parsed witness graph, held by the witness-graph WASM until `free` releases it.

| Property  | Type                                 | Description                                                                                                                                                                                                                          |
| --------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `witness` | `(inputsJson: string) => Uint8Array` | Computes the witness, in `.wtns` binary form, for the circuit's inputs written as JSON with each field element a decimal string. Throws when an input is missing, extra or misshapen, or when the inputs do not satisfy the circuit. |
| `free`    | `() => void`                         | Releases the graph's WASM memory.                                                                                                                                                                                                    |

Generated from the TSDoc in `sdks/typescript/nimbus-solana-web/src/prover-worker.ts`.


Last updated 21 October 2026
