@paraspell/sdk 1.1.10 → 1.1.11

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.
package/dist/index.mjs CHANGED
@@ -2,6 +2,13 @@ import '@polkadot/api';
2
2
  import { ethers } from 'ethers';
3
3
  import '@polkadot/apps-config/endpoints';
4
4
 
5
+ // derrived from https://github.com/kodadot/packages/blob/main/minimark/src/common/types.ts
6
+ var Version;
7
+ (function (Version) {
8
+ Version[Version["V1"] = 0] = "V1";
9
+ Version[Version["V3"] = 1] = "V3";
10
+ })(Version || (Version = {}));
11
+
5
12
  function _classCallCheck(instance, Constructor) {
6
13
  if (!(instance instanceof Constructor)) {
7
14
  throw new TypeError("Cannot call a class as a function");
@@ -3680,11 +3687,12 @@ var supportsPolkadotXCM = function supportsPolkadotXCM(obj) {
3680
3687
  return 'transferPolkadotXCM' in obj;
3681
3688
  };
3682
3689
  var ParachainNode = /*#__PURE__*/function () {
3683
- function ParachainNode(node, name, type) {
3690
+ function ParachainNode(node, name, type, version) {
3684
3691
  _classCallCheck(this, ParachainNode);
3685
3692
  this._name = name;
3686
3693
  this._type = type;
3687
3694
  this._node = node;
3695
+ this._version = version;
3688
3696
  }
3689
3697
  _createClass(ParachainNode, [{
3690
3698
  key: "name",
@@ -3701,6 +3709,11 @@ var ParachainNode = /*#__PURE__*/function () {
3701
3709
  get: function get() {
3702
3710
  return this._node;
3703
3711
  }
3712
+ }, {
3713
+ key: "version",
3714
+ get: function get() {
3715
+ return this._version;
3716
+ }
3704
3717
  }, {
3705
3718
  key: "transfer",
3706
3719
  value: function transfer(api, currencySymbol, currencyId, amount, to, destination) {
@@ -3712,15 +3725,15 @@ var ParachainNode = /*#__PURE__*/function () {
3712
3725
  currency: currencySymbol,
3713
3726
  currencyID: currencyId,
3714
3727
  amount: amount,
3715
- addressSelection: handleAddress(scenario, 'xTokens', api, to, paraId, this._node),
3728
+ addressSelection: handleAddress(scenario, 'xTokens', api, to, this.version, paraId),
3716
3729
  fees: getFees(scenario)
3717
3730
  });
3718
3731
  } else if (supportsPolkadotXCM(this)) {
3719
3732
  return this.transferPolkadotXCM({
3720
3733
  api: api,
3721
- header: createHeaderPolkadotXCM(scenario, paraId, this._node),
3722
- addressSelection: handleAddress(scenario, 'polkadotXCM', api, to, paraId, this._node),
3723
- currencySelection: createCurrencySpecification(amount, scenario, this._node, currencyId),
3734
+ header: createHeaderPolkadotXCM(scenario, this.version, paraId),
3735
+ addressSelection: handleAddress(scenario, 'polkadotXCM', api, to, this.version, paraId),
3736
+ currencySelection: createCurrencySpecification(amount, scenario, this.version, this._node, currencyId),
3724
3737
  scenario: scenario
3725
3738
  });
3726
3739
  } else {
@@ -3754,7 +3767,7 @@ var Acala$1 = /*#__PURE__*/function (_ParachainNode) {
3754
3767
  var _super = _createSuper(Acala);
3755
3768
  function Acala() {
3756
3769
  _classCallCheck(this, Acala);
3757
- return _super.call(this, 'Acala', 'acala', 'polkadot');
3770
+ return _super.call(this, 'Acala', 'acala', 'polkadot', Version.V1);
3758
3771
  }
3759
3772
  _createClass(Acala, [{
3760
3773
  key: "transferXTokens",
@@ -3777,7 +3790,7 @@ var Unique$1 = /*#__PURE__*/function (_ParachainNode) {
3777
3790
  var _super = _createSuper(Unique);
3778
3791
  function Unique() {
3779
3792
  _classCallCheck(this, Unique);
3780
- return _super.call(this, 'Unique', 'unique', 'polkadot');
3793
+ return _super.call(this, 'Unique', 'unique', 'polkadot', Version.V3);
3781
3794
  }
3782
3795
  _createClass(Unique, [{
3783
3796
  key: "transferXTokens",
@@ -3809,7 +3822,7 @@ var Crust$1 = /*#__PURE__*/function (_ParachainNode) {
3809
3822
  var _super = _createSuper(Crust);
3810
3823
  function Crust() {
3811
3824
  _classCallCheck(this, Crust);
3812
- return _super.call(this, 'Crust', 'crustParachain', 'polkadot');
3825
+ return _super.call(this, 'Crust', 'crustParachain', 'polkadot', Version.V1);
3813
3826
  }
3814
3827
  _createClass(Crust, [{
3815
3828
  key: "getCurrencySelection",
@@ -3840,7 +3853,7 @@ var Efinity$1 = /*#__PURE__*/function (_ParachainNode) {
3840
3853
  var _super = _createSuper(Efinity);
3841
3854
  function Efinity() {
3842
3855
  _classCallCheck(this, Efinity);
3843
- return _super.call(this, 'Efinity', 'efinity', 'polkadot');
3856
+ return _super.call(this, 'Efinity', 'efinity', 'polkadot', Version.V3);
3844
3857
  }
3845
3858
  _createClass(Efinity, [{
3846
3859
  key: "transferXTokens",
@@ -3859,7 +3872,7 @@ var BifrostPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
3859
3872
  var _super = _createSuper(BifrostPolkadot);
3860
3873
  function BifrostPolkadot() {
3861
3874
  _classCallCheck(this, BifrostPolkadot);
3862
- return _super.call(this, 'BifrostPolkadot', 'bifrost', 'polkadot');
3875
+ return _super.call(this, 'BifrostPolkadot', 'bifrost', 'polkadot', Version.V3);
3863
3876
  }
3864
3877
  _createClass(BifrostPolkadot, [{
3865
3878
  key: "transferXTokens",
@@ -3879,7 +3892,7 @@ var Bitgreen$1 = /*#__PURE__*/function (_ParachainNode) {
3879
3892
  var _super = _createSuper(Bitgreen);
3880
3893
  function Bitgreen() {
3881
3894
  _classCallCheck(this, Bitgreen);
3882
- return _super.call(this, 'Bitgreen', 'bitgreen', 'polkadot');
3895
+ return _super.call(this, 'Bitgreen', 'bitgreen', 'polkadot', Version.V1);
3883
3896
  }
3884
3897
  return _createClass(Bitgreen);
3885
3898
  }(ParachainNode);
@@ -3889,7 +3902,7 @@ var Centrifuge$1 = /*#__PURE__*/function (_ParachainNode) {
3889
3902
  var _super = _createSuper(Centrifuge);
3890
3903
  function Centrifuge() {
3891
3904
  _classCallCheck(this, Centrifuge);
3892
- return _super.call(this, 'Centrifuge', 'centrifuge', 'polkadot');
3905
+ return _super.call(this, 'Centrifuge', 'centrifuge', 'polkadot', Version.V1);
3893
3906
  }
3894
3907
  _createClass(Centrifuge, [{
3895
3908
  key: "transferXTokens",
@@ -3910,7 +3923,7 @@ var Clover$1 = /*#__PURE__*/function (_ParachainNode) {
3910
3923
  var _super = _createSuper(Clover);
3911
3924
  function Clover() {
3912
3925
  _classCallCheck(this, Clover);
3913
- return _super.call(this, 'Clover', 'clover', 'polkadot');
3926
+ return _super.call(this, 'Clover', 'clover', 'polkadot', Version.V1);
3914
3927
  }
3915
3928
  _createClass(Clover, [{
3916
3929
  key: "getCurrencySelection",
@@ -3941,7 +3954,7 @@ var ComposableFinance$1 = /*#__PURE__*/function (_ParachainNode) {
3941
3954
  var _super = _createSuper(ComposableFinance);
3942
3955
  function ComposableFinance() {
3943
3956
  _classCallCheck(this, ComposableFinance);
3944
- return _super.call(this, 'ComposableFinance', 'composableFinance', 'polkadot');
3957
+ return _super.call(this, 'ComposableFinance', 'composableFinance', 'polkadot', Version.V3);
3945
3958
  }
3946
3959
  return _createClass(ComposableFinance);
3947
3960
  }(ParachainNode);
@@ -3951,14 +3964,14 @@ var HydraDX$1 = /*#__PURE__*/function (_ParachainNode) {
3951
3964
  var _super = _createSuper(HydraDX);
3952
3965
  function HydraDX() {
3953
3966
  _classCallCheck(this, HydraDX);
3954
- return _super.call(this, 'HydraDX', 'hydra', 'polkadot');
3967
+ return _super.call(this, 'HydraDX', 'hydra', 'polkadot', Version.V3);
3955
3968
  }
3956
3969
  _createClass(HydraDX, [{
3957
3970
  key: "transferXTokens",
3958
3971
  value: function transferXTokens(input) {
3959
- var currencyID = input.currencyID,
3960
- fees = input.fees;
3961
- return XTokensTransferImpl.transferXTokens(input, currencyID, fees);
3972
+ var currencyID = input.currencyID;
3973
+ input.fees;
3974
+ return XTokensTransferImpl.transferXTokens(input, currencyID);
3962
3975
  }
3963
3976
  }]);
3964
3977
  return HydraDX;
@@ -3969,7 +3982,7 @@ var Interlay$1 = /*#__PURE__*/function (_ParachainNode) {
3969
3982
  var _super = _createSuper(Interlay);
3970
3983
  function Interlay() {
3971
3984
  _classCallCheck(this, Interlay);
3972
- return _super.call(this, 'Interlay', 'interlay', 'polkadot');
3985
+ return _super.call(this, 'Interlay', 'interlay', 'polkadot', Version.V3);
3973
3986
  }
3974
3987
  _createClass(Interlay, [{
3975
3988
  key: "transferXTokens",
@@ -3992,7 +4005,7 @@ var Kylin$1 = /*#__PURE__*/function (_ParachainNode) {
3992
4005
  var _super = _createSuper(Kylin);
3993
4006
  function Kylin() {
3994
4007
  _classCallCheck(this, Kylin);
3995
- return _super.call(this, 'Kylin', 'kylin', 'polkadot');
4008
+ return _super.call(this, 'Kylin', 'kylin', 'polkadot', Version.V1);
3996
4009
  }
3997
4010
  _createClass(Kylin, [{
3998
4011
  key: "transferXTokens",
@@ -4010,7 +4023,7 @@ var Litentry$1 = /*#__PURE__*/function (_ParachainNode) {
4010
4023
  var _super = _createSuper(Litentry);
4011
4024
  function Litentry() {
4012
4025
  _classCallCheck(this, Litentry);
4013
- return _super.call(this, 'Litentry', 'litentry', 'polkadot');
4026
+ return _super.call(this, 'Litentry', 'litentry', 'polkadot', Version.V1);
4014
4027
  }
4015
4028
  _createClass(Litentry, [{
4016
4029
  key: "transferXTokens",
@@ -4026,7 +4039,7 @@ var Moonbeam$1 = /*#__PURE__*/function (_ParachainNode) {
4026
4039
  var _super = _createSuper(Moonbeam);
4027
4040
  function Moonbeam() {
4028
4041
  _classCallCheck(this, Moonbeam);
4029
- return _super.call(this, 'Moonbeam', 'moonbeam', 'polkadot');
4042
+ return _super.call(this, 'Moonbeam', 'moonbeam', 'polkadot', Version.V3);
4030
4043
  }
4031
4044
  _createClass(Moonbeam, [{
4032
4045
  key: "transferXTokens",
@@ -4047,7 +4060,7 @@ var Parallel$1 = /*#__PURE__*/function (_ParachainNode) {
4047
4060
  var _super = _createSuper(Parallel);
4048
4061
  function Parallel() {
4049
4062
  _classCallCheck(this, Parallel);
4050
- return _super.call(this, 'Parallel', 'parallel', 'polkadot');
4063
+ return _super.call(this, 'Parallel', 'parallel', 'polkadot', Version.V1);
4051
4064
  }
4052
4065
  _createClass(Parallel, [{
4053
4066
  key: "transferXTokens",
@@ -4063,7 +4076,7 @@ var Altair$1 = /*#__PURE__*/function (_ParachainNode) {
4063
4076
  var _super = _createSuper(Altair);
4064
4077
  function Altair() {
4065
4078
  _classCallCheck(this, Altair);
4066
- return _super.call(this, 'Altair', 'altair', 'kusama');
4079
+ return _super.call(this, 'Altair', 'altair', 'kusama', Version.V1);
4067
4080
  }
4068
4081
  _createClass(Altair, [{
4069
4082
  key: "transferXTokens",
@@ -4091,7 +4104,7 @@ var Amplitude$1 = /*#__PURE__*/function (_ParachainNode) {
4091
4104
  var _super = _createSuper(Amplitude);
4092
4105
  function Amplitude() {
4093
4106
  _classCallCheck(this, Amplitude);
4094
- return _super.call(this, 'Amplitude', 'amplitude', 'kusama');
4107
+ return _super.call(this, 'Amplitude', 'amplitude', 'kusama', Version.V1);
4095
4108
  }
4096
4109
  _createClass(Amplitude, [{
4097
4110
  key: "transferXTokens",
@@ -4109,7 +4122,7 @@ var Bajun$1 = /*#__PURE__*/function (_ParachainNode) {
4109
4122
  var _super = _createSuper(Bajun);
4110
4123
  function Bajun() {
4111
4124
  _classCallCheck(this, Bajun);
4112
- return _super.call(this, 'Bajun', 'bajun', 'kusama');
4125
+ return _super.call(this, 'Bajun', 'bajun', 'kusama', Version.V1);
4113
4126
  }
4114
4127
  return _createClass(Bajun);
4115
4128
  }(ParachainNode);
@@ -4119,14 +4132,14 @@ var Basilisk$1 = /*#__PURE__*/function (_ParachainNode) {
4119
4132
  var _super = _createSuper(Basilisk);
4120
4133
  function Basilisk() {
4121
4134
  _classCallCheck(this, Basilisk);
4122
- return _super.call(this, 'Basilisk', 'basilisk', 'kusama');
4135
+ return _super.call(this, 'Basilisk', 'basilisk', 'kusama', Version.V3);
4123
4136
  }
4124
4137
  _createClass(Basilisk, [{
4125
4138
  key: "transferXTokens",
4126
4139
  value: function transferXTokens(input) {
4127
- var currencyID = input.currencyID,
4128
- fees = input.fees;
4129
- return XTokensTransferImpl.transferXTokens(input, currencyID, fees);
4140
+ var currencyID = input.currencyID;
4141
+ input.fees;
4142
+ return XTokensTransferImpl.transferXTokens(input, currencyID);
4130
4143
  }
4131
4144
  }]);
4132
4145
  return Basilisk;
@@ -4137,7 +4150,7 @@ var BifrostKusama$1 = /*#__PURE__*/function (_ParachainNode) {
4137
4150
  var _super = _createSuper(BifrostKusama);
4138
4151
  function BifrostKusama() {
4139
4152
  _classCallCheck(this, BifrostKusama);
4140
- return _super.call(this, 'BifrostKusama', 'bifrost', 'kusama');
4153
+ return _super.call(this, 'BifrostKusama', 'bifrost', 'kusama', Version.V3);
4141
4154
  }
4142
4155
  _createClass(BifrostKusama, [{
4143
4156
  key: "transferXTokens",
@@ -4156,7 +4169,7 @@ var Pioneer$1 = /*#__PURE__*/function (_ParachainNode) {
4156
4169
  var _super = _createSuper(Pioneer);
4157
4170
  function Pioneer() {
4158
4171
  _classCallCheck(this, Pioneer);
4159
- return _super.call(this, 'Pioneer', 'bitcountryPioneer', 'kusama');
4172
+ return _super.call(this, 'Pioneer', 'bitcountryPioneer', 'kusama', Version.V1);
4160
4173
  }
4161
4174
  _createClass(Pioneer, [{
4162
4175
  key: "transferXTokens",
@@ -4173,14 +4186,14 @@ var Turing$1 = /*#__PURE__*/function (_ParachainNode) {
4173
4186
  var _super = _createSuper(Turing);
4174
4187
  function Turing() {
4175
4188
  _classCallCheck(this, Turing);
4176
- return _super.call(this, 'Turing', 'turing', 'kusama');
4189
+ return _super.call(this, 'Turing', 'turing', 'kusama', Version.V3);
4177
4190
  }
4178
4191
  _createClass(Turing, [{
4179
4192
  key: "transferXTokens",
4180
4193
  value: function transferXTokens(input) {
4181
- var currencyID = input.currencyID,
4182
- fees = input.fees;
4183
- return XTokensTransferImpl.transferXTokens(input, currencyID, fees);
4194
+ var currencyID = input.currencyID;
4195
+ input.fees;
4196
+ return XTokensTransferImpl.transferXTokens(input, currencyID);
4184
4197
  }
4185
4198
  }]);
4186
4199
  return Turing;
@@ -4191,7 +4204,7 @@ var Pichiu$1 = /*#__PURE__*/function (_ParachainNode) {
4191
4204
  var _super = _createSuper(Pichiu);
4192
4205
  function Pichiu() {
4193
4206
  _classCallCheck(this, Pichiu);
4194
- return _super.call(this, 'Pichiu', 'pichiu', 'kusama');
4207
+ return _super.call(this, 'Pichiu', 'pichiu', 'kusama', Version.V1);
4195
4208
  }
4196
4209
  _createClass(Pichiu, [{
4197
4210
  key: "transferXTokens",
@@ -4209,7 +4222,7 @@ var Picasso$1 = /*#__PURE__*/function (_ParachainNode) {
4209
4222
  var _super = _createSuper(Picasso);
4210
4223
  function Picasso() {
4211
4224
  _classCallCheck(this, Picasso);
4212
- return _super.call(this, 'Picasso', 'picasso', 'kusama');
4225
+ return _super.call(this, 'Picasso', 'picasso', 'kusama', Version.V3);
4213
4226
  }
4214
4227
  _createClass(Picasso, [{
4215
4228
  key: "transferXTokens",
@@ -4225,7 +4238,7 @@ var ParallelHeiko$1 = /*#__PURE__*/function (_ParachainNode) {
4225
4238
  var _super = _createSuper(ParallelHeiko);
4226
4239
  function ParallelHeiko() {
4227
4240
  _classCallCheck(this, ParallelHeiko);
4228
- return _super.call(this, 'ParallelHeiko', 'heiko', 'kusama');
4241
+ return _super.call(this, 'ParallelHeiko', 'heiko', 'kusama', Version.V1);
4229
4242
  }
4230
4243
  _createClass(ParallelHeiko, [{
4231
4244
  key: "transferXTokens",
@@ -4241,7 +4254,7 @@ var Moonriver$1 = /*#__PURE__*/function (_ParachainNode) {
4241
4254
  var _super = _createSuper(Moonriver);
4242
4255
  function Moonriver() {
4243
4256
  _classCallCheck(this, Moonriver);
4244
- return _super.call(this, 'Moonriver', 'moonriver', 'kusama');
4257
+ return _super.call(this, 'Moonriver', 'moonriver', 'kusama', Version.V3);
4245
4258
  }
4246
4259
  _createClass(Moonriver, [{
4247
4260
  key: "transferXTokens",
@@ -4262,7 +4275,7 @@ var Mangata$1 = /*#__PURE__*/function (_ParachainNode) {
4262
4275
  var _super = _createSuper(Mangata);
4263
4276
  function Mangata() {
4264
4277
  _classCallCheck(this, Mangata);
4265
- return _super.call(this, 'Mangata', 'mangata', 'kusama');
4278
+ return _super.call(this, 'Mangata', 'mangata', 'kusama', Version.V3);
4266
4279
  }
4267
4280
  _createClass(Mangata, [{
4268
4281
  key: "transferXTokens",
@@ -4278,7 +4291,7 @@ var Litmus$1 = /*#__PURE__*/function (_ParachainNode) {
4278
4291
  var _super = _createSuper(Litmus);
4279
4292
  function Litmus() {
4280
4293
  _classCallCheck(this, Litmus);
4281
- return _super.call(this, 'Litmus', 'litmus', 'kusama');
4294
+ return _super.call(this, 'Litmus', 'litmus', 'kusama', Version.V1);
4282
4295
  }
4283
4296
  _createClass(Litmus, [{
4284
4297
  key: "transferXTokens",
@@ -4295,7 +4308,7 @@ var Kintsugi$1 = /*#__PURE__*/function (_ParachainNode) {
4295
4308
  var _super = _createSuper(Kintsugi);
4296
4309
  function Kintsugi() {
4297
4310
  _classCallCheck(this, Kintsugi);
4298
- return _super.call(this, 'Kintsugi', 'kintsugi', 'kusama');
4311
+ return _super.call(this, 'Kintsugi', 'kintsugi', 'kusama', Version.V3);
4299
4312
  }
4300
4313
  _createClass(Kintsugi, [{
4301
4314
  key: "transferXTokens",
@@ -4318,7 +4331,7 @@ var Kico$1 = /*#__PURE__*/function (_ParachainNode) {
4318
4331
  var _super = _createSuper(Kico);
4319
4332
  function Kico() {
4320
4333
  _classCallCheck(this, Kico);
4321
- return _super.call(this, 'Kico', 'kico', 'kusama');
4334
+ return _super.call(this, 'Kico', 'kico', 'kusama', Version.V1);
4322
4335
  }
4323
4336
  _createClass(Kico, [{
4324
4337
  key: "transferXTokens",
@@ -4336,7 +4349,7 @@ var Calamari$1 = /*#__PURE__*/function (_ParachainNode) {
4336
4349
  var _super = _createSuper(Calamari);
4337
4350
  function Calamari() {
4338
4351
  _classCallCheck(this, Calamari);
4339
- return _super.call(this, 'Calamari', 'calamari', 'kusama');
4352
+ return _super.call(this, 'Calamari', 'calamari', 'kusama', Version.V1);
4340
4353
  }
4341
4354
  _createClass(Calamari, [{
4342
4355
  key: "transferXTokens",
@@ -4357,7 +4370,7 @@ var CrustShadow$1 = /*#__PURE__*/function (_ParachainNode) {
4357
4370
  var _super = _createSuper(CrustShadow);
4358
4371
  function CrustShadow() {
4359
4372
  _classCallCheck(this, CrustShadow);
4360
- return _super.call(this, 'CrustShadow', 'shadow', 'kusama');
4373
+ return _super.call(this, 'CrustShadow', 'shadow', 'kusama', Version.V1);
4361
4374
  }
4362
4375
  _createClass(CrustShadow, [{
4363
4376
  key: "getCurrencySelection",
@@ -4388,7 +4401,7 @@ var Dorafactory$1 = /*#__PURE__*/function (_ParachainNode) {
4388
4401
  var _super = _createSuper(Dorafactory);
4389
4402
  function Dorafactory() {
4390
4403
  _classCallCheck(this, Dorafactory);
4391
- return _super.call(this, 'Dorafactory', 'dorafactory', 'kusama');
4404
+ return _super.call(this, 'Dorafactory', 'dorafactory', 'kusama', Version.V1);
4392
4405
  }
4393
4406
  _createClass(Dorafactory, [{
4394
4407
  key: "transferXTokens",
@@ -4406,14 +4419,14 @@ var Imbue$1 = /*#__PURE__*/function (_ParachainNode) {
4406
4419
  var _super = _createSuper(Imbue);
4407
4420
  function Imbue() {
4408
4421
  _classCallCheck(this, Imbue);
4409
- return _super.call(this, 'Imbue', 'imbue', 'kusama');
4422
+ return _super.call(this, 'Imbue', 'imbue', 'kusama', Version.V3);
4410
4423
  }
4411
4424
  _createClass(Imbue, [{
4412
4425
  key: "transferXTokens",
4413
4426
  value: function transferXTokens(input) {
4414
- var currency = input.currency,
4415
- fees = input.fees;
4416
- return XTokensTransferImpl.transferXTokens(input, currency, fees);
4427
+ var currency = input.currency;
4428
+ input.fees;
4429
+ return XTokensTransferImpl.transferXTokens(input, currency);
4417
4430
  }
4418
4431
  }]);
4419
4432
  return Imbue;
@@ -4424,7 +4437,7 @@ var Integritee$1 = /*#__PURE__*/function (_ParachainNode) {
4424
4437
  var _super = _createSuper(Integritee);
4425
4438
  function Integritee() {
4426
4439
  _classCallCheck(this, Integritee);
4427
- return _super.call(this, 'Integritee', 'integritee', 'kusama');
4440
+ return _super.call(this, 'Integritee', 'integritee', 'kusama', Version.V1);
4428
4441
  }
4429
4442
  _createClass(Integritee, [{
4430
4443
  key: "transferXTokens",
@@ -4440,7 +4453,7 @@ var InvArchTinker$1 = /*#__PURE__*/function (_ParachainNode) {
4440
4453
  var _super = _createSuper(InvArchTinker);
4441
4454
  function InvArchTinker() {
4442
4455
  _classCallCheck(this, InvArchTinker);
4443
- return _super.call(this, 'InvArchTinker', 'tinker', 'kusama');
4456
+ return _super.call(this, 'InvArchTinker', 'tinker', 'kusama', Version.V1);
4444
4457
  }
4445
4458
  _createClass(InvArchTinker, [{
4446
4459
  key: "transferXTokens",
@@ -4458,7 +4471,7 @@ var Karura$1 = /*#__PURE__*/function (_ParachainNode) {
4458
4471
  var _super = _createSuper(Karura);
4459
4472
  function Karura() {
4460
4473
  _classCallCheck(this, Karura);
4461
- return _super.call(this, 'Karura', 'karura', 'kusama');
4474
+ return _super.call(this, 'Karura', 'karura', 'kusama', Version.V3);
4462
4475
  }
4463
4476
  _createClass(Karura, [{
4464
4477
  key: "transferXTokens",
@@ -4500,7 +4513,7 @@ var Statemint$1 = /*#__PURE__*/function (_ParachainNode) {
4500
4513
  var _super = _createSuper(Statemint);
4501
4514
  function Statemint() {
4502
4515
  _classCallCheck(this, Statemint);
4503
- return _super.call(this, 'Statemint', 'statemint', 'polkadot');
4516
+ return _super.call(this, 'Statemint', 'statemint', 'polkadot', Version.V3);
4504
4517
  }
4505
4518
  _createClass(Statemint, [{
4506
4519
  key: "transferPolkadotXCM",
@@ -4519,7 +4532,7 @@ var Statemine$1 = /*#__PURE__*/function (_ParachainNode) {
4519
4532
  var _super = _createSuper(Statemine);
4520
4533
  function Statemine() {
4521
4534
  _classCallCheck(this, Statemine);
4522
- return _super.call(this, 'Statemine', 'statemine', 'kusama');
4535
+ return _super.call(this, 'Statemine', 'statemine', 'kusama', Version.V3);
4523
4536
  }
4524
4537
  _createClass(Statemine, [{
4525
4538
  key: "transferPolkadotXCM",
@@ -4552,7 +4565,7 @@ var Encointer$1 = /*#__PURE__*/function (_ParachainNode) {
4552
4565
  var _super = _createSuper(Encointer);
4553
4566
  function Encointer() {
4554
4567
  _classCallCheck(this, Encointer);
4555
- return _super.call(this, 'Encointer', 'encointer', 'kusama');
4568
+ return _super.call(this, 'Encointer', 'encointer', 'kusama', Version.V1);
4556
4569
  }
4557
4570
  _createClass(Encointer, [{
4558
4571
  key: "transferPolkadotXCM",
@@ -4573,7 +4586,7 @@ var Robonomics$1 = /*#__PURE__*/function (_ParachainNode) {
4573
4586
  var _super = _createSuper(Robonomics);
4574
4587
  function Robonomics() {
4575
4588
  _classCallCheck(this, Robonomics);
4576
- return _super.call(this, 'Robonomics', 'robonomics', 'kusama');
4589
+ return _super.call(this, 'Robonomics', 'robonomics', 'kusama', Version.V1);
4577
4590
  }
4578
4591
  _createClass(Robonomics, [{
4579
4592
  key: "transferPolkadotXCM",
@@ -4597,7 +4610,7 @@ var Astar$1 = /*#__PURE__*/function (_ParachainNode) {
4597
4610
  var _super = _createSuper(Astar);
4598
4611
  function Astar() {
4599
4612
  _classCallCheck(this, Astar);
4600
- return _super.call(this, 'Astar', 'astar', 'polkadot');
4613
+ return _super.call(this, 'Astar', 'astar', 'polkadot', Version.V3);
4601
4614
  }
4602
4615
  _createClass(Astar, [{
4603
4616
  key: "transferPolkadotXCM",
@@ -4615,7 +4628,7 @@ var Equilibrium$1 = /*#__PURE__*/function (_ParachainNode) {
4615
4628
  var _super = _createSuper(Equilibrium);
4616
4629
  function Equilibrium() {
4617
4630
  _classCallCheck(this, Equilibrium);
4618
- return _super.call(this, 'Equilibrium', 'equilibrium', 'polkadot');
4631
+ return _super.call(this, 'Equilibrium', 'equilibrium', 'polkadot', Version.V1);
4619
4632
  }
4620
4633
  _createClass(Equilibrium, [{
4621
4634
  key: "transferPolkadotXCM",
@@ -4632,7 +4645,7 @@ var Darwinia$1 = /*#__PURE__*/function (_ParachainNode) {
4632
4645
  var _super = _createSuper(Darwinia);
4633
4646
  function Darwinia() {
4634
4647
  _classCallCheck(this, Darwinia);
4635
- return _super.call(this, 'Darwinia', 'darwinia', 'polkadot');
4648
+ return _super.call(this, 'Darwinia', 'darwinia', 'polkadot', Version.V3);
4636
4649
  }
4637
4650
  _createClass(Darwinia, [{
4638
4651
  key: "transferPolkadotXCM",
@@ -4652,7 +4665,7 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
4652
4665
  var _super = _createSuper(Crab);
4653
4666
  function Crab() {
4654
4667
  _classCallCheck(this, Crab);
4655
- return _super.call(this, 'Crab', 'crab', 'kusama');
4668
+ return _super.call(this, 'Crab', 'crab', 'kusama', Version.V3);
4656
4669
  }
4657
4670
  _createClass(Crab, [{
4658
4671
  key: "transferPolkadotXCM",
@@ -4672,13 +4685,13 @@ var Ipci$1 = /*#__PURE__*/function (_ParachainNode) {
4672
4685
  var _super = _createSuper(Ipci);
4673
4686
  function Ipci() {
4674
4687
  _classCallCheck(this, Ipci);
4675
- return _super.call(this, 'Ipci', 'ipci', 'kusama');
4688
+ return _super.call(this, 'Ipci', 'ipci', 'kusama', Version.V1);
4676
4689
  }
4677
4690
  _createClass(Ipci, [{
4678
4691
  key: "transferPolkadotXCM",
4679
4692
  value: function transferPolkadotXCM(input) {
4680
4693
  // UNTESTED, ONLY HAS CHANNELS W ROBONOMICS & 0 TRANSACTIONS
4681
- if (input.scenario == 'ParaToPara') {
4694
+ if (input.scenario === 'ParaToPara') {
4682
4695
  return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserveTransferAssets');
4683
4696
  }
4684
4697
  throw new ScenarioNotSupportedError(this.node, input.scenario);
@@ -4692,7 +4705,7 @@ var Quartz$1 = /*#__PURE__*/function (_ParachainNode) {
4692
4705
  var _super = _createSuper(Quartz);
4693
4706
  function Quartz() {
4694
4707
  _classCallCheck(this, Quartz);
4695
- return _super.call(this, 'Quartz', 'quartz', 'kusama');
4708
+ return _super.call(this, 'Quartz', 'quartz', 'kusama', Version.V3);
4696
4709
  }
4697
4710
  _createClass(Quartz, [{
4698
4711
  key: "transferPolkadotXCM",
@@ -4712,7 +4725,7 @@ var Shiden$1 = /*#__PURE__*/function (_ParachainNode) {
4712
4725
  var _super = _createSuper(Shiden);
4713
4726
  function Shiden() {
4714
4727
  _classCallCheck(this, Shiden);
4715
- return _super.call(this, 'Shiden', 'shiden', 'kusama');
4728
+ return _super.call(this, 'Shiden', 'shiden', 'kusama', Version.V3);
4716
4729
  }
4717
4730
  _createClass(Shiden, [{
4718
4731
  key: "transferPolkadotXCM",
@@ -4794,10 +4807,10 @@ function getFees(scenario) {
4794
4807
  }
4795
4808
  throw new Error("Fees for scenario ".concat(scenario, " are not defined."));
4796
4809
  }
4797
- function handleAddress(scenario, pallet, api, to, nodeId, node) {
4810
+ function handleAddress(scenario, pallet, api, to, version, nodeId) {
4798
4811
  if (scenario === 'ParaToRelay' && pallet === 'xTokens') {
4799
4812
  console.log('AccountId32 transfer');
4800
- if (node === 'BifrostKusama') {
4813
+ if (version === Version.V3) {
4801
4814
  return {
4802
4815
  V3: {
4803
4816
  parents: 1,
@@ -4828,10 +4841,10 @@ function handleAddress(scenario, pallet, api, to, nodeId, node) {
4828
4841
  if (scenario === 'ParaToPara' && pallet === 'xTokens') {
4829
4842
  if (ethers.utils.isAddress(to)) {
4830
4843
  console.log('AccountKey20 transfer');
4831
- if (node === 'BifrostKusama') {
4844
+ if (version === Version.V3) {
4832
4845
  return {
4833
4846
  V3: {
4834
- parents: 0,
4847
+ parents: 1,
4835
4848
  interior: {
4836
4849
  X2: [{
4837
4850
  Parachain: nodeId
@@ -4861,6 +4874,22 @@ function handleAddress(scenario, pallet, api, to, nodeId, node) {
4861
4874
  };
4862
4875
  } else {
4863
4876
  console.log('AccountId32 transfer');
4877
+ if (version === Version.V3) {
4878
+ return {
4879
+ V3: {
4880
+ parents: 1,
4881
+ interior: {
4882
+ X2: [{
4883
+ Parachain: nodeId
4884
+ }, {
4885
+ AccountId32: {
4886
+ id: createAccID(api, to)
4887
+ }
4888
+ }]
4889
+ }
4890
+ }
4891
+ };
4892
+ }
4864
4893
  return {
4865
4894
  V1: {
4866
4895
  parents: 1,
@@ -4880,7 +4909,7 @@ function handleAddress(scenario, pallet, api, to, nodeId, node) {
4880
4909
  }
4881
4910
  if (scenario === 'ParaToRelay' && pallet === 'polkadotXCM') {
4882
4911
  console.log('AccountId32 transfer');
4883
- if (node === 'Statemine' || node === 'Statemint') {
4912
+ if (version === Version.V3) {
4884
4913
  return {
4885
4914
  V3: {
4886
4915
  parents: 0,
@@ -4910,21 +4939,9 @@ function handleAddress(scenario, pallet, api, to, nodeId, node) {
4910
4939
  }
4911
4940
  }
4912
4941
  if (scenario === 'ParaToPara' && pallet === 'polkadotXCM') {
4913
- if (node === 'Quartz') {
4914
- return {
4915
- V0: {
4916
- X1: {
4917
- AccountId32: {
4918
- network: 'Any',
4919
- id: createAccID(api, to)
4920
- }
4921
- }
4922
- }
4923
- };
4924
- }
4925
4942
  if (ethers.utils.isAddress(to)) {
4926
4943
  console.log('AccountKey20 transfer');
4927
- if (node === 'Statemine' || node === 'Statemint') {
4944
+ if (version === Version.V3) {
4928
4945
  return {
4929
4946
  V3: {
4930
4947
  parents: 0,
@@ -4954,7 +4971,7 @@ function handleAddress(scenario, pallet, api, to, nodeId, node) {
4954
4971
  }
4955
4972
  } else {
4956
4973
  console.log('AccountId32 transfer');
4957
- if (node === 'Statemine' || node === 'Statemint') {
4974
+ if (version === Version.V3) {
4958
4975
  return {
4959
4976
  V3: {
4960
4977
  parents: 0,
@@ -5016,10 +5033,10 @@ function handleAddress(scenario, pallet, api, to, nodeId, node) {
5016
5033
  }
5017
5034
  }
5018
5035
  }
5019
- function createCurrencySpecification(amount, scenario, node, cur) {
5036
+ function createCurrencySpecification(amount, scenario, version, node, cur) {
5020
5037
  if (scenario === 'ParaToRelay') {
5021
5038
  console.log('polkadotXCM transfer in native currency to Relay chain');
5022
- if (node === 'Statemine' || node === 'Statemint') {
5039
+ if (version === Version.V3) {
5023
5040
  return {
5024
5041
  V3: [{
5025
5042
  id: {
@@ -5051,20 +5068,10 @@ function createCurrencySpecification(amount, scenario, node, cur) {
5051
5068
  }
5052
5069
  if (scenario === 'RelayToPara' || scenario === 'ParaToPara') {
5053
5070
  console.log('polkadotXCM Native currency to sender chain transfer');
5054
- if (node === 'Quartz' && scenario === 'ParaToPara') {
5055
- return {
5056
- V0: [{
5057
- ConcreteFungible: {
5058
- id: null,
5059
- amount: amount
5060
- }
5061
- }]
5062
- };
5063
- }
5064
5071
  if ((node === 'Darwinia' || node === 'Crab') && scenario === 'ParaToPara') {
5065
5072
  // Special case for Darwinia&Crab node
5066
5073
  return {
5067
- V1: [{
5074
+ V3: [{
5068
5075
  id: {
5069
5076
  Concrete: {
5070
5077
  parents: 0,
@@ -5080,49 +5087,27 @@ function createCurrencySpecification(amount, scenario, node, cur) {
5080
5087
  }
5081
5088
  }]
5082
5089
  };
5083
- } else if ((node === 'Statemint' || node === 'Statemine') && scenario === 'ParaToPara') {
5090
+ } else if ((node === 'Statemine' || node === 'Statemint') && scenario === 'ParaToPara') {
5084
5091
  // Another specific case for Statemint & Statemine to send for example USDt
5085
- if (node === 'Statemine' || node === 'Statemint') {
5086
- return {
5087
- V3: [{
5088
- id: {
5089
- Concrete: {
5090
- parents: 0,
5091
- interior: {
5092
- X2: [{
5093
- PalletInstance: 50
5094
- }, {
5095
- GeneralIndex: cur
5096
- }]
5097
- }
5098
- }
5099
- },
5100
- fun: {
5101
- Fungible: amount
5102
- }
5103
- }]
5104
- };
5105
- } else {
5106
- return {
5107
- V1: [{
5108
- id: {
5109
- Concrete: {
5110
- parents: 0,
5111
- interior: {
5112
- X2: [{
5113
- PalletInstance: 50
5114
- }, {
5115
- GeneralIndex: cur
5116
- }]
5117
- }
5092
+ return {
5093
+ V3: [{
5094
+ id: {
5095
+ Concrete: {
5096
+ parents: 0,
5097
+ interior: {
5098
+ X2: [{
5099
+ PalletInstance: 50
5100
+ }, {
5101
+ GeneralIndex: cur
5102
+ }]
5118
5103
  }
5119
- },
5120
- fun: {
5121
- Fungible: amount
5122
5104
  }
5123
- }]
5124
- };
5125
- }
5105
+ },
5106
+ fun: {
5107
+ Fungible: amount
5108
+ }
5109
+ }]
5110
+ };
5126
5111
  }
5127
5112
  // Otherwise
5128
5113
  return {
@@ -5140,10 +5125,10 @@ function createCurrencySpecification(amount, scenario, node, cur) {
5140
5125
  };
5141
5126
  }
5142
5127
  }
5143
- function createHeaderPolkadotXCM(scenario, nodeId, node) {
5128
+ function createHeaderPolkadotXCM(scenario, version, nodeId) {
5144
5129
  console.log('Generating header for polkadotXCM transfer');
5145
5130
  if (scenario === 'ParaToRelay') {
5146
- if (node === 'Statemine' || node === 'Statemint') {
5131
+ if (version === Version.V3) {
5147
5132
  return {
5148
5133
  V3: {
5149
5134
  parents: 1,
@@ -5160,25 +5145,29 @@ function createHeaderPolkadotXCM(scenario, nodeId, node) {
5160
5145
  }
5161
5146
  }
5162
5147
  if (scenario === 'ParaToPara') {
5163
- if (node === 'Quartz') {
5148
+ if (version === Version.V3) {
5164
5149
  return {
5165
- V0: {
5166
- X2: ['Parent', {
5167
- Parachain: nodeId
5168
- }]
5150
+ V3: {
5151
+ parents: 1,
5152
+ interior: {
5153
+ X1: {
5154
+ Parachain: nodeId
5155
+ }
5156
+ }
5169
5157
  }
5170
5158
  };
5171
- }
5172
- return {
5173
- V1: {
5174
- parents: 1,
5175
- interior: {
5176
- X1: {
5177
- Parachain: nodeId
5159
+ } else {
5160
+ return {
5161
+ V1: {
5162
+ parents: 1,
5163
+ interior: {
5164
+ X1: {
5165
+ Parachain: nodeId
5166
+ }
5178
5167
  }
5179
5168
  }
5180
- }
5181
- };
5169
+ };
5170
+ }
5182
5171
  }
5183
5172
  if (scenario === 'RelayToPara') {
5184
5173
  return {
@@ -5238,7 +5227,7 @@ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
5238
5227
  return _createClass(NodeNotSupportedError);
5239
5228
  }( /*#__PURE__*/_wrapNativeSuper(Error));
5240
5229
 
5241
- //Contains basic call formatting for different XCM Palletss
5230
+ // Contains basic call formatting for different XCM Palletss
5242
5231
  function send(api, origin, currencySymbolOrId, amount, to, destination) {
5243
5232
  var asset = getAssetBySymbolOrId(origin, currencySymbolOrId.toString());
5244
5233
  if (!asset) {
@@ -5253,14 +5242,16 @@ function send(api, origin, currencySymbolOrId, amount, to, destination) {
5253
5242
  }
5254
5243
  function transferRelayToPara(api, destination, amount, to) {
5255
5244
  var paraId = getParaId(destination);
5256
- if (destination === 'Statemint' || destination === 'Statemine' || destination === 'Encointer') {
5245
+ if (destination === 'Statemint' || destination === 'Statemine') {
5257
5246
  // Same for Statemint, Statemine and Encoiter
5258
- return api.tx.xcmPallet.limitedTeleportAssets(createHeaderPolkadotXCM('RelayToPara', paraId, destination), handleAddress('RelayToPara', '', api, to, paraId, destination), createCurrencySpecification(amount, 'RelayToPara', destination), 0, 'Unlimited');
5259
- } else if (destination === 'Darwinia' || destination === 'Crab' || destination === 'Quartz') {
5260
- // Do not do anything because Darwinia and Crab does not have DOT and KSM registered Quartz does not work with UMP & DMP too
5247
+ return api.tx.xcmPallet.limitedTeleportAssets(createHeaderPolkadotXCM('RelayToPara', Version.V3, paraId), handleAddress('RelayToPara', '', api, to, Version.V3, paraId), createCurrencySpecification(amount, 'RelayToPara', Version.V3, destination), 0, 'Unlimited');
5248
+ } else if (destination === 'Encointer') {
5249
+ return api.tx.xcmPallet.limitedTeleportAssets(createHeaderPolkadotXCM('RelayToPara', Version.V1, paraId), handleAddress('RelayToPara', '', api, to, Version.V1, paraId), createCurrencySpecification(amount, 'RelayToPara', Version.V1, destination), 0, 'Unlimited');
5250
+ } else if (destination === 'Darwinia' || destination === 'Crab') {
5251
+ // Do not do anything because Darwinia and Crab does not have DOT and KSM registered
5261
5252
  throw new NodeNotSupportedError('These nodes do not support XCM transfers from Relay / to Relay chain.');
5262
5253
  }
5263
- return api.tx.xcmPallet.reserveTransferAssets(createHeaderPolkadotXCM('RelayToPara', paraId, destination), handleAddress('RelayToPara', '', api, to, paraId, destination), createCurrencySpecification(amount, 'RelayToPara', destination), 0);
5254
+ return api.tx.xcmPallet.reserveTransferAssets(createHeaderPolkadotXCM('RelayToPara', Version.V3, paraId), handleAddress('RelayToPara', '', api, to, Version.V3, paraId), createCurrencySpecification(amount, 'RelayToPara', Version.V3, destination), 0);
5264
5255
  }
5265
5256
 
5266
5257
  var index$3 = /*#__PURE__*/Object.freeze({
@@ -5693,10 +5684,11 @@ var ToGeneralBuilder = /*#__PURE__*/function () {
5693
5684
  return ToGeneralBuilder;
5694
5685
  }();
5695
5686
  var FromGeneralBuilder = /*#__PURE__*/function () {
5696
- function FromGeneralBuilder(api, from) {
5687
+ function FromGeneralBuilder(api, from, version) {
5697
5688
  _classCallCheck(this, FromGeneralBuilder);
5698
5689
  this.api = api;
5699
5690
  this.from = from;
5691
+ this.version = version;
5700
5692
  }
5701
5693
  _createClass(FromGeneralBuilder, [{
5702
5694
  key: "to",
@@ -5724,7 +5716,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
5724
5716
  _createClass(GeneralBuilder, [{
5725
5717
  key: "from",
5726
5718
  value: function from(node) {
5727
- return new FromGeneralBuilder(this.api, node);
5719
+ return new FromGeneralBuilder(this.api, node, this.version);
5728
5720
  }
5729
5721
  }, {
5730
5722
  key: "to",
@@ -5810,9 +5802,10 @@ var Clover = {
5810
5802
  ]
5811
5803
  };
5812
5804
  var ComposableFinance = {
5813
- defaultPallet: "RelayerXcm",
5805
+ defaultPallet: "XTokens",
5814
5806
  supportedPallets: [
5815
- "RelayerXcm"
5807
+ "PolkadotXcm",
5808
+ "XTokens"
5816
5809
  ]
5817
5810
  };
5818
5811
  var Darwinia = {
@@ -6016,7 +6009,7 @@ var ParallelHeiko = {
6016
6009
  var Picasso = {
6017
6010
  defaultPallet: "XTokens",
6018
6011
  supportedPallets: [
6019
- "RelayerXcm",
6012
+ "PolkadotXcm",
6020
6013
  "XTokens"
6021
6014
  ]
6022
6015
  };
@@ -6199,4 +6192,4 @@ var getSupportedPallets = function getSupportedPallets(node) {
6199
6192
  return palletsMap[node].supportedPallets;
6200
6193
  };
6201
6194
 
6202
- export { Builder, NODE_NAMES, SUPPORTED_PALLETS, index$4 as assets, index as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$1 as openChannels, index$3 as xcmPallet, index$2 as xyk };
6195
+ export { Builder, NODE_NAMES, SUPPORTED_PALLETS, Version, index$4 as assets, index as closeChannels, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssetsObject, getDefaultPallet, getNativeAssets, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedPallets, getTNode, hasSupportForAsset, index$1 as openChannels, index$3 as xcmPallet, index$2 as xyk };