Skip to content
LogoLogo

accounts.getPendingOperations

Gets the coordinated transactions and key authorizations of a configurable account that are waiting on more owner approvals, oldest first. Use it to show an owner what to approve without sharing operation hashes out of band.

Configure the client with withRelay to read operations coordinated by a local accounts plugin or a remote relay.

Usage

import { client } from './viem.config'
 
const operations = await client.accounts.getPendingOperations({
  address: '0x5f2b4d1e3a9c8b7e6d5f4a3b2c1d0e9f8a7b6c5d',
})
[{ hash: '0x23a9…', status: 'pending', threshold: 2, type: 'transaction', weight: 1, … }]

To add an approval, pass an operation's hash to sendTransaction for transactions, or to accessKey.signAuthorization for key authorizations.

Return Type

type ReturnType = readonly AccountOperation.Operation[]

Each operation has a pending status and includes its retained approvals, signatureCount, threshold, and current weight. Use type to distinguish transaction and key-authorization operations.

The list covers operations on the client's chain. It omits operations that reached quorum, passed their signed deadline (validBefore or key expiry), or were signed under a config the account has since replaced, because those can no longer take effect.

Parameters

address

  • Type: Address

The configurable account whose owners approve the operations.