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.

Withdraw tokens from the unlink contract to any EVM address. Tokens are withdrawn from the account bound to your unlink session (set via tenant.forUser({ account }), see Quickstart). withdraw() 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.
const result = await unlink.withdraw({
  recipientEvmAddress: "0xRecipient",
  token: "0xTokenAddress",
  amount: "500000000000000000",
  signSigningRequest: (req) =>
    signSigningRequest(req, accountKeys.spendingPrivateKey),
});

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

Parameters

ParameterTypeRequiredDescription
recipientEvmAddressstringYesDestination EVM address
tokenstringYesERC-20 token address
amountstringYesAmount in wei
signSigningRequestSignSigningRequestFnYesCallback that signs the prepared transaction
Returns: { txId: string; status: string }