Skip to main content

Introduction

Signing authorizes an operation through a chosen wallet role and prepares the instructions for a Solana transaction.
  • Use when: you have instructions for a transfer, swap, or program call that the wallet should execute.
  • For: apps combining Swig authorization with Solana transaction construction.

How it works

  1. Build the inner operation with the wallet address as source or asset owner.
  2. Fetch current wallet state and choose a role with the required permissions.
  3. Call getSignInstructions with the role, inner instructions, and final fee payer.
  4. Collect the required transaction signatures, then send every returned instruction in order.

Who approves

The payer and authority may be different. Set the payer before requesting authorization and preserve the approved operation.

SDK example

Ed25519 signer

Prepare a 0.001 SOL transfer. The selected role needs System Program access and sufficient SOL allowance, or All permission.
The false argument selects the wallet rather than a subaccount. This returns instructions; Sending transactions handles signing and submission.

Secp256r1 and Secp256k1 signers

Use the callback from Secp256r1 or Secp256k1. Supply the instructions your wallet should execute:
  • Include all returned verification instructions in their original order.
  • If the operation or signer state changes, refetch and request fresh authorization.
  • Follow ProgramExec for program-supplied approval.