Skip to content

AccountConfig.getAddress

Derives the stable configurable account address.

The address is the last 20 bytes of the keccak256 hash of the initial config, encoded with fixed-width big-endian fields, not RLP: keccak256("tempo:configurable-account:account" || salt || uint8(threshold) || uint8(owners.length) || owners).

The address is derived once from the initial version-0 config. Config updates do not change it.

Imports

Named
import { AccountConfig } from 'ox/tempo'

Examples

import { AccountConfig } from 'ox/tempo'
 
const initialConfig = AccountConfig.from({
  owners: [
    { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
  ],
  threshold: 1,
})
 
const address = AccountConfig.getAddress(initialConfig)

Definition

function getAddress(
  config: Input,
): Address.Address

Source: src/tempo/AccountConfig.ts

Parameters

config

  • Type: Input

The initial account config.

config.owners

  • Type: readonly Owner[]

Weighted owner list (strictly ascending by owner address).

config.salt

  • Type: 0x${string}
  • Optional

Caller-chosen 32-byte salt mixed into the derived account address. Defaults to the zero salt (AccountConfig.zeroSalt) when omitted.

config.threshold

  • Type: numberType

Minimum total owner weight required to authorize a transaction.

config.version

  • Type: versionType
  • Optional

Configuration version as a safe integer or bigint. Defaults to 0n.

Return Type

The configurable account address.

Address.Address