Skip to content

Commit

Permalink
chore(sdk): Add advanced symbol selection info
Browse files Browse the repository at this point in the history
  • Loading branch information
dudo50 authored Nov 8, 2024
1 parent b5ffed8 commit a4db9c3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ const paraspell = require('@paraspell/sdk/papi')
const paraspell = require('@paraspell/sdk')
```

Interaction with further asset symbol abstraction:
```js
import { Native, Foreign, ForeignAbstract } from '@paraspell/sdk'; //Only needed when advanced asset symbol selection is used. PJS version.
import { Native, Foreign, ForeignAbstract } from '@paraspell/sdk/papi'; //Only needed when advanced asset symbol selection is used. PAPI version.
```
## Implementation

```
Expand All @@ -96,14 +101,19 @@ NOTES:
- POLKADOT <> ETHEREUM Bridge is now available! Try sending WETH between the ecosystems - More information here: https://paraspell.github.io/docs/sdk/xcmPallet.html#ecosystem-bridges.
```

```
Latest news:
- ParaSpell now offers advanced asset symbol selection {symbol: "symbol"} for non duplicate assets, {symbol: Native("symbol")} or {symbol: Foreign("symbol")} if the duplicates are between native and foreign assets and {symbol: ForeignAbstract("symbol")} if the duplicates are in foreign assets only. You will get an error that will guide you further if you simply start with {symbol: "symbol"}.
```

### Builder pattern:

##### Transfer assets from Parachain to Parachain
```ts
await Builder(/*node api/ws_url_string - optional*/)
.from(NODE)
.to(NODE /*,customParaId - optional*/ | Multilocation object /*Only works for PolkadotXCM pallet*/)
.currency({id: currencyID} | {symbol: currencySymbol}, | {multilocation: multilocationJson} | {multiasset: multilocationJsonArray})
.currency({id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: multilocationJson} | {multiasset: multilocationJsonArray})
/*.feeAsset(feeAsset) - Parameter required when using MultilocationArray*/
.amount(amount) // Overriden when using MultilocationArray
.address(address | Multilocation object /*If you are sending through xTokens, you need to pass the destination and address multilocation in one object (x2)*/)
Expand Down Expand Up @@ -204,7 +214,7 @@ await paraspell.xcmPallet.send(
{
api?: ApiPromise/Ws_url_string,
origin: origin Parachain name string,
currency: {id: currencyID} | {symbol: currencySymbol}, | {multilocation: multilocationJson} | {multiasset: multilocationJsonArray},
currency: {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {multilocation: multilocationJson} | {multiasset: multilocationJsonArray}) ,
feeAsset? - Fee asset select id
amount: any,
to: destination address string | Multilocation object,
Expand Down

0 comments on commit a4db9c3

Please sign in to comment.