Receipt Subquery

Get data fields from a Receipt and its Logs/Events

Description

Receipt Subqueries provide information about a completed transaction and any logs/events emitted. Etherscan (Goerli) provides a lot of useful information when looking at this data.

Limits

Maximum of 32 Receipt subqueries per Query. Each receipt can have a data field of at most 512 bytes and can have at most 20 logs.

Builder

buildReceiptSubquery(txHash)

Examples

Etherscan link for below transaction log

(corresponds to code block below) Log at index 0 (out of length 5), where topic 1 is address dst
const txHash = "0x9890aaedc5df95de7d535faf10c8d1a96a262b79e0fcb2ed52939c8ebd049d29";
const schema = getEventSchema("Deposit (index_topic_1 address dst, uint256 wad)");
const receiptSubquery: ReceiptSubquery = buildReceiptSubquery(txHash)
      .log(0) // log at index 0
      .topic(1) // topic 1: address dst
      .eventSchema(schema);
const txHash = "0x9890aaedc5df95de7d535faf10c8d1a96a262b79e0fcb2ed52939c8ebd049d29";
const receiptSubquery: ReceiptSubquery = buildReceiptSubquery(txHash)
      .txType();
const txHash = "0x9890aaedc5df95de7d535faf10c8d1a96a262b79e0fcb2ed52939c8ebd049d29";
const receiptSubquery: ReceiptSubquery = buildReceiptSubquery(txHash)
      .log(0)
      .address(); // address of contract that emitted the event at log index 0

Last updated