Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LiquidCroadloan and ForeignAsset as TradingPair for DEX #1697

Closed
zjb0807 opened this issue Dec 14, 2021 · 0 comments · Fixed by #1703
Closed

Support LiquidCroadloan and ForeignAsset as TradingPair for DEX #1697

zjb0807 opened this issue Dec 14, 2021 · 0 comments · Fixed by #1703
Assignees

Comments

@zjb0807
Copy link
Member

zjb0807 commented Dec 14, 2021

Acala/primitives/src/lib.rs

Lines 126 to 140 in e2cfafb

impl TradingPair {
pub fn from_currency_ids(currency_id_a: CurrencyId, currency_id_b: CurrencyId) -> Option<Self> {
if (currency_id_a.is_token_currency_id() || currency_id_a.is_erc20_currency_id())
&& (currency_id_b.is_token_currency_id() || currency_id_b.is_erc20_currency_id())
&& currency_id_a != currency_id_b
{
if currency_id_a > currency_id_b {
Some(TradingPair(currency_id_b, currency_id_a))
} else {
Some(TradingPair(currency_id_a, currency_id_b))
}
} else {
None
}
}

pub enum DexShare {
Token(TokenSymbol),
Erc20(EvmAddress),
LiquidCroadloan(Lease),
ForeignAsset(ForeignAssetId),
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant