Skip to main content

Module prelude

Module prelude 

Source

Re-exports§

pub use crate::NativeHandlers;
pub use anyhow;

Modules§

data_source
data_source module — mirrors graph-ts dataSource

Macros§

debug
error
info
Logging macros matching graph-ts log levels
warning

Structs§

Address
20-byte Ethereum address.
BigDecimal
BigInt
Contract
Bound contract for making eth_call.
DataSourceContext
DataSourceContext — per-instance configuration passed via createWithContext. Mirrors graph-ts DataSourceContext: typed key-value store.
Entity
EntityCache
Log
Trigger data passed to native handlers. Represents an Ethereum log entry with transaction/block context. In production, this is populated from graph-node’s trigger data.

Enums§

BigIntSign
A Sign is a BigInt’s composing element.
DecodedParam
A decoded event parameter value.
EntityIdValue
Value

Traits§

HandlerContext
IntoEntityValue

Functions§

abi_decode
Decode ABI-encoded bytes using a Solidity type signature string. Mirrors graph-ts ethereum.decode(signature, data).
bytes_from_hex_string
Decode a hex string into bytes. Mirrors graph-ts Bytes.fromHexString(). Accepts with or without 0x/0X prefix. Panics on invalid hex input — matches graph-ts strict behavior.
bytes_from_utf8
Convert a UTF-8 string into bytes. Mirrors graph-ts Bytes.fromUTF8().
bytes_to_hex_id
bytes_to_value
concat_bytes
Concatenate two byte arrays — used for entity ID generation. Mirrors graph-ts Bytes.concat()
concat_i32
Concatenate bytes with an i32 suffix — used for entity ID generation. Mirrors graph-ts Bytes.concatI32(): appends 4 little-endian bytes of the i32 to the byte array, returns 0x-prefixed hex string.
decode_event_params
Decode event parameters from a log entry using its JSON ABI definition.
hex_id_to_bytes
read_bigdecimal
read_bigint
read_bool
read_bytes
read_i32
read_string
read_value

Type Aliases§

Bytes
Bytes type alias