2024-06-02 19:58:29 -04:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
|
|
|
|
#![cfg_attr(not(feature = "std"), no_std)]
|
2023-12-06 09:53:48 -05:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
|
|
2024-06-02 19:58:29 -04:00
|
|
|
extern crate alloc;
|
|
|
|
|
|
|
|
|
|
pub use serai_primitives as primitives;
|
|
|
|
|
|
2023-12-06 09:53:48 -05:00
|
|
|
pub mod system;
|
|
|
|
|
|
|
|
|
|
pub mod timestamp;
|
|
|
|
|
|
|
|
|
|
pub mod coins;
|
2024-07-19 02:30:19 +03:00
|
|
|
pub mod liquidity_tokens;
|
2023-12-06 09:53:48 -05:00
|
|
|
pub mod dex;
|
|
|
|
|
|
|
|
|
|
pub mod validator_sets;
|
|
|
|
|
pub mod in_instructions;
|
|
|
|
|
pub mod signals;
|
|
|
|
|
|
2024-07-19 02:30:19 +03:00
|
|
|
pub mod genesis_liquidity;
|
|
|
|
|
|
2023-12-06 09:53:48 -05:00
|
|
|
pub mod babe;
|
|
|
|
|
pub mod grandpa;
|
|
|
|
|
|
2024-06-02 19:58:29 -04:00
|
|
|
pub mod tx;
|
2023-12-06 09:53:48 -05:00
|
|
|
|
2023-12-07 02:30:09 -05:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
2023-12-06 09:53:48 -05:00
|
|
|
pub enum Call {
|
|
|
|
|
Timestamp(timestamp::Call),
|
|
|
|
|
Coins(coins::Call),
|
2024-07-19 02:30:19 +03:00
|
|
|
LiquidityTokens(liquidity_tokens::Call),
|
2023-12-06 09:53:48 -05:00
|
|
|
Dex(dex::Call),
|
2024-07-19 02:30:19 +03:00
|
|
|
GenesisLiquidity(genesis_liquidity::Call),
|
2023-12-06 09:53:48 -05:00
|
|
|
ValidatorSets(validator_sets::Call),
|
|
|
|
|
InInstructions(in_instructions::Call),
|
|
|
|
|
Signals(signals::Call),
|
|
|
|
|
Babe(babe::Call),
|
|
|
|
|
Grandpa(grandpa::Call),
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-07 02:30:09 -05: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 09:53:48 -05:00
|
|
|
pub enum Event {
|
|
|
|
|
System(system::Event),
|
2023-12-07 02:30:09 -05:00
|
|
|
Timestamp,
|
|
|
|
|
TransactionPayment(TransactionPaymentEvent),
|
2023-12-06 09:53:48 -05:00
|
|
|
Coins(coins::Event),
|
2024-07-19 02:30:19 +03:00
|
|
|
LiquidityTokens(liquidity_tokens::Event),
|
2023-12-06 09:53:48 -05:00
|
|
|
Dex(dex::Event),
|
2024-07-19 02:30:19 +03:00
|
|
|
GenesisLiquidity(genesis_liquidity::Event),
|
2023-12-06 09:53:48 -05:00
|
|
|
ValidatorSets(validator_sets::Event),
|
|
|
|
|
InInstructions(in_instructions::Event),
|
|
|
|
|
Signals(signals::Event),
|
2023-12-07 02:30:09 -05:00
|
|
|
Babe,
|
2023-12-06 09:53:48 -05:00
|
|
|
Grandpa(grandpa::Event),
|
|
|
|
|
}
|
2023-12-07 02:30:09 -05:00
|
|
|
|
|
|
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
2024-06-02 19:58:29 -04:00
|
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
|
|
|
|
#[cfg_attr(all(feature = "std", feature = "serde"), derive(serde::Deserialize))]
|
2023-12-07 02:30:09 -05:00
|
|
|
pub struct Extra {
|
|
|
|
|
pub era: sp_runtime::generic::Era,
|
2024-06-02 19:58:29 -04:00
|
|
|
#[codec(compact)]
|
|
|
|
|
pub nonce: u32,
|
|
|
|
|
#[codec(compact)]
|
|
|
|
|
pub tip: u64,
|
2023-12-07 02:30:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, scale::Encode, scale::Decode, scale_info::TypeInfo)]
|
|
|
|
|
#[cfg_attr(feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize))]
|
2024-06-02 19:58:29 -04:00
|
|
|
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
|
|
|
|
|
#[cfg_attr(all(feature = "std", feature = "serde"), derive(serde::Deserialize))]
|
2023-12-07 02:30:09 -05:00
|
|
|
pub struct SignedPayloadExtra {
|
|
|
|
|
pub spec_version: u32,
|
|
|
|
|
pub tx_version: u32,
|
|
|
|
|
pub genesis: [u8; 32],
|
|
|
|
|
pub mortality_checkpoint: [u8; 32],
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-02 19:58:29 -04:00
|
|
|
pub type Transaction = tx::Transaction<Call, Extra>;
|