Skip to main content
Transfer tokens privately to one or more Unlink addresses. The sender is the account bound to your user client. See Quickstart. Sender, recipient, and amount are all hidden by a zero-knowledge proof; see How Unlink works. The transfer() method signs with the spending key from the account bound to createUnlinkClient. All public account constructors support private transfers.

Single recipient

const tx = await client.transfer({
  recipientAddress: "unlink1...",
  token: "0xTokenAddress",
  amount: "500000000000000000",
});

const confirmed = await tx.wait();
console.log(confirmed.confirmationStatus); // "confirmed" | "processed" | "failed"
confirmed means the transaction has been observed; it does not always mean new private funds are spendable. If your next action spends funds from a recent deposit or transfer, check confirmed.fundsUsable or wait with tx.wait({ until: "processed" }).

Multiple recipients

const tx = await client.transfer({
  token: "0xTokenAddress",
  transfers: [
    { recipientAddress: "unlink1aaa...", amount: "100000000000000000" },
    { recipientAddress: "unlink1bbb...", amount: "200000000000000000" },
  ],
});

await tx.wait(); // resolves at user-facing confirmation by default

Parameters

Single recipient:
  • recipientAddress: recipient Unlink address.
  • token: ERC-20 token address.
  • amount: amount in the token’s smallest unit.
Multiple recipients:
  • token: ERC-20 token address.
  • transfers: list of recipients and amounts.
Returns: a TransactionHandle. See Transaction status.