Skip to content
LogoLogo

account.getCallStatus()

Get the status of a previously submitted call batch.

Type: instance async

Signature

getCallStatus(batchId: Hash): Promise<CallStatusResponse | undefined>

Parameters

batchId

Type: Hash

The batch ID (userOpHash) returned from sendCalls().

Returns

CallStatusResponse | undefined - The call status in EIP-5792 format, or undefined if the batch ID is not found.

interface CallStatusResponse {
  /** EIP-5792 version */
  version: string;
  /** The batch ID (userOpHash) */
  id: `0x${string}`;
  /** Chain ID in hex format */
  chainId: `0x${string}`;
  /** Status code: 100=pending, 200=completed, 400=offchain failure, 500=onchain revert */
  status: number;
  /** Whether the operation is atomic (always true for ERC-4337) */
  atomic: boolean;
  /** Transaction receipts (present when completed or reverted) */
  receipts?: CallReceipt[];
}
 
interface CallReceipt {
  logs: Array<{
    address: `0x${string}`;
    data: `0x${string}`;
    topics: `0x${string}`[];
  }>;
  status: `0x${string}`;
  blockHash: `0x${string}`;
  blockNumber: `0x${string}`;
  gasUsed: `0x${string}`;
  transactionHash: `0x${string}`;
}

Status Codes

CodeNameDescription
100PendingNot yet completed onchain
200CompletedIncluded onchain without reverts
400Offchain FailureNot included onchain, wallet won't retry
500Complete RevertReverted completely, has receipt with status 0x0

Behavior

  1. Looks up the batch ID in the internal call status store first (fast path; populated by sendCalls() in the same process and updated in the background).
  2. On a miss — typical for short-lived processes like the CLI, or for browsers after a page reload — falls back to querying the bundler directly via eth_getUserOperationReceipt so the chain stays the source of truth.
  3. Returns the status in EIP-5792 format.
  4. Returns undefined if neither the in-memory store nor the bundler knows the batch.

Example

Getting an Account Instance

Before calling instance methods, create an account using one of the factory methods:

import { Account } from '@jaw.id/core';
 
// Option 1: Restore existing session or login with passkey
const account = await Account.get({ chainId: 1, apiKey: 'your-api-key' });
 
// Option 2: Create a new account with passkey
const account = await Account.create({ chainId: 1, apiKey: 'your-api-key' }, { username: 'alice' });
 
// Option 3: Import from cloud backup
const account = await Account.import({ chainId: 1, apiKey: 'your-api-key' });
 
// Option 4: From a local account (server-side / embedded wallets)
const account = await Account.fromLocalAccount({ chainId: 1, apiKey: 'your-api-key' }, localAccount);

Basic Usage

// Send calls and get the batch ID
const { id } = await account.sendCalls([{ to: '0x...', value: parseEther('0.1') }]);
 
// Check status immediately
const status = await account.getCallStatus(id);