@paraspell/sdk 7.2.3 → 7.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -584,180 +584,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
584
584
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
585
585
  };
586
586
 
587
- /**
588
- * Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
589
- */
590
- var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
591
- /**
592
- * Constructs a new InvalidCurrencyError.
593
- *
594
- * @param message - The error message.
595
- */
596
- function InvalidCurrencyError(message) {
597
- var _this;
598
- _classCallCheck(this, InvalidCurrencyError);
599
- _this = _callSuper(this, InvalidCurrencyError, [message]);
600
- _this.name = 'InvalidCurrencyError';
601
- return _this;
602
- }
603
- _inherits(InvalidCurrencyError, _Error);
604
- return _createClass(InvalidCurrencyError);
605
- }(/*#__PURE__*/_wrapNativeSuper(Error));
606
-
607
- /**
608
- * Used to inform user, that Parachain they wish to use is not supported yet
609
- */
610
- var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
611
- /**
612
- * Constructs a new NodeNotSupportedError.
613
- *
614
- * @param message - Optional custom error message.
615
- */
616
- function NodeNotSupportedError(message) {
617
- var _this;
618
- _classCallCheck(this, NodeNotSupportedError);
619
- _this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
620
- _this.name = 'NodeNotSupported';
621
- return _this;
622
- }
623
- _inherits(NodeNotSupportedError, _Error);
624
- return _createClass(NodeNotSupportedError);
625
- }(/*#__PURE__*/_wrapNativeSuper(Error));
626
-
627
- /**
628
- * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
629
- */
630
- var NoXCMSupportImplementedError = /*#__PURE__*/function (_Error) {
631
- /**
632
- * Constructs a new NoXCMSupportImplementedError.
633
- *
634
- * @param node - The node for which XCM support is not implemented.
635
- */
636
- function NoXCMSupportImplementedError(node) {
637
- var _this;
638
- _classCallCheck(this, NoXCMSupportImplementedError);
639
- _this = _callSuper(this, NoXCMSupportImplementedError, ["No XCM support implemented for ".concat(node, " node yet.")]);
640
- _this.name = 'NoXCMSupportImplemented';
641
- return _this;
642
- }
643
- _inherits(NoXCMSupportImplementedError, _Error);
644
- return _createClass(NoXCMSupportImplementedError);
645
- }(/*#__PURE__*/_wrapNativeSuper(Error));
646
-
647
- /**
648
- * Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
649
- */
650
- var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
651
- /**
652
- * Constructs a new ScenarioNotSupportedError.
653
- *
654
- * @param node - The node where the scenario is not supported.
655
- * @param scenario - The scenario that is not supported.
656
- * @param message - Optional custom error message.
657
- */
658
- function ScenarioNotSupportedError(node, scenario, message) {
659
- var _this;
660
- _classCallCheck(this, ScenarioNotSupportedError);
661
- _this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
662
- _this.name = 'ScenarioNotSupported';
663
- return _this;
664
- }
665
- _inherits(ScenarioNotSupportedError, _Error);
666
- return _createClass(ScenarioNotSupportedError);
667
- }(/*#__PURE__*/_wrapNativeSuper(Error));
668
-
669
- /**
670
- * Error thrown when nodes from different relay chains are incompatible.
671
- */
672
- var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
673
- /**
674
- * Constructs a new IncompatibleNodesError.
675
- *
676
- * @param message - Optional custom error message.
677
- */
678
- function IncompatibleNodesError(message) {
679
- var _this;
680
- _classCallCheck(this, IncompatibleNodesError);
681
- _this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== void 0 ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
682
- _this.name = 'IncompatibleNodes';
683
- return _this;
684
- }
685
- _inherits(IncompatibleNodesError, _Error);
686
- return _createClass(IncompatibleNodesError);
687
- }(/*#__PURE__*/_wrapNativeSuper(Error));
688
-
689
- /**
690
- * Error thrown when multiple assets with the same symbol are found.
691
- */
692
- var DuplicateAssetError = /*#__PURE__*/function (_Error) {
693
- /**
694
- * Constructs a new DuplicateAssetError.
695
- *
696
- * @param symbol - The symbol of the asset causing the duplication error.
697
- */
698
- function DuplicateAssetError(msg) {
699
- var _this;
700
- _classCallCheck(this, DuplicateAssetError);
701
- _this = _callSuper(this, DuplicateAssetError, [msg]);
702
- _this.name = 'DuplicateAsset';
703
- return _this;
704
- }
705
- _inherits(DuplicateAssetError, _Error);
706
- return _createClass(DuplicateAssetError);
707
- }(/*#__PURE__*/_wrapNativeSuper(Error));
708
-
709
- /**
710
- * Error thrown when multiple assets with the same symbol are found.
711
- */
712
- var DuplicateAssetIdError = /*#__PURE__*/function (_Error) {
713
- /**
714
- * Constructs a new DuplicateAssetError.
715
- *
716
- * @param symbol - The symbol of the asset causing the duplication error.
717
- */
718
- function DuplicateAssetIdError(id) {
719
- var _this;
720
- _classCallCheck(this, DuplicateAssetIdError);
721
- _this = _callSuper(this, DuplicateAssetIdError, ["Multiple assets found with the same ID: ".concat(id, ". Please specify asset directly by symbol using .currency({symbol: <ASSET_SYMBOL>})")]);
722
- _this.name = 'DuplicateAssetId';
723
- return _this;
724
- }
725
- _inherits(DuplicateAssetIdError, _Error);
726
- return _createClass(DuplicateAssetIdError);
727
- }(/*#__PURE__*/_wrapNativeSuper(Error));
728
-
729
- /**
730
- * Error thrown when an invalid address is provided.
731
- */
732
- var InvalidAddressError = /*#__PURE__*/function (_Error) {
733
- /**
734
- * Constructs a new InvalidAddressError.
735
- *
736
- * @param message - The error message.
737
- */
738
- function InvalidAddressError(message) {
739
- var _this;
740
- _classCallCheck(this, InvalidAddressError);
741
- _this = _callSuper(this, InvalidAddressError, [message]);
742
- _this.name = 'InvalidAddressError';
743
- return _this;
744
- }
745
- _inherits(InvalidAddressError, _Error);
746
- return _createClass(InvalidAddressError);
747
- }(/*#__PURE__*/_wrapNativeSuper(Error));
748
-
749
- var KeepAliveError = /*#__PURE__*/function (_Error) {
750
- function KeepAliveError(message) {
751
- var _this;
752
- _classCallCheck(this, KeepAliveError);
753
- _this = _callSuper(this, KeepAliveError, [message]);
754
- _this.name = 'KeepAliveError';
755
- return _this;
756
- }
757
- _inherits(KeepAliveError, _Error);
758
- return _createClass(KeepAliveError);
759
- }(/*#__PURE__*/_wrapNativeSuper(Error));
760
-
761
587
  var Polkadot$2 = {
762
588
  relayChainAssetSymbol: "DOT",
763
589
  nativeAssetSymbol: "DOT",
@@ -1241,6 +1067,27 @@ var Astar$4 = {
1241
1067
  }
1242
1068
  }
1243
1069
  },
1070
+ {
1071
+ assetId: "18446744073709551641",
1072
+ symbol: "GAME",
1073
+ decimals: 10,
1074
+ multiLocation: {
1075
+ parents: 1,
1076
+ interior: {
1077
+ X3: [
1078
+ {
1079
+ Parachain: 1000
1080
+ },
1081
+ {
1082
+ PalletInstance: 50
1083
+ },
1084
+ {
1085
+ GeneralIndex: 555
1086
+ }
1087
+ ]
1088
+ }
1089
+ }
1090
+ },
1244
1091
  {
1245
1092
  assetId: "4294969281",
1246
1093
  symbol: "USDC",
@@ -3406,64 +3253,83 @@ var Hydration$4 = {
3406
3253
  }
3407
3254
  },
3408
3255
  {
3409
- assetId: "8",
3410
- symbol: "PHA",
3411
- decimals: 12,
3256
+ assetId: "1001",
3257
+ symbol: "aDOT",
3258
+ decimals: 10,
3412
3259
  multiLocation: {
3413
3260
  parents: 1,
3414
3261
  interior: {
3415
- X1: {
3416
- Parachain: 2035
3417
- }
3262
+ X2: [
3263
+ {
3264
+ Parachain: 2034
3265
+ },
3266
+ {
3267
+ AccountKey20: {
3268
+ network: null,
3269
+ key: "0x02639ec01313c8775fae74f2dad1118c8a8a86da"
3270
+ }
3271
+ }
3272
+ ]
3418
3273
  }
3419
3274
  }
3420
3275
  },
3421
3276
  {
3422
- assetId: "25",
3423
- symbol: "UNQ",
3424
- decimals: 18,
3277
+ assetId: "1002",
3278
+ symbol: "aUSDT",
3279
+ decimals: 6,
3425
3280
  multiLocation: {
3426
3281
  parents: 1,
3427
3282
  interior: {
3428
- X1: {
3429
- Parachain: 2037
3430
- }
3283
+ X2: [
3284
+ {
3285
+ Parachain: 2034
3286
+ },
3287
+ {
3288
+ AccountKey20: {
3289
+ network: null,
3290
+ key: "0xc64980e4eaf9a1151bd21712b9946b81e41e2b92"
3291
+ }
3292
+ }
3293
+ ]
3431
3294
  }
3432
3295
  }
3433
3296
  },
3434
3297
  {
3435
- assetId: "31",
3436
- symbol: "RING",
3437
- decimals: 18,
3298
+ assetId: "1003",
3299
+ symbol: "aUSDC",
3300
+ decimals: 6,
3438
3301
  multiLocation: {
3439
3302
  parents: 1,
3440
3303
  interior: {
3441
3304
  X2: [
3442
3305
  {
3443
- Parachain: 2046
3306
+ Parachain: 2034
3444
3307
  },
3445
3308
  {
3446
- PalletInstance: 5
3309
+ AccountKey20: {
3310
+ network: null,
3311
+ key: "0x2ec4884088d84e5c2970a034732e5209b0acfa93"
3312
+ }
3447
3313
  }
3448
3314
  ]
3449
3315
  }
3450
3316
  }
3451
3317
  },
3452
3318
  {
3453
- assetId: "32",
3454
- symbol: "AJUN",
3455
- decimals: 12,
3319
+ assetId: "1004",
3320
+ symbol: "aWBTC",
3321
+ decimals: 8,
3456
3322
  multiLocation: {
3457
3323
  parents: 1,
3458
3324
  interior: {
3459
3325
  X2: [
3460
3326
  {
3461
- Parachain: 2051
3327
+ Parachain: 2034
3462
3328
  },
3463
3329
  {
3464
- GeneralKey: {
3465
- length: 4,
3466
- data: "0x414a554e00000000000000000000000000000000000000000000000000000000"
3330
+ AccountKey20: {
3331
+ network: null,
3332
+ key: "0x02759d14d0d4f452b9c76f5a230750e8857d36f2"
3467
3333
  }
3468
3334
  }
3469
3335
  ]
@@ -3471,11 +3337,76 @@ var Hydration$4 = {
3471
3337
  }
3472
3338
  },
3473
3339
  {
3474
- assetId: "28",
3475
- symbol: "KILT",
3476
- decimals: 15,
3477
- multiLocation: {
3478
- parents: 1,
3340
+ assetId: "8",
3341
+ symbol: "PHA",
3342
+ decimals: 12,
3343
+ multiLocation: {
3344
+ parents: 1,
3345
+ interior: {
3346
+ X1: {
3347
+ Parachain: 2035
3348
+ }
3349
+ }
3350
+ }
3351
+ },
3352
+ {
3353
+ assetId: "25",
3354
+ symbol: "UNQ",
3355
+ decimals: 18,
3356
+ multiLocation: {
3357
+ parents: 1,
3358
+ interior: {
3359
+ X1: {
3360
+ Parachain: 2037
3361
+ }
3362
+ }
3363
+ }
3364
+ },
3365
+ {
3366
+ assetId: "31",
3367
+ symbol: "RING",
3368
+ decimals: 18,
3369
+ multiLocation: {
3370
+ parents: 1,
3371
+ interior: {
3372
+ X2: [
3373
+ {
3374
+ Parachain: 2046
3375
+ },
3376
+ {
3377
+ PalletInstance: 5
3378
+ }
3379
+ ]
3380
+ }
3381
+ }
3382
+ },
3383
+ {
3384
+ assetId: "32",
3385
+ symbol: "AJUN",
3386
+ decimals: 12,
3387
+ multiLocation: {
3388
+ parents: 1,
3389
+ interior: {
3390
+ X2: [
3391
+ {
3392
+ Parachain: 2051
3393
+ },
3394
+ {
3395
+ GeneralKey: {
3396
+ length: 4,
3397
+ data: "0x414a554e00000000000000000000000000000000000000000000000000000000"
3398
+ }
3399
+ }
3400
+ ]
3401
+ }
3402
+ }
3403
+ },
3404
+ {
3405
+ assetId: "28",
3406
+ symbol: "KILT",
3407
+ decimals: 15,
3408
+ multiLocation: {
3409
+ parents: 1,
3479
3410
  interior: {
3480
3411
  X1: {
3481
3412
  Parachain: 2086
@@ -5361,6 +5292,25 @@ var AssetHubPolkadot$4 = {
5361
5292
  }
5362
5293
  ]
5363
5294
  },
5295
+ {
5296
+ assetId: "555",
5297
+ symbol: "GAME",
5298
+ decimals: 10,
5299
+ xcmInterior: [
5300
+ {
5301
+ Network: "polkadot"
5302
+ },
5303
+ {
5304
+ Parachain: 1000
5305
+ },
5306
+ {
5307
+ PalletInstance: 50
5308
+ },
5309
+ {
5310
+ GeneralIndex: 555
5311
+ }
5312
+ ]
5313
+ },
5364
5314
  {
5365
5315
  symbol: "EQ",
5366
5316
  decimals: 9,
@@ -6542,19 +6492,6 @@ var KiltSpiritnet$4 = {
6542
6492
  otherAssets: [
6543
6493
  ]
6544
6494
  };
6545
- var Integritee$4 = {
6546
- relayChainAssetSymbol: "KSM",
6547
- nativeAssetSymbol: "TEER",
6548
- isEVM: false,
6549
- nativeAssets: [
6550
- {
6551
- symbol: "TEER",
6552
- decimals: 12
6553
- }
6554
- ],
6555
- otherAssets: [
6556
- ]
6557
- };
6558
6495
  var InvArchTinker$4 = {
6559
6496
  relayChainAssetSymbol: "KSM",
6560
6497
  nativeAssetSymbol: "TNKR",
@@ -8189,19 +8126,6 @@ var Picasso$4 = {
8189
8126
  }
8190
8127
  ]
8191
8128
  };
8192
- var Pioneer$4 = {
8193
- relayChainAssetSymbol: "KSM",
8194
- nativeAssetSymbol: "NEER",
8195
- isEVM: false,
8196
- nativeAssets: [
8197
- {
8198
- symbol: "NEER",
8199
- decimals: 18
8200
- }
8201
- ],
8202
- otherAssets: [
8203
- ]
8204
- };
8205
8129
  var Quartz$4 = {
8206
8130
  relayChainAssetSymbol: "KSM",
8207
8131
  nativeAssetSymbol: "QTZ",
@@ -9496,78 +9420,6 @@ var Pendulum$4 = {
9496
9420
  }
9497
9421
  ]
9498
9422
  };
9499
- var Polkadex$4 = {
9500
- relayChainAssetSymbol: "DOT",
9501
- nativeAssetSymbol: "PDEX",
9502
- isEVM: false,
9503
- nativeAssets: [
9504
- {
9505
- symbol: "PDEX",
9506
- decimals: 12
9507
- }
9508
- ],
9509
- otherAssets: [
9510
- {
9511
- assetId: "226557799181424065994173367616174607641",
9512
- symbol: "IBTC",
9513
- decimals: 12
9514
- },
9515
- {
9516
- assetId: "193492391581201937291053139015355410612",
9517
- symbol: "PHA",
9518
- decimals: 12
9519
- },
9520
- {
9521
- assetId: "130314105136721928300689838359167097187"
9522
- },
9523
- {
9524
- assetId: "14826654563114266286226336203450732505"
9525
- },
9526
- {
9527
- assetId: "222121451965151777636299756141619631150",
9528
- symbol: "ASTR",
9529
- decimals: 12
9530
- },
9531
- {
9532
- assetId: "95930534000017180603917534864279132680",
9533
- symbol: "DOT",
9534
- decimals: 12
9535
- },
9536
- {
9537
- assetId: "119367686984583275840673742485354142551",
9538
- symbol: "DED",
9539
- decimals: 12
9540
- },
9541
- {
9542
- assetId: "339306133874233608313826294843504252047",
9543
- symbol: "PINK",
9544
- decimals: 12
9545
- },
9546
- {
9547
- assetId: "3496813586714279103986568049643838918",
9548
- symbol: "USDT",
9549
- decimals: 12
9550
- },
9551
- {
9552
- assetId: "32595388462891559990827225517299393930",
9553
- symbol: "UNQ",
9554
- decimals: 12
9555
- },
9556
- {
9557
- assetId: "182269558229932594457975666948556356791",
9558
- symbol: "GLMR",
9559
- decimals: 12
9560
- },
9561
- {
9562
- assetId: "304494718746685751324769169435167367843",
9563
- symbol: "USDC",
9564
- decimals: 12
9565
- },
9566
- {
9567
- assetId: "240851462719321838889739625279903325250"
9568
- }
9569
- ]
9570
- };
9571
9423
  var Zeitgeist$4 = {
9572
9424
  relayChainAssetSymbol: "DOT",
9573
9425
  nativeAssetSymbol: "ZTG",
@@ -10612,7 +10464,6 @@ var assetsMapJson = {
10612
10464
  Encointer: Encointer$4,
10613
10465
  Imbue: Imbue$4,
10614
10466
  KiltSpiritnet: KiltSpiritnet$4,
10615
- Integritee: Integritee$4,
10616
10467
  InvArchTinker: InvArchTinker$4,
10617
10468
  Curio: Curio$4,
10618
10469
  Karura: Karura$4,
@@ -10621,7 +10472,6 @@ var assetsMapJson = {
10621
10472
  Moonriver: Moonriver$4,
10622
10473
  ParallelHeiko: ParallelHeiko$4,
10623
10474
  Picasso: Picasso$4,
10624
- Pioneer: Pioneer$4,
10625
10475
  Quartz: Quartz$4,
10626
10476
  RobonomicsKusama: RobonomicsKusama$4,
10627
10477
  RobonomicsPolkadot: RobonomicsPolkadot$4,
@@ -10638,7 +10488,6 @@ var assetsMapJson = {
10638
10488
  Nodle: Nodle$4,
10639
10489
  NeuroWeb: NeuroWeb$4,
10640
10490
  Pendulum: Pendulum$4,
10641
- Polkadex: Polkadex$4,
10642
10491
  Zeitgeist: Zeitgeist$4,
10643
10492
  Collectives: Collectives$4,
10644
10493
  Phala: Phala$4,
@@ -10813,10 +10662,6 @@ var BifrostPolkadot$3 = {
10813
10662
  {
10814
10663
  name: "LiebiEU",
10815
10664
  endpoint: "wss://eu.bifrost-polkadot-rpc.liebi.com/ws"
10816
- },
10817
- {
10818
- name: "RadiumBlock",
10819
- endpoint: "wss://bifrost.public.curie.radiumblock.co/ws"
10820
10665
  }
10821
10666
  ]
10822
10667
  };
@@ -11234,7 +11079,7 @@ var Bajun$3 = {
11234
11079
  providers: [
11235
11080
  {
11236
11081
  name: "AjunaNetwork",
11237
- endpoint: "wss://rpc-parachain.bajun.network"
11082
+ endpoint: "wss://rpc-para.bajun.network"
11238
11083
  },
11239
11084
  {
11240
11085
  name: "OnFinality",
@@ -11277,17 +11122,10 @@ var BifrostKusama$3 = {
11277
11122
  {
11278
11123
  name: "LiebiUS",
11279
11124
  endpoint: "wss://us.bifrost-rpc.liebi.com/ws"
11280
- }
11281
- ]
11282
- };
11283
- var Pioneer$3 = {
11284
- name: "Pioneer",
11285
- info: "pioneer",
11286
- paraId: 2096,
11287
- providers: [
11125
+ },
11288
11126
  {
11289
- name: "MetaverseNetwork",
11290
- endpoint: "wss://pioneer-rpc-3.bit.country/wss"
11127
+ name: "RadiumBlock",
11128
+ endpoint: "wss://bifrost.public.curie.radiumblock.co/ws"
11291
11129
  }
11292
11130
  ]
11293
11131
  };
@@ -11355,21 +11193,6 @@ var Imbue$3 = {
11355
11193
  }
11356
11194
  ]
11357
11195
  };
11358
- var Integritee$3 = {
11359
- name: "Integritee Network",
11360
- info: "integritee",
11361
- paraId: 2015,
11362
- providers: [
11363
- {
11364
- name: "Integritee",
11365
- endpoint: "wss://kusama.api.integritee.network"
11366
- },
11367
- {
11368
- name: "OnFinality",
11369
- endpoint: "wss://integritee-kusama.api.onfinality.io/public-ws"
11370
- }
11371
- ]
11372
- };
11373
11196
  var InvArchTinker$3 = {
11374
11197
  name: "InvArch Tinkernet",
11375
11198
  info: "tinker",
@@ -11642,10 +11465,6 @@ var Turing$3 = {
11642
11465
  {
11643
11466
  name: "Dwellir",
11644
11467
  endpoint: "wss://turing-rpc.dwellir.com"
11645
- },
11646
- {
11647
- name: "OAK",
11648
- endpoint: "wss://rpc.turing.oak.tech"
11649
11468
  }
11650
11469
  ]
11651
11470
  };
@@ -11759,13 +11578,6 @@ var Pendulum$3 = {
11759
11578
  }
11760
11579
  ]
11761
11580
  };
11762
- var Polkadex$3 = {
11763
- name: "Polkadex",
11764
- info: "polkadex",
11765
- paraId: 3363,
11766
- providers: [
11767
- ]
11768
- };
11769
11581
  var Zeitgeist$3 = {
11770
11582
  name: "Zeitgeist",
11771
11583
  info: "zeitgeist",
@@ -12107,12 +11919,10 @@ var configs = {
12107
11919
  Bajun: Bajun$3,
12108
11920
  Basilisk: Basilisk$3,
12109
11921
  BifrostKusama: BifrostKusama$3,
12110
- Pioneer: Pioneer$3,
12111
11922
  Calamari: Calamari$3,
12112
11923
  CrustShadow: CrustShadow$3,
12113
11924
  Crab: Crab$3,
12114
11925
  Imbue: Imbue$3,
12115
- Integritee: Integritee$3,
12116
11926
  InvArchTinker: InvArchTinker$3,
12117
11927
  Karura: Karura$3,
12118
11928
  Kintsugi: Kintsugi$3,
@@ -12132,7 +11942,6 @@ var configs = {
12132
11942
  Nodle: Nodle$3,
12133
11943
  NeuroWeb: NeuroWeb$3,
12134
11944
  Pendulum: Pendulum$3,
12135
- Polkadex: Polkadex$3,
12136
11945
  Zeitgeist: Zeitgeist$3,
12137
11946
  Collectives: Collectives$3,
12138
11947
  Khala: Khala$3,
@@ -12163,284 +11972,226 @@ var getNodeProviders = function getNodeProviders(node) {
12163
11972
  });
12164
11973
  };
12165
11974
 
12166
- var createX1Payload = function createX1Payload(version, junction) {
12167
- return version === Version.V4 ? {
12168
- X1: [junction]
12169
- } : {
12170
- X1: junction
12171
- };
11975
+ var getNodeProvider = function getNodeProvider(node) {
11976
+ if (isRelayChain(node)) {
11977
+ var _getNodeConfig = getNodeConfig(node),
11978
+ providers = _getNodeConfig.providers;
11979
+ if (providers.length === 0) {
11980
+ throw new Error("No providers found for node ".concat(node));
11981
+ }
11982
+ return providers[0].endpoint;
11983
+ }
11984
+ return getNode(node).getProvider();
12172
11985
  };
12173
11986
 
12174
- var isPrimitive = function isPrimitive(obj) {
12175
- return obj !== Object(obj);
11987
+ /**
11988
+ * Retrieves the parachain ID for a specified node.
11989
+ *
11990
+ * @param node - The node for which to get the paraId.
11991
+ * @returns The parachain ID of the node.
11992
+ */
11993
+ var getParaId = function getParaId(node) {
11994
+ return getNodeConfig(node).paraId;
12176
11995
  };
12177
- var _deepEqual = function deepEqual(obj1, obj2) {
12178
- if (obj1 === obj2) return true;
12179
- if (isPrimitive(obj1) && isPrimitive(obj2)) return obj1 === obj2;
12180
- if (_typeof(obj1) !== 'object' || obj1 === null || _typeof(obj2) !== 'object' || obj2 === null) {
12181
- return false;
11996
+
11997
+ /**
11998
+ * Used to inform user, that Parachain they wish to use has not yet implemented full XCM Support
11999
+ */
12000
+ var NoXCMSupportImplementedError = /*#__PURE__*/function (_Error) {
12001
+ /**
12002
+ * Constructs a new NoXCMSupportImplementedError.
12003
+ *
12004
+ * @param node - The node for which XCM support is not implemented.
12005
+ */
12006
+ function NoXCMSupportImplementedError(node) {
12007
+ var _this;
12008
+ _classCallCheck(this, NoXCMSupportImplementedError);
12009
+ _this = _callSuper(this, NoXCMSupportImplementedError, ["No XCM support implemented for ".concat(node, " node yet.")]);
12010
+ _this.name = 'NoXCMSupportImplemented';
12011
+ return _this;
12182
12012
  }
12183
- if (Array.isArray(obj1) !== Array.isArray(obj2)) {
12184
- return false;
12013
+ _inherits(NoXCMSupportImplementedError, _Error);
12014
+ return _createClass(NoXCMSupportImplementedError);
12015
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12016
+
12017
+ var findParachainJunction = function findParachainJunction(multilocation) {
12018
+ var interior = multilocation.interior;
12019
+ if (interior === 'Here') {
12020
+ return null;
12185
12021
  }
12186
- var obj1Keys = Object.keys(obj1).map(function (key) {
12187
- return key.toLowerCase();
12188
- });
12189
- var obj2Keys = Object.keys(obj2).map(function (key) {
12190
- return key.toLowerCase();
12191
- });
12192
- if (obj1Keys.length !== obj2Keys.length) return false;
12193
- var _iterator = _createForOfIteratorHelper(obj1Keys),
12194
- _step;
12195
- try {
12196
- var _loop = function _loop() {
12197
- var key = _step.value;
12198
- var keyInObj2 = obj2Keys.find(function (k) {
12199
- return k === key;
12200
- });
12201
- if (!keyInObj2) return {
12202
- v: false
12203
- };
12204
- var obj1Value = obj1[Object.keys(obj1).find(function (k) {
12205
- return k.toLowerCase() === key;
12206
- })];
12207
- var obj2Value = obj2[Object.keys(obj2).find(function (k) {
12208
- return k.toLowerCase() === key;
12209
- })];
12210
- if (!_deepEqual(obj1Value, obj2Value)) return {
12211
- v: false
12212
- };
12213
- },
12214
- _ret;
12215
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
12216
- _ret = _loop();
12217
- if (_ret) return _ret.v;
12022
+ for (var key in interior) {
12023
+ var junctions = interior[key];
12024
+ if (Array.isArray(junctions)) {
12025
+ var _iterator = _createForOfIteratorHelper(junctions),
12026
+ _step;
12027
+ try {
12028
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
12029
+ var junction = _step.value;
12030
+ if ('Parachain' in junction) {
12031
+ return Number(junction.Parachain);
12032
+ }
12033
+ }
12034
+ } catch (err) {
12035
+ _iterator.e(err);
12036
+ } finally {
12037
+ _iterator.f();
12038
+ }
12039
+ } else if (_typeof(junctions) === 'object' && junctions !== null && 'Parachain' in junctions) {
12040
+ return Number(junctions.Parachain);
12218
12041
  }
12219
- } catch (err) {
12220
- _iterator.e(err);
12221
- } finally {
12222
- _iterator.f();
12223
12042
  }
12224
- return true;
12043
+ return null;
12225
12044
  };
12226
12045
 
12227
- var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api, address) {
12228
- var isMultiLocation = _typeof(address) === 'object';
12229
- if (isMultiLocation) {
12230
- return _defineProperty({}, Version.V4, address);
12231
- }
12232
- var isEthAddress = ethers.isAddress(address);
12233
- return _defineProperty({}, Version.V4, {
12234
- parents: Parents.ZERO,
12235
- interior: {
12236
- X1: [isEthAddress ? {
12237
- AccountKey20: {
12238
- key: address
12239
- }
12240
- } : {
12241
- AccountId32: {
12242
- id: api.createAccountId(address),
12243
- network: null
12244
- }
12245
- }]
12246
- }
12247
- });
12046
+ var createX1Payload = function createX1Payload(version, junction) {
12047
+ return version === Version.V4 ? {
12048
+ X1: [junction]
12049
+ } : {
12050
+ X1: junction
12051
+ };
12248
12052
  };
12249
12053
 
12250
- var generateAddressPayload = function generateAddressPayload(api, scenario, pallet, recipientAddress, version, nodeId) {
12251
- var isMultiLocation = _typeof(recipientAddress) === 'object';
12252
- if (isMultiLocation) {
12253
- return _defineProperty({}, version, recipientAddress);
12254
- }
12255
- var isEthAddress = ethers.isAddress(recipientAddress);
12256
- if (scenario === 'ParaToRelay') {
12257
- return _defineProperty({}, version, {
12258
- parents: pallet === 'XTokens' ? Parents.ONE : Parents.ZERO,
12259
- interior: createX1Payload(version, {
12260
- AccountId32: Object.assign(Object.assign({}, version === Version.V1 && {
12261
- network: 'any'
12262
- }), {
12263
- id: api.createAccountId(recipientAddress)
12264
- })
12265
- })
12266
- });
12267
- }
12268
- if (scenario === 'ParaToPara' && pallet === 'XTokens') {
12269
- return _defineProperty({}, version, {
12270
- parents: Parents.ONE,
12271
- interior: {
12272
- X2: [{
12273
- Parachain: nodeId
12274
- }, isEthAddress ? {
12275
- AccountKey20: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
12276
- network: 'any'
12277
- }), {
12278
- key: recipientAddress
12279
- })
12280
- } : {
12281
- AccountId32: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
12282
- network: 'any'
12283
- }), {
12284
- id: api.createAccountId(recipientAddress)
12285
- })
12286
- }]
12287
- }
12288
- });
12289
- }
12290
- if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
12291
- return _defineProperty({}, version, {
12292
- parents: Parents.ZERO,
12293
- interior: createX1Payload(version, isEthAddress ? {
12294
- AccountKey20: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
12295
- network: 'any'
12296
- }), {
12297
- key: recipientAddress
12298
- })
12299
- } : {
12300
- AccountId32: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
12301
- network: 'any'
12302
- }), {
12303
- id: api.createAccountId(recipientAddress)
12304
- })
12305
- })
12306
- });
12054
+ /**
12055
+ * Used to inform user, that currency they wish to use is not registered on either origin or destination Parachain
12056
+ */
12057
+ var InvalidCurrencyError = /*#__PURE__*/function (_Error) {
12058
+ /**
12059
+ * Constructs a new InvalidCurrencyError.
12060
+ *
12061
+ * @param message - The error message.
12062
+ */
12063
+ function InvalidCurrencyError(message) {
12064
+ var _this;
12065
+ _classCallCheck(this, InvalidCurrencyError);
12066
+ _this = _callSuper(this, InvalidCurrencyError, [message]);
12067
+ _this.name = 'InvalidCurrencyError';
12068
+ return _this;
12307
12069
  }
12308
- return _defineProperty({}, version, {
12309
- parents: Parents.ZERO,
12310
- interior: createX1Payload(version, isEthAddress ? {
12311
- AccountKey20: {
12312
- key: recipientAddress
12313
- }
12314
- } : {
12315
- AccountId32: {
12316
- id: api.createAccountId(recipientAddress)
12317
- }
12318
- })
12319
- });
12320
- };
12070
+ _inherits(InvalidCurrencyError, _Error);
12071
+ return _createClass(InvalidCurrencyError);
12072
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12321
12073
 
12322
- var getFees = function getFees(scenario) {
12323
- if (scenario === 'ParaToRelay') {
12324
- return 4600000000;
12325
- } else if (scenario === 'ParaToPara') {
12326
- return 399600000000;
12074
+ /**
12075
+ * Used to inform user, that Parachain they wish to use is not supported yet
12076
+ */
12077
+ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
12078
+ /**
12079
+ * Constructs a new NodeNotSupportedError.
12080
+ *
12081
+ * @param message - Optional custom error message.
12082
+ */
12083
+ function NodeNotSupportedError(message) {
12084
+ var _this;
12085
+ _classCallCheck(this, NodeNotSupportedError);
12086
+ _this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
12087
+ _this.name = 'NodeNotSupported';
12088
+ return _this;
12327
12089
  }
12328
- throw new Error("Fees for scenario ".concat(scenario, " are not defined."));
12329
- };
12090
+ _inherits(NodeNotSupportedError, _Error);
12091
+ return _createClass(NodeNotSupportedError);
12092
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12330
12093
 
12331
12094
  /**
12332
- * Retrieves the node instance for a given node.
12333
- *
12334
- * @param node - The node identifier.
12335
- * @returns The node instance
12095
+ * Used to inform user, that Parachain they wish to use does not support scenario they wish to use yet
12336
12096
  */
12337
- var getNode = function getNode(node) {
12338
- var nodeMap = nodes();
12339
- return nodeMap[node];
12340
- };
12341
-
12342
- var createApiInstanceForNode$1 = function createApiInstanceForNode(api, node) {
12343
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12344
- var wsUrl;
12345
- return _regeneratorRuntime().wrap(function _callee$(_context) {
12346
- while (1) switch (_context.prev = _context.next) {
12347
- case 0:
12348
- if (!(node === 'Polkadot' || node === 'Kusama')) {
12349
- _context.next = 3;
12350
- break;
12351
- }
12352
- wsUrl = getNodeProvider(node);
12353
- return _context.abrupt("return", api.createApiInstance(wsUrl));
12354
- case 3:
12355
- return _context.abrupt("return", getNode(node).createApiInstance(api));
12356
- case 4:
12357
- case "end":
12358
- return _context.stop();
12359
- }
12360
- }, _callee);
12361
- }));
12362
- };
12363
-
12364
- var determineRelayChainSymbol = function determineRelayChainSymbol(node) {
12365
- if (node === 'Polkadot') {
12366
- return 'DOT';
12367
- } else if (node === 'Kusama') {
12368
- return 'KSM';
12369
- } else {
12370
- return getRelayChainSymbol(node);
12097
+ var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
12098
+ /**
12099
+ * Constructs a new ScenarioNotSupportedError.
12100
+ *
12101
+ * @param node - The node where the scenario is not supported.
12102
+ * @param scenario - The scenario that is not supported.
12103
+ * @param message - Optional custom error message.
12104
+ */
12105
+ function ScenarioNotSupportedError(node, scenario, message) {
12106
+ var _this;
12107
+ _classCallCheck(this, ScenarioNotSupportedError);
12108
+ _this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
12109
+ _this.name = 'ScenarioNotSupported';
12110
+ return _this;
12371
12111
  }
12372
- };
12112
+ _inherits(ScenarioNotSupportedError, _Error);
12113
+ return _createClass(ScenarioNotSupportedError);
12114
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12373
12115
 
12374
- // Contains important call creation utils (Selection of fees,formating of header and more.. )
12375
12116
  /**
12376
- * Determines the relay chain for a given node.
12377
- *
12378
- * @param node - The node for which to determine the relay chain.
12379
- * @returns 'Kusama' if the node's relay chain symbol is 'KSM'; otherwise, 'Polkadot'.
12117
+ * Error thrown when nodes from different relay chains are incompatible.
12380
12118
  */
12381
- var determineRelayChain = function determineRelayChain(node) {
12382
- return getRelayChainSymbol(node) === 'KSM' ? 'Kusama' : 'Polkadot';
12383
- };
12119
+ var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
12120
+ /**
12121
+ * Constructs a new IncompatibleNodesError.
12122
+ *
12123
+ * @param message - Optional custom error message.
12124
+ */
12125
+ function IncompatibleNodesError(message) {
12126
+ var _this;
12127
+ _classCallCheck(this, IncompatibleNodesError);
12128
+ _this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== void 0 ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
12129
+ _this.name = 'IncompatibleNodes';
12130
+ return _this;
12131
+ }
12132
+ _inherits(IncompatibleNodesError, _Error);
12133
+ return _createClass(IncompatibleNodesError);
12134
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12135
+
12384
12136
  /**
12385
- * Determines whether a given node is a relay chain (Polkadot or Kusama).
12386
- *
12387
- * @param node - The node to check.
12388
- * @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
12137
+ * Error thrown when multiple assets with the same symbol are found.
12389
12138
  */
12390
- var isRelayChain = function isRelayChain(node) {
12391
- return node === 'Polkadot' || node === 'Kusama';
12392
- };
12393
-
12394
- var getNodeProvider = function getNodeProvider(node) {
12395
- if (isRelayChain(node)) {
12396
- var _getNodeConfig = getNodeConfig(node),
12397
- providers = _getNodeConfig.providers;
12398
- if (providers.length === 0) {
12399
- throw new Error("No providers found for node ".concat(node));
12400
- }
12401
- return providers[0].endpoint;
12139
+ var DuplicateAssetError = /*#__PURE__*/function (_Error) {
12140
+ /**
12141
+ * Constructs a new DuplicateAssetError.
12142
+ *
12143
+ * @param symbol - The symbol of the asset causing the duplication error.
12144
+ */
12145
+ function DuplicateAssetError(msg) {
12146
+ var _this;
12147
+ _classCallCheck(this, DuplicateAssetError);
12148
+ _this = _callSuper(this, DuplicateAssetError, [msg]);
12149
+ _this.name = 'DuplicateAsset';
12150
+ return _this;
12402
12151
  }
12403
- return getNode(node).getProvider();
12404
- };
12152
+ _inherits(DuplicateAssetError, _Error);
12153
+ return _createClass(DuplicateAssetError);
12154
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12405
12155
 
12406
12156
  /**
12407
- * Retrieves the parachain ID for a specified node.
12408
- *
12409
- * @param node - The node for which to get the paraId.
12410
- * @returns The parachain ID of the node.
12157
+ * Error thrown when multiple assets with the same symbol are found.
12411
12158
  */
12412
- var getParaId = function getParaId(node) {
12413
- return getNodeConfig(node).paraId;
12414
- };
12415
-
12416
- var findParachainJunction = function findParachainJunction(multilocation) {
12417
- var interior = multilocation.interior;
12418
- if (interior === 'Here') {
12419
- return null;
12159
+ var DuplicateAssetIdError = /*#__PURE__*/function (_Error) {
12160
+ /**
12161
+ * Constructs a new DuplicateAssetError.
12162
+ *
12163
+ * @param symbol - The symbol of the asset causing the duplication error.
12164
+ */
12165
+ function DuplicateAssetIdError(id) {
12166
+ var _this;
12167
+ _classCallCheck(this, DuplicateAssetIdError);
12168
+ _this = _callSuper(this, DuplicateAssetIdError, ["Multiple assets found with the same ID: ".concat(id, ". Please specify asset directly by symbol using .currency({symbol: <ASSET_SYMBOL>})")]);
12169
+ _this.name = 'DuplicateAssetId';
12170
+ return _this;
12420
12171
  }
12421
- for (var key in interior) {
12422
- var junctions = interior[key];
12423
- if (Array.isArray(junctions)) {
12424
- var _iterator = _createForOfIteratorHelper(junctions),
12425
- _step;
12426
- try {
12427
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
12428
- var junction = _step.value;
12429
- if ('Parachain' in junction) {
12430
- return Number(junction.Parachain);
12431
- }
12432
- }
12433
- } catch (err) {
12434
- _iterator.e(err);
12435
- } finally {
12436
- _iterator.f();
12437
- }
12438
- } else if (_typeof(junctions) === 'object' && junctions !== null && 'Parachain' in junctions) {
12439
- return Number(junctions.Parachain);
12440
- }
12172
+ _inherits(DuplicateAssetIdError, _Error);
12173
+ return _createClass(DuplicateAssetIdError);
12174
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12175
+
12176
+ /**
12177
+ * Error thrown when an invalid address is provided.
12178
+ */
12179
+ var InvalidAddressError = /*#__PURE__*/function (_Error) {
12180
+ /**
12181
+ * Constructs a new InvalidAddressError.
12182
+ *
12183
+ * @param message - The error message.
12184
+ */
12185
+ function InvalidAddressError(message) {
12186
+ var _this;
12187
+ _classCallCheck(this, InvalidAddressError);
12188
+ _this = _callSuper(this, InvalidAddressError, [message]);
12189
+ _this.name = 'InvalidAddressError';
12190
+ return _this;
12441
12191
  }
12442
- return null;
12443
- };
12192
+ _inherits(InvalidAddressError, _Error);
12193
+ return _createClass(InvalidAddressError);
12194
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
12444
12195
 
12445
12196
  var DEFAULT_FEE_ASSET = 0;
12446
12197
  var ETH_CHAIN_ID = BigInt(1);
@@ -12462,7 +12213,10 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
12462
12213
  address = _ref.address,
12463
12214
  amount = _ref.amount,
12464
12215
  paraIdTo = _ref.paraIdTo;
12465
- var includeFee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
12216
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
12217
+ includeFee: false
12218
+ },
12219
+ includeFee = _ref2.includeFee;
12466
12220
  // Handle the case when a destination is a multi-location
12467
12221
  var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
12468
12222
  return Object.assign({
@@ -12843,15 +12597,28 @@ var ParachainNode = /*#__PURE__*/function () {
12843
12597
  }, _callee, this);
12844
12598
  }));
12845
12599
  }
12600
+ }, {
12601
+ key: "getRelayToParaOverrides",
12602
+ value: function getRelayToParaOverrides() {
12603
+ return {
12604
+ section: 'reserve_transfer_assets',
12605
+ includeFee: false
12606
+ };
12607
+ }
12846
12608
  }, {
12847
12609
  key: "transferRelayToPara",
12848
12610
  value: function transferRelayToPara(options) {
12849
12611
  var _options$version = options.version,
12850
12612
  version = _options$version === void 0 ? Version.V3 : _options$version;
12613
+ var _this$getRelayToParaO = this.getRelayToParaOverrides(),
12614
+ section = _this$getRelayToParaO.section,
12615
+ includeFee = _this$getRelayToParaO.includeFee;
12851
12616
  return {
12852
12617
  module: 'XcmPallet',
12853
- section: 'reserve_transfer_assets',
12854
- parameters: constructRelayToParaParameters(options, version)
12618
+ section: section,
12619
+ parameters: constructRelayToParaParameters(options, version, {
12620
+ includeFee: includeFee
12621
+ })
12855
12622
  };
12856
12623
  }
12857
12624
  }, {
@@ -13413,7 +13180,7 @@ var Hydration$2 = /*#__PURE__*/function (_ParachainNode) {
13413
13180
  key: "getProvider",
13414
13181
  value: function getProvider() {
13415
13182
  // Return the second WebSocket URL because the first one is sometimes unreliable.
13416
- return getNodeProviders(this.node)[2];
13183
+ return getNodeProviders(this.node)[3];
13417
13184
  }
13418
13185
  }]);
13419
13186
  }(ParachainNode);
@@ -13492,14 +13259,11 @@ var Moonbeam$2 = /*#__PURE__*/function (_ParachainNode) {
13492
13259
  }), 'transfer_assets', 'Unlimited'));
13493
13260
  }
13494
13261
  }, {
13495
- key: "transferRelayToPara",
13496
- value: function transferRelayToPara(options) {
13497
- var _options$version = options.version,
13498
- version = _options$version === void 0 ? Version.V3 : _options$version;
13262
+ key: "getRelayToParaOverrides",
13263
+ value: function getRelayToParaOverrides() {
13499
13264
  return {
13500
- module: 'XcmPallet',
13501
13265
  section: 'limited_reserve_transfer_assets',
13502
- parameters: constructRelayToParaParameters(options, version, true)
13266
+ includeFee: true
13503
13267
  };
13504
13268
  }
13505
13269
  }, {
@@ -13648,23 +13412,6 @@ var BifrostKusama$2 = /*#__PURE__*/function (_ParachainNode) {
13648
13412
  }]);
13649
13413
  }(ParachainNode);
13650
13414
 
13651
- var Pioneer$2 = /*#__PURE__*/function (_ParachainNode) {
13652
- function Pioneer() {
13653
- _classCallCheck(this, Pioneer);
13654
- return _callSuper(this, Pioneer, ['Pioneer', 'pioneer', 'kusama', Version.V1]);
13655
- }
13656
- _inherits(Pioneer, _ParachainNode);
13657
- return _createClass(Pioneer, [{
13658
- key: "transferXTokens",
13659
- value: function transferXTokens(input) {
13660
- // Multiple asset options needs addressing
13661
- var fees = input.fees;
13662
- var currencySelection = 'NativeToken';
13663
- return XTokensTransferImpl.transferXTokens(input, currencySelection, fees);
13664
- }
13665
- }]);
13666
- }(ParachainNode);
13667
-
13668
13415
  var Turing$2 = /*#__PURE__*/function (_ParachainNode) {
13669
13416
  function Turing() {
13670
13417
  _classCallCheck(this, Turing);
@@ -13753,14 +13500,11 @@ var Moonriver$2 = /*#__PURE__*/function (_ParachainNode) {
13753
13500
  }), 'transfer_assets', 'Unlimited'));
13754
13501
  }
13755
13502
  }, {
13756
- key: "transferRelayToPara",
13757
- value: function transferRelayToPara(options) {
13758
- var _options$version = options.version,
13759
- version = _options$version === void 0 ? Version.V3 : _options$version;
13503
+ key: "getRelayToParaOverrides",
13504
+ value: function getRelayToParaOverrides() {
13760
13505
  return {
13761
- module: 'XcmPallet',
13762
13506
  section: 'limited_reserve_transfer_assets',
13763
- parameters: constructRelayToParaParameters(options, version, true)
13507
+ includeFee: true
13764
13508
  };
13765
13509
  }
13766
13510
  }, {
@@ -13858,27 +13602,6 @@ var Imbue$2 = /*#__PURE__*/function (_ParachainNode) {
13858
13602
  }]);
13859
13603
  }(ParachainNode);
13860
13604
 
13861
- var Integritee$2 = /*#__PURE__*/function (_ParachainNode) {
13862
- function Integritee() {
13863
- _classCallCheck(this, Integritee);
13864
- return _callSuper(this, Integritee, ['Integritee', 'integritee', 'kusama', Version.V3]);
13865
- }
13866
- _inherits(Integritee, _ParachainNode);
13867
- return _createClass(Integritee, [{
13868
- key: "transferXTokens",
13869
- value: function transferXTokens(input) {
13870
- var asset = input.asset;
13871
- if (asset.symbol === 'KSM') throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency KSM"));
13872
- return XTokensTransferImpl.transferXTokens(input, asset.symbol);
13873
- }
13874
- }, {
13875
- key: "transferRelayToPara",
13876
- value: function transferRelayToPara() {
13877
- throw new NodeNotSupportedError();
13878
- }
13879
- }]);
13880
- }(ParachainNode);
13881
-
13882
13605
  var InvArchTinker$2 = /*#__PURE__*/function (_ParachainNode) {
13883
13606
  function InvArchTinker() {
13884
13607
  _classCallCheck(this, InvArchTinker);
@@ -13902,20 +13625,115 @@ var Karura$2 = /*#__PURE__*/function (_ParachainNode) {
13902
13625
  _classCallCheck(this, Karura);
13903
13626
  return _callSuper(this, Karura, ['Karura', 'karura', 'kusama', Version.V3]);
13904
13627
  }
13905
- _inherits(Karura, _ParachainNode);
13906
- return _createClass(Karura, [{
13907
- key: "transferXTokens",
13908
- value: function transferXTokens(input) {
13909
- return getNode('Acala').transferXTokens(input);
13910
- }
13911
- }, {
13912
- key: "getProvider",
13913
- value: function getProvider() {
13914
- // Return the second WebSocket URL because the first one is sometimes unreliable.
13915
- return getNodeProviders(this.node)[4];
13916
- }
13917
- }]);
13918
- }(ParachainNode);
13628
+ _inherits(Karura, _ParachainNode);
13629
+ return _createClass(Karura, [{
13630
+ key: "transferXTokens",
13631
+ value: function transferXTokens(input) {
13632
+ return getNode('Acala').transferXTokens(input);
13633
+ }
13634
+ }, {
13635
+ key: "getProvider",
13636
+ value: function getProvider() {
13637
+ // Return the second WebSocket URL because the first one is sometimes unreliable.
13638
+ return getNodeProviders(this.node)[4];
13639
+ }
13640
+ }]);
13641
+ }(ParachainNode);
13642
+
13643
+ var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api, address) {
13644
+ var isMultiLocation = _typeof(address) === 'object';
13645
+ if (isMultiLocation) {
13646
+ return _defineProperty({}, Version.V4, address);
13647
+ }
13648
+ var isEthAddress = ethers.isAddress(address);
13649
+ return _defineProperty({}, Version.V4, {
13650
+ parents: Parents.ZERO,
13651
+ interior: {
13652
+ X1: [isEthAddress ? {
13653
+ AccountKey20: {
13654
+ key: address
13655
+ }
13656
+ } : {
13657
+ AccountId32: {
13658
+ id: api.createAccountId(address),
13659
+ network: null
13660
+ }
13661
+ }]
13662
+ }
13663
+ });
13664
+ };
13665
+
13666
+ var generateAddressPayload = function generateAddressPayload(api, scenario, pallet, recipientAddress, version, nodeId) {
13667
+ var isMultiLocation = _typeof(recipientAddress) === 'object';
13668
+ if (isMultiLocation) {
13669
+ return _defineProperty({}, version, recipientAddress);
13670
+ }
13671
+ var isEthAddress = ethers.isAddress(recipientAddress);
13672
+ if (scenario === 'ParaToRelay') {
13673
+ return _defineProperty({}, version, {
13674
+ parents: pallet === 'XTokens' ? Parents.ONE : Parents.ZERO,
13675
+ interior: createX1Payload(version, {
13676
+ AccountId32: Object.assign(Object.assign({}, version === Version.V1 && {
13677
+ network: 'any'
13678
+ }), {
13679
+ id: api.createAccountId(recipientAddress)
13680
+ })
13681
+ })
13682
+ });
13683
+ }
13684
+ if (scenario === 'ParaToPara' && pallet === 'XTokens') {
13685
+ return _defineProperty({}, version, {
13686
+ parents: Parents.ONE,
13687
+ interior: {
13688
+ X2: [{
13689
+ Parachain: nodeId
13690
+ }, isEthAddress ? {
13691
+ AccountKey20: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
13692
+ network: 'any'
13693
+ }), {
13694
+ key: recipientAddress
13695
+ })
13696
+ } : {
13697
+ AccountId32: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
13698
+ network: 'any'
13699
+ }), {
13700
+ id: api.createAccountId(recipientAddress)
13701
+ })
13702
+ }]
13703
+ }
13704
+ });
13705
+ }
13706
+ if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
13707
+ return _defineProperty({}, version, {
13708
+ parents: Parents.ZERO,
13709
+ interior: createX1Payload(version, isEthAddress ? {
13710
+ AccountKey20: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
13711
+ network: 'any'
13712
+ }), {
13713
+ key: recipientAddress
13714
+ })
13715
+ } : {
13716
+ AccountId32: Object.assign(Object.assign({}, (version === Version.V1 || version === Version.V2) && {
13717
+ network: 'any'
13718
+ }), {
13719
+ id: api.createAccountId(recipientAddress)
13720
+ })
13721
+ })
13722
+ });
13723
+ }
13724
+ return _defineProperty({}, version, {
13725
+ parents: Parents.ZERO,
13726
+ interior: createX1Payload(version, isEthAddress ? {
13727
+ AccountKey20: {
13728
+ key: recipientAddress
13729
+ }
13730
+ } : {
13731
+ AccountId32: {
13732
+ id: api.createAccountId(recipientAddress)
13733
+ }
13734
+ })
13735
+ });
13736
+ };
13919
13737
 
13920
13738
  var createCustomXcmToBifrost = function createCustomXcmToBifrost(_ref, version) {
13921
13739
  var api = _ref.api,
@@ -14122,14 +13940,11 @@ var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
14122
13940
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, section, 'Unlimited'));
14123
13941
  }
14124
13942
  }, {
14125
- key: "transferRelayToPara",
14126
- value: function transferRelayToPara(options) {
14127
- var _options$version = options.version,
14128
- version = _options$version === void 0 ? Version.V3 : _options$version;
13943
+ key: "getRelayToParaOverrides",
13944
+ value: function getRelayToParaOverrides() {
14129
13945
  return {
14130
- module: 'XcmPallet',
14131
13946
  section: 'limited_teleport_assets',
14132
- parameters: constructRelayToParaParameters(options, version, true)
13947
+ includeFee: true
14133
13948
  };
14134
13949
  }
14135
13950
  }, {
@@ -14150,6 +13965,12 @@ var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
14150
13965
  return _superPropGet(AssetHubPolkadot, "createCurrencySpec", this, 3)([amount, scenario, version, asset]);
14151
13966
  }
14152
13967
  }
13968
+ }, {
13969
+ key: "getProvider",
13970
+ value: function getProvider() {
13971
+ // Return the second WebSocket URL because the first one is sometimes unreliable.
13972
+ return getNodeProviders(this.node)[1];
13973
+ }
14153
13974
  }]);
14154
13975
  }(ParachainNode);
14155
13976
 
@@ -14180,14 +14001,11 @@ var AssetHubKusama$2 = /*#__PURE__*/function (_ParachainNode) {
14180
14001
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14181
14002
  }
14182
14003
  }, {
14183
- key: "transferRelayToPara",
14184
- value: function transferRelayToPara(options) {
14185
- var _options$version = options.version,
14186
- version = _options$version === void 0 ? Version.V3 : _options$version;
14004
+ key: "getRelayToParaOverrides",
14005
+ value: function getRelayToParaOverrides() {
14187
14006
  return {
14188
- module: 'XcmPallet',
14189
14007
  section: 'limited_teleport_assets',
14190
- parameters: constructRelayToParaParameters(options, version, true)
14008
+ includeFee: true
14191
14009
  };
14192
14010
  }
14193
14011
  }, {
@@ -14216,16 +14034,11 @@ var CoretimeKusama$2 = /*#__PURE__*/function (_ParachainNode) {
14216
14034
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14217
14035
  }
14218
14036
  }, {
14219
- key: "transferRelayToPara",
14220
- value: function transferRelayToPara(options) {
14221
- // TESTED block hash on Rococo: 0x28929f7b2aeadbf3333f05d35bed18214a4b23dd270bd072f99e8a0131d22456
14222
- // https://rococo.subscan.io/extrinsic/0x469eec7dccb22696b0c95cf4f5eec4b367ad3dc23243a346cc2aad3cc9522800
14223
- var _options$version = options.version,
14224
- version = _options$version === void 0 ? Version.V3 : _options$version;
14037
+ key: "getRelayToParaOverrides",
14038
+ value: function getRelayToParaOverrides() {
14225
14039
  return {
14226
- module: 'XcmPallet',
14227
14040
  section: 'limited_teleport_assets',
14228
- parameters: constructRelayToParaParameters(options, version, true)
14041
+ includeFee: true
14229
14042
  };
14230
14043
  }
14231
14044
  }]);
@@ -14248,14 +14061,11 @@ var CoretimePolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
14248
14061
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14249
14062
  }
14250
14063
  }, {
14251
- key: "transferRelayToPara",
14252
- value: function transferRelayToPara(options) {
14253
- var _options$version = options.version,
14254
- version = _options$version === void 0 ? Version.V3 : _options$version;
14064
+ key: "getRelayToParaOverrides",
14065
+ value: function getRelayToParaOverrides() {
14255
14066
  return {
14256
- module: 'XcmPallet',
14257
14067
  section: 'limited_teleport_assets',
14258
- parameters: constructRelayToParaParameters(options, version, true)
14068
+ includeFee: true
14259
14069
  };
14260
14070
  }
14261
14071
  }]);
@@ -14278,14 +14088,11 @@ var Encointer$2 = /*#__PURE__*/function (_ParachainNode) {
14278
14088
  throw new ScenarioNotSupportedError(this.node, input.scenario);
14279
14089
  }
14280
14090
  }, {
14281
- key: "transferRelayToPara",
14282
- value: function transferRelayToPara(options) {
14283
- var _options$version = options.version,
14284
- version = _options$version === void 0 ? Version.V1 : _options$version;
14091
+ key: "getRelayToParaOverrides",
14092
+ value: function getRelayToParaOverrides() {
14285
14093
  return {
14286
- module: 'XcmPallet',
14287
14094
  section: 'limited_teleport_assets',
14288
- parameters: constructRelayToParaParameters(options, version, true)
14095
+ includeFee: true
14289
14096
  };
14290
14097
  }
14291
14098
  }]);
@@ -14336,16 +14143,19 @@ var PeoplePolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
14336
14143
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14337
14144
  }
14338
14145
  }, {
14339
- key: "transferRelayToPara",
14340
- value: function transferRelayToPara(options) {
14341
- var _options$version = options.version,
14342
- version = _options$version === void 0 ? Version.V3 : _options$version;
14146
+ key: "getRelayToParaOverrides",
14147
+ value: function getRelayToParaOverrides() {
14343
14148
  return {
14344
- module: 'XcmPallet',
14345
14149
  section: 'limited_teleport_assets',
14346
- parameters: constructRelayToParaParameters(options, version, true)
14150
+ includeFee: true
14347
14151
  };
14348
14152
  }
14153
+ }, {
14154
+ key: "getProvider",
14155
+ value: function getProvider() {
14156
+ // Return the second WebSocket URL because the first one is sometimes unreliable.
14157
+ return getNodeProviders(this.node)[2];
14158
+ }
14349
14159
  }]);
14350
14160
  }(ParachainNode);
14351
14161
 
@@ -14366,14 +14176,11 @@ var PeopleKusama$2 = /*#__PURE__*/function (_ParachainNode) {
14366
14176
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14367
14177
  }
14368
14178
  }, {
14369
- key: "transferRelayToPara",
14370
- value: function transferRelayToPara(options) {
14371
- var _options$version = options.version,
14372
- version = _options$version === void 0 ? Version.V3 : _options$version;
14179
+ key: "getRelayToParaOverrides",
14180
+ value: function getRelayToParaOverrides() {
14373
14181
  return {
14374
- module: 'XcmPallet',
14375
14182
  section: 'limited_teleport_assets',
14376
- parameters: constructRelayToParaParameters(options, version, true)
14183
+ includeFee: true
14377
14184
  };
14378
14185
  }
14379
14186
  }]);
@@ -14630,29 +14437,6 @@ var Pendulum$2 = /*#__PURE__*/function (_ParachainNode) {
14630
14437
  }]);
14631
14438
  }(ParachainNode);
14632
14439
 
14633
- var Polkadex$2 = /*#__PURE__*/function (_ParachainNode) {
14634
- function Polkadex() {
14635
- _classCallCheck(this, Polkadex);
14636
- return _callSuper(this, Polkadex, ['Polkadex', 'polkadex', 'polkadot', Version.V3]);
14637
- }
14638
- _inherits(Polkadex, _ParachainNode);
14639
- return _createClass(Polkadex, [{
14640
- key: "transferXTokens",
14641
- value: function transferXTokens(input) {
14642
- var asset = input.asset;
14643
- if (!isForeignAsset(asset) || !asset.assetId) {
14644
- throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
14645
- }
14646
- return XTokensTransferImpl.transferXTokens(input, BigInt(asset.assetId));
14647
- }
14648
- }, {
14649
- key: "getProvider",
14650
- value: function getProvider() {
14651
- return 'wss://polkadex-parachain-rpc.dwellir.com';
14652
- }
14653
- }]);
14654
- }(ParachainNode);
14655
-
14656
14440
  var Zeitgeist$2 = /*#__PURE__*/function (_ParachainNode) {
14657
14441
  function Zeitgeist() {
14658
14442
  _classCallCheck(this, Zeitgeist);
@@ -14696,14 +14480,11 @@ var Collectives$2 = /*#__PURE__*/function (_ParachainNode) {
14696
14480
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_teleport_assets', 'Unlimited'));
14697
14481
  }
14698
14482
  }, {
14699
- key: "transferRelayToPara",
14700
- value: function transferRelayToPara(options) {
14701
- var _options$version = options.version,
14702
- version = _options$version === void 0 ? Version.V3 : _options$version;
14483
+ key: "getRelayToParaOverrides",
14484
+ value: function getRelayToParaOverrides() {
14703
14485
  return {
14704
- module: 'XcmPallet',
14705
14486
  section: 'limited_teleport_assets',
14706
- parameters: constructRelayToParaParameters(options, version, true)
14487
+ includeFee: true
14707
14488
  };
14708
14489
  }
14709
14490
  }, {
@@ -14922,14 +14703,11 @@ var BridgeHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
14922
14703
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14923
14704
  }
14924
14705
  }, {
14925
- key: "transferRelayToPara",
14926
- value: function transferRelayToPara(options) {
14927
- var _options$version = options.version,
14928
- version = _options$version === void 0 ? Version.V3 : _options$version;
14706
+ key: "getRelayToParaOverrides",
14707
+ value: function getRelayToParaOverrides() {
14929
14708
  return {
14930
- module: 'XcmPallet',
14931
14709
  section: 'limited_teleport_assets',
14932
- parameters: constructRelayToParaParameters(options, version, true)
14710
+ includeFee: true
14933
14711
  };
14934
14712
  }
14935
14713
  }]);
@@ -14955,14 +14733,11 @@ var BridgeHubKusama$2 = /*#__PURE__*/function (_ParachainNode) {
14955
14733
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited'));
14956
14734
  }
14957
14735
  }, {
14958
- key: "transferRelayToPara",
14959
- value: function transferRelayToPara(options) {
14960
- var _options$version = options.version,
14961
- version = _options$version === void 0 ? Version.V3 : _options$version;
14736
+ key: "getRelayToParaOverrides",
14737
+ value: function getRelayToParaOverrides() {
14962
14738
  return {
14963
- module: 'XcmPallet',
14964
14739
  section: 'limited_teleport_assets',
14965
- parameters: constructRelayToParaParameters(options, version, true)
14740
+ includeFee: true
14966
14741
  };
14967
14742
  }
14968
14743
  }]);
@@ -15074,7 +14849,7 @@ var Polimec$2 = /*#__PURE__*/function (_ParachainNode) {
15074
14849
  _classCallCheck(this, Polimec);
15075
14850
  _this = _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot', Version.V3]);
15076
14851
  _this.getAssetMultiLocation = function (asset) {
15077
- if (!isForeignAsset(asset) && asset.symbol === 'DOT') {
14852
+ if (asset.symbol === 'DOT') {
15078
14853
  return DOT_MULTILOCATION;
15079
14854
  }
15080
14855
  if (isForeignAsset(asset) && asset.multiLocation !== undefined) {
@@ -15178,7 +14953,7 @@ var Polimec$2 = /*#__PURE__*/function (_ParachainNode) {
15178
14953
  /**
15179
14954
  * Supported nodes excluding relay chains and Ethereum.
15180
14955
  */
15181
- var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'CoretimePolkadot', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Pioneer', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'Integritee', 'InvArchTinker', 'Karura', 'Kintsugi', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'RobonomicsKusama', 'RobonomicsPolkadot', 'PeoplePolkadot', 'PeopleKusama', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Polkadex', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq', 'Polimec'];
14956
+ var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'CoretimePolkadot', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'InvArchTinker', 'Karura', 'Kintsugi', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'RobonomicsKusama', 'RobonomicsPolkadot', 'PeoplePolkadot', 'PeopleKusama', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq', 'Polimec'];
15182
14957
  /**
15183
14958
  * Supported nodes including Ethereum.
15184
14959
  */
@@ -15219,12 +14994,10 @@ var nodes = function nodes() {
15219
14994
  Bajun: new Bajun$2(),
15220
14995
  Basilisk: new Basilisk$2(),
15221
14996
  BifrostKusama: new BifrostKusama$2(),
15222
- Pioneer: new Pioneer$2(),
15223
14997
  Calamari: new Calamari$2(),
15224
14998
  CrustShadow: new CrustShadow$2(),
15225
14999
  Crab: new Crab$2(),
15226
15000
  Imbue: new Imbue$2(),
15227
- Integritee: new Integritee$2(),
15228
15001
  InvArchTinker: new InvArchTinker$2(),
15229
15002
  Karura: new Karura$2(),
15230
15003
  Kintsugi: new Kintsugi$2(),
@@ -15242,7 +15015,6 @@ var nodes = function nodes() {
15242
15015
  Nodle: new Nodle$2(),
15243
15016
  NeuroWeb: new NeuroWeb$2(),
15244
15017
  Pendulum: new Pendulum$2(),
15245
- Polkadex: new Polkadex$2(),
15246
15018
  Zeitgeist: new Zeitgeist$2(),
15247
15019
  Collectives: new Collectives$2(),
15248
15020
  Khala: new Khala$2(),
@@ -15441,12 +15213,10 @@ var Amplitude$1 = "1000000000";
15441
15213
  var Bajun$1 = "1000000000";
15442
15214
  var Basilisk$1 = "1000000000000";
15443
15215
  var BifrostKusama$1 = "10000000000";
15444
- var Pioneer$1 = "100000000000000000";
15445
15216
  var Calamari$1 = "100000000000";
15446
15217
  var CrustShadow$1 = "100000000000";
15447
15218
  var Crab$1 = "0";
15448
15219
  var Imbue$1 = "1000000";
15449
- var Integritee$1 = "1000000000";
15450
15220
  var InvArchTinker$1 = "1000000000";
15451
15221
  var Karura$1 = "100000000000";
15452
15222
  var Moonriver$1 = "0";
@@ -15462,7 +15232,6 @@ var Manta$1 = "100000000000000000";
15462
15232
  var Nodle$1 = "10000";
15463
15233
  var NeuroWeb$1 = "1000000000000";
15464
15234
  var Pendulum$1 = "1000000000";
15465
- var Polkadex$1 = "1000000000000";
15466
15235
  var Zeitgeist$1 = "50000000";
15467
15236
  var Polkadot = "10000000000";
15468
15237
  var Kusama = "333333333";
@@ -15477,7 +15246,7 @@ var Curio$1 = "10000000000000000";
15477
15246
  var BridgeHubPolkadot$1 = "1000000000";
15478
15247
  var BridgeHubKusama$1 = "33333333";
15479
15248
  var Mythos$1 = "10000000000000000";
15480
- var Peaq$1 = "500";
15249
+ var Peaq$1 = "0";
15481
15250
  var CoretimePolkadot$1 = "1000000000";
15482
15251
  var Polimec$1 = "100000000";
15483
15252
  var RobonomicsPolkadot$1 = "1000";
@@ -15504,12 +15273,10 @@ var existentialDeposits = {
15504
15273
  Bajun: Bajun$1,
15505
15274
  Basilisk: Basilisk$1,
15506
15275
  BifrostKusama: BifrostKusama$1,
15507
- Pioneer: Pioneer$1,
15508
15276
  Calamari: Calamari$1,
15509
15277
  CrustShadow: CrustShadow$1,
15510
15278
  Crab: Crab$1,
15511
15279
  Imbue: Imbue$1,
15512
- Integritee: Integritee$1,
15513
15280
  InvArchTinker: InvArchTinker$1,
15514
15281
  Karura: Karura$1,
15515
15282
  Moonriver: Moonriver$1,
@@ -15525,7 +15292,6 @@ var existentialDeposits = {
15525
15292
  Nodle: Nodle$1,
15526
15293
  NeuroWeb: NeuroWeb$1,
15527
15294
  Pendulum: Pendulum$1,
15528
- Polkadex: Polkadex$1,
15529
15295
  Zeitgeist: Zeitgeist$1,
15530
15296
  Polkadot: Polkadot,
15531
15297
  Kusama: Kusama,
@@ -15577,7 +15343,6 @@ var edsMapJson = /*#__PURE__*/Object.freeze({
15577
15343
  Encointer: Encointer$1,
15578
15344
  Hydration: Hydration$1,
15579
15345
  Imbue: Imbue$1,
15580
- Integritee: Integritee$1,
15581
15346
  Interlay: Interlay$1,
15582
15347
  InvArchTinker: InvArchTinker$1,
15583
15348
  Karura: Karura$1,
@@ -15600,9 +15365,7 @@ var edsMapJson = /*#__PURE__*/Object.freeze({
15600
15365
  PeoplePolkadot: PeoplePolkadot$1,
15601
15366
  Phala: Phala$1,
15602
15367
  Picasso: Picasso$1,
15603
- Pioneer: Pioneer$1,
15604
15368
  Polimec: Polimec$1,
15605
- Polkadex: Polkadex$1,
15606
15369
  Polkadot: Polkadot,
15607
15370
  Quartz: Quartz$1,
15608
15371
  RobonomicsKusama: RobonomicsKusama$1,
@@ -15709,10 +15472,9 @@ var Litentry = {
15709
15472
  ]
15710
15473
  };
15711
15474
  var Moonbeam = {
15712
- defaultPallet: "XTokens",
15475
+ defaultPallet: "PolkadotXcm",
15713
15476
  supportedPallets: [
15714
- "PolkadotXcm",
15715
- "XTokens"
15477
+ "PolkadotXcm"
15716
15478
  ]
15717
15479
  };
15718
15480
  var Parallel = {
@@ -15770,13 +15532,6 @@ var BifrostKusama = {
15770
15532
  "XTokens"
15771
15533
  ]
15772
15534
  };
15773
- var Pioneer = {
15774
- defaultPallet: "XTokens",
15775
- supportedPallets: [
15776
- "PolkadotXcm",
15777
- "XTokens"
15778
- ]
15779
- };
15780
15535
  var Calamari = {
15781
15536
  defaultPallet: "XTokens",
15782
15537
  supportedPallets: [
@@ -15804,13 +15559,6 @@ var Imbue = {
15804
15559
  "XTokens"
15805
15560
  ]
15806
15561
  };
15807
- var Integritee = {
15808
- defaultPallet: "XTokens",
15809
- supportedPallets: [
15810
- "PolkadotXcm",
15811
- "XTokens"
15812
- ]
15813
- };
15814
15562
  var InvArchTinker = {
15815
15563
  defaultPallet: "XTokens",
15816
15564
  supportedPallets: [
@@ -15833,10 +15581,9 @@ var Kintsugi = {
15833
15581
  ]
15834
15582
  };
15835
15583
  var Moonriver = {
15836
- defaultPallet: "XTokens",
15584
+ defaultPallet: "PolkadotXcm",
15837
15585
  supportedPallets: [
15838
- "PolkadotXcm",
15839
- "XTokens"
15586
+ "PolkadotXcm"
15840
15587
  ]
15841
15588
  };
15842
15589
  var ParallelHeiko = {
@@ -15902,10 +15649,9 @@ var Manta = {
15902
15649
  ]
15903
15650
  };
15904
15651
  var Nodle = {
15905
- defaultPallet: "XTokens",
15652
+ defaultPallet: "PolkadotXcm",
15906
15653
  supportedPallets: [
15907
- "PolkadotXcm",
15908
- "XTokens"
15654
+ "PolkadotXcm"
15909
15655
  ]
15910
15656
  };
15911
15657
  var NeuroWeb = {
@@ -15928,13 +15674,6 @@ var Zeitgeist = {
15928
15674
  "XTokens"
15929
15675
  ]
15930
15676
  };
15931
- var Polkadex = {
15932
- defaultPallet: "XTokens",
15933
- supportedPallets: [
15934
- "PolkadotXcm",
15935
- "XTokens"
15936
- ]
15937
- };
15938
15677
  var Collectives = {
15939
15678
  defaultPallet: "PolkadotXcm",
15940
15679
  supportedPallets: [
@@ -16051,12 +15790,10 @@ var pallets = {
16051
15790
  Bajun: Bajun,
16052
15791
  Basilisk: Basilisk,
16053
15792
  BifrostKusama: BifrostKusama,
16054
- Pioneer: Pioneer,
16055
15793
  Calamari: Calamari,
16056
15794
  CrustShadow: CrustShadow,
16057
15795
  Crab: Crab,
16058
15796
  Imbue: Imbue,
16059
- Integritee: Integritee,
16060
15797
  InvArchTinker: InvArchTinker,
16061
15798
  Karura: Karura,
16062
15799
  Kintsugi: Kintsugi,
@@ -16074,7 +15811,6 @@ var pallets = {
16074
15811
  NeuroWeb: NeuroWeb,
16075
15812
  Pendulum: Pendulum,
16076
15813
  Zeitgeist: Zeitgeist,
16077
- Polkadex: Polkadex,
16078
15814
  Collectives: Collectives,
16079
15815
  Khala: Khala,
16080
15816
  Phala: Phala,
@@ -16121,7 +15857,6 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
16121
15857
  Encointer: Encointer,
16122
15858
  Hydration: Hydration,
16123
15859
  Imbue: Imbue,
16124
- Integritee: Integritee,
16125
15860
  Interlay: Interlay,
16126
15861
  InvArchTinker: InvArchTinker,
16127
15862
  Karura: Karura,
@@ -16143,9 +15878,7 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
16143
15878
  PeoplePolkadot: PeoplePolkadot,
16144
15879
  Phala: Phala,
16145
15880
  Picasso: Picasso,
16146
- Pioneer: Pioneer,
16147
15881
  Polimec: Polimec,
16148
- Polkadex: Polkadex,
16149
15882
  Quartz: Quartz,
16150
15883
  RobonomicsKusama: RobonomicsKusama,
16151
15884
  RobonomicsPolkadot: RobonomicsPolkadot,
@@ -18069,9 +17802,171 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
18069
17802
  symbol: "".concat(wethAsset.symbol, ".e")
18070
17803
  });
18071
17804
  }
18072
- return supportedAssets;
17805
+ return supportedAssets;
17806
+ };
17807
+
17808
+ var isPrimitive = function isPrimitive(obj) {
17809
+ return obj !== Object(obj);
17810
+ };
17811
+ var _deepEqual = function deepEqual(obj1, obj2) {
17812
+ if (obj1 === obj2) return true;
17813
+ if (isPrimitive(obj1) && isPrimitive(obj2)) return obj1 === obj2;
17814
+ if (_typeof(obj1) !== 'object' || obj1 === null || _typeof(obj2) !== 'object' || obj2 === null) {
17815
+ return false;
17816
+ }
17817
+ if (Array.isArray(obj1) !== Array.isArray(obj2)) {
17818
+ return false;
17819
+ }
17820
+ var obj1Keys = Object.keys(obj1).map(function (key) {
17821
+ return key.toLowerCase();
17822
+ });
17823
+ var obj2Keys = Object.keys(obj2).map(function (key) {
17824
+ return key.toLowerCase();
17825
+ });
17826
+ if (obj1Keys.length !== obj2Keys.length) return false;
17827
+ var _iterator = _createForOfIteratorHelper(obj1Keys),
17828
+ _step;
17829
+ try {
17830
+ var _loop = function _loop() {
17831
+ var key = _step.value;
17832
+ var keyInObj2 = obj2Keys.find(function (k) {
17833
+ return k === key;
17834
+ });
17835
+ if (!keyInObj2) return {
17836
+ v: false
17837
+ };
17838
+ var obj1Value = obj1[Object.keys(obj1).find(function (k) {
17839
+ return k.toLowerCase() === key;
17840
+ })];
17841
+ var obj2Value = obj2[Object.keys(obj2).find(function (k) {
17842
+ return k.toLowerCase() === key;
17843
+ })];
17844
+ if (!_deepEqual(obj1Value, obj2Value)) return {
17845
+ v: false
17846
+ };
17847
+ },
17848
+ _ret;
17849
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
17850
+ _ret = _loop();
17851
+ if (_ret) return _ret.v;
17852
+ }
17853
+ } catch (err) {
17854
+ _iterator.e(err);
17855
+ } finally {
17856
+ _iterator.f();
17857
+ }
17858
+ return true;
17859
+ };
17860
+
17861
+ var getFees = function getFees(scenario) {
17862
+ if (scenario === 'ParaToRelay') {
17863
+ return 4600000000;
17864
+ } else if (scenario === 'ParaToPara') {
17865
+ return 399600000000;
17866
+ }
17867
+ throw new Error("Fees for scenario ".concat(scenario, " are not defined."));
17868
+ };
17869
+
17870
+ /**
17871
+ * Retrieves the node instance for a given node.
17872
+ *
17873
+ * @param node - The node identifier.
17874
+ * @returns The node instance
17875
+ */
17876
+ var getNode = function getNode(node) {
17877
+ var nodeMap = nodes();
17878
+ return nodeMap[node];
17879
+ };
17880
+
17881
+ var createApiInstanceForNode$1 = function createApiInstanceForNode(api, node) {
17882
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
17883
+ var wsUrl;
17884
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
17885
+ while (1) switch (_context.prev = _context.next) {
17886
+ case 0:
17887
+ if (!(node === 'Polkadot' || node === 'Kusama')) {
17888
+ _context.next = 3;
17889
+ break;
17890
+ }
17891
+ wsUrl = getNodeProvider(node);
17892
+ return _context.abrupt("return", api.createApiInstance(wsUrl));
17893
+ case 3:
17894
+ return _context.abrupt("return", getNode(node).createApiInstance(api));
17895
+ case 4:
17896
+ case "end":
17897
+ return _context.stop();
17898
+ }
17899
+ }, _callee);
17900
+ }));
17901
+ };
17902
+
17903
+ var determineRelayChainSymbol = function determineRelayChainSymbol(node) {
17904
+ if (node === 'Polkadot') {
17905
+ return 'DOT';
17906
+ } else if (node === 'Kusama') {
17907
+ return 'KSM';
17908
+ } else {
17909
+ return getRelayChainSymbol(node);
17910
+ }
17911
+ };
17912
+
17913
+ // Contains important call creation utils (Selection of fees,formating of header and more.. )
17914
+ /**
17915
+ * Determines the relay chain for a given node.
17916
+ *
17917
+ * @param node - The node for which to determine the relay chain.
17918
+ * @returns 'Kusama' if the node's relay chain symbol is 'KSM'; otherwise, 'Polkadot'.
17919
+ */
17920
+ var determineRelayChain = function determineRelayChain(node) {
17921
+ return getRelayChainSymbol(node) === 'KSM' ? 'Kusama' : 'Polkadot';
17922
+ };
17923
+ /**
17924
+ * Determines whether a given node is a relay chain (Polkadot or Kusama).
17925
+ *
17926
+ * @param node - The node to check.
17927
+ * @returns True if the node is 'Polkadot' or 'Kusama'; otherwise, false.
17928
+ */
17929
+ var isRelayChain = function isRelayChain(node) {
17930
+ return node === 'Polkadot' || node === 'Kusama';
17931
+ };
17932
+
17933
+ var validateDestinationAddress = function validateDestinationAddress(address, destination) {
17934
+ if (typeof address === 'string' && destination && !isTMultiLocation(destination)) {
17935
+ var isDestinationEvm = isNodeEvm(destination);
17936
+ var isEthereumAddress = ethers.isAddress(address);
17937
+ if (isDestinationEvm) {
17938
+ if (!isEthereumAddress) {
17939
+ throw new InvalidAddressError('Destination node is an EVM chain, but the address provided is not a valid Ethereum address.');
17940
+ }
17941
+ } else {
17942
+ if (isEthereumAddress) {
17943
+ throw new InvalidAddressError('EVM address provided but destination is not an EVM chain.');
17944
+ }
17945
+ }
17946
+ }
17947
+ };
17948
+
17949
+ var determineAssetCheckEnabled = function determineAssetCheckEnabled(origin, currency, isBridge) {
17950
+ var originNode = getNode(origin);
17951
+ return 'multiasset' in currency || 'multilocation' in currency && isOverrideMultiLocationSpecifier(currency.multilocation) || isBridge ? false : originNode.assetCheckEnabled;
18073
17952
  };
18074
17953
 
17954
+ var isBridgeTransfer = function isBridgeTransfer(origin, destination) {
17955
+ return origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot';
17956
+ };
17957
+
17958
+ var KeepAliveError = /*#__PURE__*/function (_Error) {
17959
+ function KeepAliveError(message) {
17960
+ var _this;
17961
+ _classCallCheck(this, KeepAliveError);
17962
+ _this = _callSuper(this, KeepAliveError, [message]);
17963
+ _this.name = 'KeepAliveError';
17964
+ return _this;
17965
+ }
17966
+ _inherits(KeepAliveError, _Error);
17967
+ return _createClass(KeepAliveError);
17968
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
17969
+
18075
17970
  var createTx = function createTx(originApi, destApi, address, amount, currencySymbol, originNode, destNode) {
18076
17971
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
18077
17972
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -18126,73 +18021,67 @@ var checkKeepAlive = function checkKeepAlive(_a) {
18126
18021
  }
18127
18022
  return _context.abrupt("return");
18128
18023
  case 2:
18129
- if (!(asset.symbol === undefined)) {
18130
- _context.next = 4;
18131
- break;
18132
- }
18133
- throw new KeepAliveError('Currency symbol not found for this asset. Cannot check keep alive.');
18134
- case 4:
18135
18024
  if (!(originNode !== undefined && destNode !== undefined && asset.symbol !== getAssetsObject(destNode).nativeAssetSymbol)) {
18136
- _context.next = 6;
18025
+ _context.next = 4;
18137
18026
  break;
18138
18027
  }
18139
18028
  throw new KeepAliveError('Keep alive check is only supported when sending native asset of destination parachain.');
18140
- case 6:
18141
- _context.next = 8;
18029
+ case 4:
18030
+ _context.next = 6;
18142
18031
  return destApi.getBalanceNative(address);
18143
- case 8:
18032
+ case 6:
18144
18033
  balance = _context.sent;
18145
- _context.next = 11;
18034
+ _context.next = 9;
18146
18035
  return originApi.getBalanceNative(address);
18147
- case 11:
18036
+ case 9:
18148
18037
  balanceOrigin = _context.sent;
18149
18038
  amountBN = BigInt(amount);
18150
18039
  ed = getExistentialDeposit$1(destNode !== null && destNode !== void 0 ? destNode : determineRelayChain(originNode));
18151
18040
  edOrigin = getExistentialDeposit$1(originNode !== null && originNode !== void 0 ? originNode : determineRelayChain(destNode));
18152
18041
  oldDisconnectAllowed = originApi.getDisconnectAllowed();
18153
18042
  originApi.setDisconnectAllowed(false);
18154
- _context.next = 19;
18043
+ _context.next = 17;
18155
18044
  return createTx(originApi, destApi, address, amount, asset.symbol, originNode, destNode);
18156
- case 19:
18045
+ case 17:
18157
18046
  tx = _context.sent;
18158
18047
  originApi.setDisconnectAllowed(oldDisconnectAllowed);
18159
18048
  if (!(tx === null)) {
18160
- _context.next = 23;
18049
+ _context.next = 21;
18161
18050
  break;
18162
18051
  }
18163
18052
  throw new KeepAliveError('Transaction for XCM fee calculation could not be created.');
18164
- case 23:
18165
- _context.next = 25;
18053
+ case 21:
18054
+ _context.next = 23;
18166
18055
  return originApi.calculateTransactionFee(tx, address);
18167
- case 25:
18056
+ case 23:
18168
18057
  xcmFee = _context.sent;
18169
18058
  if (!(ed === null)) {
18170
- _context.next = 28;
18059
+ _context.next = 26;
18171
18060
  break;
18172
18061
  }
18173
18062
  throw new KeepAliveError('Existential deposit not found for destination parachain.');
18174
- case 28:
18063
+ case 26:
18175
18064
  if (!(edOrigin === null)) {
18176
- _context.next = 30;
18065
+ _context.next = 28;
18177
18066
  break;
18178
18067
  }
18179
18068
  throw new KeepAliveError('Existential deposit not found for origin parachain.');
18180
- case 30:
18069
+ case 28:
18181
18070
  increasedFee = xcmFee + xcmFee / BigInt(2);
18182
18071
  amountBNWithoutFee = amountBN - increasedFee;
18183
18072
  if (!(balance + amountBNWithoutFee < BigInt(ed))) {
18184
- _context.next = 34;
18073
+ _context.next = 32;
18185
18074
  break;
18186
18075
  }
18187
18076
  throw new KeepAliveError("Keep alive check failed: Sending ".concat(amount, " ").concat(asset.symbol, " to ").concat(destNode, " would result in an account balance below the required existential deposit.\n Please increase the amount to meet the minimum balance requirement of the destination chain."));
18188
- case 34:
18077
+ case 32:
18189
18078
  amountOriginBNWithoutFee = amountBN - (xcmFee + xcmFee / BigInt(2));
18190
18079
  if (!((asset.symbol === 'DOT' || asset.symbol === 'KSM') && balanceOrigin - amountOriginBNWithoutFee > BigInt(edOrigin))) {
18191
- _context.next = 37;
18080
+ _context.next = 35;
18192
18081
  break;
18193
18082
  }
18194
18083
  throw new KeepAliveError("Keep alive check failed: Sending ".concat(amount, " ").concat(asset.symbol, " to ").concat(destNode, " would result in an account balance below the required existential deposit on origin.\n Please decrease the amount to meet the minimum balance requirement of the origin chain."));
18195
- case 37:
18084
+ case 35:
18196
18085
  case "end":
18197
18086
  return _context.stop();
18198
18087
  }
@@ -18201,205 +18090,193 @@ var checkKeepAlive = function checkKeepAlive(_a) {
18201
18090
  });
18202
18091
  };
18203
18092
 
18204
- var validateDestinationAddress = function validateDestinationAddress(address, destination) {
18205
- if (typeof address === 'string' && destination && !isTMultiLocation(destination)) {
18206
- var isDestinationEvm = isNodeEvm(destination);
18207
- var isEthereumAddress = ethers.isAddress(address);
18208
- if (isDestinationEvm) {
18209
- if (!isEthereumAddress) {
18210
- throw new InvalidAddressError('Destination node is an EVM chain, but the address provided is not a valid Ethereum address.');
18211
- }
18212
- } else {
18213
- if (isEthereumAddress) {
18214
- throw new InvalidAddressError('EVM address provided but destination is not an EVM chain.');
18215
- }
18093
+ var performKeepAliveCheck = function performKeepAliveCheck(_a, asset_1) {
18094
+ return __awaiter(void 0, [_a, asset_1], void 0, function (_ref, asset) {
18095
+ var api = _ref.api,
18096
+ origin = _ref.origin,
18097
+ destApiForKeepAlive = _ref.destApiForKeepAlive,
18098
+ amount = _ref.amount,
18099
+ currency = _ref.currency,
18100
+ address = _ref.address,
18101
+ destination = _ref.destination;
18102
+ return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
18103
+ var amountStr;
18104
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
18105
+ while (1) switch (_context.prev = _context.next) {
18106
+ case 0:
18107
+ amountStr = amount === null || amount === void 0 ? void 0 : amount.toString();
18108
+ if (!('multilocation' in currency || 'multiasset' in currency)) {
18109
+ _context.next = 5;
18110
+ break;
18111
+ }
18112
+ console.warn('Keep alive check is not supported when using MultiLocation as currency.');
18113
+ _context.next = 23;
18114
+ break;
18115
+ case 5:
18116
+ if (!(_typeof(address) === 'object')) {
18117
+ _context.next = 9;
18118
+ break;
18119
+ }
18120
+ console.warn('Keep alive check is not supported when using MultiLocation as address.');
18121
+ _context.next = 23;
18122
+ break;
18123
+ case 9:
18124
+ if (!(_typeof(destination) === 'object')) {
18125
+ _context.next = 13;
18126
+ break;
18127
+ }
18128
+ console.warn('Keep alive check is not supported when using MultiLocation as destination.');
18129
+ _context.next = 23;
18130
+ break;
18131
+ case 13:
18132
+ if (!(destination === 'Ethereum')) {
18133
+ _context.next = 17;
18134
+ break;
18135
+ }
18136
+ console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
18137
+ _context.next = 23;
18138
+ break;
18139
+ case 17:
18140
+ if (asset) {
18141
+ _context.next = 21;
18142
+ break;
18143
+ }
18144
+ console.warn('Keep alive check is not supported when asset check is disabled.');
18145
+ _context.next = 23;
18146
+ break;
18147
+ case 21:
18148
+ _context.next = 23;
18149
+ return checkKeepAlive({
18150
+ originApi: api,
18151
+ address: address,
18152
+ amount: amountStr !== null && amountStr !== void 0 ? amountStr : '',
18153
+ originNode: origin,
18154
+ destApi: destApiForKeepAlive,
18155
+ asset: asset,
18156
+ destNode: destination
18157
+ });
18158
+ case 23:
18159
+ case "end":
18160
+ return _context.stop();
18161
+ }
18162
+ }, _callee);
18163
+ })();
18164
+ });
18165
+ };
18166
+
18167
+ var resolveAsset = function resolveAsset(currency, origin, destination, assetCheckEnabled) {
18168
+ var isRelayDestination = destination === undefined;
18169
+ return assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination ? determineRelayChain(origin) : !isTMultiLocation(destination) ? destination : null) : null;
18170
+ };
18171
+
18172
+ var validateCurrency = function validateCurrency(currency, amount, feeAsset) {
18173
+ if ((!('multiasset' in currency) || 'multilocation' in currency) && amount === null) {
18174
+ throw new Error('Amount is required');
18175
+ }
18176
+ if ('multiasset' in currency) {
18177
+ if (amount !== null) {
18178
+ console.warn('Amount is ignored when using overriding currency using multiple multi locations. Please set it to null.');
18179
+ }
18180
+ if (currency.multiasset.length === 0) {
18181
+ throw new InvalidCurrencyError('Overrided multi assets cannot be empty');
18182
+ }
18183
+ if (currency.multiasset.length === 1 && (feeAsset === 0 || feeAsset !== undefined)) {
18184
+ throw new InvalidCurrencyError('Overrided single multi asset cannot be used with fee asset');
18185
+ }
18186
+ if (currency.multiasset.length > 1 && feeAsset === undefined) {
18187
+ throw new InvalidCurrencyError('Overrided multi assets cannot be used without specifying fee asset');
18188
+ }
18189
+ if (currency.multiasset.length > 1 && feeAsset !== undefined && (feeAsset < 0 || feeAsset >= currency.multiasset.length)) {
18190
+ throw new InvalidCurrencyError('Fee asset index is out of bounds. Please provide a valid index.');
18191
+ }
18192
+ }
18193
+ };
18194
+ var validateDestination = function validateDestination(origin, destination) {
18195
+ if (destination === 'Ethereum' && origin !== 'AssetHubPolkadot' && origin !== 'Hydration') {
18196
+ throw new IncompatibleNodesError('Transfers to Ethereum are only supported from AssetHubPolkadot and Hydration.');
18197
+ }
18198
+ var isMultiLocationDestination = _typeof(destination) === 'object';
18199
+ var isBridge = isBridgeTransfer(origin, destination);
18200
+ var isRelayDestination = destination === undefined;
18201
+ if (!isRelayDestination && !isMultiLocationDestination) {
18202
+ var originRelayChainSymbol = getRelayChainSymbol(origin);
18203
+ var destinationRelayChainSymbol = getRelayChainSymbol(destination);
18204
+ if (!isBridge && originRelayChainSymbol !== destinationRelayChainSymbol) {
18205
+ throw new IncompatibleNodesError();
18206
+ }
18207
+ }
18208
+ };
18209
+ var validateAssetSpecifiers = function validateAssetSpecifiers(assetCheckEnabled, currency) {
18210
+ if (!assetCheckEnabled && 'symbol' in currency && isSymbolSpecifier(currency.symbol)) {
18211
+ throw new InvalidCurrencyError('Symbol specifier is not supported when asset check is disabled. Please use normal symbol instead.');
18212
+ }
18213
+ if (!assetCheckEnabled && 'id' in currency) {
18214
+ throw new InvalidCurrencyError('Asset ID is not supported when asset check is disabled. Please use normal symbol instead');
18215
+ }
18216
+ };
18217
+ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled, isBridge, asset) {
18218
+ var origin = _ref.origin,
18219
+ destination = _ref.destination,
18220
+ currency = _ref.currency;
18221
+ var isRelayDestination = destination === undefined;
18222
+ var isMultiLocationDestination = _typeof(destination) === 'object';
18223
+ var isDestAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
18224
+ var pallet = getDefaultPallet(origin);
18225
+ var isBifrost = origin === 'BifrostPolkadot' || origin === 'BifrostKusama';
18226
+ if (!isBridge && isDestAssetHub && pallet === 'XTokens' && !isBifrost) {
18227
+ var nativeAssets = getNativeAssets(destination);
18228
+ if (origin === 'Hydration') {
18229
+ nativeAssets = nativeAssets.filter(function (nativeAsset) {
18230
+ return nativeAsset.symbol !== 'DOT';
18231
+ });
18232
+ }
18233
+ if ('symbol' in currency && nativeAssets.some(function (nativeAsset) {
18234
+ var _a;
18235
+ return nativeAsset.symbol.toLowerCase() === ((_a = asset === null || asset === void 0 ? void 0 : asset.symbol) === null || _a === void 0 ? void 0 : _a.toLowerCase());
18236
+ })) {
18237
+ throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset === void 0 ? void 0 : asset.symbol), " is not supported for transfers to ").concat(destination, "."));
18216
18238
  }
18217
18239
  }
18240
+ if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol)) {
18241
+ throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
18242
+ }
18243
+ if (!isBridge && asset === null && assetCheckEnabled) {
18244
+ throwUnsupportedCurrency(currency, origin);
18245
+ }
18218
18246
  };
18219
18247
 
18220
18248
  var send = function send(options) {
18221
18249
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
18222
- var api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, ahAddress, isMultiLocationDestination, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, isDestAssetHub, pallet, isBifrost, asset, nativeAssets, amountStr, resolvedAsset;
18250
+ var _a, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, ahAddress, originNode, isBridge, assetCheckEnabled, asset, resolvedAsset;
18223
18251
  return _regeneratorRuntime().wrap(function _callee$(_context) {
18224
18252
  while (1) switch (_context.prev = _context.next) {
18225
18253
  case 0:
18226
18254
  api = options.api, origin = options.origin, currency = options.currency, amount = options.amount, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, feeAsset = options.feeAsset, version = options.version, ahAddress = options.ahAddress;
18227
- if (!((!('multiasset' in currency) || 'multilocation' in currency) && amount === null)) {
18228
- _context.next = 3;
18229
- break;
18230
- }
18231
- throw new Error('Amount is required');
18232
- case 3:
18233
- if (!('multilocation' in currency && (feeAsset === 0 || feeAsset !== undefined))) {
18234
- _context.next = 5;
18235
- break;
18236
- }
18237
- throw new InvalidCurrencyError('Overrided single multi asset cannot be used with fee asset');
18238
- case 5:
18239
- if (!('multiasset' in currency)) {
18240
- _context.next = 15;
18241
- break;
18242
- }
18243
- if (amount !== null) {
18244
- console.warn('Amount is ignored when using overriding currency using multiple multi locations. Please set it to null.');
18245
- }
18246
- if (!(currency.multiasset.length === 0)) {
18247
- _context.next = 9;
18248
- break;
18249
- }
18250
- throw new InvalidCurrencyError('Overrided multi assets cannot be empty');
18251
- case 9:
18252
- if (!(currency.multiasset.length === 1 && (feeAsset === 0 || feeAsset !== undefined))) {
18253
- _context.next = 11;
18254
- break;
18255
- }
18256
- throw new InvalidCurrencyError('Overrided single multi asset cannot be used with fee asset');
18257
- case 11:
18258
- if (!(currency.multiasset.length > 1 && feeAsset === undefined)) {
18259
- _context.next = 13;
18260
- break;
18261
- }
18262
- throw new InvalidCurrencyError('Overrided multi assets cannot be used without specifying fee asset');
18263
- case 13:
18264
- if (!(currency.multiasset.length > 1 && feeAsset !== undefined && (feeAsset < 0 || feeAsset >= currency.multiasset.length))) {
18265
- _context.next = 15;
18266
- break;
18267
- }
18268
- throw new InvalidCurrencyError('Fee asset index is out of bounds. Please provide a valid index.');
18269
- case 15:
18270
- if (!(destination === 'Ethereum' && origin !== 'AssetHubPolkadot' && origin !== 'Hydration')) {
18271
- _context.next = 17;
18272
- break;
18273
- }
18274
- throw new IncompatibleNodesError('Transfers to Ethereum are only supported from AssetHubPolkadot and Hydration.');
18275
- case 17:
18276
- isMultiLocationDestination = _typeof(destination) === 'object';
18277
- isBridge = origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot';
18278
- isRelayDestination = destination === undefined;
18279
- if (!(!isRelayDestination && !isMultiLocationDestination)) {
18280
- _context.next = 25;
18281
- break;
18282
- }
18283
- originRelayChainSymbol = getRelayChainSymbol(origin);
18284
- destinationRelayChainSymbol = getRelayChainSymbol(destination);
18285
- if (!(!isBridge && originRelayChainSymbol !== destinationRelayChainSymbol)) {
18286
- _context.next = 25;
18287
- break;
18288
- }
18289
- throw new IncompatibleNodesError();
18290
- case 25:
18291
- originNode = getNode(origin);
18292
- assetCheckEnabled = 'multiasset' in currency || 'multilocation' in currency && isOverrideMultiLocationSpecifier(currency.multilocation) || isBridge ? false : originNode.assetCheckEnabled;
18255
+ validateCurrency(currency, amount, feeAsset);
18256
+ validateDestination(origin, destination);
18293
18257
  validateDestinationAddress(address, destination);
18294
- isDestAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
18295
- pallet = getDefaultPallet(origin);
18296
- isBifrost = origin === 'BifrostPolkadot' || origin === 'BifrostKusama';
18297
- if (!(!assetCheckEnabled && 'symbol' in currency && isSymbolSpecifier(currency.symbol))) {
18298
- _context.next = 33;
18299
- break;
18300
- }
18301
- throw new InvalidCurrencyError('Symbol specifier is not supported when asset check is disabled. Please use normal symbol instead.');
18302
- case 33:
18303
- if (!(!assetCheckEnabled && 'id' in currency)) {
18304
- _context.next = 35;
18305
- break;
18306
- }
18307
- throw new InvalidCurrencyError('Asset ID is not supported when asset check is disabled. Please use normal symbol instead');
18308
- case 35:
18309
- asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination ? determineRelayChain(origin) : !isTMultiLocation(destination) ? destination : null) : null;
18310
- if (!(!isBridge && isDestAssetHub && pallet === 'XTokens' && !isBifrost)) {
18311
- _context.next = 41;
18312
- break;
18313
- }
18314
- nativeAssets = getNativeAssets(destination);
18315
- if (origin === 'Hydration') {
18316
- nativeAssets = nativeAssets.filter(function (nativeAsset) {
18317
- return nativeAsset.symbol !== 'DOT';
18318
- });
18319
- }
18320
- if (!('symbol' in currency && nativeAssets.some(function (nativeAsset) {
18321
- var _a;
18322
- return nativeAsset.symbol.toLowerCase() === ((_a = asset === null || asset === void 0 ? void 0 : asset.symbol) === null || _a === void 0 ? void 0 : _a.toLowerCase());
18323
- }))) {
18324
- _context.next = 41;
18325
- break;
18326
- }
18327
- throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset === void 0 ? void 0 : asset.symbol), " is not supported for transfers to ").concat(destination, "."));
18328
- case 41:
18329
- if (!isBridge && asset === null && assetCheckEnabled) {
18330
- throwUnsupportedCurrency(currency, origin);
18331
- }
18332
- if (!(!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol))) {
18333
- _context.next = 44;
18334
- break;
18335
- }
18336
- throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
18337
- case 44:
18338
- _context.next = 46;
18258
+ originNode = getNode(origin);
18259
+ isBridge = isBridgeTransfer(origin, destination);
18260
+ assetCheckEnabled = determineAssetCheckEnabled(origin, currency, isBridge);
18261
+ validateAssetSpecifiers(assetCheckEnabled, currency);
18262
+ asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
18263
+ validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
18264
+ _context.next = 12;
18339
18265
  return api.init(origin);
18340
- case 46:
18341
- _context.prev = 46;
18342
- amountStr = amount === null || amount === void 0 ? void 0 : amount.toString();
18343
- if (!('multilocation' in currency || 'multiasset' in currency)) {
18344
- _context.next = 52;
18345
- break;
18346
- }
18347
- console.warn('Keep alive check is not supported when using MultiLocation as currency.');
18348
- _context.next = 70;
18349
- break;
18350
- case 52:
18351
- if (!(_typeof(address) === 'object')) {
18352
- _context.next = 56;
18353
- break;
18354
- }
18355
- console.warn('Keep alive check is not supported when using MultiLocation as address.');
18356
- _context.next = 70;
18357
- break;
18358
- case 56:
18359
- if (!(_typeof(destination) === 'object')) {
18360
- _context.next = 60;
18361
- break;
18362
- }
18363
- console.warn('Keep alive check is not supported when using MultiLocation as destination.');
18364
- _context.next = 70;
18365
- break;
18366
- case 60:
18367
- if (!(destination === 'Ethereum')) {
18368
- _context.next = 64;
18369
- break;
18370
- }
18371
- console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
18372
- _context.next = 70;
18373
- break;
18374
- case 64:
18375
- if (asset) {
18376
- _context.next = 68;
18377
- break;
18378
- }
18379
- console.warn('Keep alive check is not supported when asset check is disabled.');
18380
- _context.next = 70;
18381
- break;
18382
- case 68:
18383
- _context.next = 70;
18384
- return checkKeepAlive({
18385
- originApi: api,
18386
- address: address,
18387
- amount: amountStr !== null && amountStr !== void 0 ? amountStr : '',
18388
- originNode: origin,
18389
- destApi: destApiForKeepAlive,
18390
- asset: asset,
18391
- destNode: destination
18392
- });
18393
- case 70:
18266
+ case 12:
18267
+ _context.prev = 12;
18268
+ _context.next = 15;
18269
+ return performKeepAliveCheck(options, asset);
18270
+ case 15:
18394
18271
  // In case asset check is disabled, we create asset object from currency symbol
18395
18272
  resolvedAsset = asset !== null && asset !== void 0 ? asset : {
18396
18273
  symbol: 'symbol' in currency ? currency.symbol : undefined
18397
18274
  };
18398
- _context.next = 73;
18275
+ _context.next = 18;
18399
18276
  return originNode.transfer({
18400
18277
  api: api,
18401
18278
  asset: resolvedAsset,
18402
- amount: amountStr !== null && amountStr !== void 0 ? amountStr : '',
18279
+ amount: (_a = amount === null || amount === void 0 ? void 0 : amount.toString()) !== null && _a !== void 0 ? _a : '',
18403
18280
  address: address,
18404
18281
  destination: destination,
18405
18282
  paraIdTo: paraIdTo,
@@ -18409,62 +18286,63 @@ var send = function send(options) {
18409
18286
  destApiForKeepAlive: destApiForKeepAlive,
18410
18287
  ahAddress: ahAddress
18411
18288
  });
18412
- case 73:
18289
+ case 18:
18413
18290
  return _context.abrupt("return", _context.sent);
18414
- case 74:
18415
- _context.prev = 74;
18291
+ case 19:
18292
+ _context.prev = 19;
18416
18293
  if (!isPjsClient(api)) {
18417
- _context.next = 78;
18294
+ _context.next = 23;
18418
18295
  break;
18419
18296
  }
18420
- _context.next = 78;
18297
+ _context.next = 23;
18421
18298
  return api.disconnect();
18422
- case 78:
18423
- return _context.finish(74);
18424
- case 79:
18299
+ case 23:
18300
+ return _context.finish(19);
18301
+ case 24:
18425
18302
  case "end":
18426
18303
  return _context.stop();
18427
18304
  }
18428
- }, _callee, null, [[46,, 74, 79]]);
18305
+ }, _callee, null, [[12,, 19, 24]]);
18429
18306
  }));
18430
18307
  };
18308
+
18431
18309
  var transferRelayToPara = function transferRelayToPara(options) {
18432
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
18310
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
18433
18311
  var api, destination, amount, address, paraIdTo, destApiForKeepAlive, version, isMultiLocationDestination, isAddressMultiLocation, amountStr, serializedApiCall;
18434
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
18435
- while (1) switch (_context2.prev = _context2.next) {
18312
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
18313
+ while (1) switch (_context.prev = _context.next) {
18436
18314
  case 0:
18437
18315
  api = options.api, destination = options.destination, amount = options.amount, address = options.address, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, version = options.version;
18438
18316
  isMultiLocationDestination = _typeof(destination) === 'object';
18439
18317
  isAddressMultiLocation = _typeof(address) === 'object';
18440
- if (!(api === undefined && isMultiLocationDestination)) {
18441
- _context2.next = 5;
18318
+ if (!(api.getApiOrUrl() === undefined && isMultiLocationDestination)) {
18319
+ _context.next = 5;
18442
18320
  break;
18443
18321
  }
18444
18322
  throw new Error('API is required when using MultiLocation as destination.');
18445
18323
  case 5:
18446
- _context2.next = 7;
18324
+ _context.next = 7;
18447
18325
  return api.init(determineRelayChain(destination));
18448
18326
  case 7:
18449
- _context2.prev = 7;
18327
+ _context.prev = 7;
18450
18328
  amountStr = amount.toString();
18451
18329
  if (!isMultiLocationDestination) {
18452
- _context2.next = 13;
18330
+ _context.next = 13;
18453
18331
  break;
18454
18332
  }
18455
18333
  console.warn('Keep alive check is not supported when using MultiLocation as destination.');
18456
- _context2.next = 19;
18334
+ _context.next = 19;
18457
18335
  break;
18458
18336
  case 13:
18459
18337
  if (!isAddressMultiLocation) {
18460
- _context2.next = 17;
18338
+ _context.next = 17;
18461
18339
  break;
18462
18340
  }
18463
18341
  console.warn('Keep alive check is not supported when using MultiLocation as address.');
18464
- _context2.next = 19;
18342
+ _context.next = 19;
18465
18343
  break;
18466
18344
  case 17:
18467
- _context2.next = 19;
18345
+ _context.next = 19;
18468
18346
  return checkKeepAlive({
18469
18347
  originApi: api,
18470
18348
  address: address,
@@ -18485,22 +18363,22 @@ var transferRelayToPara = function transferRelayToPara(options) {
18485
18363
  destApiForKeepAlive: destApiForKeepAlive,
18486
18364
  version: version
18487
18365
  });
18488
- return _context2.abrupt("return", api.callTxMethod(serializedApiCall));
18366
+ return _context.abrupt("return", api.callTxMethod(serializedApiCall));
18489
18367
  case 21:
18490
- _context2.prev = 21;
18368
+ _context.prev = 21;
18491
18369
  if (!isPjsClient(api)) {
18492
- _context2.next = 25;
18370
+ _context.next = 25;
18493
18371
  break;
18494
18372
  }
18495
- _context2.next = 25;
18373
+ _context.next = 25;
18496
18374
  return api.disconnect();
18497
18375
  case 25:
18498
- return _context2.finish(21);
18376
+ return _context.finish(21);
18499
18377
  case 26:
18500
18378
  case "end":
18501
- return _context2.stop();
18379
+ return _context.stop();
18502
18380
  }
18503
- }, _callee2, null, [[7,, 21, 26]]);
18381
+ }, _callee, null, [[7,, 21, 26]]);
18504
18382
  }));
18505
18383
  };
18506
18384
 
@@ -18701,7 +18579,7 @@ var _transform = function transform(obj) {
18701
18579
  }
18702
18580
  };
18703
18581
 
18704
- var unsupportedNodes = ['ComposableFinance', 'Interlay', 'Parallel', 'Pioneer', 'CrustShadow', 'Kintsugi', 'ParallelHeiko', 'Picasso', 'RobonomicsKusama', 'Turing', 'Pendulum', 'Polkadex', 'Subsocial'];
18582
+ var unsupportedNodes = ['ComposableFinance', 'Interlay', 'Parallel', 'CrustShadow', 'Kintsugi', 'ParallelHeiko', 'Picasso', 'RobonomicsKusama', 'Turing', 'Pendulum', 'Subsocial'];
18705
18583
  var PapiApi = /*#__PURE__*/function () {
18706
18584
  function PapiApi() {
18707
18585
  _classCallCheck(this, PapiApi);
@@ -18713,6 +18591,11 @@ var PapiApi = /*#__PURE__*/function () {
18713
18591
  value: function setApi(api) {
18714
18592
  this._api = api;
18715
18593
  }
18594
+ }, {
18595
+ key: "getApiOrUrl",
18596
+ value: function getApiOrUrl() {
18597
+ return this._api;
18598
+ }
18716
18599
  }, {
18717
18600
  key: "getApi",
18718
18601
  value: function getApi() {