Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"crates/shepherd-sdk-test",
"modules/ethflow-watcher",
"modules/example",
"modules/examples/balance-tracker",
"modules/examples/price-alert",
"modules/twap-monitor",
]
Expand Down
15 changes: 15 additions & 0 deletions modules/examples/balance-tracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "balance-tracker"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Shepherd example module: tracks native-token balances of a list of addresses and emits a log when one changes by more than a threshold. Demonstrates chain::request + local-store + multi-key persistence."

[lib]
crate-type = ["cdylib"]

[dependencies]
shepherd-sdk = { path = "../../../crates/shepherd-sdk" }
alloy-primitives = { version = "1.5", default-features = false, features = ["std"] }
wit-bindgen = { version = "0.57", default-features = false, features = ["macros", "realloc"] }
32 changes: 32 additions & 0 deletions modules/examples/balance-tracker/module.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# balance-tracker example module: tracks native-token balances of a
# fixed address list and emits a Warn log when one moves by more than
# `change_threshold` wei between blocks. Demonstrates `chain::request`
# (non-eth_call), per-key `local-store` state, and "diff-against-last-
# seen" patterns reusable across indexer modules.

[module]
name = "balance-tracker"
version = "0.1.0"
component = "sha256:0000000000000000000000000000000000000000000000000000000000000000"

[capabilities]
required = ["logging", "chain", "local-store"]
optional = []

[capabilities.http]
allow = []

# --- subscriptions ----------------------------------------------------

[[subscription]]
kind = "block"
chain_id = 11155111

# --- config -----------------------------------------------------------

[config]
# Comma-separated list of 0x-prefixed 20-byte addresses. Whitespace
# around entries is tolerated.
addresses = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8,0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
# Change threshold in wei. Default is 0.1 ETH = 10**17.
change_threshold = "100000000000000000"
Loading