mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
add Serai JSON-RPC methods (#627)
* add serai rpc methods * fix machete & dex quote price api * fix validators api --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
This commit is contained in:
19
substrate/primitives/src/dex.rs
Normal file
19
substrate/primitives/src/dex.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
#[cfg(feature = "borsh")]
|
||||
use borsh::{BorshSerialize, BorshDeserialize};
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use scale::{Encode, Decode, MaxEncodedLen};
|
||||
|
||||
use crate::{Coin, SubstrateAmount};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Encode, Decode, MaxEncodedLen)]
|
||||
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct QuotePriceParams {
|
||||
pub coin1: Coin,
|
||||
pub coin2: Coin,
|
||||
pub amount: SubstrateAmount,
|
||||
pub include_fee: bool,
|
||||
pub exact_in: bool,
|
||||
}
|
||||
@@ -40,6 +40,10 @@ pub use account::*;
|
||||
mod constants;
|
||||
pub use constants::*;
|
||||
|
||||
mod dex;
|
||||
#[allow(unused_imports)]
|
||||
pub use dex::*;
|
||||
|
||||
pub type BlockNumber = u64;
|
||||
pub type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user