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:
akildemir
2025-01-30 12:23:03 +03:00
committed by GitHub
parent e4cc23b72d
commit 11d48d0685
13 changed files with 393 additions and 42 deletions

View 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,
}

View File

@@ -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>;