wallet.roles.add() to prepare a transaction that attaches a new authority
and its permitted actions to an existing Swig wallet. Your application signs
and submits the transaction.
Choose the actions from the Permissions
reference, then follow this guide to add the role.
General role creation is available in TypeScript 0.10.0 and Python 0.9.0.
Before you begin
You need:- an existing Swig config address
- the fee payer public key
- an existing Ed25519 or secp256r1 requester authority whose role includes
manageAuthorityorall - the public authority value for the new role
- one or more actions for the new role
signAndSubmit /
sign_and_submit represents your application-owned signing, RPC submission,
and confirmation helper.
Add a scoped SOL-transfer role
This example gives a new Ed25519 authority permission to transfer up to 1,000,000 lamports through Solana’s System Program.TypeScript
program permits the System Program
invocation, while solLimit provides the role’s remaining one-time SOL budget.
Each successful transfer decrements that budget. SignV2 checks program access
and SOL spending independently, so the transfer needs both permissions.
For other operations, choose the required actions and fields from
Permissions.
Choose the new authority
The new role may use any of these authority shapes:
For a ParticipantSet role, create the set first and pass its address without a
role ID. Adding the authority creates a new role whose ID is assigned by Swig.
Continue to Participant Sets for member
approval collection and compilation.
The authority being added may use any supported shape above. The existing
authority requesting the add-role operation must use Ed25519 or secp256r1.
Confirm the role
The add-role call returns a prepared transaction; it does not broadcast or confirm it. After your signing helper submits the transaction and it lands, read the wallet roles to confirm the new authority and actions.TypeScript
Request boundaries
- Supply at least one action.
- Use an existing Ed25519 or secp256r1 authority as the requester.
- Pass a ParticipantSet address without a role ID when adding it as the new authority.
- Add the transaction-level signatures required by the serialized transaction before submission.
What to read next
Participant Sets
Add M-of-N threshold authorization to a role
Transfer SOL and Tokens
Use a configured role for wallet transfers
Permissions
Look up available actions, fields, and units
Sponsor & Submit
Submit application-signed transactions

