2023-12-06 14:53:48 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
|
|
|
|
pub mod system;
|
|
|
|
|
|
|
|
pub mod timestamp;
|
|
|
|
|
|
|
|
pub mod coins;
|
|
|
|
pub mod dex;
|
|
|
|
|
|
|
|
pub mod validator_sets;
|
|
|
|
pub mod in_instructions;
|
|
|
|
pub mod signals;
|
|
|
|
|
|
|
|
pub mod babe;
|
|
|
|
pub mod grandpa;
|
|
|
|
|
|
|
|
pub use serai_primitives as primitives;
|
|
|
|
|
2023-12-07 07:30:09 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
2023-12-06 14:53:48 +00:00
|
|
|
pub enum Call {
|
2023-12-07 07:30:09 +00:00
|
|
|
System,
|
2023-12-06 14:53:48 +00:00
|
|
|
Timestamp(timestamp::Call),
|
2023-12-07 07:30:09 +00:00
|
|
|
TransactionPayment,
|
2023-12-06 14:53:48 +00:00
|
|
|
Coins(coins::Call),
|
|
|
|
LiquidityTokens(coins::Call),
|
|
|
|
Dex(dex::Call),
|
|
|
|
ValidatorSets(validator_sets::Call),
|
|
|
|
InInstructions(in_instructions::Call),
|
|
|
|
Signals(signals::Call),
|
|
|
|
Babe(babe::Call),
|
|
|
|
Grandpa(grandpa::Call),
|
|
|
|
}
|
|
|
|
|
2023-12-07 07:30:09 +00:00
|
|
|
// TODO: Remove this
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
|
|
pub enum TransactionPaymentEvent {
|
|
|
|
TransactionFeePaid { who: serai_primitives::SeraiAddress, actual_fee: u64, tip: u64 },
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
2023-12-06 14:53:48 +00:00
|
|
|
pub enum Event {
|
|
|
|
System(system::Event),
|
2023-12-07 07:30:09 +00:00
|
|
|
Timestamp,
|
|
|
|
TransactionPayment(TransactionPaymentEvent),
|
2023-12-06 14:53:48 +00:00
|
|
|
Coins(coins::Event),
|
|
|
|
LiquidityTokens(coins::Event),
|
|
|
|
Dex(dex::Event),
|
|
|
|
ValidatorSets(validator_sets::Event),
|
|
|
|
InInstructions(in_instructions::Event),
|
|
|
|
Signals(signals::Event),
|
2023-12-07 07:30:09 +00:00
|
|
|
Babe,
|
2023-12-06 14:53:48 +00:00
|
|
|
Grandpa(grandpa::Event),
|
|
|
|
}
|
2023-12-07 07:30:09 +00:00
|
|
|
|
|
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
|
|
|
pub struct Extra {
|
|
|
|
pub era: sp_runtime::generic::Era,
|
|
|
|
pub nonce: scale::Compact<u32>,
|
|
|
|
pub tip: scale::Compact<u64>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
|
|
#[cfg_attr(feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize))]
|
|
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
|
|
|
pub struct SignedPayloadExtra {
|
|
|
|
pub spec_version: u32,
|
|
|
|
pub tx_version: u32,
|
|
|
|
pub genesis: [u8; 32],
|
|
|
|
pub mortality_checkpoint: [u8; 32],
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type Transaction = primitives::Transaction<Call, Extra>;
|