xcm-tools icon indicating copy to clipboard operation
xcm-tools copied to clipboard

Refactor Asset selection in XCM SDK

Open dudo50 opened this issue 1 year ago • 0 comments

We have been playing with the idea of how can we abstract asset selection from developer further and do not overengineer it too much. Currently currency selection consists of following types: string | number | bigint | {symbol: symbol}(If asset Symbol is number) | {id: id} (If there are duplicate assets on Parachain) | multilocation | multiasset

These are 7 options and it could be hard to navigate between them and know which one is the right one.

Thus our idea is to let currency selection be an object and format would look like this:

.currency({ id: //Asset id })

or

.currency({ symbol: //Asset symbol })

or

.currency({ multilocation: //Asset multilocation })

or

.currency({ multiasset: //Multiasset selection })

This will limit currency type to 1 with 4 options instead of 7 different types and 7 different options.

The major drawback to this option is, that it will be breaking change.

We will assist projects with switch if this gets implemented.

dudo50 avatar Aug 13 '24 20:08 dudo50