Skip to main content

Introduction

A ProgramExec authority accepts approval from a Solana program for a wallet operation.
  • Use when: an existing policy or approval integration decides whether an operation may proceed.
  • For: apps consuming an integration that supplies ProgramExec approval instructions.

How it works

  1. Obtain the integration’s program ID and authorization instruction prefix.
  2. Create a role pairing that authority with the required wallet permissions.
  3. Ask the integration for an approval bound to the exact wallet operation.
  4. Pass the approval to the Swig builder, then submit the complete returned instruction list.

Approval contract

  • The authorization prefix fits within 40 bytes; use the integration’s exact value.
  • For wallet execution, the approval instruction’s first two accounts are the Swig config and wallet, in that order.
  • The builder accepts one approval instruction in preInstructions and includes it in its output.
  • Other management operations can have different approval account requirements; follow the integration’s client.

SDK example

Register the integration

Pass this authority to Add a role with the permissions the integration needs.

Authorize an operation

Supply a freshly fetched swig, its ProgramExec role ID, and the integration’s approval for walletInstructions.
Send the returned list once, in order, with the payer and any signers required by the integration. The role’s permissions still apply. Use Sessions if the integration should approve a temporary application key.