darwinia-network / darwinia.js-1.0-deprecated

Javascript API and Types
Apache License 2.0
5 stars 4 forks source link

Add derive apis for api rpc for storage derive type feature #63

Closed hackfisher closed 2 years ago

hackfisher commented 2 years ago

Moving functions to SDK can help simplify the code, especially for multi instance pallets, and make runtime smaller.

https://github.com/darwinia-network/darwinia-common/pull/1171

decl_runtime_apis! {
    pub trait BalancesApi<AccountId, Balance>
    where
        AccountId: Codec,
        Balance: Debug + Codec + MaybeDisplay + MaybeFromStr,
    {
        fn usable_balance(instance: u8, who: AccountId) -> RuntimeDispatchInfo<Balance>;
    }
}
decl_runtime_apis! {
    pub trait FeeMarketApi<Balance>
    where
        Balance: Codec + MaybeDisplay + MaybeFromStr,
     {
        fn market_fee(instance: u8) -> Option<Fee<Balance>>;

        fn in_process_orders(instance: u8) -> InProcessOrders;
    }
}
hackfisher commented 2 years ago

related: https://github.com/darwinia-network/wormhole-ui/issues/142

hackfisher commented 2 years ago

closed by #72 #71