Trait tidefi_primitives::pallet::OracleExt
source · pub trait OracleExt<AccountId, BlockNumber> {
fn is_oracle_enabled() -> bool;
fn is_market_maker(account_id: AccountId) -> Result<bool, DispatchError>;
fn add_new_swap_in_queue(
account_id: AccountId,
asset_id_from: CurrencyId,
amount_from: Balance,
asset_id_to: CurrencyId,
amount_to: Balance,
block_number: BlockNumber,
extrinsic_hash: [u8; 32],
is_market_maker: bool,
swap_type: SwapType,
slippage_tolerance: Permill
) -> Result<(Hash, Swap<AccountId, BlockNumber>), DispatchError>;
fn remove_swap_from_queue(
requester: AccountId,
request_id: Hash
) -> Result<(), DispatchError>;
}
Expand description
Oracle traits to share with pallets.
Required Methods§
sourcefn is_oracle_enabled() -> bool
fn is_oracle_enabled() -> bool
Get current Oracle status.
sourcefn is_market_maker(account_id: AccountId) -> Result<bool, DispatchError>
fn is_market_maker(account_id: AccountId) -> Result<bool, DispatchError>
Check if the account is an official market maker.
sourcefn add_new_swap_in_queue(
account_id: AccountId,
asset_id_from: CurrencyId,
amount_from: Balance,
asset_id_to: CurrencyId,
amount_to: Balance,
block_number: BlockNumber,
extrinsic_hash: [u8; 32],
is_market_maker: bool,
swap_type: SwapType,
slippage_tolerance: Permill
) -> Result<(Hash, Swap<AccountId, BlockNumber>), DispatchError>
fn add_new_swap_in_queue(
account_id: AccountId,
asset_id_from: CurrencyId,
amount_from: Balance,
asset_id_to: CurrencyId,
amount_to: Balance,
block_number: BlockNumber,
extrinsic_hash: [u8; 32],
is_market_maker: bool,
swap_type: SwapType,
slippage_tolerance: Permill
) -> Result<(Hash, Swap<AccountId, BlockNumber>), DispatchError>
Add a new swap to the queue.
sourcefn remove_swap_from_queue(
requester: AccountId,
request_id: Hash
) -> Result<(), DispatchError>
fn remove_swap_from_queue(
requester: AccountId,
request_id: Hash
) -> Result<(), DispatchError>
Cancel swap and release funds.