Skip to content

Commit 5ad3909

Browse files
committed
Add signers
1 parent b6b6a71 commit 5ad3909

2 files changed

Lines changed: 37 additions & 35 deletions

File tree

docs/router/router-use.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ await RouterBuilder(/* builder_config - Optional*/)
5757

5858
Asset selection by Location:
5959
```ts
60-
{location: AssetLocationString, amount: amount} //Recommended
61-
{location: AssetLocationJson, amount: amount} //Recommended
60+
{location: AssetLocationString} //Recommended
61+
{location: AssetLocationJson} //Recommended
6262
```
6363

6464
Asset selection by asset ID:
6565
```ts
66-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
66+
{id: currencyID} // Disabled when automatic exchange selection is chosen
6767
```
6868

6969
Asset selection by asset Symbol:
7070
```ts
7171
// For basic symbol selection
72-
{symbol: currencySymbol, amount: amount}
72+
{symbol: currencySymbol}
7373
```
7474

7575
:::
@@ -169,19 +169,19 @@ await RouterBuilder(/* builder_config - Optional*/)
169169

170170
Asset selection by Location:
171171
```ts
172-
{location: AssetLocationString, amount: amount} //Recommended
173-
{location: AssetLocationJson, amount: amount} //Recommended
172+
{location: AssetLocationString} //Recommended
173+
{location: AssetLocationJson} //Recommended
174174
```
175175

176176
Asset selection by asset ID:
177177
```ts
178-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
178+
{id: currencyID} // Disabled when automatic exchange selection is chosen
179179
```
180180

181181
Asset selection by asset Symbol:
182182
```ts
183183
// For basic symbol selection
184-
{symbol: currencySymbol, amount: amount}
184+
{symbol: currencySymbol}
185185
```
186186

187187
:::
@@ -282,19 +282,19 @@ await RouterBuilder(/* builder_config - Optional*/)
282282

283283
Asset selection by Location:
284284
```ts
285-
{location: AssetLocationString, amount: amount} //Recommended
286-
{location: AssetLocationJson, amount: amount} //Recommended
285+
{location: AssetLocationString} //Recommended
286+
{location: AssetLocationJson} //Recommended
287287
```
288288

289289
Asset selection by asset ID:
290290
```ts
291-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
291+
{id: currencyID} // Disabled when automatic exchange selection is chosen
292292
```
293293

294294
Asset selection by asset Symbol:
295295
```ts
296296
// For basic symbol selection
297-
{symbol: currencySymbol, amount: amount}
297+
{symbol: currencySymbol}
298298
```
299299

300300
:::
@@ -384,19 +384,19 @@ const result = await RouterBuilder()
384384

385385
Asset selection by Location:
386386
```ts
387-
{location: AssetLocationString, amount: amount} //Recommended
388-
{location: AssetLocationJson, amount: amount} //Recommended
387+
{location: AssetLocationString} //Recommended
388+
{location: AssetLocationJson} //Recommended
389389
```
390390

391391
Asset selection by asset ID:
392392
```ts
393-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
393+
{id: currencyID} // Disabled when automatic exchange selection is chosen
394394
```
395395

396396
Asset selection by asset Symbol:
397397
```ts
398398
// For basic symbol selection
399-
{symbol: currencySymbol, amount: amount}
399+
{symbol: currencySymbol}
400400
```
401401

402402
:::
@@ -1327,19 +1327,19 @@ const result = await RouterBuilder()
13271327

13281328
Asset selection by Location:
13291329
```ts
1330-
{location: AssetLocationString, amount: amount} //Recommended
1331-
{location: AssetLocationJson, amount: amount} //Recommended
1330+
{location: AssetLocationString} //Recommended
1331+
{location: AssetLocationJson} //Recommended
13321332
```
13331333

13341334
Asset selection by asset ID:
13351335
```ts
1336-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
1336+
{id: currencyID} // Disabled when automatic exchange selection is chosen
13371337
```
13381338

13391339
Asset selection by asset Symbol:
13401340
```ts
13411341
// For basic symbol selection
1342-
{symbol: currencySymbol, amount: amount}
1342+
{symbol: currencySymbol}
13431343
```
13441344

13451345
:::
@@ -1437,19 +1437,19 @@ const result = await RouterBuilder()
14371437

14381438
Asset selection by Location:
14391439
```ts
1440-
{location: AssetLocationString, amount: amount} //Recommended
1441-
{location: AssetLocationJson, amount: amount} //Recommended
1440+
{location: AssetLocationString} //Recommended
1441+
{location: AssetLocationJson} //Recommended
14421442
```
14431443

14441444
Asset selection by asset ID:
14451445
```ts
1446-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
1446+
{id: currencyID} // Disabled when automatic exchange selection is chosen
14471447
```
14481448

14491449
Asset selection by asset Symbol:
14501450
```ts
14511451
// For basic symbol selection
1452-
{symbol: currencySymbol, amount: amount}
1452+
{symbol: currencySymbol}
14531453
```
14541454

14551455
:::
@@ -1545,19 +1545,19 @@ console.log(result.exchange)
15451545

15461546
Asset selection by Location:
15471547
```ts
1548-
{location: AssetLocationString, amount: amount} //Recommended
1549-
{location: AssetLocationJson, amount: amount} //Recommended
1548+
{location: AssetLocationString} //Recommended
1549+
{location: AssetLocationJson} //Recommended
15501550
```
15511551

15521552
Asset selection by asset ID:
15531553
```ts
1554-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
1554+
{id: currencyID} // Disabled when automatic exchange selection is chosen
15551555
```
15561556

15571557
Asset selection by asset Symbol:
15581558
```ts
15591559
// For basic symbol selection
1560-
{symbol: currencySymbol, amount: amount}
1560+
{symbol: currencySymbol}
15611561
```
15621562

15631563
:::
@@ -1656,19 +1656,19 @@ const fees = await RouterBuilder(/* builder_config - Optional*/)
16561656

16571657
Asset selection by Location:
16581658
```ts
1659-
{location: AssetLocationString, amount: amount} //Recommended
1660-
{location: AssetLocationJson, amount: amount} //Recommended
1659+
{location: AssetLocationString} //Recommended
1660+
{location: AssetLocationJson} //Recommended
16611661
```
16621662

16631663
Asset selection by asset ID:
16641664
```ts
1665-
{id: currencyID, amount: amount} // Disabled when automatic exchange selection is chosen
1665+
{id: currencyID} // Disabled when automatic exchange selection is chosen
16661666
```
16671667

16681668
Asset selection by asset Symbol:
16691669
```ts
16701670
// For basic symbol selection
1671-
{symbol: currencySymbol, amount: amount}
1671+
{symbol: currencySymbol}
16721672
```
16731673

16741674
:::

docs/sdk/xcmPallet.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ const builder = Builder(/*client | builder_config |ws_url | [ws_url, ws_url,..]
1414
.to(TChain /*,customParaId - optional*/ | Location object /*Only works for PolkadotXCM pallet*/) //'AssetHubPolkadot' | 'Hydration' | 'Moonbeam' | 'Polkadot' | ... https://paraspell.github.io/docs/sdk/AssetPallet.html#import-chains-as-types
1515
.currency(CURRENCY_SPEC) // Refer to currency spec options below
1616
.address(address | Location object /*If you are sending through xTokens, you need to pass the destination and address location in one object (x2)*/)
17-
.senderAddress(address) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub/Hydration with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED.
17+
.senderAddress(address | PAPI_SIGNER /*Only in PAPI SDK*/ | {address, PJS_SIGNER} /*Only in PJS SDK*/) // - OPTIONAL but strongly recommended as it is automatically ignored when not needed - Used when origin is AssetHub/Hydration with feeAsset or when sending to AssetHub to prevent asset traps by auto-swapping to DOT to have DOT ED.
1818

1919
const tx = await builder.build()
20+
// Or if you use signers in senderAddress:
21+
// await builder.signAndSubmit() - Signs and submits the transaction; returns TX hash for tracking
2022

2123
// Make sure to disconnect API after it is no longer used (eg. after transaction)
2224
await builder.disconnect()
@@ -67,7 +69,7 @@ Asset selection of multiple assets:
6769
These can be added to further customize your calls.
6870

6971
```ts
70-
.ahAddress(ahAddress) - OPTIONAL - used when origin is EVM CHAIN and XCM goes through AssetHub (Multihop transfer where we are unable to convert Key20 to ID32 address eg. origin: Moonbeam & destination: Ethereum (Multihop goes from Moonbeam > AssetHub > BridgeHub > Ethereum)
72+
.ahAddress(ahAddress) // - OPTIONAL - used when origin is EVM CHAIN and XCM goes through AssetHub (Multihop transfer where we are unable to convert Key20 to ID32 address eg. origin: Moonbeam & destination: Ethereum (Multihop goes from Moonbeam > AssetHub > BridgeHub > Ethereum)
7173
.feeAsset({symbol: 'symbol'} || {id: 'id'} || {location: 'location'}) // Optional parameter used when multiple assets are provided or when origin is AssetHub/Hydration - so user can pay fees with asset different than DOT
7274
.xcmVersion(Version.V3/V4/V5) // Optional parameter for manual override of XCM Version used in call
7375
.customPallet('Pallet','pallet_function') // Optional parameter for manual override of XCM Pallet and function used in call (If they are named differently on some CHAIN but syntax stays the same). Both pallet name and function required. Pallet name must be CamelCase, function name snake_case.
@@ -1408,7 +1410,7 @@ const builder = await Builder({
14081410

14091411
const tx = await builder.build()
14101412
//Or if you use prederived account as senderAddress:
1411-
//await builder.signAndSubmit()
1413+
//await builder.signAndSubmit() - Signs and submits the transaction; returns TX hash for tracking
14121414

14131415
// Disconnect API after TX
14141416
await builder.disconnect()

0 commit comments

Comments
 (0)