Skip to main content

Introduction

A role combines an authority with the actions it may perform. Use a separate role for each person, service, or participant set that needs wallet access. This lets an administrator grant a spending budget without sharing root access. Adding a role prepares a transaction. The existing administrator signs it; the new authority becomes usable after confirmation.

SDK examples

Add a scoped SOL-transfer role

This role can invoke the System Program and spend a total of 1,000,000 lamports. Both actions are required: program access and asset spending are checked separately. Each successful transfer reduces the remaining one-time budget. Use the clients from Client setup. signAndSubmit / sign_and_submit is your application’s signing, submission, and confirmation helper, not an SDK method. Rust address inputs are Pubkey values.

Confirm the role

Use the returned role data to display existing authority and allowance. Rust decodes permissions into typed variants.

Input

TypeScript/Python use public-key strings. Rust uses Pubkey for Ed25519 and compressed 33-byte SEC1 keys for secp256k1/secp256r1. A new ParticipantSet role takes the set address without a role ID (role_id: None in Rust). Swig assigns the new role ID.

Output

TypeScript fields are shown below; Python uses snake_case names. Use the read after confirmation to verify the grant. Saved policy metadata is separate. Rust returns native typed authority and permission values through its role-list result. Use the returned role ID when preparing an operation for a participant set.

Errors