multisig.approveTransaction
Prepares a multisig transaction, signs one owner approval, and stores the approval. The action returns a pending operation below quorum. The approval that reaches quorum broadcasts the final transaction and returns a successful operation.
Usage
import { Account } from 'viem/tempo'
import { client } from './multisig.config'
const owner_1 = Account.fromSecp256k1(
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
)
const owner_2 = Account.fromSecp256k1(
'0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d'
)
const multisig = Account.fromMultisig({
owners: [owner_1.address, owner_2.address],
threshold: 2,
})
const pending = await client.multisig.approveTransaction({
account: owner_1,
calls: [
{ to: '0xcafebabecafebabecafebabecafebabecafebabe', value: 1n },
],
multisig,
})
{ status: 'pending', id: '0x...', weight: 1, threshold: 2, request: { ... } }
const success = await client.multisig.approveTransaction({
...pending.request,
account: owner_2,
})
{ status: 'success', transactionHash: '0x...', weight: 2, threshold: 2, request: { ... } }import { createClient } from 'viem/tempo'
export const client = createClient({
experimental_multisig: true,
})Pass the returned request unchanged to every later owner. Changing a transaction field creates
a different signing payload, so the stored approvals cannot be combined.
Return Type
type ReturnType = Multisig.Operation.Transaction & {
request: MultisigTransactionRequest
}A pending or successful transaction operation and the prepared request that later owners must
approve. A pending operation includes its deterministic id, collected approvals, weight, and
threshold. A successful operation includes the final transactionHash.
Parameters
account
- Type:
Account | Address
The owner that signs this approval. The account can also come from the client.
multisig
- Type:
Address | Account.MultisigAccount | MultisigConfig.Config
The multisig sender. The first approval must identify the multisig through this parameter or a
multisig account. Later approvals can reuse the returned request without passing it again.
Transaction Parameters
The action accepts the same Tempo transaction fields as
prepareTransactionRequest, including calls,
feePayer, feeToken, nonceKey, and validity-window fields.