viem-goviem-go

getCallsStatus

Gets the status of a call batch (EIP-5792)

Import

Import the wallet actions package so you can call this action.

import "github.com/ChefBingbong/viem-go/actions/wallet"

Usage

See how to construct a wallet client and call this action.

import (
"context"
"log"
"github.com/ChefBingbong/viem-go/actions/wallet"
"github.com/ChefBingbong/viem-go/client"
"github.com/ChefBingbong/viem-go/client/transport"
"github.com/ChefBingbong/viem-go/chain/definitions"
)
ctx := context.Background()
walletClient, err := client.CreateWalletClient(client.WalletClientConfig{
Chain: definitions.Mainnet,
Transport: transport.HTTP("https://eth.llamarpc.com"),
})
if err != nil {
log.Fatal(err)
}
defer func() { _ = walletClient.Close() }()
status, err := wallet.GetCallsStatus(ctx, walletClient, wallet.GetCallsStatusParameters{
ID: "0xdeadbeef",
})
if err != nil {
log.Fatal(err)
}
log.Printf("Status: %s (code: %d)", status.Status, status.StatusCode)

Returns

*GetCallsStatusReturnType

An object containing:

  • StatusCode - The status code (100=pending, 200=success, 300+=failure)
  • Status - The status string ("pending", "success", "failure")
  • Receipts - Array of transaction receipts
  • Atomic - Whether the calls were executed atomically
  • ChainID - The chain ID
  • Version - The EIP-5792 version
  • Capabilities - The wallet capabilities (optional)

Parameters

ID

Specify which call batch to fetch the status for.

  • Type: string

  • Required

The identifier of the call batch (returned from sendCalls).

result, err := wallet.SendCalls(ctx, walletClient, wallet.SendCallsParameters{
Calls: []wallet.Call{...},
})
if err != nil {
log.Fatal(err)
}
status, err := wallet.GetCallsStatus(ctx, walletClient, wallet.GetCallsStatusParameters{
ID: result.ID,
})

JSON-RPC Method

Note: For fallback call batches (sent via eth_sendTransaction), this action uses eth_getTransactionReceipt internally.