CallsStatus
The status of a batch of calls, as wallet_getCallsStatus returns it (EIP-5792): a status
code, whether the batch ran atomically, and the receipts of its transactions.
import { Effect } from "effect";import { Wallet } from "@ethect/core/rpc";
const hashes = (id: string) => Effect.gen(function* () { const status = yield* Wallet.getCallsStatus(id); // status: CallsStatus.CallsStatus return status.receipts.map((receipt) => receipt.transactionHash); });Schemas
Section titled “Schemas”| Schema | Type | Describes | Returned by |
|---|---|---|---|
CallsStatus.schema |
CallsStatus.CallsStatus |
where a batch stands | Wallet.getCallsStatus |
CallsStatus.receiptSchema |
CallsStatus.Receipt |
the receipt of a transaction that carried calls of the batch | the receipts of a status |
Status fields
Section titled “Status fields”CallsStatus.CallsStatus.
| Field | Type | Notes |
|---|---|---|
version |
string (optional) |
as the wallet sends it, such as "2.0.0" |
id |
string (optional) |
the id of the batch, when the wallet sends it as a string |
chainId |
number (optional) |
the chain the batch was sent on, when the wallet sends it |
status |
number |
a code, in the table below |
atomic |
boolean (optional) |
whether the wallet ran the calls atomically |
receipts |
ReadonlyArray<CallsStatus.Receipt> |
in the order the transactions were included. Empty while pending, and when the wallet sends none |
capabilities |
WalletCapabilities (optional) |
what the wallet attached to its answer |
Status codes
Section titled “Status codes”| Code | Meaning |
|---|---|
100 |
pending |
200 |
confirmed |
400 |
failed off chain |
500 |
reverted |
600 |
partly reverted |
EIP-5792 v1 said it in words: "PENDING" is read as 100 and "CONFIRMED" as 200, as
viem reads them.
Receipt fields
Section titled “Receipt fields”CallsStatus.Receipt, a subset of a Receipt.
| Field | Type | Notes |
|---|---|---|
logs |
ReadonlyArray<{ address: Address, data: Hex, topics: ReadonlyArray<Hash> }> |
only the logs of the batch’s own calls |
status |
"success" | "reverted" |
|
blockHash |
Hash |
|
blockNumber |
bigint |
from hex, or from a JSON number |
gasUsed |
bigint |
from hex, or from a JSON number |
transactionHash |
Hash |
Behavior
Section titled “Behavior”-
Codes come in hundreds. A more specific code stays in the hundred of its kind. Test the range, such as
status >= 200 && status < 300, not one value. -
statustwice. Thestatusof the batch is a number. Thestatusof a receipt is a name, decoded from"0x1"and"0x0". -
No receipts is an empty list. A wallet that leaves
receiptsout, as most do while the batch is pending, answers[]. -
versionandatomicare optional. A wallet that leaves one out still says where its batch stands: thestatusis read all the same. -
What a wallet means is read. Wallets do not all answer as EIP-5792 writes it, and an answer is read whenever its meaning is unambiguous:
The wallet sends Read as a status "PENDING"or"CONFIRMED"(EIP-5792 v1)100,200a receipt’s blockNumberorgasUsedas a JSON numberthe same bigintno receipts[]an idthat is not a string, such as Ambire’s{ type, identifier, bundler }no idno chainIdno chainIda key set to undefined, which only a provider in the page can sendan absent key idandchainIdare never needed to read an answer: whoever asked knows both. -
What it cannot read fails. An answer without a
status, or a receipt without a 32-bytetransactionHash, fails the call with aCodecErroron the result. Itsvalueis the answer as the wallet sent it. -
Encoded as EIP-5792 writes it. A status encodes to a number, the numbers of a receipt to hex, and
idandchainIdwhen they are there. A key is never written asundefined. -
One receipt or several. When
atomicistrue, all the calls may be in one receipt. -
A log has three fields.
address,dataandtopics. The other fields of aLogare dropped when a wallet sends them.