# 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.

[TIP-1107](https://tips.sh/1107) · [TIP-1114](https://tips.sh/1114)

## Examples

```ts twoslash
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, {
  factory: '0x7171717171717171717171717171717171717171'
})
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`AccountConfig.assert`](/tempo/reference/AccountConfig/assert) | Asserts that an [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#config) is valid. |
| [`AccountConfig.from`](/tempo/reference/AccountConfig/from) | Normalizes an [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#config). |
| [`AccountConfig.fromRpc`](/tempo/reference/AccountConfig/fromRpc) | Converts a JSON-RPC account configuration to its domain representation. |
| [`AccountConfig.fromTuple`](/tempo/reference/AccountConfig/fromTuple) | Converts an RLP [`AccountConfig.Tuple`](/tempo/reference/AccountConfig/types#tuple) back to a [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#config). |
| [`AccountConfig.getAddress`](/tempo/reference/AccountConfig/getAddress) | Derives the stable configurable account address. |
| [`AccountConfig.getCommitment`](/tempo/reference/AccountConfig/getCommitment) | Computes the commitment for an account configuration. |
| [`AccountConfig.getSignPayload`](/tempo/reference/AccountConfig/getSignPayload) | Computes the digest a configurable account owner approves (signs). |
| [`AccountConfig.toRpc`](/tempo/reference/AccountConfig/toRpc) | Converts an account configuration to its JSON-RPC representation. |
| [`AccountConfig.toTuple`](/tempo/reference/AccountConfig/toTuple) | Converts a [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#config) to its RLP tuple form. |
| [`AccountConfig.update`](/tempo/reference/AccountConfig/update) | Derives the configuration that replaces the current one in an owner update. |
| [`AccountConfig.validate`](/tempo/reference/AccountConfig/validate) | Validates an [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#config). Returns `true` if valid, `false` otherwise. |

## Errors

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`AccountConfig.InvalidConfigError`](/tempo/reference/AccountConfig/errors#accountconfiginvalidconfigerror) | Thrown when an account config is invalid. |

## Types

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#accountconfigconfig) | Complete account configuration witness. |
| [`AccountConfig.Input`](/tempo/reference/AccountConfig/types#accountconfiginput) | Input accepted when constructing an account configuration. |
| [`AccountConfig.Owner`](/tempo/reference/AccountConfig/types#accountconfigowner) | Account config owner entry. |
| [`AccountConfig.Rpc`](/tempo/reference/AccountConfig/types#accountconfigrpc) | JSON-RPC representation of an account configuration. |
| [`AccountConfig.Tuple`](/tempo/reference/AccountConfig/types#accountconfigtuple) | RLP tuple representation of a [`AccountConfig.Config`](/tempo/reference/AccountConfig/types#config). |
