AccountConfig
Configurable account configuration utilities (TIP-1107).
Configurable accounts have weighted owners and an approval threshold that can change without changing the account address. Derives the stable account address from the initial configuration, computes configuration commitments, and computes the owner approval digest that owners sign.
Examples
import { AccountConfig } from 'ox/tempo'
const initialConfig = AccountConfig.from({
threshold: 2,
owners: [
{ owner: '0x1111111111111111111111111111111111111111', weight: 1 },
{ owner: '0x2222222222222222222222222222222222222222', weight: 1 },
],
})
const account = AccountConfig.getAddress(initialConfig)Functions
| Name | Description |
|---|---|
AccountConfig.assert | Asserts that an AccountConfig.Config is valid. |
AccountConfig.from | Normalizes an AccountConfig.Config. |
AccountConfig.fromRpc | Converts a JSON-RPC account configuration to its domain representation. |
AccountConfig.fromTuple | Converts an RLP AccountConfig.Tuple back to a AccountConfig.Config. |
AccountConfig.fromUpgrade | Derives the configuration an existing account installs when it migrates in place with the upgradeAccount precompile call (TIP-1113). |
AccountConfig.getAddress | Derives the stable configurable account address. |
AccountConfig.getCommitment | Computes the commitment for an account configuration. |
AccountConfig.getSignPayload | Computes the digest a configurable account owner approves (signs). |
AccountConfig.toRpc | Converts an account configuration to its JSON-RPC representation. |
AccountConfig.toTuple | Converts a AccountConfig.Config to its RLP tuple form. |
AccountConfig.update | Derives the configuration that replaces the current one in an owner update. |
AccountConfig.validate | Validates an AccountConfig.Config. Returns true if valid, false otherwise. |
Errors
| Name | Description |
|---|---|
AccountConfig.InvalidConfigError | Thrown when an account config is invalid. |
Types
| Name | Description |
|---|---|
AccountConfig.Config | Complete account configuration witness. |
AccountConfig.Input | Input accepted when constructing an account configuration. |
AccountConfig.Owner | Account config owner entry. |
AccountConfig.Rpc | JSON-RPC representation of an account configuration. |
AccountConfig.Tuple | RLP tuple representation of a AccountConfig.Config. |

