-
Notifications
You must be signed in to change notification settings - Fork 767
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
asset conversion runtime quote api generalised #1442
Conversation
(only possible if fees are not included in quote)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Jegor Sidorenko <[email protected]>
Co-authored-by: Jegor Sidorenko <[email protected]>
Co-authored-by: Jegor Sidorenko <[email protected]>
Co-authored-by: Jegor Sidorenko <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes should be made to the Fellowship repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting on the fellowship runtimes to be updated such that kusama asset hub has the asset-conversion pallet in it. Then can address this.
The CI pipeline was cancelled due to failure one of the required jobs. |
> for Runtime | ||
{ | ||
fn quote_price_exact_tokens_for_tokens(asset1: NativeOrAssetId<u32>, asset2: NativeOrAssetId<u32>, amount: u128, include_fee: bool) -> Option<Balance> { | ||
AssetConversion::quote_price_exact_tokens_for_tokens(asset1, asset2, amount, include_fee) | ||
fn quote_price_exact_tokens_for_tokens(path: BoundedVec<NativeOrAssetId<u32>, MaxSwapLength>, amount: u128, include_fee: bool) -> Option<Balance> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any reason to have this Vec
bounded?
in this PR I actually simplifying the API, migrating from BoundedVec
to Vec
. the pallet still ensures it's not lager then max.
#1677
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We started with Vec
originally and it got switched to BoundedVec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using BoundedVec
in a runtime api makes no real sense?
Merge queue setting changed
Closing this as stale. |
To get a quote from XYZ token to ABC token currently requires two runtime calls that then need to be combined (one call of XYZ to DOT and another DOT to ABC). This PR allows this to be done in one call and makes the quote api look more like the swap api.
It's a breaking api change, but the API has not been released on kusama yet. Devs in the field integrating this API have suggested they would like this change.