21 unstable releases (3 breaking)

new 0.10.0-rc.22 Dec 3, 2025
0.10.0-rc.21 Dec 2, 2025
0.10.0-rc.20 Nov 27, 2025
0.10.0-rc.12 Oct 30, 2025
0.2.1 Aug 31, 2025

#7 in #sdk-macro

Download history 112/week @ 2025-08-25 125/week @ 2025-09-01 145/week @ 2025-09-08 32/week @ 2025-09-15 14/week @ 2025-09-22 19/week @ 2025-09-29 470/week @ 2025-10-06 48/week @ 2025-10-13 22/week @ 2025-10-20 152/week @ 2025-10-27 20/week @ 2025-11-03 17/week @ 2025-11-10 22/week @ 2025-11-17 7/week @ 2025-11-24

66 downloads per month
Used in 4 crates (via calimero-sdk)

MIT/Apache

89KB
2K SLoC

Procedural macros for Calimero SDK applications.

This module provides the core procedural macros that enable Calimero applications to define their state, logic, events, and private data structures with minimal boilerplate.

Key Macros

  • #[app::state] - Defines the application's persistent state structure
  • #[app::logic] - Defines the application's business logic implementation
  • #[app::event] - Defines application events for external communication
  • #[app::private] - Defines private data structures for internal use
  • app::emit! - Emits events with optional callback handlers

Basic Usage

The macros work together to define application state, logic, and events:

  • Use #[app::state] to define persistent application state
  • Use #[app::logic] to implement business logic methods
  • Use #[app::event] to define events for external communication

Event Emission with Handlers

Use app::emit! macro to emit events:

  • Simple emission: app::emit!(MyEvent::DataChanged { data: "hello" })
  • With callback handler: app::emit!((MyEvent::CounterUpdated { value: 42 }, "counter_handler"))

Dependencies

~1–1.7MB
~39K SLoC