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