A reusable Motoko component for receiving ICRC-72 event notifications, managing subscriptions and replays, batching confirmations, and optionally participating in ICRC-85 open value sharing.
mops add icrc72-subscriber-moimport Subscriber "mo:icrc72-subscriber-mo";The package uses the ClassPlus and migration patterns for stable state management. See example/ for integration wiring.
This is alpha software. Use it at your own risk.
- Subscription registration and updates
- Notification processing with persistent out-of-order backlogs
- Broadcaster authorization and validation
- Retryable, cycle-funded confirmation batches
- Synchronous and asynchronous execution listeners
- ICRC-77 replay registration and status support
- ICRC-85 open value sharing
Initialize the component through its ClassPlus-compatible Init function, supplying an initialization manager, stable state, arguments, environment loader, initialization callback, and storage-change callback. The environment provides application-specific record, ordering, pricing, and subscription-readiness handlers.
Register notification handlers with registerExecutionListenerSync or registerExecutionListenerAsync. Subscription operations and statistics are exposed by registerSubscriptions, updateSubscription, and stats.
The default open-value-sharing behavior funds continued maintenance. Applications may override or disable the sharing configuration under ICRC-85. The default calculation starts at 1 XDR per month and adds 1 XDR per 10,000 processed actions, capped at 100 XDR. The default beneficiary is the ICDevs.org collector configured by the package.
mops install
dfx build --check example
mops benchThe saved benchmark compares the collection types used for notification and confirmation batching.
See BENCHMARKS.md for results and the collection-choice rationale.
MIT. Copyright ICDevs.org.