Skip to main content
Most app flows start with a wallet handle, then prepare one movement at a time.

Start from a wallet handle

Attach to an existing wallet with the config address, wallet address, and the authority that should sign on the client:
const wallet = swig.wallets.use({
  swigConfigAddress,
  walletAddress,
  requesterAuthority: {
    ed25519: {
      publicKey: userPublicKey,
    },
  },
});
The same handle shape works for secp256k1 and secp256r1 authorities too. If you already have an IDP session, the same model works through swig.wallets.fromIdpSession(session).

SOL transfer

const preparedTransfer = await wallet.transfer.sol({
  feePayer,
  destination,
  amount: 1_000_000n,
});

Token transfer

Token transfers are owner-based. The backend derives the token program, source ATA, destination ATA, and any destination ATA creation it needs.
const preparedTokenTransfer = await wallet.transfer.token({
  feePayer,
  mint,
  destinationOwner,
  amount: 10_000n,
});

How to read the result

Prepared results are intentionally split:
FieldMeaning
transactionsordered transactions to submit
clientAuthorityTransactionstransactions that still need client authority
feePayerOnlyTransactionstransactions that only need fee payer or sponsor submission
signatureRequestsper-transaction signature metadata

Submission

Use Client Signing for the signing step, then use Sponsor & Submit or your own send path to finish submission.