Skip to content
LogoLogo

accounts.getConfig

Gets the account config that matches an account's current onchain commitment.

The coordinator caches configs after validating transaction approvals. It returns null when the current config is not cached. Chain state remains authoritative.

Use withRelay with an accounts plugin for local coordination, or with a remote transport to read from a relay coordinator.

Usage

import { client } from './viem.config'
 
const config = await client.accounts.getConfig({
  address: '0x7b378778e4b0dfd068bc74979508219e2ba2074c',
})

The client uses the same lookup when a coordinated request passes an address-only account:

import { Account } from 'viem/tempo'
import { client } from './viem.config'
 
const owner = Account.fromSecp256k1(
  '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
)
const account = Account.fromConfig(
  '0x7b378778e4b0dfd068bc74979508219e2ba2074c'
)
 
const pending = await client.sendTransactionSync({
  account,
  calls: [{ data: '0xdeadbeef', to: '0xcafebabecafebabecafebabecafebabecafebabe' }],
  owner,
})

An address-only account contains no local owner keys. Pass the local signer through owner.

Return Type

type ReturnType = AccountConfig.Config | null

The complete current config, or null when the coordinator has not cached it.

Parameters

address

  • Type: Address

The stable configurable account address.