Reserved funds
The two functions that list what stopped payments hold and give it back.
A payment that stops halfway can keep part of the balance reserved. Reserved funds shows a list of those payments and a Release button.
listReservedSpends
Use it to show what part of the balance is held, and by which payments.
function listReservedSpends(
session: NimbusSession,
_args?: Readonly<Record<string, never>>,
): Promise<readonly ReservedSpend[]>;Types used: NimbusSession, ReservedSpend
Example
import { } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
declare const : NimbusSession;
const = (await (, {})).(() => . === "unsent");Parameters
Prop
Type
Returns
Promise<readonly ReservedSpend[]>
The spends; none for a session whose store holds nothing yet.
NimbusSdkError with reason "unreadable" when the store was replaced while it was
read or cannot be read back; "unsupported-browser" when the browser refuses it.
Lists the spends holding the session's notes, in id order: what readBalances counts as
reserved.
Reads only the session's note store; nothing is fetched. A spend that stopped without finishing,
because its tab closed or a step failed, holds its notes until it is released, here or by the
store once its holder's lock is gone. A deposit is listed, as deposit, only while it holds the
notes it merges.
Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/reserved.ts.
releaseReservedNotes
Use it behind a Release button, for payments that are not running.
function releaseReservedNotes(
session: NimbusSession,
_args?: Readonly<Record<string, never>>,
options?: { readonly spendId?: string; readonly force?: boolean },
): Promise<ReleasedNotes>;Types used: NimbusSession, ReleasedNotes
Example
import { } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
declare const : NimbusSession;
const { , , } = await (, {});Parameters
Prop
Type
Returns
Promise<ReleasedNotes>
The spends released at once, those settling, each as it stands after the release, and those left running.
NimbusSdkError with reason "service-unavailable" when the RPC cannot be reached
for the confirmed slot; "unreadable" when the store was replaced while it was written, cannot
be read back, or kept losing to other writers; "unsupported-browser" when the browser refuses
it.
Releases the spends holding the session's notes, or one of them: no attempt of a released spend begins or is sent again.
An unsent spend's notes are free at once. A spend that may have been sent keeps its notes until
that attempt lands, which completes the payment, or can no longer land, since spending them again
meanwhile could race it. A deposit whose transaction may still land is released the same way;
resolvePendingDeposit still settles it afterwards, and a failed or expired resolution
then answers its intent as settled, since the release already stopped it. A spend a tab of this origin is still running, which holds
its lock, is left alone and returned as running unless force is set: released, it would fail
at its next step. A browser that cannot list its locks reports no spend as running. Releasing
what is already released, or an id that names no reserved spend, changes nothing.
Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/reserved.ts.
Last updated