@paraspell/sdk-core 8.5.2 → 8.6.0

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
@@ -13,7 +13,7 @@ function _arrayWithoutHoles(r) {
13
13
  if (Array.isArray(r)) return _arrayLikeToArray(r);
14
14
  }
15
15
  function _assertThisInitialized(e) {
16
- if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
16
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
17
17
  return e;
18
18
  }
19
19
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
@@ -37,7 +37,7 @@ function _asyncToGenerator(n) {
37
37
  function _throw(n) {
38
38
  asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
39
39
  }
40
- _next(undefined);
40
+ _next(void 0);
41
41
  });
42
42
  };
43
43
  }
@@ -218,7 +218,7 @@ function _objectSpread2(e) {
218
218
  }
219
219
  function _possibleConstructorReturn(t, e) {
220
220
  if (e && ("object" == typeof e || "function" == typeof e)) return e;
221
- if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
221
+ if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
222
222
  return _assertThisInitialized(t);
223
223
  }
224
224
  function _regeneratorRuntime() {
@@ -421,7 +421,7 @@ function _regeneratorRuntime() {
421
421
  }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
422
422
  return this;
423
423
  }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
424
- undefined === i && (i = Promise);
424
+ void 0 === i && (i = Promise);
425
425
  var a = new AsyncIterator(wrap(t, r, n, o), i);
426
426
  return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
427
427
  return t.done ? t.value : a.next();
@@ -535,7 +535,7 @@ function _superPropBase(t, o) {
535
535
  return t;
536
536
  }
537
537
  function _superPropGet(t, o, e, r) {
538
- var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
538
+ var p = _get(_getPrototypeOf(t.prototype ), o, e);
539
539
  return 2 & r && "function" == typeof p ? function (t) {
540
540
  return p.apply(e, t);
541
541
  } : p;
@@ -546,12 +546,12 @@ function _toConsumableArray(r) {
546
546
  function _toPrimitive(t, r) {
547
547
  if ("object" != typeof t || !t) return t;
548
548
  var e = t[Symbol.toPrimitive];
549
- if (undefined !== e) {
550
- var i = e.call(t, r || "default");
549
+ if (void 0 !== e) {
550
+ var i = e.call(t, r);
551
551
  if ("object" != typeof i) return i;
552
552
  throw new TypeError("@@toPrimitive must return a primitive value.");
553
553
  }
554
- return ("string" === r ? String : Number)(t);
554
+ return (String )(t);
555
555
  }
556
556
  function _toPropertyKey(t) {
557
557
  var i = _toPrimitive(t, "string");
@@ -570,15 +570,15 @@ function _unsupportedIterableToArray(r, a) {
570
570
  if (r) {
571
571
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
572
572
  var t = {}.toString.call(r).slice(8, -1);
573
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : undefined;
573
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
574
574
  }
575
575
  }
576
576
  function _wrapNativeSuper(t) {
577
- var r = "function" == typeof Map ? new Map() : undefined;
577
+ var r = "function" == typeof Map ? new Map() : void 0;
578
578
  return _wrapNativeSuper = function (t) {
579
579
  if (null === t || !_isNativeFunction(t)) return t;
580
580
  if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
581
- if (undefined !== r) {
581
+ if (void 0 !== r) {
582
582
  if (r.has(t)) return r.get(t);
583
583
  r.set(t, Wrapper);
584
584
  }
@@ -4699,7 +4699,7 @@ var Interlay$3 = {
4699
4699
  }
4700
4700
  ]
4701
4701
  };
4702
- var Litentry$3 = {
4702
+ var Heima$3 = {
4703
4703
  relayChainAssetSymbol: "DOT",
4704
4704
  nativeAssetSymbol: "HEI",
4705
4705
  isEVM: false,
@@ -6088,6 +6088,12 @@ var AssetHubPolkadot$3 = {
6088
6088
  symbol: "DOT",
6089
6089
  isNative: true,
6090
6090
  decimals: 10,
6091
+ multiLocation: {
6092
+ parents: 1,
6093
+ interior: {
6094
+ Here: null
6095
+ }
6096
+ },
6091
6097
  existentialDeposit: "100000000"
6092
6098
  },
6093
6099
  {
@@ -6101,260 +6107,286 @@ var AssetHubPolkadot$3 = {
6101
6107
  assetId: "1024",
6102
6108
  symbol: "NCTR",
6103
6109
  decimals: 18,
6104
- xcmInterior: [
6105
- {
6106
- Network: "polkadot"
6107
- },
6108
- {
6109
- Parachain: 1000
6110
- },
6111
- {
6112
- PalletInstance: 50
6113
- },
6114
- {
6115
- GeneralIndex: 1024
6116
- }
6117
- ],
6110
+ multiLocation: {
6111
+ parents: 1,
6112
+ interior: {
6113
+ X3: [
6114
+ {
6115
+ Parachain: 1000
6116
+ },
6117
+ {
6118
+ PalletInstance: 50
6119
+ },
6120
+ {
6121
+ GeneralIndex: 1024
6122
+ }
6123
+ ]
6124
+ }
6125
+ },
6118
6126
  existentialDeposit: "100000000"
6119
6127
  },
6120
6128
  {
6121
6129
  assetId: "1337",
6122
6130
  symbol: "USDC",
6123
6131
  decimals: 6,
6124
- xcmInterior: [
6125
- {
6126
- Network: "polkadot"
6127
- },
6128
- {
6129
- Parachain: 1000
6130
- },
6131
- {
6132
- PalletInstance: 50
6133
- },
6134
- {
6135
- GeneralIndex: 1337
6136
- }
6137
- ],
6132
+ multiLocation: {
6133
+ parents: 1,
6134
+ interior: {
6135
+ X3: [
6136
+ {
6137
+ Parachain: 1000
6138
+ },
6139
+ {
6140
+ PalletInstance: 50
6141
+ },
6142
+ {
6143
+ GeneralIndex: 1337
6144
+ }
6145
+ ]
6146
+ }
6147
+ },
6138
6148
  existentialDeposit: "10000"
6139
6149
  },
6140
6150
  {
6141
6151
  assetId: "17",
6142
6152
  symbol: "WIFD",
6143
6153
  decimals: 10,
6144
- xcmInterior: [
6145
- {
6146
- Network: "polkadot"
6147
- },
6148
- {
6149
- Parachain: 1000
6150
- },
6151
- {
6152
- PalletInstance: 50
6153
- },
6154
- {
6155
- GeneralIndex: 17
6156
- }
6157
- ],
6154
+ multiLocation: {
6155
+ parents: 1,
6156
+ interior: {
6157
+ X3: [
6158
+ {
6159
+ Parachain: 1000
6160
+ },
6161
+ {
6162
+ PalletInstance: 50
6163
+ },
6164
+ {
6165
+ GeneralIndex: 17
6166
+ }
6167
+ ]
6168
+ }
6169
+ },
6158
6170
  existentialDeposit: "1"
6159
6171
  },
6160
6172
  {
6161
6173
  assetId: "1984",
6162
6174
  symbol: "USDt",
6163
6175
  decimals: 6,
6164
- xcmInterior: [
6165
- {
6166
- Network: "polkadot"
6167
- },
6168
- {
6169
- Parachain: 1000
6170
- },
6171
- {
6172
- PalletInstance: 50
6173
- },
6174
- {
6175
- GeneralIndex: 1984
6176
- }
6177
- ],
6176
+ multiLocation: {
6177
+ parents: 1,
6178
+ interior: {
6179
+ X3: [
6180
+ {
6181
+ Parachain: 1000
6182
+ },
6183
+ {
6184
+ PalletInstance: 50
6185
+ },
6186
+ {
6187
+ GeneralIndex: 1984
6188
+ }
6189
+ ]
6190
+ }
6191
+ },
6178
6192
  existentialDeposit: "10000"
6179
6193
  },
6180
6194
  {
6181
6195
  assetId: "21",
6182
6196
  symbol: "WBTC",
6183
6197
  decimals: 8,
6184
- xcmInterior: [
6185
- {
6186
- Network: "polkadot"
6187
- },
6188
- {
6189
- Parachain: 1000
6190
- },
6191
- {
6192
- PalletInstance: 50
6193
- },
6194
- {
6195
- GeneralIndex: 21
6196
- }
6197
- ],
6198
+ multiLocation: {
6199
+ parents: 1,
6200
+ interior: {
6201
+ X3: [
6202
+ {
6203
+ Parachain: 1000
6204
+ },
6205
+ {
6206
+ PalletInstance: 50
6207
+ },
6208
+ {
6209
+ GeneralIndex: 21
6210
+ }
6211
+ ]
6212
+ }
6213
+ },
6198
6214
  existentialDeposit: "3000"
6199
6215
  },
6200
6216
  {
6201
6217
  assetId: "22222012",
6202
6218
  symbol: "DAMN",
6203
6219
  decimals: 12,
6204
- xcmInterior: [
6205
- {
6206
- Network: "polkadot"
6207
- },
6208
- {
6209
- Parachain: 1000
6210
- },
6211
- {
6212
- PalletInstance: 50
6213
- },
6214
- {
6215
- GeneralIndex: 22222012
6216
- }
6217
- ],
6220
+ multiLocation: {
6221
+ parents: 1,
6222
+ interior: {
6223
+ X3: [
6224
+ {
6225
+ Parachain: 1000
6226
+ },
6227
+ {
6228
+ PalletInstance: 50
6229
+ },
6230
+ {
6231
+ GeneralIndex: 22222012
6232
+ }
6233
+ ]
6234
+ }
6235
+ },
6218
6236
  existentialDeposit: "1000000000000"
6219
6237
  },
6220
6238
  {
6221
6239
  assetId: "23",
6222
6240
  symbol: "PINK",
6223
6241
  decimals: 10,
6224
- xcmInterior: [
6225
- {
6226
- Network: "polkadot"
6227
- },
6228
- {
6229
- Parachain: 1000
6230
- },
6231
- {
6232
- PalletInstance: 50
6233
- },
6234
- {
6235
- GeneralIndex: 23
6236
- }
6237
- ],
6242
+ multiLocation: {
6243
+ parents: 1,
6244
+ interior: {
6245
+ X3: [
6246
+ {
6247
+ Parachain: 1000
6248
+ },
6249
+ {
6250
+ PalletInstance: 50
6251
+ },
6252
+ {
6253
+ GeneralIndex: 23
6254
+ }
6255
+ ]
6256
+ }
6257
+ },
6238
6258
  existentialDeposit: "1"
6239
6259
  },
6240
6260
  {
6241
6261
  assetId: "30",
6242
6262
  symbol: "DED",
6243
6263
  decimals: 10,
6244
- xcmInterior: [
6245
- {
6246
- Network: "polkadot"
6247
- },
6248
- {
6249
- Parachain: 1000
6250
- },
6251
- {
6252
- PalletInstance: 50
6253
- },
6254
- {
6255
- GeneralIndex: 30
6256
- }
6257
- ],
6264
+ multiLocation: {
6265
+ parents: 1,
6266
+ interior: {
6267
+ X3: [
6268
+ {
6269
+ Parachain: 1000
6270
+ },
6271
+ {
6272
+ PalletInstance: 50
6273
+ },
6274
+ {
6275
+ GeneralIndex: 30
6276
+ }
6277
+ ]
6278
+ }
6279
+ },
6258
6280
  existentialDeposit: "1"
6259
6281
  },
6260
6282
  {
6261
6283
  assetId: "31337",
6262
6284
  symbol: "WUD",
6263
6285
  decimals: 10,
6264
- xcmInterior: [
6265
- {
6266
- Network: "polkadot"
6267
- },
6268
- {
6269
- Parachain: 1000
6270
- },
6271
- {
6272
- PalletInstance: 50
6273
- },
6274
- {
6275
- GeneralIndex: 31337
6276
- }
6277
- ],
6286
+ multiLocation: {
6287
+ parents: 1,
6288
+ interior: {
6289
+ X3: [
6290
+ {
6291
+ Parachain: 1000
6292
+ },
6293
+ {
6294
+ PalletInstance: 50
6295
+ },
6296
+ {
6297
+ GeneralIndex: 31337
6298
+ }
6299
+ ]
6300
+ }
6301
+ },
6278
6302
  existentialDeposit: "10000000"
6279
6303
  },
6280
6304
  {
6281
6305
  assetId: "42069",
6282
6306
  symbol: "STINK",
6283
6307
  decimals: 10,
6284
- xcmInterior: [
6285
- {
6286
- Network: "polkadot"
6287
- },
6288
- {
6289
- Parachain: 1000
6290
- },
6291
- {
6292
- PalletInstance: 50
6293
- },
6294
- {
6295
- GeneralIndex: 42069
6296
- }
6297
- ],
6308
+ multiLocation: {
6309
+ parents: 1,
6310
+ interior: {
6311
+ X3: [
6312
+ {
6313
+ Parachain: 1000
6314
+ },
6315
+ {
6316
+ PalletInstance: 50
6317
+ },
6318
+ {
6319
+ GeneralIndex: 42069
6320
+ }
6321
+ ]
6322
+ }
6323
+ },
6298
6324
  existentialDeposit: "1000000"
6299
6325
  },
6300
6326
  {
6301
6327
  assetId: "50000028",
6302
6328
  symbol: "LOVA",
6303
6329
  decimals: 12,
6304
- xcmInterior: [
6305
- {
6306
- Network: "polkadot"
6307
- },
6308
- {
6309
- Parachain: 1000
6310
- },
6311
- {
6312
- PalletInstance: 50
6313
- },
6314
- {
6315
- GeneralIndex: 50000028
6316
- }
6317
- ],
6330
+ multiLocation: {
6331
+ parents: 1,
6332
+ interior: {
6333
+ X3: [
6334
+ {
6335
+ Parachain: 1000
6336
+ },
6337
+ {
6338
+ PalletInstance: 50
6339
+ },
6340
+ {
6341
+ GeneralIndex: 50000028
6342
+ }
6343
+ ]
6344
+ }
6345
+ },
6318
6346
  existentialDeposit: "1000000000000"
6319
6347
  },
6320
6348
  {
6321
6349
  assetId: "50000069",
6322
6350
  symbol: "LOTY",
6323
6351
  decimals: 12,
6324
- xcmInterior: [
6325
- {
6326
- Network: "polkadot"
6327
- },
6328
- {
6329
- Parachain: 1000
6330
- },
6331
- {
6332
- PalletInstance: 50
6333
- },
6334
- {
6335
- GeneralIndex: 50000069
6336
- }
6337
- ],
6352
+ multiLocation: {
6353
+ parents: 1,
6354
+ interior: {
6355
+ X3: [
6356
+ {
6357
+ Parachain: 1000
6358
+ },
6359
+ {
6360
+ PalletInstance: 50
6361
+ },
6362
+ {
6363
+ GeneralIndex: 50000069
6364
+ }
6365
+ ]
6366
+ }
6367
+ },
6338
6368
  existentialDeposit: "100000000"
6339
6369
  },
6340
6370
  {
6341
6371
  assetId: "555",
6342
6372
  symbol: "GAME",
6343
6373
  decimals: 10,
6344
- xcmInterior: [
6345
- {
6346
- Network: "polkadot"
6347
- },
6348
- {
6349
- Parachain: 1000
6350
- },
6351
- {
6352
- PalletInstance: 50
6353
- },
6354
- {
6355
- GeneralIndex: 555
6356
- }
6357
- ],
6374
+ multiLocation: {
6375
+ parents: 1,
6376
+ interior: {
6377
+ X3: [
6378
+ {
6379
+ Parachain: 1000
6380
+ },
6381
+ {
6382
+ PalletInstance: 50
6383
+ },
6384
+ {
6385
+ GeneralIndex: 555
6386
+ }
6387
+ ]
6388
+ }
6389
+ },
6358
6390
  existentialDeposit: "100000"
6359
6391
  },
6360
6392
  {
@@ -6751,7 +6783,7 @@ var Basilisk$3 = {
6751
6783
  relayChainAssetSymbol: "KSM",
6752
6784
  nativeAssetSymbol: "BSX",
6753
6785
  isEVM: false,
6754
- supportsDryRunApi: false,
6786
+ supportsDryRunApi: true,
6755
6787
  nativeAssets: [
6756
6788
  {
6757
6789
  symbol: "BSX",
@@ -9978,8 +10010,8 @@ var Shiden$3 = {
9978
10010
  nativeAssets: [
9979
10011
  {
9980
10012
  symbol: "SDN",
9981
- decimals: 18,
9982
10013
  isNative: true,
10014
+ decimals: 18,
9983
10015
  existentialDeposit: "1000000"
9984
10016
  }
9985
10017
  ],
@@ -10322,6 +10354,12 @@ var AssetHubKusama$3 = {
10322
10354
  symbol: "KSM",
10323
10355
  isNative: true,
10324
10356
  decimals: 12,
10357
+ multiLocation: {
10358
+ parents: 1,
10359
+ interior: {
10360
+ Here: null
10361
+ }
10362
+ },
10325
10363
  existentialDeposit: "3333333"
10326
10364
  },
10327
10365
  {
@@ -10335,80 +10373,88 @@ var AssetHubKusama$3 = {
10335
10373
  assetId: "16",
10336
10374
  symbol: "ARIS",
10337
10375
  decimals: 8,
10338
- xcmInterior: [
10339
- {
10340
- Network: "kusama"
10341
- },
10342
- {
10343
- Parachain: 1000
10344
- },
10345
- {
10346
- PalletInstance: 50
10347
- },
10348
- {
10349
- GeneralIndex: 16
10350
- }
10351
- ],
10376
+ multiLocation: {
10377
+ parents: 1,
10378
+ interior: {
10379
+ X3: [
10380
+ {
10381
+ Parachain: 1000
10382
+ },
10383
+ {
10384
+ PalletInstance: 50
10385
+ },
10386
+ {
10387
+ GeneralIndex: 16
10388
+ }
10389
+ ]
10390
+ }
10391
+ },
10352
10392
  existentialDeposit: "10000000"
10353
10393
  },
10354
10394
  {
10355
10395
  assetId: "1984",
10356
10396
  symbol: "USDt",
10357
10397
  decimals: 6,
10358
- xcmInterior: [
10359
- {
10360
- Network: "kusama"
10361
- },
10362
- {
10363
- Parachain: 1000
10364
- },
10365
- {
10366
- PalletInstance: 50
10367
- },
10368
- {
10369
- GeneralIndex: 1984
10370
- }
10371
- ],
10398
+ multiLocation: {
10399
+ parents: 1,
10400
+ interior: {
10401
+ X3: [
10402
+ {
10403
+ Parachain: 1000
10404
+ },
10405
+ {
10406
+ PalletInstance: 50
10407
+ },
10408
+ {
10409
+ GeneralIndex: 1984
10410
+ }
10411
+ ]
10412
+ }
10413
+ },
10372
10414
  existentialDeposit: "100"
10373
10415
  },
10374
10416
  {
10375
10417
  assetId: "223",
10376
10418
  symbol: "BILL",
10377
10419
  decimals: 8,
10378
- xcmInterior: [
10379
- {
10380
- Network: "kusama"
10381
- },
10382
- {
10383
- Parachain: 1000
10384
- },
10385
- {
10386
- PalletInstance: 50
10387
- },
10388
- {
10389
- GeneralIndex: 223
10390
- }
10391
- ],
10420
+ multiLocation: {
10421
+ parents: 1,
10422
+ interior: {
10423
+ X3: [
10424
+ {
10425
+ Parachain: 1000
10426
+ },
10427
+ {
10428
+ PalletInstance: 50
10429
+ },
10430
+ {
10431
+ GeneralIndex: 223
10432
+ }
10433
+ ]
10434
+ }
10435
+ },
10392
10436
  existentialDeposit: "10000"
10393
10437
  },
10394
10438
  {
10395
10439
  assetId: "8",
10396
10440
  symbol: "RMRK",
10397
10441
  decimals: 10,
10398
- xcmInterior: [
10399
- {
10400
- Network: "kusama"
10401
- },
10402
- {
10403
- Parachain: 1000
10404
- },
10405
- {
10406
- PalletInstance: 50
10407
- },
10408
- {
10409
- GeneralIndex: 8
10410
- }
10411
- ],
10442
+ multiLocation: {
10443
+ parents: 1,
10444
+ interior: {
10445
+ X3: [
10446
+ {
10447
+ Parachain: 1000
10448
+ },
10449
+ {
10450
+ PalletInstance: 50
10451
+ },
10452
+ {
10453
+ GeneralIndex: 8
10454
+ }
10455
+ ]
10456
+ }
10457
+ },
10412
10458
  existentialDeposit: "10000"
10413
10459
  },
10414
10460
  {
@@ -11100,9 +11146,22 @@ var Nodle$3 = {
11100
11146
  nativeAssets: [
11101
11147
  {
11102
11148
  symbol: "NODL",
11103
- decimals: 11,
11104
11149
  isNative: true,
11105
- existentialDeposit: "10000"
11150
+ decimals: 11,
11151
+ existentialDeposit: "10000",
11152
+ multiLocation: {
11153
+ parents: 1,
11154
+ interior: {
11155
+ X2: [
11156
+ {
11157
+ Parachain: 2026
11158
+ },
11159
+ {
11160
+ PalletInstance: 2
11161
+ }
11162
+ ]
11163
+ }
11164
+ }
11106
11165
  }
11107
11166
  ],
11108
11167
  otherAssets: [
@@ -11445,7 +11504,7 @@ var Zeitgeist$3 = {
11445
11504
  symbol: "ZTG",
11446
11505
  isNative: true,
11447
11506
  decimals: 10,
11448
- existentialDeposit: "50000000",
11507
+ existentialDeposit: "5000000000",
11449
11508
  multiLocation: {
11450
11509
  parents: 1,
11451
11510
  interior: {
@@ -12096,423 +12155,104 @@ var Ethereum = {
12096
12155
  }
12097
12156
  },
12098
12157
  {
12099
- symbol: "USDT",
12100
- assetId: "0xdac17f958d2ee523a2206206994597c13d831ec7",
12101
- existentialDeposit: "1",
12102
- multiLocation: {
12103
- parents: 2,
12104
- interior: {
12105
- X2: [
12106
- {
12107
- GlobalConsensus: {
12108
- Ethereum: {
12109
- chainId: 1
12110
- }
12111
- }
12112
- },
12113
- {
12114
- AccountKey20: {
12115
- network: null,
12116
- key: "0xdac17f958d2ee523a2206206994597c13d831ec7"
12117
- }
12118
- }
12119
- ]
12120
- }
12121
- }
12122
- },
12123
- {
12124
- symbol: "DAI",
12125
- assetId: "0x6b175474e89094c44da98b954eedeac495271d0f",
12126
- existentialDeposit: "1",
12127
- multiLocation: {
12128
- parents: 2,
12129
- interior: {
12130
- X2: [
12131
- {
12132
- GlobalConsensus: {
12133
- Ethereum: {
12134
- chainId: 1
12135
- }
12136
- }
12137
- },
12138
- {
12139
- AccountKey20: {
12140
- network: null,
12141
- key: "0x6b175474e89094c44da98b954eedeac495271d0f"
12142
- }
12143
- }
12144
- ]
12145
- }
12146
- }
12147
- },
12148
- {
12149
- symbol: "KILT",
12150
- assetId: "0x5d3d01fd6d2ad1169b17918eb4f153c6616288eb",
12151
- existentialDeposit: "1",
12152
- multiLocation: {
12153
- parents: 2,
12154
- interior: {
12155
- X2: [
12156
- {
12157
- GlobalConsensus: {
12158
- Ethereum: {
12159
- chainId: 1
12160
- }
12161
- }
12162
- },
12163
- {
12164
- AccountKey20: {
12165
- network: null,
12166
- key: "0x5d3d01fd6d2ad1169b17918eb4f153c6616288eb"
12167
- }
12168
- }
12169
- ]
12170
- }
12171
- }
12172
- },
12173
- {
12174
- symbol: "AAVE",
12175
- assetId: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
12176
- existentialDeposit: "1",
12177
- multiLocation: {
12178
- parents: 2,
12179
- interior: {
12180
- X2: [
12181
- {
12182
- GlobalConsensus: {
12183
- Ethereum: {
12184
- chainId: 1
12185
- }
12186
- }
12187
- },
12188
- {
12189
- AccountKey20: {
12190
- network: null,
12191
- key: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"
12192
- }
12193
- }
12194
- ]
12195
- }
12196
- }
12197
- }
12198
- ]
12199
- };
12200
- var Khala$3 = {
12201
- relayChainAssetSymbol: "KSM",
12202
- nativeAssetSymbol: "PHA",
12203
- isEVM: false,
12204
- supportsDryRunApi: false,
12205
- nativeAssets: [
12206
- {
12207
- symbol: "PHA",
12208
- decimals: 12,
12209
- isNative: true,
12210
- existentialDeposit: "10000000000"
12211
- }
12212
- ],
12213
- otherAssets: [
12214
- {
12215
- assetId: "0",
12216
- symbol: "KSM",
12217
- decimals: 12,
12218
- multiLocation: {
12219
- parents: 1,
12220
- interior: {
12221
- Here: null
12222
- }
12223
- },
12224
- existentialDeposit: "10000000000"
12225
- },
12226
- {
12227
- assetId: "1",
12228
- symbol: "KAR",
12229
- decimals: 12,
12230
- multiLocation: {
12231
- parents: 1,
12232
- interior: {
12233
- X2: [
12234
- {
12235
- Parachain: 2000
12236
- },
12237
- {
12238
- GeneralKey: {
12239
- length: 2,
12240
- data: "0x0080000000000000000000000000000000000000000000000000000000000000"
12241
- }
12242
- }
12243
- ]
12244
- }
12245
- },
12246
- existentialDeposit: "10000000000"
12247
- },
12248
- {
12249
- assetId: "4",
12250
- symbol: "aUSD",
12251
- decimals: 12,
12252
- multiLocation: {
12253
- parents: 1,
12254
- interior: {
12255
- X2: [
12256
- {
12257
- Parachain: 2000
12258
- },
12259
- {
12260
- GeneralKey: {
12261
- length: 2,
12262
- data: "0x0081000000000000000000000000000000000000000000000000000000000000"
12263
- }
12264
- }
12265
- ]
12266
- }
12267
- },
12268
- existentialDeposit: "10000000000"
12269
- },
12270
- {
12271
- assetId: "2",
12272
- symbol: "BNC",
12273
- decimals: 12,
12274
- multiLocation: {
12275
- parents: 1,
12276
- interior: {
12277
- X2: [
12278
- {
12279
- Parachain: 2001
12280
- },
12281
- {
12282
- GeneralKey: {
12283
- length: 2,
12284
- data: "0x0001000000000000000000000000000000000000000000000000000000000000"
12285
- }
12286
- }
12287
- ]
12288
- }
12289
- },
12290
- existentialDeposit: "10000000000"
12291
- },
12292
- {
12293
- assetId: "3",
12294
- symbol: "ZLK",
12295
- decimals: 18,
12296
- multiLocation: {
12297
- parents: 1,
12298
- interior: {
12299
- X2: [
12300
- {
12301
- Parachain: 2001
12302
- },
12303
- {
12304
- GeneralKey: {
12305
- length: 2,
12306
- data: "0x0207000000000000000000000000000000000000000000000000000000000000"
12307
- }
12308
- }
12309
- ]
12310
- }
12311
- },
12312
- existentialDeposit: "10000000000"
12313
- },
12314
- {
12315
- assetId: "12",
12316
- symbol: "SDN",
12317
- decimals: 18,
12318
- multiLocation: {
12319
- parents: 1,
12320
- interior: {
12321
- X1: {
12322
- Parachain: 2007
12323
- }
12324
- }
12325
- },
12326
- existentialDeposit: "10000000000000000"
12327
- },
12328
- {
12329
- assetId: "6",
12330
- symbol: "MOVR",
12331
- decimals: 18,
12332
- multiLocation: {
12333
- parents: 1,
12334
- interior: {
12335
- X2: [
12336
- {
12337
- Parachain: 2023
12338
- },
12339
- {
12340
- PalletInstance: 10
12341
- }
12342
- ]
12343
- }
12344
- },
12345
- existentialDeposit: "10000000000"
12346
- },
12347
- {
12348
- assetId: "8",
12349
- symbol: "KMA",
12350
- decimals: 12,
12351
- multiLocation: {
12352
- parents: 1,
12353
- interior: {
12354
- X1: {
12355
- Parachain: 2084
12356
- }
12357
- }
12358
- },
12359
- existentialDeposit: "10000000000"
12360
- },
12361
- {
12362
- assetId: "7",
12363
- symbol: "HKO",
12364
- decimals: 12,
12365
- multiLocation: {
12366
- parents: 1,
12367
- interior: {
12368
- X2: [
12369
- {
12370
- Parachain: 2085
12371
- },
12372
- {
12373
- GeneralKey: {
12374
- length: 3,
12375
- data: "0x484b4f0000000000000000000000000000000000000000000000000000000000"
12376
- }
12377
- }
12378
- ]
12379
- }
12380
- },
12381
- existentialDeposit: "10000000000"
12382
- },
12383
- {
12384
- assetId: "15",
12385
- symbol: "PICA",
12386
- decimals: 12,
12387
- multiLocation: {
12388
- parents: 1,
12389
- interior: {
12390
- X1: {
12391
- Parachain: 2087
12392
- }
12393
- }
12394
- },
12395
- existentialDeposit: "10000000000"
12396
- },
12397
- {
12398
- assetId: "5",
12399
- symbol: "BSX",
12400
- decimals: 12,
12401
- multiLocation: {
12402
- parents: 1,
12403
- interior: {
12404
- X2: [
12405
- {
12406
- Parachain: 2090
12407
- },
12408
- {
12409
- GeneralKey: {
12410
- length: 4,
12411
- data: "0x0000000000000000000000000000000000000000000000000000000000000000"
12412
- }
12413
- }
12414
- ]
12415
- }
12416
- },
12417
- existentialDeposit: "10000000000",
12418
- alias: "BSX1"
12419
- },
12420
- {
12421
- assetId: "9",
12422
- symbol: "BSX",
12423
- decimals: 12,
12158
+ symbol: "USDT",
12159
+ assetId: "0xdac17f958d2ee523a2206206994597c13d831ec7",
12160
+ existentialDeposit: "1",
12424
12161
  multiLocation: {
12425
- parents: 1,
12162
+ parents: 2,
12426
12163
  interior: {
12427
12164
  X2: [
12428
12165
  {
12429
- Parachain: 2090
12166
+ GlobalConsensus: {
12167
+ Ethereum: {
12168
+ chainId: 1
12169
+ }
12170
+ }
12430
12171
  },
12431
12172
  {
12432
- GeneralIndex: 0
12173
+ AccountKey20: {
12174
+ network: null,
12175
+ key: "0xdac17f958d2ee523a2206206994597c13d831ec7"
12176
+ }
12433
12177
  }
12434
12178
  ]
12435
12179
  }
12436
- },
12437
- existentialDeposit: "10000000000",
12438
- alias: "BSX2"
12180
+ }
12439
12181
  },
12440
12182
  {
12441
- assetId: "13",
12442
- symbol: "NEER",
12443
- decimals: 18,
12183
+ symbol: "DAI",
12184
+ assetId: "0x6b175474e89094c44da98b954eedeac495271d0f",
12185
+ existentialDeposit: "1",
12444
12186
  multiLocation: {
12445
- parents: 1,
12187
+ parents: 2,
12446
12188
  interior: {
12447
12189
  X2: [
12448
12190
  {
12449
- Parachain: 2096
12191
+ GlobalConsensus: {
12192
+ Ethereum: {
12193
+ chainId: 1
12194
+ }
12195
+ }
12450
12196
  },
12451
12197
  {
12452
- GeneralKey: {
12453
- length: 9,
12454
- data: "0x0000000000000000000000000000000000000000000000000000000000000000"
12198
+ AccountKey20: {
12199
+ network: null,
12200
+ key: "0x6b175474e89094c44da98b954eedeac495271d0f"
12455
12201
  }
12456
12202
  }
12457
12203
  ]
12458
12204
  }
12459
- },
12460
- existentialDeposit: "10000000000000000"
12205
+ }
12461
12206
  },
12462
12207
  {
12463
- assetId: "14",
12464
- symbol: "BIT",
12465
- decimals: 18,
12208
+ symbol: "KILT",
12209
+ assetId: "0x5d3d01fd6d2ad1169b17918eb4f153c6616288eb",
12210
+ existentialDeposit: "1",
12466
12211
  multiLocation: {
12467
- parents: 1,
12212
+ parents: 2,
12468
12213
  interior: {
12469
12214
  X2: [
12470
12215
  {
12471
- Parachain: 2096
12216
+ GlobalConsensus: {
12217
+ Ethereum: {
12218
+ chainId: 1
12219
+ }
12220
+ }
12472
12221
  },
12473
12222
  {
12474
- GeneralKey: {
12475
- length: 9,
12476
- data: "0x0200000000000000000000000000000000000000000000000000000000000000"
12223
+ AccountKey20: {
12224
+ network: null,
12225
+ key: "0x5d3d01fd6d2ad1169b17918eb4f153c6616288eb"
12477
12226
  }
12478
12227
  }
12479
12228
  ]
12480
12229
  }
12481
- },
12482
- existentialDeposit: "10000000000000000"
12230
+ }
12483
12231
  },
12484
12232
  {
12485
- assetId: "11",
12486
- symbol: "CRAB",
12487
- decimals: 18,
12233
+ symbol: "AAVE",
12234
+ assetId: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
12235
+ existentialDeposit: "1",
12488
12236
  multiLocation: {
12489
- parents: 1,
12237
+ parents: 2,
12490
12238
  interior: {
12491
12239
  X2: [
12492
12240
  {
12493
- Parachain: 2105
12241
+ GlobalConsensus: {
12242
+ Ethereum: {
12243
+ chainId: 1
12244
+ }
12245
+ }
12494
12246
  },
12495
12247
  {
12496
- PalletInstance: 5
12248
+ AccountKey20: {
12249
+ network: null,
12250
+ key: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"
12251
+ }
12497
12252
  }
12498
12253
  ]
12499
12254
  }
12500
- },
12501
- existentialDeposit: "10000000000000000"
12502
- },
12503
- {
12504
- assetId: "10",
12505
- symbol: "TUR",
12506
- decimals: 10,
12507
- multiLocation: {
12508
- parents: 1,
12509
- interior: {
12510
- X1: {
12511
- Parachain: 2114
12512
- }
12513
- }
12514
- },
12515
- existentialDeposit: "100000000"
12255
+ }
12516
12256
  }
12517
12257
  ]
12518
12258
  };
@@ -12606,7 +12346,7 @@ var assetsMapJson = {
12606
12346
  Darwinia: Darwinia$3,
12607
12347
  Hydration: Hydration$3,
12608
12348
  Interlay: Interlay$3,
12609
- Litentry: Litentry$3,
12349
+ Heima: Heima$3,
12610
12350
  Moonbeam: Moonbeam$3,
12611
12351
  Parallel: Parallel$3,
12612
12352
  AssetHubPolkadot: AssetHubPolkadot$3,
@@ -12649,7 +12389,6 @@ var assetsMapJson = {
12649
12389
  Collectives: Collectives$3,
12650
12390
  Phala: Phala$3,
12651
12391
  Ethereum: Ethereum,
12652
- Khala: Khala$3,
12653
12392
  Mythos: Mythos$3,
12654
12393
  Peaq: Peaq$3
12655
12394
  };
@@ -12755,7 +12494,7 @@ var DOT_MULTILOCATION = {
12755
12494
  /**
12756
12495
  * Supported nodes excluding relay chains and Ethereum.
12757
12496
  */
12758
- 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'];
12497
+ var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', 'Heima', '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', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq', 'Polimec'];
12759
12498
  /**
12760
12499
  * Supported nodes including Ethereum.
12761
12500
  */
@@ -12774,7 +12513,7 @@ var NODES_WITH_RELAY_CHAINS_DOT_KSM = [].concat(NODE_NAMES_DOT_KSM, ['Polkadot',
12774
12513
  var SUPPORTED_PALLETS = ['XTokens', 'OrmlXTokens', 'PolkadotXcm', 'RelayerXcm', 'XTransfer', 'XcmPallet'];
12775
12514
 
12776
12515
  var isForeignAsset = function isForeignAsset(asset) {
12777
- return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'multiLocation' in asset || 'xcmInterior' in asset) && !('isNative' in asset);
12516
+ return _typeof(asset) === 'object' && asset !== null && ('assetId' in asset || 'multiLocation' in asset) && !('isNative' in asset);
12778
12517
  };
12779
12518
 
12780
12519
  var isSymbolSpecifier = function isSymbolSpecifier(currencySymbolValue) {
@@ -12870,7 +12609,7 @@ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
12870
12609
  function NodeNotSupportedError(message) {
12871
12610
  var _this;
12872
12611
  _classCallCheck(this, NodeNotSupportedError);
12873
- _this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== undefined ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
12612
+ _this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
12874
12613
  _this.name = 'NodeNotSupported';
12875
12614
  return _this;
12876
12615
  }
@@ -12892,7 +12631,7 @@ var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
12892
12631
  function ScenarioNotSupportedError(node, scenario, message) {
12893
12632
  var _this;
12894
12633
  _classCallCheck(this, ScenarioNotSupportedError);
12895
- _this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== undefined ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
12634
+ _this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
12896
12635
  _this.name = 'ScenarioNotSupported';
12897
12636
  return _this;
12898
12637
  }
@@ -12912,7 +12651,7 @@ var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
12912
12651
  function IncompatibleNodesError(message) {
12913
12652
  var _this;
12914
12653
  _classCallCheck(this, IncompatibleNodesError);
12915
- _this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== undefined ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
12654
+ _this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== void 0 ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
12916
12655
  _this.name = 'IncompatibleNodes';
12917
12656
  return _this;
12918
12657
  }
@@ -12985,6 +12724,10 @@ var AssetHubPolkadot$2 = {
12985
12724
  info: "PolkadotAssetHub",
12986
12725
  paraId: 1000,
12987
12726
  providers: [
12727
+ {
12728
+ name: "Blockops",
12729
+ endpoint: "wss://polkadot-assethub-rpc.blockops.network/ws"
12730
+ },
12988
12731
  {
12989
12732
  name: "Dwellir",
12990
12733
  endpoint: "wss://asset-hub-polkadot-rpc.dwellir.com"
@@ -13312,8 +13055,8 @@ var Interlay$2 = {
13312
13055
  }
13313
13056
  ]
13314
13057
  };
13315
- var Litentry$2 = {
13316
- name: "Litentry",
13058
+ var Heima$2 = {
13059
+ name: "Heima",
13317
13060
  info: "litentry",
13318
13061
  paraId: 2013,
13319
13062
  providers: [
@@ -13378,10 +13121,6 @@ var Parallel$2 = {
13378
13121
  {
13379
13122
  name: "Gatotech",
13380
13123
  endpoint: "wss://parallel.gatotech.network"
13381
- },
13382
- {
13383
- name: "Parallel",
13384
- endpoint: "wss://polkadot-parallel-rpc.parallel.fi"
13385
13124
  }
13386
13125
  ]
13387
13126
  };
@@ -13535,10 +13274,6 @@ var Bajun$2 = {
13535
13274
  {
13536
13275
  name: "AjunaNetwork",
13537
13276
  endpoint: "wss://rpc-para.bajun.network"
13538
- },
13539
- {
13540
- name: "OnFinality",
13541
- endpoint: "wss://bajun.api.onfinality.io/public-ws"
13542
13277
  }
13543
13278
  ]
13544
13279
  };
@@ -13623,10 +13358,6 @@ var Crab$2 = {
13623
13358
  name: "Darwinia",
13624
13359
  endpoint: "wss://crab-rpc.darwinia.network/"
13625
13360
  },
13626
- {
13627
- name: "Dcdao",
13628
- endpoint: "wss://crab-rpc.dcdao.box"
13629
- },
13630
13361
  {
13631
13362
  name: "Dwellir",
13632
13363
  endpoint: "wss://darwiniacrab-rpc.dwellir.com"
@@ -14029,10 +13760,6 @@ var Zeitgeist$2 = {
14029
13760
  {
14030
13761
  name: "OnFinality",
14031
13762
  endpoint: "wss://zeitgeist.api.onfinality.io/public-ws"
14032
- },
14033
- {
14034
- name: "ZeitgeistPM",
14035
- endpoint: "wss://main.rpc.zeitgeist.pm/ws"
14036
13763
  }
14037
13764
  ]
14038
13765
  };
@@ -14079,33 +13806,6 @@ var Collectives$2 = {
14079
13806
  }
14080
13807
  ]
14081
13808
  };
14082
- var Khala$2 = {
14083
- name: "Khala Network",
14084
- info: "khala",
14085
- paraId: 2004,
14086
- providers: [
14087
- {
14088
- name: "Dwellir",
14089
- endpoint: "wss://khala-rpc.dwellir.com"
14090
- },
14091
- {
14092
- name: "Helikon",
14093
- endpoint: "wss://rpc.helikon.io/khala"
14094
- },
14095
- {
14096
- name: "OnFinality",
14097
- endpoint: "wss://khala.api.onfinality.io/public-ws"
14098
- },
14099
- {
14100
- name: "Phala",
14101
- endpoint: "wss://khala-api.phala.network/ws"
14102
- },
14103
- {
14104
- name: "RadiumBlock",
14105
- endpoint: "wss://khala.public.curie.radiumblock.co/ws"
14106
- }
14107
- ]
14108
- };
14109
13809
  var Phala$2 = {
14110
13810
  name: "Phala Network",
14111
13811
  info: "phala",
@@ -14123,10 +13823,6 @@ var Phala$2 = {
14123
13823
  name: "OnFinality",
14124
13824
  endpoint: "wss://phala.api.onfinality.io/public-ws"
14125
13825
  },
14126
- {
14127
- name: "Phala",
14128
- endpoint: "wss://api.phala.network/ws"
14129
- },
14130
13826
  {
14131
13827
  name: "RadiumBlock",
14132
13828
  endpoint: "wss://phala.public.curie.radiumblock.co/ws"
@@ -14153,10 +13849,6 @@ var KiltSpiritnet$2 = {
14153
13849
  info: "kilt",
14154
13850
  paraId: 2086,
14155
13851
  providers: [
14156
- {
14157
- name: "BOTLabs",
14158
- endpoint: "wss://spiritnet.kilt.io/"
14159
- },
14160
13852
  {
14161
13853
  name: "Dwellir",
14162
13854
  endpoint: "wss://kilt-rpc.dwellir.com"
@@ -14168,6 +13860,10 @@ var KiltSpiritnet$2 = {
14168
13860
  {
14169
13861
  name: "IBP2",
14170
13862
  endpoint: "wss://kilt.dotters.network"
13863
+ },
13864
+ {
13865
+ name: "KILT Foundation",
13866
+ endpoint: "wss://spiritnet.kilt.io/"
14171
13867
  }
14172
13868
  ]
14173
13869
  };
@@ -14191,6 +13887,14 @@ var Mythos$2 = {
14191
13887
  name: "Helikon",
14192
13888
  endpoint: "wss://rpc.helikon.io/mythos"
14193
13889
  },
13890
+ {
13891
+ name: "IBP1",
13892
+ endpoint: "wss://mythos.ibp.network"
13893
+ },
13894
+ {
13895
+ name: "IBP2",
13896
+ endpoint: "wss://mythos.dotters.network"
13897
+ },
14194
13898
  {
14195
13899
  name: "parity",
14196
13900
  endpoint: "wss://polkadot-mythos-rpc.polkadot.io"
@@ -14256,6 +13960,10 @@ var Polkadot$1 = {
14256
13960
  name: "Dwellir Tunisia",
14257
13961
  endpoint: "wss://polkadot-rpc-tn.dwellir.com"
14258
13962
  },
13963
+ {
13964
+ name: "Helixstreet",
13965
+ endpoint: "wss://rpc-polkadot.helixstreet.io"
13966
+ },
14259
13967
  {
14260
13968
  name: "IBP1",
14261
13969
  endpoint: "wss://rpc.ibp.network/polkadot"
@@ -14272,6 +13980,10 @@ var Polkadot$1 = {
14272
13980
  name: "OnFinality",
14273
13981
  endpoint: "wss://polkadot.api.onfinality.io/public-ws"
14274
13982
  },
13983
+ {
13984
+ name: "Permanence DAO EU",
13985
+ endpoint: "wss://polkadot.rpc.permanence.io"
13986
+ },
14275
13987
  {
14276
13988
  name: "RadiumBlock",
14277
13989
  endpoint: "wss://polkadot.public.curie.radiumblock.co/ws"
@@ -14307,6 +14019,10 @@ var Kusama$1 = {
14307
14019
  name: "Dwellir Tunisia",
14308
14020
  endpoint: "wss://kusama-rpc-tn.dwellir.com"
14309
14021
  },
14022
+ {
14023
+ name: "Helixstreet",
14024
+ endpoint: "wss://rpc-kusama.helixstreet.io"
14025
+ },
14310
14026
  {
14311
14027
  name: "IBP1",
14312
14028
  endpoint: "wss://rpc.ibp.network/kusama"
@@ -14350,7 +14066,7 @@ var configs = {
14350
14066
  Darwinia: Darwinia$2,
14351
14067
  Hydration: Hydration$2,
14352
14068
  Interlay: Interlay$2,
14353
- Litentry: Litentry$2,
14069
+ Heima: Heima$2,
14354
14070
  Moonbeam: Moonbeam$2,
14355
14071
  Parallel: Parallel$2,
14356
14072
  AssetHubKusama: AssetHubKusama$2,
@@ -14387,7 +14103,6 @@ var configs = {
14387
14103
  Pendulum: Pendulum$2,
14388
14104
  Zeitgeist: Zeitgeist$2,
14389
14105
  Collectives: Collectives$2,
14390
- Khala: Khala$2,
14391
14106
  Phala: Phala$2,
14392
14107
  Subsocial: Subsocial$2,
14393
14108
  KiltSpiritnet: KiltSpiritnet$2,
@@ -14492,27 +14207,36 @@ var createMultiAsset = function createMultiAsset(version, amount, multiLocation)
14492
14207
  }
14493
14208
  };
14494
14209
  };
14495
- var createCurrencySpec = function createCurrencySpec(amount, version, parents, overriddenCurrency) {
14210
+ var addXcmVersionHeader = function addXcmVersionHeader(obj, version) {
14211
+ return _defineProperty({}, version, obj);
14212
+ };
14213
+ var getCurrency = function getCurrency(amount, version, parents, overriddenCurrency) {
14496
14214
  var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
14497
14215
  if (!overriddenCurrency) {
14498
- return _defineProperty({}, version, [createMultiAsset(version, amount, {
14216
+ return [createMultiAsset(version, amount, {
14499
14217
  parents: parents,
14500
14218
  interior: interior
14501
- })]);
14219
+ })];
14502
14220
  }
14503
- return isTMultiLocation(overriddenCurrency) ? _defineProperty({}, version, [createMultiAsset(version, amount, overriddenCurrency)]) : // It must be TMultiAsset if not TMultiLocation
14504
- _defineProperty({}, version, overriddenCurrency);
14221
+ return isTMultiLocation(overriddenCurrency) ? [createMultiAsset(version, amount, overriddenCurrency)] :
14222
+ // It must be TMultiAsset if not TMultiLocation
14223
+ overriddenCurrency;
14224
+ };
14225
+ var createCurrencySpec = function createCurrencySpec(amount, version, parents, overriddenCurrency) {
14226
+ var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
14227
+ var currency = getCurrency(amount, version, parents, overriddenCurrency, interior);
14228
+ return addXcmVersionHeader(currency, version);
14505
14229
  };
14506
14230
  var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
14507
- var parentsResolved = parents !== null && parents !== undefined ? parents : scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
14508
- var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== undefined ? junction : {
14231
+ var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
14232
+ var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
14509
14233
  Parachain: nodeId
14510
14234
  });
14511
- var isMultiLocationDestination = _typeof(destination) === 'object';
14512
- return _defineProperty({}, version, isMultiLocationDestination ? destination : {
14235
+ var isMultiLocationDestination = isTMultiLocation(destination);
14236
+ return addXcmVersionHeader(isMultiLocationDestination ? destination : {
14513
14237
  parents: parentsResolved,
14514
14238
  interior: interior
14515
- });
14239
+ }, version);
14516
14240
  };
14517
14241
  var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version, ecosystem, destination, nodeId) {
14518
14242
  var multiLocation = {
@@ -14525,8 +14249,8 @@ var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version,
14525
14249
  }]
14526
14250
  }
14527
14251
  };
14528
- var isMultiLocationDestination = _typeof(destination) === 'object';
14529
- return _defineProperty({}, version, isMultiLocationDestination ? destination : multiLocation);
14252
+ var isMultiLocationDestination = isTMultiLocation(destination);
14253
+ return addXcmVersionHeader(isMultiLocationDestination ? destination : multiLocation, version);
14530
14254
  };
14531
14255
  var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(relayChain, multiLocation) {
14532
14256
  var _NODE_NAMES_DOT_KSM$f;
@@ -14536,17 +14260,17 @@ var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(relay
14536
14260
  }
14537
14261
  var node = (_NODE_NAMES_DOT_KSM$f = NODE_NAMES_DOT_KSM.find(function (nodeName) {
14538
14262
  return getParaId(nodeName) === parachainId && determineRelayChain(nodeName) === relayChain;
14539
- })) !== null && _NODE_NAMES_DOT_KSM$f !== undefined ? _NODE_NAMES_DOT_KSM$f : null;
14263
+ })) !== null && _NODE_NAMES_DOT_KSM$f !== void 0 ? _NODE_NAMES_DOT_KSM$f : null;
14540
14264
  if (node === null) {
14541
14265
  throw new Error('Node with specified paraId not found in destination multi location.');
14542
14266
  }
14543
14267
  return node;
14544
14268
  };
14545
14269
  var throwUnsupportedCurrency = function throwUnsupportedCurrency(currency, node) {
14546
- var _ref8 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
14270
+ var _ref4 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
14547
14271
  isDestination: false
14548
14272
  },
14549
- isDestination = _ref8.isDestination;
14273
+ isDestination = _ref4.isDestination;
14550
14274
  if ('multilocation' in currency) {
14551
14275
  throw new InvalidCurrencyError("\n Selected chain doesn't support multilocation you provided. Maybe you meant custom multilocation. If so, you need to use override option. Your selection should look like this: {multilocation: Override(".concat(JSON.stringify(currency.multilocation), ")}."));
14552
14276
  }
@@ -14569,18 +14293,13 @@ var buildMultiLocation = function buildMultiLocation(_ref) {
14569
14293
  // If it is a native asset, search by symbol on AssetHub and use the multiLocation from there
14570
14294
  var assetHubAsset = getOtherAssets(destination).find(function (ahAsset) {
14571
14295
  var _ahAsset$symbol, _asset$symbol;
14572
- return ((_ahAsset$symbol = ahAsset.symbol) === null || _ahAsset$symbol === undefined ? undefined : _ahAsset$symbol.toLowerCase()) === ((_asset$symbol = asset.symbol) === null || _asset$symbol === undefined ? undefined : _asset$symbol.toLowerCase());
14296
+ return ((_ahAsset$symbol = ahAsset.symbol) === null || _ahAsset$symbol === void 0 ? void 0 : _ahAsset$symbol.toLowerCase()) === ((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase());
14573
14297
  });
14574
14298
  if (assetHubAsset === undefined) {
14575
14299
  throw new InvalidCurrencyError("Asset ".concat(asset.symbol, " not found in AssetHub"));
14576
14300
  }
14577
14301
  if (assetHubAsset.multiLocation) {
14578
14302
  return assetHubAsset.multiLocation;
14579
- } else if (assetHubAsset.xcmInterior) {
14580
- return {
14581
- parents: Parents.ONE,
14582
- interior: _defineProperty({}, "X".concat(assetHubAsset.xcmInterior.length), assetHubAsset.xcmInterior)
14583
- };
14584
14303
  }
14585
14304
  throw new InvalidCurrencyError("Asset ".concat(asset.symbol, " has no multiLocation"));
14586
14305
  }
@@ -14604,20 +14323,15 @@ var buildMultiLocation = function buildMultiLocation(_ref) {
14604
14323
  }
14605
14324
  if (asset.multiLocation) {
14606
14325
  return asset.multiLocation;
14607
- } else if (asset.xcmInterior) {
14608
- return {
14609
- parents: Parents.ONE,
14610
- interior: _defineProperty({}, "X".concat(asset.xcmInterior.length), asset.xcmInterior)
14611
- };
14612
14326
  } else {
14613
14327
  return createDefaultMultiLocation(asset.assetId);
14614
14328
  }
14615
14329
  };
14616
14330
  var getModifiedCurrencySelection = function getModifiedCurrencySelection(version, input) {
14617
- var asset = input.asset;
14331
+ var amount = input.asset.amount;
14618
14332
  var multiLocation = buildMultiLocation(input);
14619
- var multiAsset = createMultiAsset(version, asset.amount, multiLocation);
14620
- return _defineProperty({}, version, multiAsset);
14333
+ var multiAsset = createMultiAsset(version, amount, multiLocation);
14334
+ return addXcmVersionHeader(multiAsset, version);
14621
14335
  };
14622
14336
 
14623
14337
  var getCurrencySelection = function getCurrencySelection(input, isAssetHub, currencySelection) {
@@ -14625,7 +14339,7 @@ var getCurrencySelection = function getCurrencySelection(input, isAssetHub, curr
14625
14339
  overriddenAsset = input.overriddenAsset;
14626
14340
  var _getNode = getNode(origin),
14627
14341
  version = _getNode.version;
14628
- if (overriddenAsset !== undefined) return _defineProperty({}, version, overriddenAsset);
14342
+ if (overriddenAsset !== undefined) return addXcmVersionHeader(overriddenAsset, version);
14629
14343
  if (isAssetHub) {
14630
14344
  return getModifiedCurrencySelection(version, input);
14631
14345
  }
@@ -14677,14 +14391,15 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
14677
14391
  var isBifrostOrigin = origin === 'BifrostPolkadot' || origin === 'BifrostKusama';
14678
14392
  var isAssetHubDest = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
14679
14393
  var isAstarOrShidenToRelay = scenario === 'ParaToRelay' && (origin === 'Astar' || origin === 'Shiden');
14394
+ var isTuring = origin === 'Turing';
14680
14395
  var isMultiAsset = overriddenAsset && !isTMultiLocation(overriddenAsset);
14681
- var shouldUseMultiasset = isAstarOrShidenToRelay || isAssetHubDest && !isBifrostOrigin || !!isMultiAsset;
14396
+ var shouldUseMultiasset = isTuring || isAstarOrShidenToRelay || isAssetHubDest && !isBifrostOrigin || !!isMultiAsset;
14682
14397
  var modifiedCurrencySelection = getCurrencySelection(input, shouldUseMultiasset, currencySelection);
14683
14398
  var section = shouldUseMultiasset ? isMultiAsset ? 'transfer_multiassets' : 'transfer_multiasset' : 'transfer';
14684
14399
  var parameters = getXTokensParameters(shouldUseMultiasset, modifiedCurrencySelection, addressSelection, asset.amount, fees, overriddenAsset);
14685
14400
  var call = {
14686
- module: pallet !== null && pallet !== undefined ? pallet : 'XTokens',
14687
- section: method !== null && method !== undefined ? method : section,
14401
+ module: pallet !== null && pallet !== void 0 ? pallet : 'XTokens',
14402
+ section: method !== null && method !== void 0 ? method : section,
14688
14403
  parameters: parameters
14689
14404
  };
14690
14405
  return api.callTxMethod(call);
@@ -14696,17 +14411,17 @@ var resolveParaId = function resolveParaId(paraId, destination) {
14696
14411
  if (isTMultiLocation(destination) || isRelayChain(destination) || destination === 'Ethereum') {
14697
14412
  return undefined;
14698
14413
  }
14699
- return paraId !== null && paraId !== undefined ? paraId : getParaId(destination);
14414
+ return paraId !== null && paraId !== void 0 ? paraId : getParaId(destination);
14700
14415
  };
14701
14416
 
14702
14417
  var generateAddressPayload = function generateAddressPayload(api, scenario, pallet, recipientAddress, version, nodeId) {
14703
14418
  var isMultiLocation = _typeof(recipientAddress) === 'object';
14704
14419
  if (isMultiLocation) {
14705
- return _defineProperty({}, version, recipientAddress);
14420
+ return addXcmVersionHeader(recipientAddress, version);
14706
14421
  }
14707
14422
  var isEthAddress = ethers.isAddress(recipientAddress);
14708
14423
  if (scenario === 'ParaToRelay') {
14709
- return _defineProperty({}, version, {
14424
+ return addXcmVersionHeader({
14710
14425
  parents: pallet === 'XTokens' ? Parents.ONE : Parents.ZERO,
14711
14426
  interior: createX1Payload(version, {
14712
14427
  AccountId32: _objectSpread2(_objectSpread2({}, version === Version.V1 && {
@@ -14715,10 +14430,10 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
14715
14430
  id: api.accountToHex(recipientAddress)
14716
14431
  })
14717
14432
  })
14718
- });
14433
+ }, version);
14719
14434
  }
14720
14435
  if (scenario === 'ParaToPara' && pallet === 'XTokens') {
14721
- return _defineProperty({}, version, {
14436
+ return addXcmVersionHeader({
14722
14437
  parents: Parents.ONE,
14723
14438
  interior: {
14724
14439
  X2: [{
@@ -14737,10 +14452,10 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
14737
14452
  })
14738
14453
  }]
14739
14454
  }
14740
- });
14455
+ }, version);
14741
14456
  }
14742
14457
  if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
14743
- return _defineProperty({}, version, {
14458
+ return addXcmVersionHeader({
14744
14459
  parents: Parents.ZERO,
14745
14460
  interior: createX1Payload(version, isEthAddress ? {
14746
14461
  AccountKey20: _objectSpread2(_objectSpread2({}, (version === Version.V1 || version === Version.V2) && {
@@ -14755,9 +14470,9 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
14755
14470
  id: api.accountToHex(recipientAddress)
14756
14471
  })
14757
14472
  })
14758
- });
14473
+ }, version);
14759
14474
  }
14760
- return _defineProperty({}, version, {
14475
+ return addXcmVersionHeader({
14761
14476
  parents: Parents.ZERO,
14762
14477
  interior: createX1Payload(version, isEthAddress ? {
14763
14478
  AccountKey20: {
@@ -14768,21 +14483,24 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
14768
14483
  id: api.accountToHex(recipientAddress)
14769
14484
  }
14770
14485
  })
14771
- });
14486
+ }, version);
14772
14487
  };
14773
14488
 
14774
- var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, version) {
14489
+ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, version, messageId) {
14775
14490
  var api = _ref.api,
14776
14491
  address = _ref.address,
14777
14492
  asset = _ref.asset,
14778
14493
  scenario = _ref.scenario,
14779
- ahAddress = _ref.ahAddress;
14494
+ senderAddress = _ref.senderAddress;
14780
14495
  if (!isForeignAsset(asset)) {
14781
14496
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " is not a foreign asset"));
14782
14497
  }
14783
14498
  if (!asset.multiLocation) {
14784
14499
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multiLocation"));
14785
14500
  }
14501
+ if (!senderAddress) {
14502
+ throw new InvalidCurrencyError("Please provide senderAddress");
14503
+ }
14786
14504
  var ethAsset = findAssetByMultiLocation(getOtherAssets('Ethereum'), asset.multiLocation);
14787
14505
  if (!ethAsset) {
14788
14506
  throw new InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset)));
@@ -14793,7 +14511,7 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, version) {
14793
14511
  assets: {
14794
14512
  Wild: 'All'
14795
14513
  },
14796
- beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', ahAddress !== null && ahAddress !== undefined ? ahAddress : '', version, undefined))[0]
14514
+ beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', senderAddress, version, undefined))[0]
14797
14515
  }
14798
14516
  }]
14799
14517
  }, {
@@ -14851,11 +14569,39 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, version) {
14851
14569
  }
14852
14570
  }
14853
14571
  }
14572
+ }, {
14573
+ SetTopic: messageId
14854
14574
  }]
14855
14575
  }
14576
+ }, {
14577
+ SetTopic: messageId
14856
14578
  }]);
14857
14579
  };
14858
14580
 
14581
+ var generateMessageId = /*#__PURE__*/function () {
14582
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, senderAddress, sourceParaId, tokenAddress, recipientAddress, amount) {
14583
+ var accountNextId, sourceAccountHex, entropy;
14584
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
14585
+ while (1) switch (_context.prev = _context.next) {
14586
+ case 0:
14587
+ _context.next = 2;
14588
+ return api.getFromRpc('system', 'accountNextIndex', senderAddress);
14589
+ case 2:
14590
+ accountNextId = _context.sent;
14591
+ sourceAccountHex = api.accountToHex(senderAddress);
14592
+ entropy = new Uint8Array([].concat(_toConsumableArray(api.stringToUint8a(sourceParaId.toString())), _toConsumableArray(api.hexToUint8a(sourceAccountHex)), _toConsumableArray(api.stringToUint8a(accountNextId)), _toConsumableArray(api.hexToUint8a(tokenAddress)), _toConsumableArray(api.stringToUint8a(recipientAddress)), _toConsumableArray(api.stringToUint8a(amount.toString()))));
14593
+ return _context.abrupt("return", api.blake2AsHex(entropy));
14594
+ case 6:
14595
+ case "end":
14596
+ return _context.stop();
14597
+ }
14598
+ }, _callee);
14599
+ }));
14600
+ return function generateMessageId(_x, _x2, _x3, _x4, _x5, _x6) {
14601
+ return _ref.apply(this, arguments);
14602
+ };
14603
+ }();
14604
+
14859
14605
  var supportsXTokens = function supportsXTokens(obj) {
14860
14606
  return _typeof(obj) === 'object' && obj !== null && 'transferXTokens' in obj;
14861
14607
  };
@@ -14908,11 +14654,11 @@ var ParachainNode = /*#__PURE__*/function () {
14908
14654
  key: "transfer",
14909
14655
  value: function () {
14910
14656
  var _transfer = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
14911
- var api, asset, address, destination, paraIdTo, overriddenAsset, version, ahAddress, pallet, method, isRelayDestination, scenario, paraId, versionOrDefault, isBifrostOrigin, isAssetHubDest, shouldUseMultiasset, input;
14657
+ var api, asset, address, destination, paraIdTo, overriddenAsset, version, senderAddress, pallet, method, isRelayDestination, scenario, paraId, versionOrDefault, isBifrostOrigin, isAssetHubDest, shouldUseMultiasset, input;
14912
14658
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14913
14659
  while (1) switch (_context.prev = _context.next) {
14914
14660
  case 0:
14915
- api = options.api, asset = options.asset, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, overriddenAsset = options.overriddenAsset, version = options.version, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method;
14661
+ api = options.api, asset = options.asset, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, overriddenAsset = options.overriddenAsset, version = options.version, senderAddress = options.senderAddress, pallet = options.pallet, method = options.method;
14916
14662
  isRelayDestination = !isTMultiLocation(destination) && isRelayChain(destination);
14917
14663
  scenario = isRelayDestination ? 'ParaToRelay' : 'ParaToPara';
14918
14664
  paraId = resolveParaId(paraIdTo, destination);
@@ -14922,7 +14668,7 @@ var ParachainNode = /*#__PURE__*/function () {
14922
14668
  }
14923
14669
  throw new Error('Sending assets to Polimec is supported only from AssetHubPolkadot');
14924
14670
  case 6:
14925
- versionOrDefault = version !== null && version !== undefined ? version : this.version;
14671
+ versionOrDefault = version !== null && version !== void 0 ? version : this.version;
14926
14672
  if (!(supportsXTokens(this) && this.canUseXTokens(options))) {
14927
14673
  _context.next = 17;
14928
14674
  break;
@@ -14983,7 +14729,7 @@ var ParachainNode = /*#__PURE__*/function () {
14983
14729
  paraIdTo: paraId,
14984
14730
  overriddenAsset: overriddenAsset,
14985
14731
  version: version,
14986
- ahAddress: ahAddress,
14732
+ senderAddress: senderAddress,
14987
14733
  pallet: pallet,
14988
14734
  method: method
14989
14735
  }));
@@ -15012,15 +14758,15 @@ var ParachainNode = /*#__PURE__*/function () {
15012
14758
  key: "transferRelayToPara",
15013
14759
  value: function transferRelayToPara(options) {
15014
14760
  var _options$version = options.version,
15015
- version = _options$version === undefined ? Version.V3 : _options$version,
14761
+ version = _options$version === void 0 ? Version.V3 : _options$version,
15016
14762
  pallet = options.pallet,
15017
14763
  method = options.method;
15018
14764
  var _this$getRelayToParaO = this.getRelayToParaOverrides(),
15019
14765
  section = _this$getRelayToParaO.section,
15020
14766
  includeFee = _this$getRelayToParaO.includeFee;
15021
14767
  return {
15022
- module: pallet !== null && pallet !== undefined ? pallet : 'XcmPallet',
15023
- section: method !== null && method !== undefined ? method : section,
14768
+ module: pallet !== null && pallet !== void 0 ? pallet : 'XcmPallet',
14769
+ section: method !== null && method !== void 0 ? method : section,
15024
14770
  parameters: constructRelayToParaParameters(options, version, {
15025
14771
  includeFee: includeFee
15026
14772
  })
@@ -15045,55 +14791,72 @@ var ParachainNode = /*#__PURE__*/function () {
15045
14791
  key: "transferToEthereum",
15046
14792
  value: function () {
15047
14793
  var _transferToEthereum = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(input) {
15048
- var api, asset, scenario, version, destination, ahAddress, versionOrDefault, ethMultiAsset, ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, executionFee, fee, call;
14794
+ var api, asset, scenario, version, destination, address, senderAddress, versionOrDefault, ethMultiAsset, ahApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, executionFee, fee, ethAsset, messageId, call;
15049
14795
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
15050
14796
  while (1) switch (_context2.prev = _context2.next) {
15051
14797
  case 0:
15052
- api = input.api, asset = input.asset, scenario = input.scenario, version = input.version, destination = input.destination, ahAddress = input.ahAddress;
14798
+ api = input.api, asset = input.asset, scenario = input.scenario, version = input.version, destination = input.destination, address = input.address, senderAddress = input.senderAddress;
15053
14799
  if (isForeignAsset(asset)) {
15054
14800
  _context2.next = 3;
15055
14801
  break;
15056
14802
  }
15057
14803
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
15058
14804
  case 3:
15059
- if (!(ahAddress === undefined)) {
14805
+ if (!(senderAddress === undefined)) {
15060
14806
  _context2.next = 5;
15061
14807
  break;
15062
14808
  }
15063
- throw new Error('AssetHub address is required for Ethereum transfers');
14809
+ throw new Error('Sender address is required for transfers to Ethereum');
15064
14810
  case 5:
15065
- versionOrDefault = version !== null && version !== undefined ? version : Version.V4;
15066
- ethMultiAsset = Object.values(createCurrencySpec(asset.amount, versionOrDefault, Parents.TWO, asset.multiLocation))[0][0];
15067
- _context2.next = 9;
14811
+ if (!isTMultiLocation(address)) {
14812
+ _context2.next = 7;
14813
+ break;
14814
+ }
14815
+ throw new Error('Multi-location address is not supported for Ethereum transfers');
14816
+ case 7:
14817
+ versionOrDefault = version !== null && version !== void 0 ? version : Version.V4;
14818
+ ethMultiAsset = createMultiAsset(versionOrDefault, asset.amount, asset.multiLocation);
14819
+ _context2.next = 11;
15068
14820
  return api.createApiForNode('AssetHubPolkadot');
15069
- case 9:
14821
+ case 11:
15070
14822
  ahApi = _context2.sent;
15071
- _context2.next = 12;
14823
+ _context2.next = 14;
15072
14824
  return getParaEthTransferFees(ahApi);
15073
- case 12:
14825
+ case 14:
15074
14826
  _yield$getParaEthTran = _context2.sent;
15075
14827
  _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
15076
14828
  bridgeFee = _yield$getParaEthTran2[0];
15077
14829
  executionFee = _yield$getParaEthTran2[1];
15078
14830
  fee = (bridgeFee + executionFee).toString();
14831
+ ethAsset = findAssetByMultiLocation(getOtherAssets('Ethereum'), asset.multiLocation);
14832
+ if (!(!ethAsset || !ethAsset.assetId)) {
14833
+ _context2.next = 22;
14834
+ break;
14835
+ }
14836
+ throw new InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(asset)));
14837
+ case 22:
14838
+ _context2.next = 24;
14839
+ return generateMessageId(api, senderAddress, getParaId(this.node), ethAsset.assetId, address, asset.amount);
14840
+ case 24:
14841
+ messageId = _context2.sent;
15079
14842
  call = {
15080
14843
  module: 'PolkadotXcm',
15081
14844
  section: 'transfer_assets_using_type_and_then',
15082
14845
  parameters: {
15083
14846
  dest: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('AssetHubPolkadot')),
15084
- assets: _defineProperty({}, versionOrDefault, [Object.values(this.createCurrencySpec(fee, 'ParaToRelay', versionOrDefault))[0][0], ethMultiAsset]),
14847
+ assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, fee, DOT_MULTILOCATION), ethMultiAsset]),
15085
14848
  assets_transfer_type: 'DestinationReserve',
15086
14849
  remote_fees_id: _defineProperty({}, versionOrDefault, {
15087
14850
  parents: Parents.ONE,
15088
14851
  interior: 'Here'
15089
14852
  }),
15090
14853
  fees_transfer_type: 'DestinationReserve',
15091
- custom_xcm_on_dest: createCustomXcmOnDest(input, versionOrDefault),
14854
+ custom_xcm_on_dest: createCustomXcmOnDest(input, versionOrDefault, messageId),
15092
14855
  weight_limit: 'Unlimited'
15093
14856
  }
15094
14857
  };
15095
14858
  return _context2.abrupt("return", api.callTxMethod(call));
15096
- case 19:
14859
+ case 27:
15097
14860
  case "end":
15098
14861
  return _context2.stop();
15099
14862
  }
@@ -15197,8 +14960,8 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
15197
14960
  return asset.isFeeAsset;
15198
14961
  });
15199
14962
  var call = {
15200
- module: pallet !== null && pallet !== undefined ? pallet : 'PolkadotXcm',
15201
- section: method !== null && method !== undefined ? method : section,
14963
+ module: pallet !== null && pallet !== void 0 ? pallet : 'PolkadotXcm',
14964
+ section: method !== null && method !== void 0 ? method : section,
15202
14965
  parameters: _objectSpread2({
15203
14966
  dest: header,
15204
14967
  beneficiary: addressSelection,
@@ -15267,7 +15030,7 @@ var BifrostPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
15267
15030
  currencySelection: createCurrencySpec(asset.amount, this.version, asset.symbol === 'DOT' ? Parents.ONE : Parents.TWO, overriddenAsset, asset.symbol === 'WETH' ? {
15268
15031
  X2: [ETHEREUM_JUNCTION, {
15269
15032
  AccountKey20: {
15270
- key: (_getAssetId = getAssetId('Ethereum', 'WETH')) !== null && _getAssetId !== undefined ? _getAssetId : ''
15033
+ key: (_getAssetId = getAssetId('Ethereum', 'WETH')) !== null && _getAssetId !== void 0 ? _getAssetId : ''
15271
15034
  }
15272
15035
  }]
15273
15036
  } : undefined)
@@ -15376,13 +15139,13 @@ var Hydration$1 = /*#__PURE__*/function (_ParachainNode) {
15376
15139
  scenario = input.scenario,
15377
15140
  version = input.version,
15378
15141
  destination = input.destination;
15379
- var versionOrDefault = version !== null && version !== undefined ? version : Version.V3;
15142
+ var versionOrDefault = version !== null && version !== void 0 ? version : Version.V3;
15380
15143
  var call = {
15381
15144
  module: 'PolkadotXcm',
15382
15145
  section: 'transfer_assets_using_type_and_then',
15383
15146
  parameters: {
15384
15147
  dest: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('AssetHubPolkadot')),
15385
- assets: _defineProperty({}, versionOrDefault, [Object.values(this.createCurrencySpec(asset.amount, 'ParaToRelay', versionOrDefault))[0][0]]),
15148
+ assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, asset.amount, DOT_MULTILOCATION)]),
15386
15149
  assets_transfer_type: 'DestinationReserve',
15387
15150
  remote_fees_id: _defineProperty({}, versionOrDefault, {
15388
15151
  Concrete: {
@@ -15468,13 +15231,13 @@ var Interlay$1 = /*#__PURE__*/function (_ParachainNode) {
15468
15231
  }]);
15469
15232
  }(ParachainNode);
15470
15233
 
15471
- var Litentry$1 = /*#__PURE__*/function (_ParachainNode) {
15472
- function Litentry() {
15473
- _classCallCheck(this, Litentry);
15474
- return _callSuper(this, Litentry, ['Litentry', 'litentry', 'polkadot', Version.V3]);
15234
+ var Heima$1 = /*#__PURE__*/function (_ParachainNode) {
15235
+ function Heima() {
15236
+ _classCallCheck(this, Heima);
15237
+ return _callSuper(this, Heima, ['Heima', 'litentry', 'polkadot', Version.V3]);
15475
15238
  }
15476
- _inherits(Litentry, _ParachainNode);
15477
- return _createClass(Litentry, [{
15239
+ _inherits(Heima, _ParachainNode);
15240
+ return _createClass(Heima, [{
15478
15241
  key: "transferPolkadotXCM",
15479
15242
  value: function transferPolkadotXCM(input) {
15480
15243
  var scenario = input.scenario,
@@ -15519,7 +15282,7 @@ var Moonbeam$1 = /*#__PURE__*/function (_ParachainNode) {
15519
15282
  var asset = input.asset,
15520
15283
  scenario = input.scenario,
15521
15284
  _input$version = input.version,
15522
- version = _input$version === undefined ? this.version : _input$version,
15285
+ version = _input$version === void 0 ? this.version : _input$version,
15523
15286
  overriddenAsset = input.overriddenAsset;
15524
15287
  var multiLocation = this.getJunctions(asset, scenario);
15525
15288
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
@@ -15742,7 +15505,7 @@ var Moonriver$1 = /*#__PURE__*/function (_ParachainNode) {
15742
15505
  var asset = input.asset,
15743
15506
  scenario = input.scenario,
15744
15507
  _input$version = input.version,
15745
- version = _input$version === undefined ? this.version : _input$version,
15508
+ version = _input$version === void 0 ? this.version : _input$version,
15746
15509
  overriddenAsset = input.overriddenAsset;
15747
15510
  var multiLocation = this.getJunctions(asset, scenario);
15748
15511
  return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
@@ -15884,7 +15647,7 @@ var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api
15884
15647
  return _defineProperty({}, Version.V4, address);
15885
15648
  }
15886
15649
  var isEthAddress = ethers.isAddress(address);
15887
- return _defineProperty({}, Version.V4, {
15650
+ return addXcmVersionHeader({
15888
15651
  parents: Parents.ZERO,
15889
15652
  interior: {
15890
15653
  X1: [isEthAddress ? {
@@ -15898,7 +15661,7 @@ var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api
15898
15661
  }
15899
15662
  }]
15900
15663
  }
15901
- });
15664
+ }, Version.V4);
15902
15665
  };
15903
15666
 
15904
15667
  var createCustomXcmToBifrost = function createCustomXcmToBifrost(_ref, version) {
@@ -15931,13 +15694,13 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
15931
15694
  if (!asset.multiLocation) {
15932
15695
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multiLocation"));
15933
15696
  }
15934
- var versionOrDefault = version !== null && version !== undefined ? version : _this.version;
15697
+ var versionOrDefault = version !== null && version !== void 0 ? version : _this.version;
15935
15698
  var call = {
15936
15699
  module: 'PolkadotXcm',
15937
15700
  section: 'transfer_assets_using_type_and_then',
15938
15701
  parameters: {
15939
15702
  dest: _this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('BifrostPolkadot')),
15940
- assets: _defineProperty({}, versionOrDefault, [Object.values(createCurrencySpec(asset.amount, versionOrDefault, Parents.TWO, asset.multiLocation))[0][0]]),
15703
+ assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, asset.amount, asset.multiLocation)]),
15941
15704
  assets_transfer_type: 'LocalReserve',
15942
15705
  remote_fees_id: _defineProperty({}, versionOrDefault, {
15943
15706
  Concrete: asset.multiLocation
@@ -15956,14 +15719,14 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
15956
15719
  key: "handleBridgeTransfer",
15957
15720
  value: function handleBridgeTransfer(input, targetChain) {
15958
15721
  var _input$asset$symbol, _input$asset$symbol2, _input$asset$symbol3, _input$asset$symbol4;
15959
- if (targetChain === 'Kusama' && ((_input$asset$symbol = input.asset.symbol) === null || _input$asset$symbol === undefined ? undefined : _input$asset$symbol.toUpperCase()) === 'KSM' || targetChain === 'Polkadot' && ((_input$asset$symbol2 = input.asset.symbol) === null || _input$asset$symbol2 === undefined ? undefined : _input$asset$symbol2.toUpperCase()) === 'DOT') {
15722
+ if (targetChain === 'Kusama' && ((_input$asset$symbol = input.asset.symbol) === null || _input$asset$symbol === void 0 ? void 0 : _input$asset$symbol.toUpperCase()) === 'KSM' || targetChain === 'Polkadot' && ((_input$asset$symbol2 = input.asset.symbol) === null || _input$asset$symbol2 === void 0 ? void 0 : _input$asset$symbol2.toUpperCase()) === 'DOT') {
15960
15723
  var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
15961
15724
  header: createBridgePolkadotXcmDest(Version.V4, targetChain, input.destination, input.paraIdTo),
15962
15725
  addressSelection: generateAddressMultiLocationV4(input.api, input.address),
15963
15726
  currencySelection: createBridgeCurrencySpec(input.asset.amount, targetChain)
15964
15727
  });
15965
15728
  return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited');
15966
- } else if (targetChain === 'Polkadot' && ((_input$asset$symbol3 = input.asset.symbol) === null || _input$asset$symbol3 === undefined ? undefined : _input$asset$symbol3.toUpperCase()) === 'KSM' || targetChain === 'Kusama' && ((_input$asset$symbol4 = input.asset.symbol) === null || _input$asset$symbol4 === undefined ? undefined : _input$asset$symbol4.toUpperCase()) === 'DOT') {
15729
+ } else if (targetChain === 'Polkadot' && ((_input$asset$symbol3 = input.asset.symbol) === null || _input$asset$symbol3 === void 0 ? void 0 : _input$asset$symbol3.toUpperCase()) === 'KSM' || targetChain === 'Kusama' && ((_input$asset$symbol4 = input.asset.symbol) === null || _input$asset$symbol4 === void 0 ? void 0 : _input$asset$symbol4.toUpperCase()) === 'DOT') {
15967
15730
  var _modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
15968
15731
  header: createBridgePolkadotXcmDest(Version.V3, targetChain, input.destination, input.paraIdTo),
15969
15732
  currencySelection: createCurrencySpec(input.asset.amount, Version.V3, Parents.ONE, input.overriddenAsset)
@@ -16020,7 +15783,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
16020
15783
  var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
16021
15784
  header: this.createPolkadotXcmHeader(scenario, version, destination, paraId),
16022
15785
  addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, version, paraId),
16023
- currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== null && overriddenAsset !== undefined ? overriddenAsset : customMultiLocation)
15786
+ currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== null && overriddenAsset !== void 0 ? overriddenAsset : customMultiLocation)
16024
15787
  });
16025
15788
  return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'limited_teleport_assets', 'Unlimited');
16026
15789
  }
@@ -16036,9 +15799,9 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
16036
15799
  api = input.api,
16037
15800
  version = input.version,
16038
15801
  address = input.address;
16039
- if ((((_asset$symbol = asset.symbol) === null || _asset$symbol === undefined ? undefined : _asset$symbol.toUpperCase()) === 'USDT' || ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === undefined ? undefined : _asset$symbol2.toUpperCase()) === 'USDC') && destination === 'BifrostPolkadot') {
15802
+ if ((((_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toUpperCase()) === 'USDT' || ((_asset$symbol2 = asset.symbol) === null || _asset$symbol2 === void 0 ? void 0 : _asset$symbol2.toUpperCase()) === 'USDC') && destination === 'BifrostPolkadot') {
16040
15803
  var _input$version;
16041
- var versionOrDefault = (_input$version = input.version) !== null && _input$version !== undefined ? _input$version : Version.V2;
15804
+ var versionOrDefault = (_input$version = input.version) !== null && _input$version !== void 0 ? _input$version : Version.V2;
16042
15805
  return _objectSpread2(_objectSpread2({}, input), {}, {
16043
15806
  header: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, paraIdTo),
16044
15807
  addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, versionOrDefault, paraIdTo),
@@ -16046,7 +15809,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
16046
15809
  });
16047
15810
  }
16048
15811
  if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
16049
- var _versionOrDefault = version !== null && version !== undefined ? version : this.version;
15812
+ var _versionOrDefault = version !== null && version !== void 0 ? version : this.version;
16050
15813
  return _objectSpread2(_objectSpread2({}, input), {}, {
16051
15814
  currencySelection: _superPropGet(AssetHubPolkadot, "createCurrencySpec", this, 3)([asset.amount, 'ParaToRelay', _versionOrDefault, asset, overriddenAsset])
16052
15815
  });
@@ -16365,44 +16128,10 @@ var Darwinia$1 = /*#__PURE__*/function (_ParachainNode) {
16365
16128
  }
16366
16129
  _inherits(Darwinia, _ParachainNode);
16367
16130
  return _createClass(Darwinia, [{
16368
- key: "getCurrencySelection",
16369
- value: function getCurrencySelection(asset) {
16370
- if (asset.symbol === this.getNativeAssetSymbol()) {
16371
- return 'SelfReserve';
16372
- }
16373
- if (!isForeignAsset(asset) || !asset.assetId) {
16374
- throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
16375
- }
16376
- return {
16377
- ForeignAsset: BigInt(asset.assetId)
16378
- };
16379
- }
16380
- }, {
16381
- key: "transferXTokens",
16382
- value: function transferXTokens(input) {
16383
- var asset = input.asset;
16384
- var currencySelection = this.getCurrencySelection(asset);
16385
- return XTokensTransferImpl.transferXTokens(input, currencySelection);
16386
- }
16387
- }, {
16388
16131
  key: "transferRelayToPara",
16389
16132
  value: function transferRelayToPara() {
16390
16133
  throw new NodeNotSupportedError();
16391
16134
  }
16392
- }, {
16393
- key: "createCurrencySpec",
16394
- value: function createCurrencySpec$1(amount, scenario, version, _asset, overridedMultiLocation) {
16395
- if (scenario === 'ParaToPara') {
16396
- var interior = {
16397
- X1: {
16398
- PalletInstance: 5
16399
- }
16400
- };
16401
- return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
16402
- } else {
16403
- return _superPropGet(Darwinia, "createCurrencySpec", this, 3)([amount, scenario, version, undefined, overridedMultiLocation]);
16404
- }
16405
- }
16406
16135
  }]);
16407
16136
  }(ParachainNode);
16408
16137
 
@@ -16428,8 +16157,17 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
16428
16157
  }
16429
16158
  }, {
16430
16159
  key: "createCurrencySpec",
16431
- value: function createCurrencySpec(amount, scenario, version, asset) {
16432
- return getNode('Darwinia').createCurrencySpec(amount, scenario, version, asset);
16160
+ value: function createCurrencySpec$1(amount, scenario, version, _asset, overridedMultiLocation) {
16161
+ if (scenario === 'ParaToPara') {
16162
+ var interior = {
16163
+ X1: {
16164
+ PalletInstance: 5
16165
+ }
16166
+ };
16167
+ return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
16168
+ } else {
16169
+ return _superPropGet(Crab, "createCurrencySpec", this, 3)([amount, scenario, version, undefined, overridedMultiLocation]);
16170
+ }
16433
16171
  }
16434
16172
  }]);
16435
16173
  }(ParachainNode);
@@ -16631,11 +16369,7 @@ var Collectives$1 = /*#__PURE__*/function (_ParachainNode) {
16631
16369
  }, {
16632
16370
  key: "createCurrencySpec",
16633
16371
  value: function createCurrencySpec(amount, scenario, version, asset) {
16634
- if (scenario === 'ParaToPara') {
16635
- return {};
16636
- } else {
16637
- return _superPropGet(Collectives, "createCurrencySpec", this, 3)([amount, scenario, version, asset]);
16638
- }
16372
+ return _superPropGet(Collectives, "createCurrencySpec", this, 3)([amount, scenario, version, asset]);
16639
16373
  }
16640
16374
  }]);
16641
16375
  }(ParachainNode);
@@ -16692,7 +16426,6 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
16692
16426
  key: "transferXTransfer",
16693
16427
  value: function transferXTransfer(input) {
16694
16428
  var api = input.api,
16695
- origin = input.origin,
16696
16429
  destination = input.destination,
16697
16430
  asset = input.asset,
16698
16431
  overriddenAsset = input.overriddenAsset,
@@ -16702,41 +16435,23 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
16702
16435
  if (isMultiLocationDestination) {
16703
16436
  throw new Error('Multilocation destinations are not supported for specific transfer you are trying to create. In special cases such as xTokens or xTransfer pallet try using address multilocation instead (for both destination and address in same multilocation set (eg. X2 - Parachain, Address). For further assistance please open issue in our repository.');
16704
16437
  }
16705
- var currencySpec = Object.values(createCurrencySpec(asset.amount, Version.V1, Parents.ZERO, overriddenAsset))[0][0];
16438
+ var currencySpec = getCurrency(asset.amount, Version.V1, Parents.ZERO, overriddenAsset)[0];
16706
16439
  var dest = getDestination(input);
16707
16440
  var section = 'transfer';
16708
- var destWeight = origin === 'Khala' ? null : determineDestWeight(destination);
16441
+ var destWeight = determineDestWeight(destination);
16709
16442
  var call = {
16710
- module: pallet !== null && pallet !== undefined ? pallet : 'XTransfer',
16711
- section: method !== null && method !== undefined ? method : section,
16443
+ module: pallet !== null && pallet !== void 0 ? pallet : 'XTransfer',
16444
+ section: method !== null && method !== void 0 ? method : section,
16712
16445
  parameters: {
16713
16446
  asset: currencySpec,
16714
- dest: dest,
16715
- dest_weight: destWeight
16716
- }
16717
- };
16718
- return api.callTxMethod(call);
16719
- }
16720
- }]);
16721
- }();
16722
-
16723
- var Khala$1 = /*#__PURE__*/function (_ParachainNode) {
16724
- function Khala() {
16725
- _classCallCheck(this, Khala);
16726
- return _callSuper(this, Khala, ['Khala', 'khala', 'kusama', Version.V3]);
16727
- }
16728
- _inherits(Khala, _ParachainNode);
16729
- return _createClass(Khala, [{
16730
- key: "transferXTransfer",
16731
- value: function transferXTransfer(input) {
16732
- var asset = input.asset;
16733
- if (asset.symbol !== this.getNativeAssetSymbol()) {
16734
- throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(asset.symbol));
16735
- }
16736
- return XTransferTransferImpl.transferXTransfer(input);
16447
+ dest: dest,
16448
+ dest_weight: destWeight
16449
+ }
16450
+ };
16451
+ return api.callTxMethod(call);
16737
16452
  }
16738
16453
  }]);
16739
- }(ParachainNode);
16454
+ }();
16740
16455
 
16741
16456
  var Phala$1 = /*#__PURE__*/function (_ParachainNode) {
16742
16457
  function Phala() {
@@ -17000,12 +16715,12 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
17000
16715
  return _regeneratorRuntime().wrap(function _callee$(_context) {
17001
16716
  while (1) switch (_context.prev = _context.next) {
17002
16717
  case 0:
17003
- api = input.api, _input$version = input.version, version = _input$version === undefined ? this.version : _input$version, asset = input.asset, destination = input.destination, address = input.address, scenario = input.scenario, paraIdTo = input.paraIdTo;
16718
+ api = input.api, _input$version = input.version, version = _input$version === void 0 ? this.version : _input$version, asset = input.asset, destination = input.destination, address = input.address, scenario = input.scenario, paraIdTo = input.paraIdTo;
17004
16719
  if (!(scenario === 'ParaToPara' && destination === 'AssetHubPolkadot')) {
17005
16720
  _context.next = 4;
17006
16721
  break;
17007
16722
  }
17008
- currencySelection = _defineProperty({}, version, [createMultiAsset(version, asset.amount.toString(), this.getAssetMultiLocation(input.asset))]);
16723
+ currencySelection = addXcmVersionHeader([createMultiAsset(version, asset.amount.toString(), this.getAssetMultiLocation(input.asset))], version);
17009
16724
  return _context.abrupt("return", Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
17010
16725
  currencySelection: currencySelection
17011
16726
  }), 'transfer_assets', 'Unlimited')));
@@ -17016,13 +16731,13 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
17016
16731
  }
17017
16732
  throw new ScenarioNotSupportedError(this.node, scenario);
17018
16733
  case 6:
17019
- versionOrDefault = version !== null && version !== undefined ? version : Version.V3;
16734
+ versionOrDefault = version !== null && version !== void 0 ? version : Version.V3;
17020
16735
  call = {
17021
16736
  module: 'PolkadotXcm',
17022
16737
  section: 'transfer_assets_using_type_and_then',
17023
16738
  parameters: {
17024
16739
  dest: this.createPolkadotXcmHeader('RelayToPara', versionOrDefault, destination, getParaId('AssetHubPolkadot')),
17025
- assets: _defineProperty({}, versionOrDefault, [Object.values(this.createCurrencySpec(asset.amount, 'RelayToPara', versionOrDefault))[0][0]]),
16740
+ assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, asset.amount, DOT_MULTILOCATION)]),
17026
16741
  assets_transfer_type: 'Teleport',
17027
16742
  remote_fees_id: _defineProperty({}, versionOrDefault, {
17028
16743
  Concrete: {
@@ -17051,7 +16766,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
17051
16766
  key: "transferRelayToPara",
17052
16767
  value: function transferRelayToPara(options) {
17053
16768
  var _options$version = options.version,
17054
- version = _options$version === undefined ? Version.V3 : _options$version,
16769
+ version = _options$version === void 0 ? Version.V3 : _options$version,
17055
16770
  api = options.api,
17056
16771
  asset = options.asset,
17057
16772
  address = options.address,
@@ -17062,7 +16777,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
17062
16777
  section: 'transfer_assets_using_type_and_then',
17063
16778
  parameters: {
17064
16779
  dest: this.createPolkadotXcmHeader('RelayToPara', version, destination, getParaId('AssetHubPolkadot')),
17065
- assets: _defineProperty({}, version, [Object.values(this.createCurrencySpec(asset.amount, 'RelayToPara', version))[0][0]]),
16780
+ assets: _defineProperty({}, version, [createMultiAsset(version, asset.amount, DOT_MULTILOCATION)]),
17066
16781
  assets_transfer_type: 'Teleport',
17067
16782
  remote_fees_id: _defineProperty({}, version, {
17068
16783
  Concrete: {
@@ -17096,7 +16811,7 @@ var nodes = function nodes() {
17096
16811
  Darwinia: new Darwinia$1(),
17097
16812
  Hydration: new Hydration$1(),
17098
16813
  Interlay: new Interlay$1(),
17099
- Litentry: new Litentry$1(),
16814
+ Heima: new Heima$1(),
17100
16815
  Moonbeam: new Moonbeam$1(),
17101
16816
  Parallel: new Parallel$1(),
17102
16817
  AssetHubKusama: new AssetHubKusama$1(),
@@ -17131,7 +16846,6 @@ var nodes = function nodes() {
17131
16846
  Pendulum: new Pendulum$1(),
17132
16847
  Zeitgeist: new Zeitgeist$1(),
17133
16848
  Collectives: new Collectives$1(),
17134
- Khala: new Khala$1(),
17135
16849
  Phala: new Phala$1(),
17136
16850
  Subsocial: new Subsocial$1(),
17137
16851
  KiltSpiritnet: new KiltSpiritnet$1(),
@@ -17185,7 +16899,7 @@ var findBestMatches = function findBestMatches(assets, value) {
17185
16899
  // Case-insensitive match
17186
16900
  matches = assets.filter(function (asset) {
17187
16901
  var _asset$property;
17188
- return ((_asset$property = asset[property]) === null || _asset$property === undefined ? undefined : _asset$property.toLowerCase()) === lowerValue;
16902
+ return ((_asset$property = asset[property]) === null || _asset$property === void 0 ? void 0 : _asset$property.toLowerCase()) === lowerValue;
17189
16903
  });
17190
16904
  return matches;
17191
16905
  };
@@ -17362,21 +17076,19 @@ var sanitizeMultiLocation = function sanitizeMultiLocation(multiLocation) {
17362
17076
  return multiLocation.replace(/"(\d+),(\d+)"/g, '"$1$2"');
17363
17077
  };
17364
17078
  var compareMultiLocations = function compareMultiLocations(input, asset) {
17365
- var _asset$multiLocation, _asset$xcmInterior;
17079
+ var _asset$multiLocation;
17366
17080
  var sanitizedInput = sanitizeMultiLocation(input);
17367
- var assetMLStr = JSON.stringify((_asset$multiLocation = asset.multiLocation) !== null && _asset$multiLocation !== undefined ? _asset$multiLocation : '');
17368
- var assetMLInteriorStr = JSON.stringify((_asset$xcmInterior = asset.xcmInterior) !== null && _asset$xcmInterior !== undefined ? _asset$xcmInterior : '');
17081
+ var assetMLStr = JSON.stringify((_asset$multiLocation = asset.multiLocation) !== null && _asset$multiLocation !== void 0 ? _asset$multiLocation : '');
17369
17082
  var sanitizedAssetMLStr = sanitizeMultiLocation(assetMLStr);
17370
- var sanitizedAssetMLInteriorStr = sanitizeMultiLocation(assetMLInteriorStr);
17371
17083
  return (
17372
17084
  // Compare sanitized input with sanitized asset values
17373
- sanitizedInput === sanitizedAssetMLStr || sanitizedInput === sanitizedAssetMLInteriorStr ||
17085
+ sanitizedInput === sanitizedAssetMLStr ||
17374
17086
  // Compare original input with sanitized asset values
17375
- input === sanitizedAssetMLStr || input === sanitizedAssetMLInteriorStr ||
17087
+ input === sanitizedAssetMLStr ||
17376
17088
  // Compare original input with original asset values
17377
- input === assetMLStr || input === assetMLInteriorStr ||
17089
+ input === assetMLStr ||
17378
17090
  // Compare sanitized input with original asset values
17379
- sanitizedInput === assetMLStr || sanitizedInput === assetMLInteriorStr
17091
+ sanitizedInput === assetMLStr
17380
17092
  );
17381
17093
  };
17382
17094
 
@@ -17385,10 +17097,6 @@ var findAssetByMultiLocation = function findAssetByMultiLocation(foreignAssets,
17385
17097
  return foreignAssets.find(function (asset) {
17386
17098
  return compareMultiLocations(multiLocation, asset);
17387
17099
  });
17388
- } else if (Array.isArray(multiLocation)) {
17389
- return foreignAssets.find(function (asset) {
17390
- return _deepEqual(asset.xcmInterior, multiLocation);
17391
- });
17392
17100
  } else {
17393
17101
  return foreignAssets.find(function (asset) {
17394
17102
  return _deepEqual(asset.multiLocation, multiLocation);
@@ -17399,7 +17107,7 @@ var findAssetByMultiLocation = function findAssetByMultiLocation(foreignAssets,
17399
17107
  var filterEthCompatibleAssets = function filterEthCompatibleAssets(assets) {
17400
17108
  var ethAssets = getOtherAssets('Ethereum');
17401
17109
  return assets.filter(function (asset) {
17402
- var assetMultiLoc = asset.multiLocation || asset.xcmInterior;
17110
+ var assetMultiLoc = asset.multiLocation;
17403
17111
  if (!assetMultiLoc) return false;
17404
17112
  return Boolean(findAssetByMultiLocation(ethAssets, assetMultiLoc));
17405
17113
  });
@@ -17425,25 +17133,25 @@ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency, destina
17425
17133
  // If not found, search Ethereum assets directly
17426
17134
  if (isEthereumDestination) {
17427
17135
  var _findAssetBySymbol;
17428
- asset = (_findAssetBySymbol = findAssetBySymbol(node, destination, getFilteredEthereumAssets(), nativeAssets, currency.symbol)) !== null && _findAssetBySymbol !== undefined ? _findAssetBySymbol : findAssetBySymbol(node, destination, getEthereumAssets(), nativeAssets, currency.symbol);
17136
+ asset = (_findAssetBySymbol = findAssetBySymbol(node, destination, getFilteredEthereumAssets(), nativeAssets, currency.symbol)) !== null && _findAssetBySymbol !== void 0 ? _findAssetBySymbol : findAssetBySymbol(node, destination, getEthereumAssets(), nativeAssets, currency.symbol);
17429
17137
  } else {
17430
17138
  asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, currency.symbol);
17431
17139
  }
17432
17140
  } else if ('multilocation' in currency && !isOverrideMultiLocationSpecifier(currency.multilocation)) {
17433
17141
  var _findAssetByMultiLoca;
17434
17142
  var resolvedAssets = isEthereumDestination ? getEthereumAssets() : otherAssets;
17435
- asset = (_findAssetByMultiLoca = findAssetByMultiLocation(resolvedAssets, currency.multilocation)) !== null && _findAssetByMultiLoca !== undefined ? _findAssetByMultiLoca : findAssetByMultiLocation(nativeAssets, currency.multilocation);
17143
+ asset = (_findAssetByMultiLoca = findAssetByMultiLocation(resolvedAssets, currency.multilocation)) !== null && _findAssetByMultiLoca !== void 0 ? _findAssetByMultiLoca : findAssetByMultiLocation(nativeAssets, currency.multilocation);
17436
17144
  } else if ('id' in currency) {
17437
17145
  if (isEthereumDestination) {
17438
17146
  var _findAssetById;
17439
- asset = (_findAssetById = findAssetById(getFilteredEthereumAssets(), currency.id)) !== null && _findAssetById !== undefined ? _findAssetById : findAssetById(getEthereumAssets(), currency.id);
17147
+ asset = (_findAssetById = findAssetById(getFilteredEthereumAssets(), currency.id)) !== null && _findAssetById !== void 0 ? _findAssetById : findAssetById(getEthereumAssets(), currency.id);
17440
17148
  } else {
17441
17149
  asset = findAssetById(otherAssets, currency.id);
17442
17150
  }
17443
17151
  } else {
17444
17152
  throw new Error('Invalid currency input');
17445
17153
  }
17446
- return asset !== null && asset !== undefined ? asset : null;
17154
+ return asset !== null && asset !== void 0 ? asset : null;
17447
17155
  };
17448
17156
 
17449
17157
  var getAssetMultiLocation = function getAssetMultiLocation(node, currency) {
@@ -17454,18 +17162,6 @@ var getAssetMultiLocation = function getAssetMultiLocation(node, currency) {
17454
17162
  if (asset.multiLocation) {
17455
17163
  return asset.multiLocation;
17456
17164
  }
17457
- if (asset.xcmInterior) {
17458
- var _asset$xcmInterior$sl = asset.xcmInterior.slice(-2),
17459
- _asset$xcmInterior$sl2 = _slicedToArray(_asset$xcmInterior$sl, 2),
17460
- secondLast = _asset$xcmInterior$sl2[0],
17461
- last = _asset$xcmInterior$sl2[1];
17462
- return {
17463
- parents: Parents.ZERO,
17464
- interior: {
17465
- X2: [secondLast, last]
17466
- }
17467
- };
17468
- }
17469
17165
  return null;
17470
17166
  };
17471
17167
 
@@ -17480,13 +17176,13 @@ var getExistentialDeposit = function getExistentialDeposit(node, currency) {
17480
17176
  var assetsObject = getAssetsObject(node);
17481
17177
  if (!currency) {
17482
17178
  var _assetsObject$nativeA;
17483
- return (_assetsObject$nativeA = assetsObject.nativeAssets[0].existentialDeposit) !== null && _assetsObject$nativeA !== undefined ? _assetsObject$nativeA : null;
17179
+ return (_assetsObject$nativeA = assetsObject.nativeAssets[0].existentialDeposit) !== null && _assetsObject$nativeA !== void 0 ? _assetsObject$nativeA : null;
17484
17180
  }
17485
- var asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
17181
+ var asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
17486
17182
  if (!asset) {
17487
17183
  throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency), " not found on ").concat(node));
17488
17184
  }
17489
- return (_asset$existentialDep = asset.existentialDeposit) !== null && _asset$existentialDep !== undefined ? _asset$existentialDep : null;
17185
+ return (_asset$existentialDep = asset.existentialDeposit) !== null && _asset$existentialDep !== void 0 ? _asset$existentialDep : null;
17490
17186
  };
17491
17187
 
17492
17188
  var assetsMap = assetsMapJson;
@@ -17630,7 +17326,7 @@ var getAssetDecimals = function getAssetDecimals(node, symbol) {
17630
17326
  var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
17631
17327
  return o.symbol === symbol;
17632
17328
  });
17633
- return (asset === null || asset === undefined ? undefined : asset.decimals) !== undefined ? asset.decimals : null;
17329
+ return (asset === null || asset === void 0 ? void 0 : asset.decimals) !== undefined ? asset.decimals : null;
17634
17330
  };
17635
17331
  /**
17636
17332
  * Retrieves the node name corresponding to a specified parachain ID.
@@ -17648,7 +17344,10 @@ var getTNode = function getTNode(paraId, ecosystem) {
17648
17344
  }
17649
17345
  return (_NODE_NAMES_DOT_KSM$f = NODE_NAMES_DOT_KSM.find(function (nodeName) {
17650
17346
  return getNode(nodeName).type === ecosystem && getParaId(nodeName) === paraId;
17651
- })) !== null && _NODE_NAMES_DOT_KSM$f !== undefined ? _NODE_NAMES_DOT_KSM$f : null;
17347
+ })) !== null && _NODE_NAMES_DOT_KSM$f !== void 0 ? _NODE_NAMES_DOT_KSM$f : null;
17348
+ };
17349
+ var hasDryRunSupport = function hasDryRunSupport(node) {
17350
+ return getAssetsObject(node).supportsDryRunApi;
17652
17351
  };
17653
17352
 
17654
17353
  var AssetHubPolkadot = {
@@ -17748,15 +17447,11 @@ var ComposableFinance = {
17748
17447
  ]
17749
17448
  };
17750
17449
  var Darwinia = {
17751
- defaultPallet: "XTokens",
17450
+ defaultPallet: "PolkadotXcm",
17752
17451
  supportedPallets: [
17753
17452
  {
17754
17453
  name: "PolkadotXcm",
17755
17454
  index: 33
17756
- },
17757
- {
17758
- name: "XTokens",
17759
- index: 46
17760
17455
  }
17761
17456
  ]
17762
17457
  };
@@ -17786,7 +17481,7 @@ var Interlay = {
17786
17481
  }
17787
17482
  ]
17788
17483
  };
17789
- var Litentry = {
17484
+ var Heima = {
17790
17485
  defaultPallet: "PolkadotXcm",
17791
17486
  supportedPallets: [
17792
17487
  {
@@ -18166,19 +17861,6 @@ var Collectives = {
18166
17861
  }
18167
17862
  ]
18168
17863
  };
18169
- var Khala = {
18170
- defaultPallet: "XTransfer",
18171
- supportedPallets: [
18172
- {
18173
- name: "PolkadotXcm",
18174
- index: 33
18175
- },
18176
- {
18177
- name: "XTransfer",
18178
- index: 82
18179
- }
18180
- ]
18181
- };
18182
17864
  var Phala = {
18183
17865
  defaultPallet: "XTransfer",
18184
17866
  supportedPallets: [
@@ -18338,7 +18020,7 @@ var pallets = {
18338
18020
  Darwinia: Darwinia,
18339
18021
  Hydration: Hydration,
18340
18022
  Interlay: Interlay,
18341
- Litentry: Litentry,
18023
+ Heima: Heima,
18342
18024
  Moonbeam: Moonbeam,
18343
18025
  Parallel: Parallel,
18344
18026
  AssetHubKusama: AssetHubKusama,
@@ -18370,7 +18052,6 @@ var pallets = {
18370
18052
  Pendulum: Pendulum,
18371
18053
  Zeitgeist: Zeitgeist,
18372
18054
  Collectives: Collectives,
18373
- Khala: Khala,
18374
18055
  Phala: Phala,
18375
18056
  Subsocial: Subsocial,
18376
18057
  KiltSpiritnet: KiltSpiritnet,
@@ -18415,16 +18096,15 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
18415
18096
  Curio: Curio,
18416
18097
  Darwinia: Darwinia,
18417
18098
  Encointer: Encointer,
18099
+ Heima: Heima,
18418
18100
  Hydration: Hydration,
18419
18101
  Imbue: Imbue,
18420
18102
  Interlay: Interlay,
18421
18103
  InvArchTinker: InvArchTinker,
18422
18104
  Karura: Karura,
18423
- Khala: Khala,
18424
18105
  KiltSpiritnet: KiltSpiritnet,
18425
18106
  Kintsugi: Kintsugi,
18426
18107
  Kusama: Kusama,
18427
- Litentry: Litentry,
18428
18108
  Manta: Manta,
18429
18109
  Moonbeam: Moonbeam,
18430
18110
  Moonriver: Moonriver,
@@ -18589,7 +18269,7 @@ var getBalanceForeignInternal = /*#__PURE__*/function () {
18589
18269
  _context.next = 3;
18590
18270
  return api.init(node);
18591
18271
  case 3:
18592
- asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
18272
+ asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
18593
18273
  if (asset) {
18594
18274
  _context.next = 6;
18595
18275
  break;
@@ -18766,7 +18446,7 @@ var getAssetBalanceInternal = /*#__PURE__*/function () {
18766
18446
  _context.next = 16;
18767
18447
  break;
18768
18448
  }
18769
- _context.t1 = _yield$getBalanceFore !== undefined;
18449
+ _context.t1 = _yield$getBalanceFore !== void 0;
18770
18450
  case 16:
18771
18451
  if (!_context.t1) {
18772
18452
  _context.next = 20;
@@ -18846,7 +18526,7 @@ var buildClaimAssetsInput = function buildClaimAssetsInput(_ref) {
18846
18526
  multiAssets = _ref.multiAssets,
18847
18527
  address = _ref.address,
18848
18528
  _ref$version = _ref.version,
18849
- version = _ref$version === undefined ? Version.V3 : _ref$version;
18529
+ version = _ref$version === void 0 ? Version.V3 : _ref$version;
18850
18530
  return {
18851
18531
  assets: _defineProperty({}, version, multiAssets),
18852
18532
  beneficiary: _defineProperty({}, version, buildBeneficiaryInput(api, address))
@@ -18967,10 +18647,26 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
18967
18647
  return _build.apply(this, arguments);
18968
18648
  }
18969
18649
  return build;
18970
- }())
18650
+ }()
18651
+ /**
18652
+ * Returns the API instance used by the builder.
18653
+ *
18654
+ * @returns The API instance.
18655
+ */
18656
+ )
18657
+ }, {
18658
+ key: "getApi",
18659
+ value: function getApi() {
18660
+ return this.api.getApi();
18661
+ }
18662
+ /**
18663
+ * Disconnects the API.
18664
+ *
18665
+ * @returns A Promise that resolves when the API is disconnected.
18666
+ */
18971
18667
  }, {
18972
18668
  key: "disconnect",
18973
- value: function () {
18669
+ value: (function () {
18974
18670
  var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
18975
18671
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
18976
18672
  while (1) switch (_context2.prev = _context2.next) {
@@ -18986,7 +18682,7 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
18986
18682
  return _disconnect.apply(this, arguments);
18987
18683
  }
18988
18684
  return disconnect;
18989
- }()
18685
+ }())
18990
18686
  }], [{
18991
18687
  key: "create",
18992
18688
  value: function create(api, node) {
@@ -19139,9 +18835,9 @@ var GeneralBuilder = /*#__PURE__*/function () {
19139
18835
  */
19140
18836
  }, {
19141
18837
  key: "address",
19142
- value: function address(_address, ahAddress) {
18838
+ value: function address(_address, senderAddress) {
19143
18839
  this._address = _address;
19144
- this._ahAddress = ahAddress;
18840
+ this._senderAddress = senderAddress;
19145
18841
  return this;
19146
18842
  }
19147
18843
  /**
@@ -19180,7 +18876,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
19180
18876
  destination: this._to,
19181
18877
  paraIdTo: this._paraIdTo,
19182
18878
  version: this._version,
19183
- ahAddress: this._ahAddress,
18879
+ senderAddress: this._senderAddress,
19184
18880
  pallet: this._pallet,
19185
18881
  method: this._method
19186
18882
  };
@@ -19291,6 +18987,16 @@ var GeneralBuilder = /*#__PURE__*/function () {
19291
18987
  }
19292
18988
  return dryRun;
19293
18989
  }()
18990
+ /**
18991
+ * Returns the API instance used by the builder.
18992
+ *
18993
+ * @returns The API instance.
18994
+ */
18995
+ }, {
18996
+ key: "getApi",
18997
+ value: function getApi() {
18998
+ return this.api.getApi();
18999
+ }
19294
19000
  }, {
19295
19001
  key: "disconnect",
19296
19002
  value: function () {
@@ -19325,16 +19031,16 @@ var Builder = function Builder(api) {
19325
19031
  var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
19326
19032
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
19327
19033
  var _getExistentialDeposi;
19328
- var api, account, accountDestination, ahAccount, currency, origin, destination, _ref$feeMarginPercent, feeMarginPercentage, tx, xcmFee, xcmFeeWithMargin, nativeBalance, existentialDeposit, sufficientForXCM;
19034
+ var api, account, accountDestination, currency, origin, destination, _ref$feeMarginPercent, feeMarginPercentage, tx, xcmFee, xcmFeeWithMargin, nativeBalance, existentialDeposit, sufficientForXCM;
19329
19035
  return _regeneratorRuntime().wrap(function _callee$(_context) {
19330
19036
  while (1) switch (_context.prev = _context.next) {
19331
19037
  case 0:
19332
- api = _ref.api, account = _ref.account, accountDestination = _ref.accountDestination, ahAccount = _ref.ahAccount, currency = _ref.currency, origin = _ref.origin, destination = _ref.destination, _ref$feeMarginPercent = _ref.feeMarginPercentage, feeMarginPercentage = _ref$feeMarginPercent === undefined ? 10 : _ref$feeMarginPercent;
19038
+ api = _ref.api, account = _ref.account, accountDestination = _ref.accountDestination, currency = _ref.currency, origin = _ref.origin, destination = _ref.destination, _ref$feeMarginPercent = _ref.feeMarginPercentage, feeMarginPercentage = _ref$feeMarginPercent === void 0 ? 10 : _ref$feeMarginPercent;
19333
19039
  _context.next = 3;
19334
19040
  return api.init(origin);
19335
19041
  case 3:
19336
19042
  _context.next = 5;
19337
- return Builder(api).from(origin).to(destination).currency(currency).address(accountDestination, ahAccount).build();
19043
+ return Builder(api).from(origin).to(destination).currency(currency).address(accountDestination, account).build();
19338
19044
  case 5:
19339
19045
  tx = _context.sent;
19340
19046
  _context.next = 8;
@@ -19350,7 +19056,7 @@ var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
19350
19056
  });
19351
19057
  case 12:
19352
19058
  nativeBalance = _context.sent;
19353
- existentialDeposit = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== undefined ? _getExistentialDeposi : '0');
19059
+ existentialDeposit = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== void 0 ? _getExistentialDeposi : '0');
19354
19060
  sufficientForXCM = nativeBalance - existentialDeposit - xcmFeeWithMargin > 0;
19355
19061
  return _context.abrupt("return", {
19356
19062
  sufficientForXCM: sufficientForXCM,
@@ -19458,7 +19164,7 @@ var getMaxForeignTransferableAmount = /*#__PURE__*/function () {
19458
19164
  case 0:
19459
19165
  api = _ref3.api, address = _ref3.address, node = _ref3.node, currency = _ref3.currency;
19460
19166
  validateAddress(address, node, false);
19461
- asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
19167
+ asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
19462
19168
  if (asset) {
19463
19169
  _context2.next = 5;
19464
19170
  break;
@@ -19509,7 +19215,7 @@ var getTransferableAmount = /*#__PURE__*/function () {
19509
19215
  case 0:
19510
19216
  api = _ref5.api, address = _ref5.address, node = _ref5.node, currency = _ref5.currency;
19511
19217
  validateAddress(address, node, false);
19512
- asset = (_getAssetBySymbolOrId2 = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId2 !== undefined ? _getAssetBySymbolOrId2 : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
19218
+ asset = (_getAssetBySymbolOrId2 = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId2 !== void 0 ? _getAssetBySymbolOrId2 : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
19513
19219
  if (asset) {
19514
19220
  _context3.next = 5;
19515
19221
  break;
@@ -19583,7 +19289,7 @@ var getTransferInfo = /*#__PURE__*/function () {
19583
19289
  case 14:
19584
19290
  xcmFeeDetails = _context.sent;
19585
19291
  expectedBalanceAfterXCMDelivery = originBalance - xcmFeeDetails.xcmFee;
19586
- asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(origin, currency, destination)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : origin === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
19292
+ asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(origin, currency, destination)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : origin === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
19587
19293
  if (asset) {
19588
19294
  _context.next = 19;
19589
19295
  break;
@@ -19604,7 +19310,7 @@ var getTransferInfo = /*#__PURE__*/function () {
19604
19310
  });
19605
19311
  case 22:
19606
19312
  _context.t1 = _context.sent;
19607
- _context.t2 = (_asset$symbol = asset === null || asset === undefined ? undefined : asset.symbol) !== null && _asset$symbol !== undefined ? _asset$symbol : '';
19313
+ _context.t2 = (_asset$symbol = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _asset$symbol !== void 0 ? _asset$symbol : '';
19608
19314
  _context.t3 = {
19609
19315
  balance: _context.t1,
19610
19316
  currency: _context.t2
@@ -19612,9 +19318,9 @@ var getTransferInfo = /*#__PURE__*/function () {
19612
19318
  _context.t4 = originBalance;
19613
19319
  _context.t5 = expectedBalanceAfterXCMDelivery;
19614
19320
  _context.t6 = xcmFeeDetails;
19615
- _context.t7 = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== undefined ? _getExistentialDeposi : 0);
19321
+ _context.t7 = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== void 0 ? _getExistentialDeposi : 0);
19616
19322
  _context.t8 = getNativeAssetSymbol(origin);
19617
- _context.t9 = BigInt((_getExistentialDeposi2 = getExistentialDeposit(origin)) !== null && _getExistentialDeposi2 !== undefined ? _getExistentialDeposi2 : 0);
19323
+ _context.t9 = BigInt((_getExistentialDeposi2 = getExistentialDeposit(origin)) !== null && _getExistentialDeposi2 !== void 0 ? _getExistentialDeposi2 : 0);
19618
19324
  _context.next = 33;
19619
19325
  return getMaxNativeTransferableAmount({
19620
19326
  api: api,
@@ -19641,7 +19347,7 @@ var getTransferInfo = /*#__PURE__*/function () {
19641
19347
  case 37:
19642
19348
  _context.t12 = _context.sent;
19643
19349
  _context.t13 = getNativeAssetSymbol(destination);
19644
- _context.t14 = BigInt((_getExistentialDeposi3 = getExistentialDeposit(destination)) !== null && _getExistentialDeposi3 !== undefined ? _getExistentialDeposi3 : 0);
19350
+ _context.t14 = BigInt((_getExistentialDeposi3 = getExistentialDeposit(destination)) !== null && _getExistentialDeposi3 !== void 0 ? _getExistentialDeposi3 : 0);
19645
19351
  _context.t15 = {
19646
19352
  balance: _context.t12,
19647
19353
  currency: _context.t13,
@@ -19755,6 +19461,75 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
19755
19461
  return supportedAssets;
19756
19462
  };
19757
19463
 
19464
+ var verifyEdOnDestinationInternal = /*#__PURE__*/function () {
19465
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
19466
+ var api, node, address, currency, ed, edBN, balance, originalAmount, fee, amountWithoutFee;
19467
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
19468
+ while (1) switch (_context.prev = _context.next) {
19469
+ case 0:
19470
+ api = _ref.api, node = _ref.node, address = _ref.address, currency = _ref.currency;
19471
+ validateAddress(address, node);
19472
+ ed = getExistentialDeposit(node, currency);
19473
+ if (!(ed === null)) {
19474
+ _context.next = 5;
19475
+ break;
19476
+ }
19477
+ throw new Error("Cannot get existential deposit for currency ".concat(JSON.stringify(currency)));
19478
+ case 5:
19479
+ edBN = BigInt(ed);
19480
+ _context.next = 8;
19481
+ return getAssetBalanceInternal({
19482
+ address: address,
19483
+ node: node,
19484
+ api: api,
19485
+ currency: currency
19486
+ });
19487
+ case 8:
19488
+ balance = _context.sent;
19489
+ originalAmount = BigInt(currency.amount);
19490
+ fee = originalAmount / BigInt(100);
19491
+ amountWithoutFee = originalAmount - fee;
19492
+ return _context.abrupt("return", balance + amountWithoutFee - edBN > 0);
19493
+ case 13:
19494
+ case "end":
19495
+ return _context.stop();
19496
+ }
19497
+ }, _callee);
19498
+ }));
19499
+ return function verifyEdOnDestinationInternal(_x) {
19500
+ return _ref2.apply(this, arguments);
19501
+ };
19502
+ }();
19503
+
19504
+ var verifyEdOnDestination = /*#__PURE__*/function () {
19505
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
19506
+ var api;
19507
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
19508
+ while (1) switch (_context.prev = _context.next) {
19509
+ case 0:
19510
+ api = options.api;
19511
+ _context.prev = 1;
19512
+ _context.next = 4;
19513
+ return verifyEdOnDestinationInternal(options);
19514
+ case 4:
19515
+ return _context.abrupt("return", _context.sent);
19516
+ case 5:
19517
+ _context.prev = 5;
19518
+ _context.next = 8;
19519
+ return api.disconnect();
19520
+ case 8:
19521
+ return _context.finish(5);
19522
+ case 9:
19523
+ case "end":
19524
+ return _context.stop();
19525
+ }
19526
+ }, _callee, null, [[1,, 5, 9]]);
19527
+ }));
19528
+ return function verifyEdOnDestination(_x) {
19529
+ return _ref.apply(this, arguments);
19530
+ };
19531
+ }();
19532
+
19758
19533
  var isPrimitive = function isPrimitive(obj) {
19759
19534
  return obj !== Object(obj);
19760
19535
  };
@@ -19902,7 +19677,7 @@ var getMultiLocationTokenId = function getMultiLocationTokenId(location, node) {
19902
19677
  var assetId = location.interior.value[1].value;
19903
19678
  return (_foreignAssets$find$a = (_foreignAssets$find = foreignAssets.find(function (asset) {
19904
19679
  return asset.assetId === String(assetId);
19905
- })) === null || _foreignAssets$find === undefined ? undefined : _foreignAssets$find.assetId) !== null && _foreignAssets$find$a !== undefined ? _foreignAssets$find$a : null;
19680
+ })) === null || _foreignAssets$find === void 0 ? void 0 : _foreignAssets$find.assetId) !== null && _foreignAssets$find$a !== void 0 ? _foreignAssets$find$a : null;
19906
19681
  }
19907
19682
  }
19908
19683
  return null;
@@ -19971,7 +19746,7 @@ var getMultiLocationTokenIdPjs = function getMultiLocationTokenIdPjs(location, n
19971
19746
  var assetId = junctions[1].GeneralIndex;
19972
19747
  return (_foreignAssets$find$s = (_foreignAssets$find = foreignAssets.find(function (asset) {
19973
19748
  return asset.assetId === String(assetId);
19974
- })) === null || _foreignAssets$find === undefined ? undefined : _foreignAssets$find.symbol) !== null && _foreignAssets$find$s !== undefined ? _foreignAssets$find$s : null;
19749
+ })) === null || _foreignAssets$find === void 0 ? void 0 : _foreignAssets$find.symbol) !== null && _foreignAssets$find$s !== void 0 ? _foreignAssets$find$s : null;
19975
19750
  }
19976
19751
  }
19977
19752
  return null;
@@ -20128,12 +19903,12 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
20128
19903
  }
20129
19904
  if ('symbol' in currency && nativeAssets.some(function (nativeAsset) {
20130
19905
  var _asset$symbol;
20131
- return nativeAsset.symbol.toLowerCase() === (asset === null || asset === undefined || (_asset$symbol = asset.symbol) === null || _asset$symbol === undefined ? undefined : _asset$symbol.toLowerCase());
19906
+ return nativeAsset.symbol.toLowerCase() === (asset === null || asset === void 0 || (_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase());
20132
19907
  })) {
20133
- throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset === undefined ? undefined : asset.symbol), " is not supported for transfers to ").concat(destination, "."));
19908
+ throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset === void 0 ? void 0 : asset.symbol), " is not supported for transfers to ").concat(destination, "."));
20134
19909
  }
20135
19910
  }
20136
- if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === undefined ? undefined : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol)) {
19911
+ if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol)) {
20137
19912
  throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
20138
19913
  }
20139
19914
  if (!isBridge && asset === null && assetCheckEnabled) {
@@ -20205,8 +19980,8 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
20205
19980
  var originTyped = origin;
20206
19981
  var originNode = getNode(originTyped);
20207
19982
  return _objectSpread2({
20208
- isFeeAsset: (_currency$isFeeAsset = currency.isFeeAsset) !== null && _currency$isFeeAsset !== undefined ? _currency$isFeeAsset : false
20209
- }, createMultiAsset(originNode.version, currency.amount, asset === null || asset === undefined ? undefined : asset.multiLocation));
19983
+ isFeeAsset: (_currency$isFeeAsset = currency.isFeeAsset) !== null && _currency$isFeeAsset !== void 0 ? _currency$isFeeAsset : false
19984
+ }, createMultiAsset(originNode.version, currency.amount, asset === null || asset === void 0 ? void 0 : asset.multiLocation));
20210
19985
  });
20211
19986
  return assets;
20212
19987
  }
@@ -20215,47 +19990,42 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
20215
19990
 
20216
19991
  var send = /*#__PURE__*/function () {
20217
19992
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
20218
- var api, origin, currency, address, destination, paraIdTo, version, ahAddress, pallet, method, isBridge, assetCheckEnabled, asset, overriddenAsset, resolvedAsset, originNode;
19993
+ var api, origin, currency, address, destination, paraIdTo, version, senderAddress, pallet, method, isBridge, assetCheckEnabled, asset, overriddenAsset, resolvedAsset, originNode;
20219
19994
  return _regeneratorRuntime().wrap(function _callee$(_context) {
20220
19995
  while (1) switch (_context.prev = _context.next) {
20221
19996
  case 0:
20222
- api = options.api, origin = options.origin, currency = options.currency, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, version = options.version, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method;
19997
+ api = options.api, origin = options.origin, currency = options.currency, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, version = options.version, senderAddress = options.senderAddress, pallet = options.pallet, method = options.method;
20223
19998
  validateCurrency(currency);
20224
19999
  validateDestination(origin, destination);
20225
20000
  validateDestinationAddress(address, destination);
20226
- if (!(ahAddress && ethers.isAddress(ahAddress))) {
20227
- _context.next = 6;
20228
- break;
20229
- }
20230
- throw new Error('AssetHub address needs to be in Substrate format');
20231
- case 6:
20001
+ if (senderAddress) validateAddress(senderAddress, origin, false);
20232
20002
  if (!(isRelayChain(origin) && !isTMultiLocation(destination) && isRelayChain(destination))) {
20233
- _context.next = 8;
20003
+ _context.next = 7;
20234
20004
  break;
20235
20005
  }
20236
20006
  throw new Error('Relay chain to relay chain transfers are not supported.');
20237
- case 8:
20007
+ case 7:
20238
20008
  isBridge = isBridgeTransfer(origin, destination);
20239
20009
  assetCheckEnabled = determineAssetCheckEnabled(origin, currency, isBridge);
20240
20010
  validateAssetSpecifiers(assetCheckEnabled, currency);
20241
20011
  asset = resolveAsset(currency, origin, destination, assetCheckEnabled);
20242
20012
  validateAssetSupport(options, assetCheckEnabled, isBridge, asset);
20243
20013
  if (!isRelayChain(origin)) {
20244
- _context.next = 19;
20014
+ _context.next = 18;
20245
20015
  break;
20246
20016
  }
20247
20017
  if (!(destination === 'Ethereum')) {
20248
- _context.next = 16;
20018
+ _context.next = 15;
20249
20019
  break;
20250
20020
  }
20251
20021
  throw new Error('Transfers from relay chain to Ethereum are not supported.');
20252
- case 16:
20022
+ case 15:
20253
20023
  if (asset) {
20254
- _context.next = 18;
20024
+ _context.next = 17;
20255
20025
  break;
20256
20026
  }
20257
20027
  throw new Error('Asset is required for relay chain to relay chain transfers.');
20258
- case 18:
20028
+ case 17:
20259
20029
  return _context.abrupt("return", transferRelayToPara({
20260
20030
  api: api,
20261
20031
  origin: origin,
@@ -20269,13 +20039,13 @@ var send = /*#__PURE__*/function () {
20269
20039
  pallet: pallet,
20270
20040
  method: method
20271
20041
  }));
20272
- case 19:
20042
+ case 18:
20273
20043
  overriddenAsset = resolveOverriddenAsset(options, isBridge, assetCheckEnabled);
20274
- _context.next = 22;
20044
+ _context.next = 21;
20275
20045
  return api.init(origin);
20276
- case 22:
20046
+ case 21:
20277
20047
  // In case asset check is disabled, we create asset object from currency symbol
20278
- resolvedAsset = asset !== null && asset !== undefined ? asset : {
20048
+ resolvedAsset = asset !== null && asset !== void 0 ? asset : {
20279
20049
  symbol: 'symbol' in currency ? currency.symbol : undefined
20280
20050
  };
20281
20051
  originNode = getNode(origin);
@@ -20289,11 +20059,11 @@ var send = /*#__PURE__*/function () {
20289
20059
  paraIdTo: paraIdTo,
20290
20060
  overriddenAsset: overriddenAsset,
20291
20061
  version: version,
20292
- ahAddress: ahAddress,
20062
+ senderAddress: senderAddress,
20293
20063
  pallet: pallet,
20294
20064
  method: method
20295
20065
  }));
20296
- case 25:
20066
+ case 24:
20297
20067
  case "end":
20298
20068
  return _context.stop();
20299
20069
  }
@@ -20349,8 +20119,8 @@ var formatAssetIdToERC20 = function formatAssetIdToERC20(id) {
20349
20119
  if (id.startsWith('0x')) {
20350
20120
  return id;
20351
20121
  }
20352
- if (!/^\d{38,39}$/.test(id)) {
20353
- throw new Error("Asset id: ".concat(id, " must be a string and have 38-39 digits"));
20122
+ if (!(/^\d{38,39}$/.test(id) || /^\d{4}$/.test(id))) {
20123
+ throw new Error("Asset id: ".concat(id, " must be a string and have either 4 digits or 38-39 digits"));
20354
20124
  }
20355
20125
  return "0xffffffff".concat(BigInt(id).toString(16).padStart(32, '0'));
20356
20126
  };
@@ -20368,7 +20138,7 @@ var getDestinationMultilocation = function getDestinationMultilocation(api, addr
20368
20138
  return [1, paraId ? ["0x0000000".concat(paraId.toString(16)), acc] : [acc]];
20369
20139
  };
20370
20140
 
20371
- var abi = [
20141
+ var abi$1 = [
20372
20142
  {
20373
20143
  inputs: [
20374
20144
  {
@@ -20489,8 +20259,8 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
20489
20259
  }
20490
20260
  throw new Error('Override multilocation is not supported for Evm transfers');
20491
20261
  case 5:
20492
- contract = isEthersSigner(signer) ? new Contract(CONTRACT_ADDRESS, abi, signer) : getContract({
20493
- abi: abi,
20262
+ contract = isEthersSigner(signer) ? new Contract(CONTRACT_ADDRESS, abi$1, signer) : getContract({
20263
+ abi: abi$1,
20494
20264
  address: CONTRACT_ADDRESS,
20495
20265
  client: {
20496
20266
  "public": createPublicClient({
@@ -20542,7 +20312,7 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
20542
20312
  break;
20543
20313
  }
20544
20314
  _context.next = 25;
20545
- return createTx('transferMultiCurrencies', [[[asset, currency.amount], [formatAssetIdToERC20((_usdtAsset$assetId = usdtAsset.assetId) !== null && _usdtAsset$assetId !== undefined ? _usdtAsset$assetId : ''), '200000']], 1,
20315
+ return createTx('transferMultiCurrencies', [[[asset, currency.amount], [formatAssetIdToERC20((_usdtAsset$assetId = usdtAsset.assetId) !== null && _usdtAsset$assetId !== void 0 ? _usdtAsset$assetId : ''), '200000']], 1,
20546
20316
  // index of the fee asset
20547
20317
  destMultiLocation, weight]);
20548
20318
  case 25:
@@ -20568,6 +20338,72 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
20568
20338
  };
20569
20339
  }();
20570
20340
 
20341
+ var abi = [
20342
+ {
20343
+ inputs: [
20344
+ {
20345
+ components: [
20346
+ {
20347
+ internalType: "uint8",
20348
+ name: "parents",
20349
+ type: "uint8"
20350
+ },
20351
+ {
20352
+ internalType: "bytes[]",
20353
+ name: "interior",
20354
+ type: "bytes[]"
20355
+ }
20356
+ ],
20357
+ internalType: "struct XCM.Location",
20358
+ name: "dest",
20359
+ type: "tuple"
20360
+ },
20361
+ {
20362
+ components: [
20363
+ {
20364
+ internalType: "address",
20365
+ name: "asset",
20366
+ type: "address"
20367
+ },
20368
+ {
20369
+ internalType: "uint256",
20370
+ name: "amount",
20371
+ type: "uint256"
20372
+ }
20373
+ ],
20374
+ internalType: "struct XCM.AssetAddressInfo[]",
20375
+ name: "assets",
20376
+ type: "tuple[]"
20377
+ },
20378
+ {
20379
+ internalType: "enum XCM.TransferType",
20380
+ name: "assetsTransferType",
20381
+ type: "uint8"
20382
+ },
20383
+ {
20384
+ internalType: "uint8",
20385
+ name: "remoteFeesIdIndex",
20386
+ type: "uint8"
20387
+ },
20388
+ {
20389
+ internalType: "enum XCM.TransferType",
20390
+ name: "feesTransferType",
20391
+ type: "uint8"
20392
+ },
20393
+ {
20394
+ internalType: "bytes",
20395
+ name: "customXcmOnDest",
20396
+ type: "bytes"
20397
+ }
20398
+ ],
20399
+ name: "transferAssetsUsingTypeAndThenAddress",
20400
+ outputs: [
20401
+ ],
20402
+ stateMutability: "nonpayable",
20403
+ type: "function"
20404
+ }
20405
+ ];
20406
+
20571
20407
  var getParaEthTransferFees = /*#__PURE__*/function () {
20572
20408
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(ahApi) {
20573
20409
  var DEFAULT_FEE, feeStorageItem, leFeeHex, bytes, reversedHex, validReversedHex, leFee, transferBridgeFee, transferAssethubExecutionFee, finalBridgeFee, finalAssethubExecutionFee;
@@ -20576,7 +20412,7 @@ var getParaEthTransferFees = /*#__PURE__*/function () {
20576
20412
  case 0:
20577
20413
  DEFAULT_FEE = 2750872500000n;
20578
20414
  _context.next = 3;
20579
- return ahApi.getFromStorage('0x5fbc5c7ba58845ad1f1a9a7c5bc12fad');
20415
+ return ahApi.getFromRpc('state', 'getStorage', '0x5fbc5c7ba58845ad1f1a9a7c5bc12fad');
20580
20416
  case 3:
20581
20417
  feeStorageItem = _context.sent;
20582
20418
  leFeeHex = feeStorageItem.replace('0x', '');
@@ -20603,4 +20439,153 @@ var getParaEthTransferFees = /*#__PURE__*/function () {
20603
20439
  };
20604
20440
  }();
20605
20441
 
20606
- export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, _deepEqual as deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaEthTransferFees, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara, validateAddress };
20442
+ // https://github.com/moonbeam-foundation/moonbeam/blob/b2b1bde7ced13aad4bd2928effc415c521fd48cb/runtime/moonbeam/src/precompiles.rs#L281
20443
+ var xcmInterfacePrecompile = '0x000000000000000000000000000000000000081A';
20444
+ var XCDOT = '0xFfFFfFff1FcaCBd218EDc0EbA20Fc2308C778080';
20445
+ var transferMoonbeamToEth = /*#__PURE__*/function () {
20446
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
20447
+ var _signer$account;
20448
+ var api, from, to, signer, address, ahAddress, currency, foundAsset, ethAsset, contract, senderAddress, messageId, customXcm, customXcmOnDest, assetHubApi, _yield$getParaEthTran, _yield$getParaEthTran2, bridgeFee, executionFee, transferFee, createTx, numberToHex32, tx;
20449
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
20450
+ while (1) switch (_context.prev = _context.next) {
20451
+ case 0:
20452
+ api = _ref.api, from = _ref.from, to = _ref.to, signer = _ref.signer, address = _ref.address, ahAddress = _ref.ahAddress, currency = _ref.currency;
20453
+ if (ahAddress) {
20454
+ _context.next = 3;
20455
+ break;
20456
+ }
20457
+ throw new Error('AssetHub address is required');
20458
+ case 3:
20459
+ if (!('multiasset' in currency)) {
20460
+ _context.next = 5;
20461
+ break;
20462
+ }
20463
+ throw new Error('Multiassets syntax is not supported for Evm transfers');
20464
+ case 5:
20465
+ if (!('multilocation' in currency && isOverrideMultiLocationSpecifier(currency.multilocation))) {
20466
+ _context.next = 7;
20467
+ break;
20468
+ }
20469
+ throw new Error('Override multilocation is not supported for Evm transfers');
20470
+ case 7:
20471
+ foundAsset = getAssetBySymbolOrId(from, currency, to);
20472
+ if (!(foundAsset === null)) {
20473
+ _context.next = 10;
20474
+ break;
20475
+ }
20476
+ throw new InvalidCurrencyError("Origin node ".concat(from, " does not support currency ").concat(JSON.stringify(currency), "."));
20477
+ case 10:
20478
+ if (!(!isForeignAsset(foundAsset) || !foundAsset.multiLocation)) {
20479
+ _context.next = 12;
20480
+ break;
20481
+ }
20482
+ throw new InvalidCurrencyError('Currency must be a foreign asset with valid multi-location');
20483
+ case 12:
20484
+ ethAsset = findAssetByMultiLocation(getOtherAssets('Ethereum'), foundAsset.multiLocation);
20485
+ if (!(!ethAsset || !ethAsset.assetId)) {
20486
+ _context.next = 15;
20487
+ break;
20488
+ }
20489
+ throw new InvalidCurrencyError("Could not obtain Ethereum asset address for ".concat(JSON.stringify(foundAsset)));
20490
+ case 15:
20491
+ contract = isEthersSigner(signer) ? new Contract(xcmInterfacePrecompile, abi, signer) : getContract({
20492
+ abi: abi,
20493
+ address: xcmInterfacePrecompile,
20494
+ client: {
20495
+ "public": createPublicClient({
20496
+ chain: signer.chain,
20497
+ transport: http()
20498
+ }),
20499
+ wallet: signer
20500
+ }
20501
+ });
20502
+ if (!isEthersSigner(signer)) {
20503
+ _context.next = 22;
20504
+ break;
20505
+ }
20506
+ _context.next = 19;
20507
+ return signer.getAddress();
20508
+ case 19:
20509
+ _context.t0 = _context.sent;
20510
+ _context.next = 23;
20511
+ break;
20512
+ case 22:
20513
+ _context.t0 = (_signer$account = signer.account) === null || _signer$account === void 0 ? void 0 : _signer$account.address;
20514
+ case 23:
20515
+ senderAddress = _context.t0;
20516
+ if (senderAddress) {
20517
+ _context.next = 26;
20518
+ break;
20519
+ }
20520
+ throw new Error('Unable to get sender address');
20521
+ case 26:
20522
+ _context.next = 28;
20523
+ return api.init(from);
20524
+ case 28:
20525
+ _context.next = 30;
20526
+ return generateMessageId(api, senderAddress, getParaId(from), ethAsset.assetId, address, currency.amount);
20527
+ case 30:
20528
+ messageId = _context.sent;
20529
+ customXcm = createCustomXcmOnDest({
20530
+ api: api,
20531
+ address: address,
20532
+ scenario: 'ParaToPara',
20533
+ senderAddress: senderAddress,
20534
+ asset: _objectSpread2(_objectSpread2({}, foundAsset), {}, {
20535
+ amount: currency.amount
20536
+ })}, Version.V4, messageId);
20537
+ _context.next = 34;
20538
+ return api.objectToHex(customXcm, 'XcmVersionedXcm');
20539
+ case 34:
20540
+ customXcmOnDest = _context.sent;
20541
+ _context.next = 37;
20542
+ return api.createApiForNode('AssetHubPolkadot');
20543
+ case 37:
20544
+ assetHubApi = _context.sent;
20545
+ _context.next = 40;
20546
+ return getParaEthTransferFees(assetHubApi);
20547
+ case 40:
20548
+ _yield$getParaEthTran = _context.sent;
20549
+ _yield$getParaEthTran2 = _slicedToArray(_yield$getParaEthTran, 2);
20550
+ bridgeFee = _yield$getParaEthTran2[0];
20551
+ executionFee = _yield$getParaEthTran2[1];
20552
+ transferFee = (bridgeFee + executionFee).toString(); // Partially inspired by Moonbeam XCM-SDK
20553
+ // https://github.com/moonbeam-foundation/xcm-sdk/blob/ab835c15bf41612604b1c858d956a9f07705ed65/packages/sdk/src/contract/contracts/Xtokens/Xtokens.ts#L53
20554
+ createTx = function createTx(func, args) {
20555
+ if (isEthersContract(contract)) {
20556
+ return contract[func].apply(contract, _toConsumableArray(args));
20557
+ }
20558
+ return contract.write[func](args);
20559
+ };
20560
+ numberToHex32 = function numberToHex32(num) {
20561
+ return typeof num !== 'number' || isNaN(num) ? function () {
20562
+ throw new Error('Input must be a valid number');
20563
+ }() : "0x".concat((num >>> 0).toString(16).padStart(8, '0'));
20564
+ }; // Execute the custom XCM message with the precompile
20565
+ _context.next = 49;
20566
+ return createTx(isEthersSigner(signer) ? 'transferAssetsUsingTypeAndThenAddress((uint8,bytes[]),(address,uint256)[],uint8,uint8,uint8,bytes)' : 'transferAssetsUsingTypeAndThenAddress', [
20567
+ // This represents (1,X1(Parachain(1000)))
20568
+ [1, ['0x00' + numberToHex32(getParaId('AssetHubPolkadot')).slice(2)]],
20569
+ // Assets including fee and the ERC20 asset, with fee be the first
20570
+ [[XCDOT, transferFee], [ethAsset.assetId, currency.amount.toString()]],
20571
+ // The TransferType corresponding to asset being sent, 2 represents `DestinationReserve`
20572
+ 2,
20573
+ // index for the fee
20574
+ 0,
20575
+ // The TransferType corresponding to fee asset
20576
+ 2, customXcmOnDest]);
20577
+ case 49:
20578
+ tx = _context.sent;
20579
+ return _context.abrupt("return", _typeof(tx) === 'object' ? tx.hash : tx);
20580
+ case 51:
20581
+ case "end":
20582
+ return _context.stop();
20583
+ }
20584
+ }, _callee);
20585
+ }));
20586
+ return function transferMoonbeamToEth(_x) {
20587
+ return _ref2.apply(this, arguments);
20588
+ };
20589
+ }();
20590
+
20591
+ export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, ETHEREUM_JUNCTION, ETH_CHAIN_ID, Foreign, ForeignAbstract, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, _deepEqual as deepEqual, determineRelayChain, findAssetById, findAssetByMultiLocation, findAssetBySymbol, findBestMatches, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssetMultiLocation, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaEthTransferFees, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasDryRunSupport, hasSupportForAsset, isEthersContract, isEthersSigner, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, isSymbolSpecifier, normalizeSymbol, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferMoonbeamToEth, transferRelayToPara, validateAddress, verifyEdOnDestination };