VIA Labs Stellar Macros
Proc macro for providing default implementations of traits for Stellar contracts in the VIA cross-chain messaging system.
Overview
The vialabs-stellar-macros crate provides the #[default_impl] attribute macro that automatically generates default implementations for trait methods. This allows contract developers to focus on implementing only the custom logic they need, while the macro provides standard implementations for the rest.
Supported Traits
MessageClientV4Interface
The macro currently supports the full MessageClientV4Interface trait and provides all of the needed default implementations.
Note: The message_process method is not provided by default and must be implemented by the contract.
Usage
Add the macro crate to your contract's Cargo.toml:
[]
= "0.1.9"
= "0.1.9"
= "23.0.2"
Inside your contract file:
use default_impl;
use MessageClientV4Interface;
;
Overriding Methods
Important: Only message_process can be overridden. All other methods will always use the default implementation provided by the macro, even if you try to provide a custom implementation.