Skip to main content

Introduction

A transfer sends SOL or tokens from the wallet using a role with the matching asset allowance.
  • Use when: your application pays a recipient from wallet-owned funds.
  • For: payment flows, withdrawal screens, and automated disbursements.

How it works

  1. Fetch the wallet and use its wallet address as the source or token-account owner.
  2. Choose a role with access to the transfer program and the required spending budget.
  3. Build the transfer in integer base units and authorize it through Swig.
  4. Sign, submit, and confirm the returned transaction instructions.

Transfer inputs

For tokens, create the recipient token account first if it does not exist. This example uses the original SPL Token program.

SDK example

SOL

The SOL signing example builds a 0.001 SOL transfer. Send its result using Sending transactions.

SPL tokens

Install the token client:
Supply the mint, an existing destination token account for that mint, and an amount in base units. The function reads the mint’s decimals and uses the wallet’s associated token account as the source.
  • true allows the wallet’s program-derived address to own the associated token account.
  • Grant tokenLimit({ mint, amount }) or a matching recurring/destination permission alongside Token Program access.
  • This example uses an Ed25519 role. Other authorities supply their signing options.
  • Send and confirm the returned instructions with the role signer and payer.