Skip to main content

Introduction

Adding a role pairs a new authority with the permissions it may use on an existing wallet.
  • Use when: another signer needs limited access to wallet assets.
  • For: apps delegating spending to a user, service, or automation.

How it works

  1. Connect the signer for a role with authority-management permission.
  2. Encode the new authority and a permission set for its task.
  3. Submit addRole and wait for a successful receipt.
  4. Read the assigned role ID from RoleAdded and retain it for later operations.

Role fields

A fixed allowance decreases with successful spending; it is not a per-transaction limit or a deposit. Amounts fit uint64. Fund the wallet’s vault separately.

SDK example

This creates a native-currency spending role without role-management permission. The connected manager pays gas. Supply 100n for a total allowance of 100 wei.
Use the confirmed ID, not a predicted counter. Read the role to verify its authority and permissions before using the delegate. Complete examples: TypeScript, Rust, Python.