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

feat: add support for foreign asset multilocations #224

Merged
merged 60 commits into from
Aug 2, 2023

Conversation

marshacb
Copy link
Contributor

@marshacb marshacb commented Jul 13, 2023

TODOs:

  • getFeeAssetItemIndex for foreign assets
  • update multiasset sorting
  • integration tests
  • unit tests
  • docs
  • update examples
  • error validation layer
  • add foreign assets pallet instance from registry

closes: #140
closes: #229
closes: #230

…ive in order to allow system chains without assets pallet to create native asset xcm transfers
allow for multilocation string assetIds to be passed in as assetId args
@marshacb marshacb changed the title [WIP] feat: add support for foreign asset multilocations feat: add support for foreign asset multilocations Jul 21, 2023
Copy link
Contributor

@IkerAlus IkerAlus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments regarding the examples.

I will do the code review afterwards.

examples/systemToSystemXcmForeignAssets.ts Outdated Show resolved Hide resolved
examples/systemToSystemLocalForeignAssets.ts Outdated Show resolved Hide resolved
examples/systemToParaTeleportForeignAssets.ts Outdated Show resolved Hide resolved
examples/systemToParaReserveTransferForeignAssets.ts Outdated Show resolved Hide resolved
examples/paraToSystemForeignAssetsReserveTransferAssets.ts Outdated Show resolved Hide resolved
src/AssetsTransferApi.ts Outdated Show resolved Hide resolved
src/AssetsTransferApi.ts Outdated Show resolved Hide resolved
…ilocation asset ids

added checks and test cases to error when assetIds are not exclusively either symbol, integer and empty string or multilocation values
added checks and test cases to ensure assetIds length are not greater than MAX_ASSETS_FOR_TRANSFER
added test case for paysWithFeeDest to ensure xcm version is 3
update dupes to account for white spaces in multilocations
@marshacb marshacb requested a review from IkerAlus July 27, 2023 23:15
import constructForeignAssetMultiLocationFromAssetId to ParaToSystem and SystemToPara
Copy link
Contributor

@IkerAlus IkerAlus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just small suggestions, and an open discussion point about the sorting function. Great and solid work.

@IkerAlus IkerAlus self-requested a review August 2, 2023 10:40
Copy link
Contributor

@IkerAlus IkerAlus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work!

P.S: what is the status regarding the last to-do point "add foreign assets pallet instance from registry"? does that one belong to the registry repo?

@marshacb
Copy link
Contributor Author

marshacb commented Aug 2, 2023

LGTM! Great work!

P.S: what is the status regarding the last to-do point "add foreign assets pallet instance from registry"? does that one belong to the registry repo?

Yes, I've updated the registry to fetch the foreignAssetsPalletInstance already. After I do a release of the registry this morning it will be a simple change of pulling the pallet instance from there rather than using a constant.

update registry type to include foreignAssetsPalletInstance and poolPairsInfo
pull foreignAssetsPalletInstance from registry
@marshacb marshacb merged commit 58c776c into main Aug 2, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants