.any() and .count().
Supported Arrays
| Array | Description | Always Available? |
|---|---|---|
tx.logs | Raw event logs emitted by contracts | ✅ Yes |
tx.transfers | Parsed ERC-20 Transfer events | ✅ Yes |
tx.approvals | Parsed ERC-20 Approval events | ✅ Yes |
.any() Method
Check if any element in an array matches a condition.
Syntax
Examples
.count() Method
Count how many elements match a condition, then compare the count.
Syntax
Supported Comparisons
>- Greater than<- Less than>=- Greater than or equal<=- Less than or equal==- Equal to!=- Not equal to
Examples
Combining with Other Conditions
Array methods work seamlessly with logical operators (and, or, not):
Available Fields in Arrays
tx.logs Fields
| Field | Type | Description | Example |
|---|---|---|---|
address | address | Contract that emitted the log | tx.logs.any(address == "0x...") |
event_signature | string | Event signature hash (topic[0]) | tx.logs.any(event_signature == "0xddf...") |
event_name | string | Parsed event name | tx.logs.any(event_name == "Transfer") |
Transfer, Approval, ApprovalForAll, Unknown
tx.transfers Fields
| Field | Type | Description | Example |
|---|---|---|---|
contract | address | Token contract address | tx.transfers.any(contract == "0x...") |
from | address | Source address (padded 32 bytes) | tx.transfers.any(from == "0x0000...") |
to | address | Destination address (padded 32 bytes) | tx.transfers.any(to == "0x0000...") |
amount | string | Transfer amount (hex string) | tx.transfers.any(amount != "0x0") |
tx.approvals Fields
| Field | Type | Description | Example |
|---|---|---|---|
contract | address | Token contract address | tx.approvals.any(contract == "0x...") |
owner | address | Owner address (padded 32 bytes) | tx.approvals.any(owner == "0x0000...") |
spender | address | Spender address (padded 32 bytes) | tx.approvals.any(spender == "0x0000...") |
amount | string | Approval amount (hex string) | tx.approvals.any(amount != "0x0") |
Limitations
Not Supported
❌ Direct array index access:Workarounds
For complex conditions, use multiple.any() or .count() calls: