Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.unlink.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Transfer tokens privately to one or more Unlink addresses. The sender is the account bound to your unlink session (set via tenant.forUser({ account }), see Quickstart). Sender, recipient, and amount are all hidden by a zero-knowledge proof. transfer() needs a signSigningRequest callback. In a single-process script, call the SDK’s signSigningRequest helper with the user’s spending key. In a Tenant + browser setup, the Tenant callback forwards the signing request to the browser and returns the browser’s signature.

Single recipient

const result = await unlink.transfer({
  recipientAddress: "unlink1...",
  token: "0xTokenAddress",
  amount: "500000000000000000",
  signSigningRequest: (req) =>
    signSigningRequest(req, accountKeys.spendingPrivateKey),
});

const confirmed = await unlink.pollTransactionStatus(result.txId);

Multiple recipients

const result = await unlink.transfer({
  token: "0xTokenAddress",
  transfers: [
    { recipientAddress: "unlink1aaa...", amount: "100000000000000000" },
    { recipientAddress: "unlink1bbb...", amount: "200000000000000000" },
  ],
  signSigningRequest: (req) =>
    signSigningRequest(req, accountKeys.spendingPrivateKey),
});

Parameters

Single recipient:
ParameterTypeRequiredDescription
recipientAddressstringYesRecipient Unlink address (unlink1...)
tokenstringYesERC-20 token address
amountstringYesAmount in the token’s smallest unit (wei for 18-decimal tokens)
signSigningRequestSignSigningRequestFnYesCallback that signs the prepared transaction
Multiple recipients:
ParameterTypeRequiredDescription
tokenstringYesERC-20 token address
transfersArray<{ recipientAddress: string; amount: string }>YesList of recipients and amounts
signSigningRequestSignSigningRequestFnYesCallback that signs the prepared transaction
Returns: { txId: string; status: string }