substrate_macro 0.1.1

Derive Macro for Substrate Actions
Documentation

Substrate Macro

Description

This is a Derive Macro for Workflow-Aurras. This macro implement functionalities for interaction between substrate based chain. This macro implement the methods like transfer, reward payout and batch reward payout.

Usage

Add following libraries.

substrate_macro = "0.1.1"

In your Cargo.toml file of your rust package.

Access this Macro by importing.

use substrate_macro::Polkadot;

Creates necessary methods to for Interaction between Substarte based chaoin.

#[derive(Polkadot)]
#[Chain = "Westend"]
#[Operation = "transfer"]
pub struct Data {
   input: TransactionInput,
   output: TransactionOutput
}

#[derive(Debug, Default, Clone, Serialize, Deserialize)]
struct TransactionInput {
   url: String,
   #[serde(default)]
   owner_key: String,
   address: String,
   #[serde(default)]
   amount: u32,
   #[serde(default)]
   era: u32,
}

References

License

Licensed under Apache-2.0