Skip to content
API reference

Transfer

The two functions a Private Send uses, its context and the payment itself.

A Private Send runs in a context made from the session. Private Send walks through the flow.

createTransferContext

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

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

Types used: NimbusSession, NimbusContextOptions, TransferContext

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

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.

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

Types used: TransferContext, TransferOptions, TransferResult

Example

import { ,  } from "@umbra/nimbus-solana-web";
import type { NimbusSession } from "@umbra/nimbus-solana-web";
import type {  } from "@solana/kit";

declare const : NimbusSession;
declare const : ;
declare const : ;
const  = await (await (), {
  : 250_000n,
  ,
  : ,
});

Parameters

Prop

Type

Returns

Promise<TransferResult>

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

Last updated

On this page