authority of a { destination: { chain, authority } }
transaction, which then runs through prepareTransaction,
signTransaction and submitTransaction like any other. The configured
owner signs the change, and the new role gets the next free role id.
Only the public key is used; it is SEC1-compressed and lowercased. An
uncompressed key must lie on secp256k1. Pass the public key of the signer an
account will be configured with as { type: 'ecdsa', account }: a compressed
key from another curve cannot be told apart, and would install a role no one
can sign for. An EVM address is refused, never read as a key.
The example assumes an authenticated sdk, an existing passkey-root
account with authority-management permission, its saved swig address,
a viem recoverySigner and its matching secp256k1 recoveryPublicKey, and
a viem WebAuthn newPasskey. Authority changes are intrinsically sponsored;
integrator sponsorship must be enabled. Do not add a sponsored flag.
Import
Usage
Parameters
`0x${string}` | {}
required
The key to add: a viem local account, or its secp256k1 public key
as 33-byte compressed, 65-byte uncompressed or 64-byte x‖y hex.
{ permission: SolanaAuthorityPermission }
required
permission, what the new role may do (required, no default):
allButManageAuthority spends and runs instructions; manageAuthority adds
and removes non-root authorities but never spends; all does both. Either
permission that manages authorities can grant all, so it controls the wallet.Returns
A frozenSolanaAuthorityChange for prepareTransaction
'add'
required
SolanaAuthorityKey
required
SolanaAuthorityPermission
required