accounts.deriveAccount
Derives a configurable account address from an initial config with the configurable account precompile. The precompile validates the config and derives the address from its hash.
To derive the address without a network request, use
Account.fromConfig with address: 'infer'.
Usage
import { } from './viem.config'
const = await ..({
: [
{ : '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', : 1 },
{ : '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', : 1 },
],
: 2,
})
'0x...'import { , } from 'viem/tempo'
export const = .({
: .('0x...'),
})Return Value
Address
The configurable account address.
Parameters
owners
- Type:
readonly { owner: Address; weight: number }[]
The initial owners. Owners are normalized into canonical address order.
await ..({
: [{ : '0x...', : 1 }],
: 1,
})salt
- Type:
Hex - Default:
0x0000000000000000000000000000000000000000000000000000000000000000
The 32-byte config salt.
await ..({
: [{ : '0x...', : 1 }],
: '0x0000000000000000000000000000000000000000000000000000000000000001',
: 1,
})threshold
- Type:
number
The approval weight required to authorize the account.
await ..({
: [{ : '0x...', : 1 }],
: 1,
})blockNumber (optional)
- Type:
bigint
Block number to read the state from.
blockOverrides (optional)
- Type:
BlockOverrides
Block overrides to apply to the state.
blockTag (optional)
- Type:
BlockTag
Block tag to read the state from.
stateOverride (optional)
- Type:
StateOverride
State override to apply.