Strike Actions Library
A Rust library for generating Strike Action metadata for blockchain interactions, specifically designed for prediction markets and betting platforms.
Features
- Generate Strike Action metadata from market data
- Support for single and multi-option markets
- Configurable canister IDs and derivation origins
- Full serde support for JSON serialization/deserialization
- Candid type system integration
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
use ;
// Create a market with options
let market = Market ;
// Convert to Strike Action metadata
let strike_metadata: StrikeActionMetadata = market.into;
// Customize with your canister ID
let strike_metadata = strike_metadata
.with_canister_id
.with_label;
// Serialize to JSON
let json = to_string.unwrap;
println!;
Types
Market
Represents a prediction market with multiple options.
StrikeActionMetadata
The main metadata structure that contains all information needed for Strike Actions.
StrikeAction
Individual actions that users can perform (betting Yes/No on options).
CandidType
Wrapper around Candid's TypeInner for proper serialization.
Testing
Run the tests with:
License
MIT License