Module account_keychain

Module account_keychain 

Source

Modules§

IAccountKeychain
Account Keychain interface for managing authorized keys
__packing_authorized_key
dispatch
slots

Structs§

AccountKeychain
AuthorizedKey
Key information stored in the precompile
KeyInfo
Key information structure
TokenLimit
Token spending limit structure
authorizeKeyCall
Authorize a new key for the caller’s account @param keyId The key identifier (address derived from public key) @param signatureType 0: secp256k1, 1: P256, 2: WebAuthn @param expiry Block timestamp when the key expires (u64::MAX for never expires) @param enforceLimits Whether to enforce spending limits for this key @param limits Initial spending limits for tokens (only used if enforceLimits is true) Function with signature authorizeKey(address,uint8,uint64,bool,(address,uint256)[]) and selector 0x54063a55.
getKeyCall
Get key information @param account The account address @param publicKey The public key @return Key information Function with signature getKey(address,address) and selector 0xbc298553.
getRemainingLimitCall
Get remaining spending limit @param account The account address @param publicKey The public key @param token The token address @return Remaining spending amount Function with signature getRemainingLimit(address,address,address) and selector 0x63b4290d.
getTransactionKeyCall
Get the key used in the current transaction @return The keyId used in the current transaction Function with signature getTransactionKey() and selector 0xb07fbc1a.
revokeKeyCall
Revoke an authorized key @param publicKey The public key to revoke Function with signature revokeKey(address) and selector 0x5ae7ab32.
updateSpendingLimitCall
Update spending limit for a key-token pair @param publicKey The public key @param token The token address @param newLimit The new spending limit Function with signature updateSpendingLimit(address,address,uint256) and selector 0xcbbb4480.

Enums§

SignatureType

Constants§

TRANSACTION_KEY_SLOT 🔒
Transient storage slot for the transaction key Using slot 0 since there’s only one transaction key at a time

Functions§

compute_keys_slot
Compute the storage slot for keys[account][key_id]