1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use frame_support::sp_runtime::{DispatchError, DispatchResult};
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PaymentInfo<Balance, AssetId, Price> {
Native(Balance),
NonNative(Balance, AssetId, Price),
}
pub trait TransactionMultiPaymentDataProvider<AccountId, AssetId, Price> {
fn get_currency_and_price(who: &AccountId) -> Result<(AssetId, Option<Price>), DispatchError>;
fn get_fee_receiver() -> AccountId;
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PaymentWithdrawResult {
Native,
Transferred,
}
pub trait CurrencyWithdraw<AccountId, Balance> {
fn withdraw(who: &AccountId, fee: Balance) -> Result<PaymentWithdrawResult, DispatchError>;
}
pub trait DepositFee<AccountId, AssetId, Balance> {
fn deposit_fee(who: &AccountId, currency: AssetId, amount: Balance) -> DispatchResult;
}