2023-01-20 16:00:18 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
|
|
|
#![cfg_attr(not(feature = "std"), no_std)]
|
|
|
|
|
|
|
|
use scale::{Encode, Decode, MaxEncodedLen};
|
|
|
|
use scale_info::TypeInfo;
|
|
|
|
|
|
|
|
#[cfg(feature = "std")]
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
2023-01-28 06:47:13 +00:00
|
|
|
use serai_primitives::{SeraiAddress, ExternalAddress, Data};
|
2023-01-20 16:00:18 +00:00
|
|
|
|
2023-01-28 06:47:13 +00:00
|
|
|
mod shorthand;
|
|
|
|
pub use shorthand::*;
|
2023-01-20 16:00:18 +00:00
|
|
|
|
2023-01-28 06:47:13 +00:00
|
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
2023-01-20 16:00:18 +00:00
|
|
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
2023-01-28 06:47:13 +00:00
|
|
|
pub enum Application {
|
|
|
|
DEX,
|
2023-01-20 16:00:18 +00:00
|
|
|
}
|
|
|
|
|
2023-01-28 06:47:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
|
|
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
|
|
|
pub struct ApplicationCall {
|
|
|
|
application: Application,
|
|
|
|
data: Data,
|
|
|
|
}
|
2023-01-20 16:00:18 +00:00
|
|
|
|
2023-01-28 06:47:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
|
|
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
|
|
|
pub enum InInstruction {
|
|
|
|
Transfer(SeraiAddress),
|
|
|
|
Call(ApplicationCall),
|
|
|
|
}
|
2023-01-20 16:00:18 +00:00
|
|
|
|
2023-01-28 06:47:13 +00:00
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
|
|
|
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
|
|
|
pub struct RefundableInInstruction {
|
|
|
|
pub origin: Option<ExternalAddress>,
|
|
|
|
pub instruction: InInstruction,
|
|
|
|
}
|