Registration
The three functions that check and complete a user's one-time registration.
A user registers once before their first deposit. Register a user walks through the flow.
readRegistration
Use it to learn whether the user is registered now. The session's own registration is fixed when
the session opens.
function readRegistration(
session: NimbusSession,
_args?: Readonly<Record<string, never>>,
): Promise<NimbusRegistrationStanding>;Types used: NimbusSession, NimbusRegistrationStanding
Example
import { } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
declare const : NimbusSession;
const = await (, {});
if (. === "registered") {
.(`registered in pool ${(.)}`);
}Parameters
Prop
Type
Returns
Promise<NimbusRegistrationStanding>
registered or unregistered, with the pool the standing is for.
NimbusSdkError with reason "service-unavailable" when the context API cannot be
reached, or "unreadable" when it answers what cannot be read.
Reads the session's registration standing again, from the context API: what register changed,
which the session's own registration, fixed when it opened, does not show.
Call it after register lands to learn the identity is registered without reopening the
session. The standing is for pool 0, as the session's is.
Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/session.ts.
createRegistrationContext
Create one before you call register. It picks the pool the user registers in.
function createRegistrationContext(
session: NimbusSession,
options?: RegistrationContextOptions,
): Promise<RegistrationContext>;Types used: NimbusSession, RegistrationContextOptions, RegistrationContext
Example
import { , } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
declare const : NimbusSession;
const = await (await (), {});Parameters
Prop
Type
Returns
Promise<RegistrationContext>
The context.
NimbusSdkError with reason "misconfigured" when an option is out of range or no
pool is open; "service-unavailable" or "unreadable" when the RPC cannot be read.
Creates the context a session registers in.
Without options.poolIndex the pools' accounts are read from the RPC once, and the highest open
pool is chosen; the data endorser node and guardian cluster default to the cluster's preset.
Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/contexts.ts.
register
Use it once per user, while readRegistration says unregistered.
function register(
context: RegistrationContext,
_args?: Readonly<Record<string, never>>,
options?: RegisterOptions,
): Promise<RegistrationResult>;Types used: RegistrationContext, RegisterOptions, RegistrationResult
Example
import { , } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
declare const : NimbusSession;
const = await (await (), {}, {
: () => {
.(.);
},
});Parameters
Prop
Type
Returns
Promise<RegistrationResult>
complete when the identity was registered and bound already, with nothing sent;
submitted with the instructions sent and where the transaction ended up, which registered
only when its submission.kind is landed; declined when the wallet declined to sign; or
store-refused when the note store would not open for the identity.
NimbusSdkError with reason "service-unavailable" or "unreadable" when a
service or the RPC cannot answer, "unauthorized" when a gateway service refuses the session's
gateway token or the session has none, "dependency-nonconforming" when a proving key or the
prover breaks its contract, "wallet-unsupported" when the wallet fails, and "misconfigured"
when no prover worker or committee endpoint was configured; NimbusSolanaFlowError,
which isNimbusSolanaFlowError recognises, when the protocol refuses the registration,
with reason "fee-payer-unfunded" when the connected wallet has no account or too few
lamports to pay the transaction's fee and keep its rent-exempt minimum, raised before any
proving key is downloaded or the committee is asked.
Registers the session's identity in the context's pool and binds the connected wallet to its platform wallet, in one transaction the wallet signs, sending only what is still missing.
Reads the identity's standing from the context API, asks the guardians and the data endorser to
endorse it, proves it, has the wallet sign once and sends it. An identity already registered and
bound is complete with nothing sent.
Generated from the TSDoc in sdks/typescript/nimbus-solana-web/src/flows.ts.
Last updated