> 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.

# Transfer (/reference/transfer)

A Private Send runs in a context made from the session. [Private Send](https://sdk.nimbusprivacy.xyz/transfer) walks through
the flow.

## createTransferContext

Create one from the session before a Private Send. It picks the pool the payment uses.

```ts
function createTransferContext(
  session: NimbusSession,
  options?: NimbusContextOptions,
): Promise<TransferContext>;
```

Creates the context a session transfers in.

Without `options.poolIndex` the pools' accounts are read from the RPC once, and the highest open
pool is chosen; the nodes and guardian cluster default to the cluster's preset.

**Parameters**

| Parameter  | Type                   | Description                                                               |
| ---------- | ---------------------- | ------------------------------------------------------------------------- |
| `session`  | `NimbusSession`        | The opened session.                                                       |
| `options?` | `NimbusContextOptions` | The pool, the screener and data endorser nodes, and the guardian cluster. |

**Returns**

`Promise<TransferContext>`

The context.

**Throws**

[`NimbusSdkError`](https://sdk.nimbusprivacy.xyz/reference/errors#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.

**Example**

```ts
import { createTransferContext } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";

declare const session: NimbusSession;
const context = await createTransferContext(session);
```

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

## transfer

Use it to pay another registered user from the private balance, so the tokens arrive in theirs.

```ts
function transfer(
  context: TransferContext,
  args: {
    readonly mint: Address;
    readonly amount: bigint;
    readonly recipient: Address;
  },
  options?: TransferOptions,
): Promise<TransferResult>;
```

Transfers `amount` of `mint` from the session's notes in the context's pool to `recipient`, a
registered identity's wallet address, as a note sealed to its identity, through the relayer.

The context API resolves the recipient to its identity; a wallet that has not registered is
refused with reason `"recipient-unregistered"` before any note is merged or anything relayed.
Syncs first, spends, and follows the relay as [`withdraw`](https://sdk.nimbusprivacy.xyz/reference/withdraw#withdraw) does, merging notes first when it
must.

**Parameters**

| Parameter  | Type                                                                                                                                                                                                                                                                                                                                                                                                     | Description                                                                                                         |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `context`  | `TransferContext`                                                                                                                                                                                                                                                                                                                                                                                        | The transfer context.                                                                                               |
| `args`     | ``{ /** The mint transferred, of the session's notes. */ readonly mint: Address; /** * In base units of the mint: under `fees: "deducted"` what leaves the session's notes, every * fee taken from it; under `added`, what the recipient's note holds. */ readonly amount: bigint; /** A registered identity's wallet address, whose identity the note is sealed to. */ readonly recipient: Address; }`` | The mint, the amount in its base units, and the recipient's wallet address.                                         |
| `options?` | `TransferOptions`                                                                                                                                                                                                                                                                                                                                                                                        | As [`withdraw`](https://sdk.nimbusprivacy.xyz/reference/withdraw#withdraw) takes them, less the token account paid. |

**Returns**

`Promise<TransferResult>`

As [`withdraw`](https://sdk.nimbusprivacy.xyz/reference/withdraw#withdraw) returns, the payee's note known made once the settlement is
`landed`.

**Throws**

[`NimbusSdkError`](https://sdk.nimbusprivacy.xyz/reference/errors#nimbussdkerror) as [`withdraw`](https://sdk.nimbusprivacy.xyz/reference/withdraw#withdraw) throws, and with reason
`"recipient-unregistered"` when the context API answers that `recipient` has no registration in
the pool; [`NimbusSolanaFlowError`](https://sdk.nimbusprivacy.xyz/reference/types#nimbussolanaflowerror) when the protocol refuses the transfer.

**Example**

```ts
import { createTransferContext, transfer } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
import type { Address } from "@solana/kit";

declare const session: NimbusSession;
declare const mint: Address;
declare const friend: Address;
const result = await transfer(await createTransferContext(session), {
  amount: 250_000n,
  mint,
  recipient: friend,
});
```

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


Last updated 21 October 2026
