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