@paraspell/sdk-core 8.5.3 → 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 +247 -599
- package/dist/index.d.ts +503 -519
- package/dist/index.mjs +247 -600
- package/package.json +11 -11
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 (
|
|
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(
|
|
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 (
|
|
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
|
-
|
|
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(
|
|
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 (
|
|
552
|
-
var i = e.call(t, r
|
|
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 (
|
|
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) :
|
|
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() :
|
|
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 (
|
|
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
|
|
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
|
{
|
|
@@ -6779,7 +6785,7 @@ var Basilisk$3 = {
|
|
|
6779
6785
|
relayChainAssetSymbol: "KSM",
|
|
6780
6786
|
nativeAssetSymbol: "BSX",
|
|
6781
6787
|
isEVM: false,
|
|
6782
|
-
supportsDryRunApi:
|
|
6788
|
+
supportsDryRunApi: true,
|
|
6783
6789
|
nativeAssets: [
|
|
6784
6790
|
{
|
|
6785
6791
|
symbol: "BSX",
|
|
@@ -10006,8 +10012,8 @@ var Shiden$3 = {
|
|
|
10006
10012
|
nativeAssets: [
|
|
10007
10013
|
{
|
|
10008
10014
|
symbol: "SDN",
|
|
10009
|
-
decimals: 18,
|
|
10010
10015
|
isNative: true,
|
|
10016
|
+
decimals: 18,
|
|
10011
10017
|
existentialDeposit: "1000000"
|
|
10012
10018
|
}
|
|
10013
10019
|
],
|
|
@@ -10350,6 +10356,12 @@ var AssetHubKusama$3 = {
|
|
|
10350
10356
|
symbol: "KSM",
|
|
10351
10357
|
isNative: true,
|
|
10352
10358
|
decimals: 12,
|
|
10359
|
+
multiLocation: {
|
|
10360
|
+
parents: 1,
|
|
10361
|
+
interior: {
|
|
10362
|
+
Here: null
|
|
10363
|
+
}
|
|
10364
|
+
},
|
|
10353
10365
|
existentialDeposit: "3333333"
|
|
10354
10366
|
},
|
|
10355
10367
|
{
|
|
@@ -11136,9 +11148,22 @@ var Nodle$3 = {
|
|
|
11136
11148
|
nativeAssets: [
|
|
11137
11149
|
{
|
|
11138
11150
|
symbol: "NODL",
|
|
11139
|
-
decimals: 11,
|
|
11140
11151
|
isNative: true,
|
|
11141
|
-
|
|
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
|
+
}
|
|
11142
11167
|
}
|
|
11143
11168
|
],
|
|
11144
11169
|
otherAssets: [
|
|
@@ -11481,7 +11506,7 @@ var Zeitgeist$3 = {
|
|
|
11481
11506
|
symbol: "ZTG",
|
|
11482
11507
|
isNative: true,
|
|
11483
11508
|
decimals: 10,
|
|
11484
|
-
existentialDeposit: "
|
|
11509
|
+
existentialDeposit: "5000000000",
|
|
11485
11510
|
multiLocation: {
|
|
11486
11511
|
parents: 1,
|
|
11487
11512
|
interior: {
|
|
@@ -12233,325 +12258,6 @@ var Ethereum = {
|
|
|
12233
12258
|
}
|
|
12234
12259
|
]
|
|
12235
12260
|
};
|
|
12236
|
-
var Khala$3 = {
|
|
12237
|
-
relayChainAssetSymbol: "KSM",
|
|
12238
|
-
nativeAssetSymbol: "PHA",
|
|
12239
|
-
isEVM: false,
|
|
12240
|
-
supportsDryRunApi: false,
|
|
12241
|
-
nativeAssets: [
|
|
12242
|
-
{
|
|
12243
|
-
symbol: "PHA",
|
|
12244
|
-
decimals: 12,
|
|
12245
|
-
isNative: true,
|
|
12246
|
-
existentialDeposit: "10000000000"
|
|
12247
|
-
}
|
|
12248
|
-
],
|
|
12249
|
-
otherAssets: [
|
|
12250
|
-
{
|
|
12251
|
-
assetId: "0",
|
|
12252
|
-
symbol: "KSM",
|
|
12253
|
-
decimals: 12,
|
|
12254
|
-
multiLocation: {
|
|
12255
|
-
parents: 1,
|
|
12256
|
-
interior: {
|
|
12257
|
-
Here: null
|
|
12258
|
-
}
|
|
12259
|
-
},
|
|
12260
|
-
existentialDeposit: "10000000000"
|
|
12261
|
-
},
|
|
12262
|
-
{
|
|
12263
|
-
assetId: "1",
|
|
12264
|
-
symbol: "KAR",
|
|
12265
|
-
decimals: 12,
|
|
12266
|
-
multiLocation: {
|
|
12267
|
-
parents: 1,
|
|
12268
|
-
interior: {
|
|
12269
|
-
X2: [
|
|
12270
|
-
{
|
|
12271
|
-
Parachain: 2000
|
|
12272
|
-
},
|
|
12273
|
-
{
|
|
12274
|
-
GeneralKey: {
|
|
12275
|
-
length: 2,
|
|
12276
|
-
data: "0x0080000000000000000000000000000000000000000000000000000000000000"
|
|
12277
|
-
}
|
|
12278
|
-
}
|
|
12279
|
-
]
|
|
12280
|
-
}
|
|
12281
|
-
},
|
|
12282
|
-
existentialDeposit: "10000000000"
|
|
12283
|
-
},
|
|
12284
|
-
{
|
|
12285
|
-
assetId: "4",
|
|
12286
|
-
symbol: "aUSD",
|
|
12287
|
-
decimals: 12,
|
|
12288
|
-
multiLocation: {
|
|
12289
|
-
parents: 1,
|
|
12290
|
-
interior: {
|
|
12291
|
-
X2: [
|
|
12292
|
-
{
|
|
12293
|
-
Parachain: 2000
|
|
12294
|
-
},
|
|
12295
|
-
{
|
|
12296
|
-
GeneralKey: {
|
|
12297
|
-
length: 2,
|
|
12298
|
-
data: "0x0081000000000000000000000000000000000000000000000000000000000000"
|
|
12299
|
-
}
|
|
12300
|
-
}
|
|
12301
|
-
]
|
|
12302
|
-
}
|
|
12303
|
-
},
|
|
12304
|
-
existentialDeposit: "10000000000"
|
|
12305
|
-
},
|
|
12306
|
-
{
|
|
12307
|
-
assetId: "2",
|
|
12308
|
-
symbol: "BNC",
|
|
12309
|
-
decimals: 12,
|
|
12310
|
-
multiLocation: {
|
|
12311
|
-
parents: 1,
|
|
12312
|
-
interior: {
|
|
12313
|
-
X2: [
|
|
12314
|
-
{
|
|
12315
|
-
Parachain: 2001
|
|
12316
|
-
},
|
|
12317
|
-
{
|
|
12318
|
-
GeneralKey: {
|
|
12319
|
-
length: 2,
|
|
12320
|
-
data: "0x0001000000000000000000000000000000000000000000000000000000000000"
|
|
12321
|
-
}
|
|
12322
|
-
}
|
|
12323
|
-
]
|
|
12324
|
-
}
|
|
12325
|
-
},
|
|
12326
|
-
existentialDeposit: "10000000000"
|
|
12327
|
-
},
|
|
12328
|
-
{
|
|
12329
|
-
assetId: "3",
|
|
12330
|
-
symbol: "ZLK",
|
|
12331
|
-
decimals: 18,
|
|
12332
|
-
multiLocation: {
|
|
12333
|
-
parents: 1,
|
|
12334
|
-
interior: {
|
|
12335
|
-
X2: [
|
|
12336
|
-
{
|
|
12337
|
-
Parachain: 2001
|
|
12338
|
-
},
|
|
12339
|
-
{
|
|
12340
|
-
GeneralKey: {
|
|
12341
|
-
length: 2,
|
|
12342
|
-
data: "0x0207000000000000000000000000000000000000000000000000000000000000"
|
|
12343
|
-
}
|
|
12344
|
-
}
|
|
12345
|
-
]
|
|
12346
|
-
}
|
|
12347
|
-
},
|
|
12348
|
-
existentialDeposit: "10000000000"
|
|
12349
|
-
},
|
|
12350
|
-
{
|
|
12351
|
-
assetId: "12",
|
|
12352
|
-
symbol: "SDN",
|
|
12353
|
-
decimals: 18,
|
|
12354
|
-
multiLocation: {
|
|
12355
|
-
parents: 1,
|
|
12356
|
-
interior: {
|
|
12357
|
-
X1: {
|
|
12358
|
-
Parachain: 2007
|
|
12359
|
-
}
|
|
12360
|
-
}
|
|
12361
|
-
},
|
|
12362
|
-
existentialDeposit: "10000000000000000"
|
|
12363
|
-
},
|
|
12364
|
-
{
|
|
12365
|
-
assetId: "6",
|
|
12366
|
-
symbol: "MOVR",
|
|
12367
|
-
decimals: 18,
|
|
12368
|
-
multiLocation: {
|
|
12369
|
-
parents: 1,
|
|
12370
|
-
interior: {
|
|
12371
|
-
X2: [
|
|
12372
|
-
{
|
|
12373
|
-
Parachain: 2023
|
|
12374
|
-
},
|
|
12375
|
-
{
|
|
12376
|
-
PalletInstance: 10
|
|
12377
|
-
}
|
|
12378
|
-
]
|
|
12379
|
-
}
|
|
12380
|
-
},
|
|
12381
|
-
existentialDeposit: "10000000000"
|
|
12382
|
-
},
|
|
12383
|
-
{
|
|
12384
|
-
assetId: "8",
|
|
12385
|
-
symbol: "KMA",
|
|
12386
|
-
decimals: 12,
|
|
12387
|
-
multiLocation: {
|
|
12388
|
-
parents: 1,
|
|
12389
|
-
interior: {
|
|
12390
|
-
X1: {
|
|
12391
|
-
Parachain: 2084
|
|
12392
|
-
}
|
|
12393
|
-
}
|
|
12394
|
-
},
|
|
12395
|
-
existentialDeposit: "10000000000"
|
|
12396
|
-
},
|
|
12397
|
-
{
|
|
12398
|
-
assetId: "7",
|
|
12399
|
-
symbol: "HKO",
|
|
12400
|
-
decimals: 12,
|
|
12401
|
-
multiLocation: {
|
|
12402
|
-
parents: 1,
|
|
12403
|
-
interior: {
|
|
12404
|
-
X2: [
|
|
12405
|
-
{
|
|
12406
|
-
Parachain: 2085
|
|
12407
|
-
},
|
|
12408
|
-
{
|
|
12409
|
-
GeneralKey: {
|
|
12410
|
-
length: 3,
|
|
12411
|
-
data: "0x484b4f0000000000000000000000000000000000000000000000000000000000"
|
|
12412
|
-
}
|
|
12413
|
-
}
|
|
12414
|
-
]
|
|
12415
|
-
}
|
|
12416
|
-
},
|
|
12417
|
-
existentialDeposit: "10000000000"
|
|
12418
|
-
},
|
|
12419
|
-
{
|
|
12420
|
-
assetId: "15",
|
|
12421
|
-
symbol: "PICA",
|
|
12422
|
-
decimals: 12,
|
|
12423
|
-
multiLocation: {
|
|
12424
|
-
parents: 1,
|
|
12425
|
-
interior: {
|
|
12426
|
-
X1: {
|
|
12427
|
-
Parachain: 2087
|
|
12428
|
-
}
|
|
12429
|
-
}
|
|
12430
|
-
},
|
|
12431
|
-
existentialDeposit: "10000000000"
|
|
12432
|
-
},
|
|
12433
|
-
{
|
|
12434
|
-
assetId: "5",
|
|
12435
|
-
symbol: "BSX",
|
|
12436
|
-
decimals: 12,
|
|
12437
|
-
multiLocation: {
|
|
12438
|
-
parents: 1,
|
|
12439
|
-
interior: {
|
|
12440
|
-
X2: [
|
|
12441
|
-
{
|
|
12442
|
-
Parachain: 2090
|
|
12443
|
-
},
|
|
12444
|
-
{
|
|
12445
|
-
GeneralKey: {
|
|
12446
|
-
length: 4,
|
|
12447
|
-
data: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
|
12448
|
-
}
|
|
12449
|
-
}
|
|
12450
|
-
]
|
|
12451
|
-
}
|
|
12452
|
-
},
|
|
12453
|
-
existentialDeposit: "10000000000",
|
|
12454
|
-
alias: "BSX1"
|
|
12455
|
-
},
|
|
12456
|
-
{
|
|
12457
|
-
assetId: "9",
|
|
12458
|
-
symbol: "BSX",
|
|
12459
|
-
decimals: 12,
|
|
12460
|
-
multiLocation: {
|
|
12461
|
-
parents: 1,
|
|
12462
|
-
interior: {
|
|
12463
|
-
X2: [
|
|
12464
|
-
{
|
|
12465
|
-
Parachain: 2090
|
|
12466
|
-
},
|
|
12467
|
-
{
|
|
12468
|
-
GeneralIndex: 0
|
|
12469
|
-
}
|
|
12470
|
-
]
|
|
12471
|
-
}
|
|
12472
|
-
},
|
|
12473
|
-
existentialDeposit: "10000000000",
|
|
12474
|
-
alias: "BSX2"
|
|
12475
|
-
},
|
|
12476
|
-
{
|
|
12477
|
-
assetId: "13",
|
|
12478
|
-
symbol: "NEER",
|
|
12479
|
-
decimals: 18,
|
|
12480
|
-
multiLocation: {
|
|
12481
|
-
parents: 1,
|
|
12482
|
-
interior: {
|
|
12483
|
-
X2: [
|
|
12484
|
-
{
|
|
12485
|
-
Parachain: 2096
|
|
12486
|
-
},
|
|
12487
|
-
{
|
|
12488
|
-
GeneralKey: {
|
|
12489
|
-
length: 9,
|
|
12490
|
-
data: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
|
12491
|
-
}
|
|
12492
|
-
}
|
|
12493
|
-
]
|
|
12494
|
-
}
|
|
12495
|
-
},
|
|
12496
|
-
existentialDeposit: "10000000000000000"
|
|
12497
|
-
},
|
|
12498
|
-
{
|
|
12499
|
-
assetId: "14",
|
|
12500
|
-
symbol: "BIT",
|
|
12501
|
-
decimals: 18,
|
|
12502
|
-
multiLocation: {
|
|
12503
|
-
parents: 1,
|
|
12504
|
-
interior: {
|
|
12505
|
-
X2: [
|
|
12506
|
-
{
|
|
12507
|
-
Parachain: 2096
|
|
12508
|
-
},
|
|
12509
|
-
{
|
|
12510
|
-
GeneralKey: {
|
|
12511
|
-
length: 9,
|
|
12512
|
-
data: "0x0200000000000000000000000000000000000000000000000000000000000000"
|
|
12513
|
-
}
|
|
12514
|
-
}
|
|
12515
|
-
]
|
|
12516
|
-
}
|
|
12517
|
-
},
|
|
12518
|
-
existentialDeposit: "10000000000000000"
|
|
12519
|
-
},
|
|
12520
|
-
{
|
|
12521
|
-
assetId: "11",
|
|
12522
|
-
symbol: "CRAB",
|
|
12523
|
-
decimals: 18,
|
|
12524
|
-
multiLocation: {
|
|
12525
|
-
parents: 1,
|
|
12526
|
-
interior: {
|
|
12527
|
-
X2: [
|
|
12528
|
-
{
|
|
12529
|
-
Parachain: 2105
|
|
12530
|
-
},
|
|
12531
|
-
{
|
|
12532
|
-
PalletInstance: 5
|
|
12533
|
-
}
|
|
12534
|
-
]
|
|
12535
|
-
}
|
|
12536
|
-
},
|
|
12537
|
-
existentialDeposit: "10000000000000000"
|
|
12538
|
-
},
|
|
12539
|
-
{
|
|
12540
|
-
assetId: "10",
|
|
12541
|
-
symbol: "TUR",
|
|
12542
|
-
decimals: 10,
|
|
12543
|
-
multiLocation: {
|
|
12544
|
-
parents: 1,
|
|
12545
|
-
interior: {
|
|
12546
|
-
X1: {
|
|
12547
|
-
Parachain: 2114
|
|
12548
|
-
}
|
|
12549
|
-
}
|
|
12550
|
-
},
|
|
12551
|
-
existentialDeposit: "100000000"
|
|
12552
|
-
}
|
|
12553
|
-
]
|
|
12554
|
-
};
|
|
12555
12261
|
var Mythos$3 = {
|
|
12556
12262
|
relayChainAssetSymbol: "DOT",
|
|
12557
12263
|
nativeAssetSymbol: "MYTH",
|
|
@@ -12642,7 +12348,7 @@ var assetsMapJson = {
|
|
|
12642
12348
|
Darwinia: Darwinia$3,
|
|
12643
12349
|
Hydration: Hydration$3,
|
|
12644
12350
|
Interlay: Interlay$3,
|
|
12645
|
-
|
|
12351
|
+
Heima: Heima$3,
|
|
12646
12352
|
Moonbeam: Moonbeam$3,
|
|
12647
12353
|
Parallel: Parallel$3,
|
|
12648
12354
|
AssetHubPolkadot: AssetHubPolkadot$3,
|
|
@@ -12685,7 +12391,6 @@ var assetsMapJson = {
|
|
|
12685
12391
|
Collectives: Collectives$3,
|
|
12686
12392
|
Phala: Phala$3,
|
|
12687
12393
|
Ethereum: Ethereum,
|
|
12688
|
-
Khala: Khala$3,
|
|
12689
12394
|
Mythos: Mythos$3,
|
|
12690
12395
|
Peaq: Peaq$3
|
|
12691
12396
|
};
|
|
@@ -12791,7 +12496,7 @@ var DOT_MULTILOCATION = {
|
|
|
12791
12496
|
/**
|
|
12792
12497
|
* Supported nodes excluding relay chains and Ethereum.
|
|
12793
12498
|
*/
|
|
12794
|
-
var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', '
|
|
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'];
|
|
12795
12500
|
/**
|
|
12796
12501
|
* Supported nodes including Ethereum.
|
|
12797
12502
|
*/
|
|
@@ -12906,7 +12611,7 @@ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
|
12906
12611
|
function NodeNotSupportedError(message) {
|
|
12907
12612
|
var _this;
|
|
12908
12613
|
_classCallCheck(this, NodeNotSupportedError);
|
|
12909
|
-
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !==
|
|
12614
|
+
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== void 0 ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
12910
12615
|
_this.name = 'NodeNotSupported';
|
|
12911
12616
|
return _this;
|
|
12912
12617
|
}
|
|
@@ -12928,7 +12633,7 @@ var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
|
12928
12633
|
function ScenarioNotSupportedError(node, scenario, message) {
|
|
12929
12634
|
var _this;
|
|
12930
12635
|
_classCallCheck(this, ScenarioNotSupportedError);
|
|
12931
|
-
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !==
|
|
12636
|
+
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== void 0 ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
12932
12637
|
_this.name = 'ScenarioNotSupported';
|
|
12933
12638
|
return _this;
|
|
12934
12639
|
}
|
|
@@ -12948,7 +12653,7 @@ var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
|
12948
12653
|
function IncompatibleNodesError(message) {
|
|
12949
12654
|
var _this;
|
|
12950
12655
|
_classCallCheck(this, IncompatibleNodesError);
|
|
12951
|
-
_this = _callSuper(this, IncompatibleNodesError, [message !== null && message !==
|
|
12656
|
+
_this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== void 0 ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
|
|
12952
12657
|
_this.name = 'IncompatibleNodes';
|
|
12953
12658
|
return _this;
|
|
12954
12659
|
}
|
|
@@ -13021,6 +12726,10 @@ var AssetHubPolkadot$2 = {
|
|
|
13021
12726
|
info: "PolkadotAssetHub",
|
|
13022
12727
|
paraId: 1000,
|
|
13023
12728
|
providers: [
|
|
12729
|
+
{
|
|
12730
|
+
name: "Blockops",
|
|
12731
|
+
endpoint: "wss://polkadot-assethub-rpc.blockops.network/ws"
|
|
12732
|
+
},
|
|
13024
12733
|
{
|
|
13025
12734
|
name: "Dwellir",
|
|
13026
12735
|
endpoint: "wss://asset-hub-polkadot-rpc.dwellir.com"
|
|
@@ -13348,8 +13057,8 @@ var Interlay$2 = {
|
|
|
13348
13057
|
}
|
|
13349
13058
|
]
|
|
13350
13059
|
};
|
|
13351
|
-
var
|
|
13352
|
-
name: "
|
|
13060
|
+
var Heima$2 = {
|
|
13061
|
+
name: "Heima",
|
|
13353
13062
|
info: "litentry",
|
|
13354
13063
|
paraId: 2013,
|
|
13355
13064
|
providers: [
|
|
@@ -13414,10 +13123,6 @@ var Parallel$2 = {
|
|
|
13414
13123
|
{
|
|
13415
13124
|
name: "Gatotech",
|
|
13416
13125
|
endpoint: "wss://parallel.gatotech.network"
|
|
13417
|
-
},
|
|
13418
|
-
{
|
|
13419
|
-
name: "Parallel",
|
|
13420
|
-
endpoint: "wss://polkadot-parallel-rpc.parallel.fi"
|
|
13421
13126
|
}
|
|
13422
13127
|
]
|
|
13423
13128
|
};
|
|
@@ -13571,10 +13276,6 @@ var Bajun$2 = {
|
|
|
13571
13276
|
{
|
|
13572
13277
|
name: "AjunaNetwork",
|
|
13573
13278
|
endpoint: "wss://rpc-para.bajun.network"
|
|
13574
|
-
},
|
|
13575
|
-
{
|
|
13576
|
-
name: "OnFinality",
|
|
13577
|
-
endpoint: "wss://bajun.api.onfinality.io/public-ws"
|
|
13578
13279
|
}
|
|
13579
13280
|
]
|
|
13580
13281
|
};
|
|
@@ -13659,10 +13360,6 @@ var Crab$2 = {
|
|
|
13659
13360
|
name: "Darwinia",
|
|
13660
13361
|
endpoint: "wss://crab-rpc.darwinia.network/"
|
|
13661
13362
|
},
|
|
13662
|
-
{
|
|
13663
|
-
name: "Dcdao",
|
|
13664
|
-
endpoint: "wss://crab-rpc.dcdao.box"
|
|
13665
|
-
},
|
|
13666
13363
|
{
|
|
13667
13364
|
name: "Dwellir",
|
|
13668
13365
|
endpoint: "wss://darwiniacrab-rpc.dwellir.com"
|
|
@@ -14065,10 +13762,6 @@ var Zeitgeist$2 = {
|
|
|
14065
13762
|
{
|
|
14066
13763
|
name: "OnFinality",
|
|
14067
13764
|
endpoint: "wss://zeitgeist.api.onfinality.io/public-ws"
|
|
14068
|
-
},
|
|
14069
|
-
{
|
|
14070
|
-
name: "ZeitgeistPM",
|
|
14071
|
-
endpoint: "wss://main.rpc.zeitgeist.pm/ws"
|
|
14072
13765
|
}
|
|
14073
13766
|
]
|
|
14074
13767
|
};
|
|
@@ -14115,33 +13808,6 @@ var Collectives$2 = {
|
|
|
14115
13808
|
}
|
|
14116
13809
|
]
|
|
14117
13810
|
};
|
|
14118
|
-
var Khala$2 = {
|
|
14119
|
-
name: "Khala Network",
|
|
14120
|
-
info: "khala",
|
|
14121
|
-
paraId: 2004,
|
|
14122
|
-
providers: [
|
|
14123
|
-
{
|
|
14124
|
-
name: "Dwellir",
|
|
14125
|
-
endpoint: "wss://khala-rpc.dwellir.com"
|
|
14126
|
-
},
|
|
14127
|
-
{
|
|
14128
|
-
name: "Helikon",
|
|
14129
|
-
endpoint: "wss://rpc.helikon.io/khala"
|
|
14130
|
-
},
|
|
14131
|
-
{
|
|
14132
|
-
name: "OnFinality",
|
|
14133
|
-
endpoint: "wss://khala.api.onfinality.io/public-ws"
|
|
14134
|
-
},
|
|
14135
|
-
{
|
|
14136
|
-
name: "Phala",
|
|
14137
|
-
endpoint: "wss://khala-api.phala.network/ws"
|
|
14138
|
-
},
|
|
14139
|
-
{
|
|
14140
|
-
name: "RadiumBlock",
|
|
14141
|
-
endpoint: "wss://khala.public.curie.radiumblock.co/ws"
|
|
14142
|
-
}
|
|
14143
|
-
]
|
|
14144
|
-
};
|
|
14145
13811
|
var Phala$2 = {
|
|
14146
13812
|
name: "Phala Network",
|
|
14147
13813
|
info: "phala",
|
|
@@ -14159,10 +13825,6 @@ var Phala$2 = {
|
|
|
14159
13825
|
name: "OnFinality",
|
|
14160
13826
|
endpoint: "wss://phala.api.onfinality.io/public-ws"
|
|
14161
13827
|
},
|
|
14162
|
-
{
|
|
14163
|
-
name: "Phala",
|
|
14164
|
-
endpoint: "wss://api.phala.network/ws"
|
|
14165
|
-
},
|
|
14166
13828
|
{
|
|
14167
13829
|
name: "RadiumBlock",
|
|
14168
13830
|
endpoint: "wss://phala.public.curie.radiumblock.co/ws"
|
|
@@ -14189,10 +13851,6 @@ var KiltSpiritnet$2 = {
|
|
|
14189
13851
|
info: "kilt",
|
|
14190
13852
|
paraId: 2086,
|
|
14191
13853
|
providers: [
|
|
14192
|
-
{
|
|
14193
|
-
name: "BOTLabs",
|
|
14194
|
-
endpoint: "wss://spiritnet.kilt.io/"
|
|
14195
|
-
},
|
|
14196
13854
|
{
|
|
14197
13855
|
name: "Dwellir",
|
|
14198
13856
|
endpoint: "wss://kilt-rpc.dwellir.com"
|
|
@@ -14204,6 +13862,10 @@ var KiltSpiritnet$2 = {
|
|
|
14204
13862
|
{
|
|
14205
13863
|
name: "IBP2",
|
|
14206
13864
|
endpoint: "wss://kilt.dotters.network"
|
|
13865
|
+
},
|
|
13866
|
+
{
|
|
13867
|
+
name: "KILT Foundation",
|
|
13868
|
+
endpoint: "wss://spiritnet.kilt.io/"
|
|
14207
13869
|
}
|
|
14208
13870
|
]
|
|
14209
13871
|
};
|
|
@@ -14227,6 +13889,14 @@ var Mythos$2 = {
|
|
|
14227
13889
|
name: "Helikon",
|
|
14228
13890
|
endpoint: "wss://rpc.helikon.io/mythos"
|
|
14229
13891
|
},
|
|
13892
|
+
{
|
|
13893
|
+
name: "IBP1",
|
|
13894
|
+
endpoint: "wss://mythos.ibp.network"
|
|
13895
|
+
},
|
|
13896
|
+
{
|
|
13897
|
+
name: "IBP2",
|
|
13898
|
+
endpoint: "wss://mythos.dotters.network"
|
|
13899
|
+
},
|
|
14230
13900
|
{
|
|
14231
13901
|
name: "parity",
|
|
14232
13902
|
endpoint: "wss://polkadot-mythos-rpc.polkadot.io"
|
|
@@ -14292,6 +13962,10 @@ var Polkadot$1 = {
|
|
|
14292
13962
|
name: "Dwellir Tunisia",
|
|
14293
13963
|
endpoint: "wss://polkadot-rpc-tn.dwellir.com"
|
|
14294
13964
|
},
|
|
13965
|
+
{
|
|
13966
|
+
name: "Helixstreet",
|
|
13967
|
+
endpoint: "wss://rpc-polkadot.helixstreet.io"
|
|
13968
|
+
},
|
|
14295
13969
|
{
|
|
14296
13970
|
name: "IBP1",
|
|
14297
13971
|
endpoint: "wss://rpc.ibp.network/polkadot"
|
|
@@ -14308,6 +13982,10 @@ var Polkadot$1 = {
|
|
|
14308
13982
|
name: "OnFinality",
|
|
14309
13983
|
endpoint: "wss://polkadot.api.onfinality.io/public-ws"
|
|
14310
13984
|
},
|
|
13985
|
+
{
|
|
13986
|
+
name: "Permanence DAO EU",
|
|
13987
|
+
endpoint: "wss://polkadot.rpc.permanence.io"
|
|
13988
|
+
},
|
|
14311
13989
|
{
|
|
14312
13990
|
name: "RadiumBlock",
|
|
14313
13991
|
endpoint: "wss://polkadot.public.curie.radiumblock.co/ws"
|
|
@@ -14343,6 +14021,10 @@ var Kusama$1 = {
|
|
|
14343
14021
|
name: "Dwellir Tunisia",
|
|
14344
14022
|
endpoint: "wss://kusama-rpc-tn.dwellir.com"
|
|
14345
14023
|
},
|
|
14024
|
+
{
|
|
14025
|
+
name: "Helixstreet",
|
|
14026
|
+
endpoint: "wss://rpc-kusama.helixstreet.io"
|
|
14027
|
+
},
|
|
14346
14028
|
{
|
|
14347
14029
|
name: "IBP1",
|
|
14348
14030
|
endpoint: "wss://rpc.ibp.network/kusama"
|
|
@@ -14386,7 +14068,7 @@ var configs = {
|
|
|
14386
14068
|
Darwinia: Darwinia$2,
|
|
14387
14069
|
Hydration: Hydration$2,
|
|
14388
14070
|
Interlay: Interlay$2,
|
|
14389
|
-
|
|
14071
|
+
Heima: Heima$2,
|
|
14390
14072
|
Moonbeam: Moonbeam$2,
|
|
14391
14073
|
Parallel: Parallel$2,
|
|
14392
14074
|
AssetHubKusama: AssetHubKusama$2,
|
|
@@ -14423,7 +14105,6 @@ var configs = {
|
|
|
14423
14105
|
Pendulum: Pendulum$2,
|
|
14424
14106
|
Zeitgeist: Zeitgeist$2,
|
|
14425
14107
|
Collectives: Collectives$2,
|
|
14426
|
-
Khala: Khala$2,
|
|
14427
14108
|
Phala: Phala$2,
|
|
14428
14109
|
Subsocial: Subsocial$2,
|
|
14429
14110
|
KiltSpiritnet: KiltSpiritnet$2,
|
|
@@ -14528,27 +14209,36 @@ var createMultiAsset = function createMultiAsset(version, amount, multiLocation)
|
|
|
14528
14209
|
}
|
|
14529
14210
|
};
|
|
14530
14211
|
};
|
|
14531
|
-
var
|
|
14212
|
+
var addXcmVersionHeader = function addXcmVersionHeader(obj, version) {
|
|
14213
|
+
return _defineProperty({}, version, obj);
|
|
14214
|
+
};
|
|
14215
|
+
var getCurrency = function getCurrency(amount, version, parents, overriddenCurrency) {
|
|
14532
14216
|
var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
|
|
14533
14217
|
if (!overriddenCurrency) {
|
|
14534
|
-
return
|
|
14218
|
+
return [createMultiAsset(version, amount, {
|
|
14535
14219
|
parents: parents,
|
|
14536
14220
|
interior: interior
|
|
14537
|
-
})]
|
|
14221
|
+
})];
|
|
14538
14222
|
}
|
|
14539
|
-
return isTMultiLocation(overriddenCurrency) ?
|
|
14540
|
-
|
|
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);
|
|
14541
14231
|
};
|
|
14542
14232
|
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
|
|
14543
|
-
var parentsResolved = parents !== null && parents !==
|
|
14544
|
-
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && 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 : {
|
|
14545
14235
|
Parachain: nodeId
|
|
14546
14236
|
});
|
|
14547
|
-
var isMultiLocationDestination =
|
|
14548
|
-
return
|
|
14237
|
+
var isMultiLocationDestination = isTMultiLocation(destination);
|
|
14238
|
+
return addXcmVersionHeader(isMultiLocationDestination ? destination : {
|
|
14549
14239
|
parents: parentsResolved,
|
|
14550
14240
|
interior: interior
|
|
14551
|
-
});
|
|
14241
|
+
}, version);
|
|
14552
14242
|
};
|
|
14553
14243
|
var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version, ecosystem, destination, nodeId) {
|
|
14554
14244
|
var multiLocation = {
|
|
@@ -14561,8 +14251,8 @@ var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version,
|
|
|
14561
14251
|
}]
|
|
14562
14252
|
}
|
|
14563
14253
|
};
|
|
14564
|
-
var isMultiLocationDestination =
|
|
14565
|
-
return
|
|
14254
|
+
var isMultiLocationDestination = isTMultiLocation(destination);
|
|
14255
|
+
return addXcmVersionHeader(isMultiLocationDestination ? destination : multiLocation, version);
|
|
14566
14256
|
};
|
|
14567
14257
|
var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(relayChain, multiLocation) {
|
|
14568
14258
|
var _NODE_NAMES_DOT_KSM$f;
|
|
@@ -14572,17 +14262,17 @@ var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(relay
|
|
|
14572
14262
|
}
|
|
14573
14263
|
var node = (_NODE_NAMES_DOT_KSM$f = NODE_NAMES_DOT_KSM.find(function (nodeName) {
|
|
14574
14264
|
return getParaId(nodeName) === parachainId && determineRelayChain(nodeName) === relayChain;
|
|
14575
|
-
})) !== null && _NODE_NAMES_DOT_KSM$f !==
|
|
14265
|
+
})) !== null && _NODE_NAMES_DOT_KSM$f !== void 0 ? _NODE_NAMES_DOT_KSM$f : null;
|
|
14576
14266
|
if (node === null) {
|
|
14577
14267
|
throw new Error('Node with specified paraId not found in destination multi location.');
|
|
14578
14268
|
}
|
|
14579
14269
|
return node;
|
|
14580
14270
|
};
|
|
14581
14271
|
var throwUnsupportedCurrency = function throwUnsupportedCurrency(currency, node) {
|
|
14582
|
-
var
|
|
14272
|
+
var _ref4 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
14583
14273
|
isDestination: false
|
|
14584
14274
|
},
|
|
14585
|
-
isDestination =
|
|
14275
|
+
isDestination = _ref4.isDestination;
|
|
14586
14276
|
if ('multilocation' in currency) {
|
|
14587
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), ")}."));
|
|
14588
14278
|
}
|
|
@@ -14605,7 +14295,7 @@ var buildMultiLocation = function buildMultiLocation(_ref) {
|
|
|
14605
14295
|
// If it is a native asset, search by symbol on AssetHub and use the multiLocation from there
|
|
14606
14296
|
var assetHubAsset = getOtherAssets(destination).find(function (ahAsset) {
|
|
14607
14297
|
var _ahAsset$symbol, _asset$symbol;
|
|
14608
|
-
return ((_ahAsset$symbol = ahAsset.symbol) === null || _ahAsset$symbol ===
|
|
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());
|
|
14609
14299
|
});
|
|
14610
14300
|
if (assetHubAsset === undefined) {
|
|
14611
14301
|
throw new InvalidCurrencyError("Asset ".concat(asset.symbol, " not found in AssetHub"));
|
|
@@ -14640,10 +14330,10 @@ var buildMultiLocation = function buildMultiLocation(_ref) {
|
|
|
14640
14330
|
}
|
|
14641
14331
|
};
|
|
14642
14332
|
var getModifiedCurrencySelection = function getModifiedCurrencySelection(version, input) {
|
|
14643
|
-
var
|
|
14333
|
+
var amount = input.asset.amount;
|
|
14644
14334
|
var multiLocation = buildMultiLocation(input);
|
|
14645
|
-
var multiAsset = createMultiAsset(version,
|
|
14646
|
-
return
|
|
14335
|
+
var multiAsset = createMultiAsset(version, amount, multiLocation);
|
|
14336
|
+
return addXcmVersionHeader(multiAsset, version);
|
|
14647
14337
|
};
|
|
14648
14338
|
|
|
14649
14339
|
var getCurrencySelection = function getCurrencySelection(input, isAssetHub, currencySelection) {
|
|
@@ -14651,7 +14341,7 @@ var getCurrencySelection = function getCurrencySelection(input, isAssetHub, curr
|
|
|
14651
14341
|
overriddenAsset = input.overriddenAsset;
|
|
14652
14342
|
var _getNode = getNode(origin),
|
|
14653
14343
|
version = _getNode.version;
|
|
14654
|
-
if (overriddenAsset !== undefined) return
|
|
14344
|
+
if (overriddenAsset !== undefined) return addXcmVersionHeader(overriddenAsset, version);
|
|
14655
14345
|
if (isAssetHub) {
|
|
14656
14346
|
return getModifiedCurrencySelection(version, input);
|
|
14657
14347
|
}
|
|
@@ -14703,14 +14393,15 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
14703
14393
|
var isBifrostOrigin = origin === 'BifrostPolkadot' || origin === 'BifrostKusama';
|
|
14704
14394
|
var isAssetHubDest = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
|
|
14705
14395
|
var isAstarOrShidenToRelay = scenario === 'ParaToRelay' && (origin === 'Astar' || origin === 'Shiden');
|
|
14396
|
+
var isTuring = origin === 'Turing';
|
|
14706
14397
|
var isMultiAsset = overriddenAsset && !isTMultiLocation(overriddenAsset);
|
|
14707
|
-
var shouldUseMultiasset = isAstarOrShidenToRelay || isAssetHubDest && !isBifrostOrigin || !!isMultiAsset;
|
|
14398
|
+
var shouldUseMultiasset = isTuring || isAstarOrShidenToRelay || isAssetHubDest && !isBifrostOrigin || !!isMultiAsset;
|
|
14708
14399
|
var modifiedCurrencySelection = getCurrencySelection(input, shouldUseMultiasset, currencySelection);
|
|
14709
14400
|
var section = shouldUseMultiasset ? isMultiAsset ? 'transfer_multiassets' : 'transfer_multiasset' : 'transfer';
|
|
14710
14401
|
var parameters = getXTokensParameters(shouldUseMultiasset, modifiedCurrencySelection, addressSelection, asset.amount, fees, overriddenAsset);
|
|
14711
14402
|
var call = {
|
|
14712
|
-
module: pallet !== null && pallet !==
|
|
14713
|
-
section: method !== null && method !==
|
|
14403
|
+
module: pallet !== null && pallet !== void 0 ? pallet : 'XTokens',
|
|
14404
|
+
section: method !== null && method !== void 0 ? method : section,
|
|
14714
14405
|
parameters: parameters
|
|
14715
14406
|
};
|
|
14716
14407
|
return api.callTxMethod(call);
|
|
@@ -14722,17 +14413,17 @@ var resolveParaId = function resolveParaId(paraId, destination) {
|
|
|
14722
14413
|
if (isTMultiLocation(destination) || isRelayChain(destination) || destination === 'Ethereum') {
|
|
14723
14414
|
return undefined;
|
|
14724
14415
|
}
|
|
14725
|
-
return paraId !== null && paraId !==
|
|
14416
|
+
return paraId !== null && paraId !== void 0 ? paraId : getParaId(destination);
|
|
14726
14417
|
};
|
|
14727
14418
|
|
|
14728
14419
|
var generateAddressPayload = function generateAddressPayload(api, scenario, pallet, recipientAddress, version, nodeId) {
|
|
14729
14420
|
var isMultiLocation = _typeof(recipientAddress) === 'object';
|
|
14730
14421
|
if (isMultiLocation) {
|
|
14731
|
-
return
|
|
14422
|
+
return addXcmVersionHeader(recipientAddress, version);
|
|
14732
14423
|
}
|
|
14733
14424
|
var isEthAddress = ethers.ethers.isAddress(recipientAddress);
|
|
14734
14425
|
if (scenario === 'ParaToRelay') {
|
|
14735
|
-
return
|
|
14426
|
+
return addXcmVersionHeader({
|
|
14736
14427
|
parents: pallet === 'XTokens' ? exports.Parents.ONE : exports.Parents.ZERO,
|
|
14737
14428
|
interior: createX1Payload(version, {
|
|
14738
14429
|
AccountId32: _objectSpread2(_objectSpread2({}, version === exports.Version.V1 && {
|
|
@@ -14741,10 +14432,10 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
|
|
|
14741
14432
|
id: api.accountToHex(recipientAddress)
|
|
14742
14433
|
})
|
|
14743
14434
|
})
|
|
14744
|
-
});
|
|
14435
|
+
}, version);
|
|
14745
14436
|
}
|
|
14746
14437
|
if (scenario === 'ParaToPara' && pallet === 'XTokens') {
|
|
14747
|
-
return
|
|
14438
|
+
return addXcmVersionHeader({
|
|
14748
14439
|
parents: exports.Parents.ONE,
|
|
14749
14440
|
interior: {
|
|
14750
14441
|
X2: [{
|
|
@@ -14763,10 +14454,10 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
|
|
|
14763
14454
|
})
|
|
14764
14455
|
}]
|
|
14765
14456
|
}
|
|
14766
|
-
});
|
|
14457
|
+
}, version);
|
|
14767
14458
|
}
|
|
14768
14459
|
if (scenario === 'ParaToPara' && pallet === 'PolkadotXcm') {
|
|
14769
|
-
return
|
|
14460
|
+
return addXcmVersionHeader({
|
|
14770
14461
|
parents: exports.Parents.ZERO,
|
|
14771
14462
|
interior: createX1Payload(version, isEthAddress ? {
|
|
14772
14463
|
AccountKey20: _objectSpread2(_objectSpread2({}, (version === exports.Version.V1 || version === exports.Version.V2) && {
|
|
@@ -14781,9 +14472,9 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
|
|
|
14781
14472
|
id: api.accountToHex(recipientAddress)
|
|
14782
14473
|
})
|
|
14783
14474
|
})
|
|
14784
|
-
});
|
|
14475
|
+
}, version);
|
|
14785
14476
|
}
|
|
14786
|
-
return
|
|
14477
|
+
return addXcmVersionHeader({
|
|
14787
14478
|
parents: exports.Parents.ZERO,
|
|
14788
14479
|
interior: createX1Payload(version, isEthAddress ? {
|
|
14789
14480
|
AccountKey20: {
|
|
@@ -14794,7 +14485,7 @@ var generateAddressPayload = function generateAddressPayload(api, scenario, pall
|
|
|
14794
14485
|
id: api.accountToHex(recipientAddress)
|
|
14795
14486
|
}
|
|
14796
14487
|
})
|
|
14797
|
-
});
|
|
14488
|
+
}, version);
|
|
14798
14489
|
};
|
|
14799
14490
|
|
|
14800
14491
|
var createCustomXcmOnDest = function createCustomXcmOnDest(_ref, version, messageId) {
|
|
@@ -14979,7 +14670,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
14979
14670
|
}
|
|
14980
14671
|
throw new Error('Sending assets to Polimec is supported only from AssetHubPolkadot');
|
|
14981
14672
|
case 6:
|
|
14982
|
-
versionOrDefault = version !== null && version !==
|
|
14673
|
+
versionOrDefault = version !== null && version !== void 0 ? version : this.version;
|
|
14983
14674
|
if (!(supportsXTokens(this) && this.canUseXTokens(options))) {
|
|
14984
14675
|
_context.next = 17;
|
|
14985
14676
|
break;
|
|
@@ -15069,15 +14760,15 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
15069
14760
|
key: "transferRelayToPara",
|
|
15070
14761
|
value: function transferRelayToPara(options) {
|
|
15071
14762
|
var _options$version = options.version,
|
|
15072
|
-
version = _options$version ===
|
|
14763
|
+
version = _options$version === void 0 ? exports.Version.V3 : _options$version,
|
|
15073
14764
|
pallet = options.pallet,
|
|
15074
14765
|
method = options.method;
|
|
15075
14766
|
var _this$getRelayToParaO = this.getRelayToParaOverrides(),
|
|
15076
14767
|
section = _this$getRelayToParaO.section,
|
|
15077
14768
|
includeFee = _this$getRelayToParaO.includeFee;
|
|
15078
14769
|
return {
|
|
15079
|
-
module: pallet !== null && pallet !==
|
|
15080
|
-
section: method !== null && method !==
|
|
14770
|
+
module: pallet !== null && pallet !== void 0 ? pallet : 'XcmPallet',
|
|
14771
|
+
section: method !== null && method !== void 0 ? method : section,
|
|
15081
14772
|
parameters: constructRelayToParaParameters(options, version, {
|
|
15082
14773
|
includeFee: includeFee
|
|
15083
14774
|
})
|
|
@@ -15125,8 +14816,8 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
15125
14816
|
}
|
|
15126
14817
|
throw new Error('Multi-location address is not supported for Ethereum transfers');
|
|
15127
14818
|
case 7:
|
|
15128
|
-
versionOrDefault = version !== null && version !==
|
|
15129
|
-
ethMultiAsset =
|
|
14819
|
+
versionOrDefault = version !== null && version !== void 0 ? version : exports.Version.V4;
|
|
14820
|
+
ethMultiAsset = createMultiAsset(versionOrDefault, asset.amount, asset.multiLocation);
|
|
15130
14821
|
_context2.next = 11;
|
|
15131
14822
|
return api.createApiForNode('AssetHubPolkadot');
|
|
15132
14823
|
case 11:
|
|
@@ -15155,7 +14846,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
15155
14846
|
section: 'transfer_assets_using_type_and_then',
|
|
15156
14847
|
parameters: {
|
|
15157
14848
|
dest: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('AssetHubPolkadot')),
|
|
15158
|
-
assets: _defineProperty({}, versionOrDefault, [
|
|
14849
|
+
assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, fee, DOT_MULTILOCATION), ethMultiAsset]),
|
|
15159
14850
|
assets_transfer_type: 'DestinationReserve',
|
|
15160
14851
|
remote_fees_id: _defineProperty({}, versionOrDefault, {
|
|
15161
14852
|
parents: exports.Parents.ONE,
|
|
@@ -15271,8 +14962,8 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
|
15271
14962
|
return asset.isFeeAsset;
|
|
15272
14963
|
});
|
|
15273
14964
|
var call = {
|
|
15274
|
-
module: pallet !== null && pallet !==
|
|
15275
|
-
section: method !== null && method !==
|
|
14965
|
+
module: pallet !== null && pallet !== void 0 ? pallet : 'PolkadotXcm',
|
|
14966
|
+
section: method !== null && method !== void 0 ? method : section,
|
|
15276
14967
|
parameters: _objectSpread2({
|
|
15277
14968
|
dest: header,
|
|
15278
14969
|
beneficiary: addressSelection,
|
|
@@ -15341,7 +15032,7 @@ var BifrostPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15341
15032
|
currencySelection: createCurrencySpec(asset.amount, this.version, asset.symbol === 'DOT' ? exports.Parents.ONE : exports.Parents.TWO, overriddenAsset, asset.symbol === 'WETH' ? {
|
|
15342
15033
|
X2: [ETHEREUM_JUNCTION, {
|
|
15343
15034
|
AccountKey20: {
|
|
15344
|
-
key: (_getAssetId = getAssetId('Ethereum', 'WETH')) !== null && _getAssetId !==
|
|
15035
|
+
key: (_getAssetId = getAssetId('Ethereum', 'WETH')) !== null && _getAssetId !== void 0 ? _getAssetId : ''
|
|
15345
15036
|
}
|
|
15346
15037
|
}]
|
|
15347
15038
|
} : undefined)
|
|
@@ -15450,13 +15141,13 @@ var Hydration$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15450
15141
|
scenario = input.scenario,
|
|
15451
15142
|
version = input.version,
|
|
15452
15143
|
destination = input.destination;
|
|
15453
|
-
var versionOrDefault = version !== null && version !==
|
|
15144
|
+
var versionOrDefault = version !== null && version !== void 0 ? version : exports.Version.V3;
|
|
15454
15145
|
var call = {
|
|
15455
15146
|
module: 'PolkadotXcm',
|
|
15456
15147
|
section: 'transfer_assets_using_type_and_then',
|
|
15457
15148
|
parameters: {
|
|
15458
15149
|
dest: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('AssetHubPolkadot')),
|
|
15459
|
-
assets: _defineProperty({}, versionOrDefault, [
|
|
15150
|
+
assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, asset.amount, DOT_MULTILOCATION)]),
|
|
15460
15151
|
assets_transfer_type: 'DestinationReserve',
|
|
15461
15152
|
remote_fees_id: _defineProperty({}, versionOrDefault, {
|
|
15462
15153
|
Concrete: {
|
|
@@ -15542,13 +15233,13 @@ var Interlay$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15542
15233
|
}]);
|
|
15543
15234
|
}(ParachainNode);
|
|
15544
15235
|
|
|
15545
|
-
var
|
|
15546
|
-
function
|
|
15547
|
-
_classCallCheck(this,
|
|
15548
|
-
return _callSuper(this,
|
|
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]);
|
|
15549
15240
|
}
|
|
15550
|
-
_inherits(
|
|
15551
|
-
return _createClass(
|
|
15241
|
+
_inherits(Heima, _ParachainNode);
|
|
15242
|
+
return _createClass(Heima, [{
|
|
15552
15243
|
key: "transferPolkadotXCM",
|
|
15553
15244
|
value: function transferPolkadotXCM(input) {
|
|
15554
15245
|
var scenario = input.scenario,
|
|
@@ -15593,7 +15284,7 @@ var Moonbeam$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15593
15284
|
var asset = input.asset,
|
|
15594
15285
|
scenario = input.scenario,
|
|
15595
15286
|
_input$version = input.version,
|
|
15596
|
-
version = _input$version ===
|
|
15287
|
+
version = _input$version === void 0 ? this.version : _input$version,
|
|
15597
15288
|
overriddenAsset = input.overriddenAsset;
|
|
15598
15289
|
var multiLocation = this.getJunctions(asset, scenario);
|
|
15599
15290
|
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
|
|
@@ -15816,7 +15507,7 @@ var Moonriver$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15816
15507
|
var asset = input.asset,
|
|
15817
15508
|
scenario = input.scenario,
|
|
15818
15509
|
_input$version = input.version,
|
|
15819
|
-
version = _input$version ===
|
|
15510
|
+
version = _input$version === void 0 ? this.version : _input$version,
|
|
15820
15511
|
overriddenAsset = input.overriddenAsset;
|
|
15821
15512
|
var multiLocation = this.getJunctions(asset, scenario);
|
|
15822
15513
|
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
|
|
@@ -15958,7 +15649,7 @@ var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api
|
|
|
15958
15649
|
return _defineProperty({}, exports.Version.V4, address);
|
|
15959
15650
|
}
|
|
15960
15651
|
var isEthAddress = ethers.ethers.isAddress(address);
|
|
15961
|
-
return
|
|
15652
|
+
return addXcmVersionHeader({
|
|
15962
15653
|
parents: exports.Parents.ZERO,
|
|
15963
15654
|
interior: {
|
|
15964
15655
|
X1: [isEthAddress ? {
|
|
@@ -15972,7 +15663,7 @@ var generateAddressMultiLocationV4 = function generateAddressMultiLocationV4(api
|
|
|
15972
15663
|
}
|
|
15973
15664
|
}]
|
|
15974
15665
|
}
|
|
15975
|
-
});
|
|
15666
|
+
}, exports.Version.V4);
|
|
15976
15667
|
};
|
|
15977
15668
|
|
|
15978
15669
|
var createCustomXcmToBifrost = function createCustomXcmToBifrost(_ref, version) {
|
|
@@ -16005,13 +15696,13 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16005
15696
|
if (!asset.multiLocation) {
|
|
16006
15697
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multiLocation"));
|
|
16007
15698
|
}
|
|
16008
|
-
var versionOrDefault = version !== null && version !==
|
|
15699
|
+
var versionOrDefault = version !== null && version !== void 0 ? version : _this.version;
|
|
16009
15700
|
var call = {
|
|
16010
15701
|
module: 'PolkadotXcm',
|
|
16011
15702
|
section: 'transfer_assets_using_type_and_then',
|
|
16012
15703
|
parameters: {
|
|
16013
15704
|
dest: _this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, getParaId('BifrostPolkadot')),
|
|
16014
|
-
assets: _defineProperty({}, versionOrDefault, [
|
|
15705
|
+
assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, asset.amount, asset.multiLocation)]),
|
|
16015
15706
|
assets_transfer_type: 'LocalReserve',
|
|
16016
15707
|
remote_fees_id: _defineProperty({}, versionOrDefault, {
|
|
16017
15708
|
Concrete: asset.multiLocation
|
|
@@ -16030,14 +15721,14 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16030
15721
|
key: "handleBridgeTransfer",
|
|
16031
15722
|
value: function handleBridgeTransfer(input, targetChain) {
|
|
16032
15723
|
var _input$asset$symbol, _input$asset$symbol2, _input$asset$symbol3, _input$asset$symbol4;
|
|
16033
|
-
if (targetChain === 'Kusama' && ((_input$asset$symbol = input.asset.symbol) === null || _input$asset$symbol ===
|
|
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') {
|
|
16034
15725
|
var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
16035
15726
|
header: createBridgePolkadotXcmDest(exports.Version.V4, targetChain, input.destination, input.paraIdTo),
|
|
16036
15727
|
addressSelection: generateAddressMultiLocationV4(input.api, input.address),
|
|
16037
15728
|
currencySelection: createBridgeCurrencySpec(input.asset.amount, targetChain)
|
|
16038
15729
|
});
|
|
16039
15730
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited');
|
|
16040
|
-
} else if (targetChain === 'Polkadot' && ((_input$asset$symbol3 = input.asset.symbol) === null || _input$asset$symbol3 ===
|
|
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') {
|
|
16041
15732
|
var _modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
16042
15733
|
header: createBridgePolkadotXcmDest(exports.Version.V3, targetChain, input.destination, input.paraIdTo),
|
|
16043
15734
|
currencySelection: createCurrencySpec(input.asset.amount, exports.Version.V3, exports.Parents.ONE, input.overriddenAsset)
|
|
@@ -16094,7 +15785,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16094
15785
|
var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
16095
15786
|
header: this.createPolkadotXcmHeader(scenario, version, destination, paraId),
|
|
16096
15787
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, version, paraId),
|
|
16097
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== null && overriddenAsset !==
|
|
15788
|
+
currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== null && overriddenAsset !== void 0 ? overriddenAsset : customMultiLocation)
|
|
16098
15789
|
});
|
|
16099
15790
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'limited_teleport_assets', 'Unlimited');
|
|
16100
15791
|
}
|
|
@@ -16110,9 +15801,9 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16110
15801
|
api = input.api,
|
|
16111
15802
|
version = input.version,
|
|
16112
15803
|
address = input.address;
|
|
16113
|
-
if ((((_asset$symbol = asset.symbol) === null || _asset$symbol ===
|
|
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') {
|
|
16114
15805
|
var _input$version;
|
|
16115
|
-
var versionOrDefault = (_input$version = input.version) !== null && _input$version !==
|
|
15806
|
+
var versionOrDefault = (_input$version = input.version) !== null && _input$version !== void 0 ? _input$version : exports.Version.V2;
|
|
16116
15807
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
16117
15808
|
header: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, paraIdTo),
|
|
16118
15809
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, versionOrDefault, paraIdTo),
|
|
@@ -16120,7 +15811,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16120
15811
|
});
|
|
16121
15812
|
}
|
|
16122
15813
|
if ((destination === 'Hydration' || destination === 'Polimec' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && asset.symbol === 'DOT') {
|
|
16123
|
-
var _versionOrDefault = version !== null && version !==
|
|
15814
|
+
var _versionOrDefault = version !== null && version !== void 0 ? version : this.version;
|
|
16124
15815
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
16125
15816
|
currencySelection: _superPropGet(AssetHubPolkadot, "createCurrencySpec", this, 3)([asset.amount, 'ParaToRelay', _versionOrDefault, asset, overriddenAsset])
|
|
16126
15817
|
});
|
|
@@ -16439,44 +16130,10 @@ var Darwinia$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16439
16130
|
}
|
|
16440
16131
|
_inherits(Darwinia, _ParachainNode);
|
|
16441
16132
|
return _createClass(Darwinia, [{
|
|
16442
|
-
key: "getCurrencySelection",
|
|
16443
|
-
value: function getCurrencySelection(asset) {
|
|
16444
|
-
if (asset.symbol === this.getNativeAssetSymbol()) {
|
|
16445
|
-
return 'SelfReserve';
|
|
16446
|
-
}
|
|
16447
|
-
if (!isForeignAsset(asset) || !asset.assetId) {
|
|
16448
|
-
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
16449
|
-
}
|
|
16450
|
-
return {
|
|
16451
|
-
ForeignAsset: BigInt(asset.assetId)
|
|
16452
|
-
};
|
|
16453
|
-
}
|
|
16454
|
-
}, {
|
|
16455
|
-
key: "transferXTokens",
|
|
16456
|
-
value: function transferXTokens(input) {
|
|
16457
|
-
var asset = input.asset;
|
|
16458
|
-
var currencySelection = this.getCurrencySelection(asset);
|
|
16459
|
-
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
16460
|
-
}
|
|
16461
|
-
}, {
|
|
16462
16133
|
key: "transferRelayToPara",
|
|
16463
16134
|
value: function transferRelayToPara() {
|
|
16464
16135
|
throw new NodeNotSupportedError();
|
|
16465
16136
|
}
|
|
16466
|
-
}, {
|
|
16467
|
-
key: "createCurrencySpec",
|
|
16468
|
-
value: function createCurrencySpec$1(amount, scenario, version, _asset, overridedMultiLocation) {
|
|
16469
|
-
if (scenario === 'ParaToPara') {
|
|
16470
|
-
var interior = {
|
|
16471
|
-
X1: {
|
|
16472
|
-
PalletInstance: 5
|
|
16473
|
-
}
|
|
16474
|
-
};
|
|
16475
|
-
return createCurrencySpec(amount, version, exports.Parents.ZERO, overridedMultiLocation, interior);
|
|
16476
|
-
} else {
|
|
16477
|
-
return _superPropGet(Darwinia, "createCurrencySpec", this, 3)([amount, scenario, version, undefined, overridedMultiLocation]);
|
|
16478
|
-
}
|
|
16479
|
-
}
|
|
16480
16137
|
}]);
|
|
16481
16138
|
}(ParachainNode);
|
|
16482
16139
|
|
|
@@ -16502,8 +16159,17 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16502
16159
|
}
|
|
16503
16160
|
}, {
|
|
16504
16161
|
key: "createCurrencySpec",
|
|
16505
|
-
value: function createCurrencySpec(amount, scenario, version,
|
|
16506
|
-
|
|
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
|
+
}
|
|
16507
16173
|
}
|
|
16508
16174
|
}]);
|
|
16509
16175
|
}(ParachainNode);
|
|
@@ -16705,11 +16371,7 @@ var Collectives$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
16705
16371
|
}, {
|
|
16706
16372
|
key: "createCurrencySpec",
|
|
16707
16373
|
value: function createCurrencySpec(amount, scenario, version, asset) {
|
|
16708
|
-
|
|
16709
|
-
return {};
|
|
16710
|
-
} else {
|
|
16711
|
-
return _superPropGet(Collectives, "createCurrencySpec", this, 3)([amount, scenario, version, asset]);
|
|
16712
|
-
}
|
|
16374
|
+
return _superPropGet(Collectives, "createCurrencySpec", this, 3)([amount, scenario, version, asset]);
|
|
16713
16375
|
}
|
|
16714
16376
|
}]);
|
|
16715
16377
|
}(ParachainNode);
|
|
@@ -16766,7 +16428,6 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
16766
16428
|
key: "transferXTransfer",
|
|
16767
16429
|
value: function transferXTransfer(input) {
|
|
16768
16430
|
var api = input.api,
|
|
16769
|
-
origin = input.origin,
|
|
16770
16431
|
destination = input.destination,
|
|
16771
16432
|
asset = input.asset,
|
|
16772
16433
|
overriddenAsset = input.overriddenAsset,
|
|
@@ -16776,13 +16437,13 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
16776
16437
|
if (isMultiLocationDestination) {
|
|
16777
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.');
|
|
16778
16439
|
}
|
|
16779
|
-
var currencySpec =
|
|
16440
|
+
var currencySpec = getCurrency(asset.amount, exports.Version.V1, exports.Parents.ZERO, overriddenAsset)[0];
|
|
16780
16441
|
var dest = getDestination(input);
|
|
16781
16442
|
var section = 'transfer';
|
|
16782
|
-
var destWeight =
|
|
16443
|
+
var destWeight = determineDestWeight(destination);
|
|
16783
16444
|
var call = {
|
|
16784
|
-
module: pallet !== null && pallet !==
|
|
16785
|
-
section: method !== null && method !==
|
|
16445
|
+
module: pallet !== null && pallet !== void 0 ? pallet : 'XTransfer',
|
|
16446
|
+
section: method !== null && method !== void 0 ? method : section,
|
|
16786
16447
|
parameters: {
|
|
16787
16448
|
asset: currencySpec,
|
|
16788
16449
|
dest: dest,
|
|
@@ -16794,24 +16455,6 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
16794
16455
|
}]);
|
|
16795
16456
|
}();
|
|
16796
16457
|
|
|
16797
|
-
var Khala$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
16798
|
-
function Khala() {
|
|
16799
|
-
_classCallCheck(this, Khala);
|
|
16800
|
-
return _callSuper(this, Khala, ['Khala', 'khala', 'kusama', exports.Version.V3]);
|
|
16801
|
-
}
|
|
16802
|
-
_inherits(Khala, _ParachainNode);
|
|
16803
|
-
return _createClass(Khala, [{
|
|
16804
|
-
key: "transferXTransfer",
|
|
16805
|
-
value: function transferXTransfer(input) {
|
|
16806
|
-
var asset = input.asset;
|
|
16807
|
-
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
16808
|
-
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(asset.symbol));
|
|
16809
|
-
}
|
|
16810
|
-
return XTransferTransferImpl.transferXTransfer(input);
|
|
16811
|
-
}
|
|
16812
|
-
}]);
|
|
16813
|
-
}(ParachainNode);
|
|
16814
|
-
|
|
16815
16458
|
var Phala$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
16816
16459
|
function Phala() {
|
|
16817
16460
|
_classCallCheck(this, Phala);
|
|
@@ -17074,12 +16717,12 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
17074
16717
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17075
16718
|
while (1) switch (_context.prev = _context.next) {
|
|
17076
16719
|
case 0:
|
|
17077
|
-
api = input.api, _input$version = input.version, version = _input$version ===
|
|
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;
|
|
17078
16721
|
if (!(scenario === 'ParaToPara' && destination === 'AssetHubPolkadot')) {
|
|
17079
16722
|
_context.next = 4;
|
|
17080
16723
|
break;
|
|
17081
16724
|
}
|
|
17082
|
-
currencySelection =
|
|
16725
|
+
currencySelection = addXcmVersionHeader([createMultiAsset(version, asset.amount.toString(), this.getAssetMultiLocation(input.asset))], version);
|
|
17083
16726
|
return _context.abrupt("return", Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
|
|
17084
16727
|
currencySelection: currencySelection
|
|
17085
16728
|
}), 'transfer_assets', 'Unlimited')));
|
|
@@ -17090,13 +16733,13 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
17090
16733
|
}
|
|
17091
16734
|
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
17092
16735
|
case 6:
|
|
17093
|
-
versionOrDefault = version !== null && version !==
|
|
16736
|
+
versionOrDefault = version !== null && version !== void 0 ? version : exports.Version.V3;
|
|
17094
16737
|
call = {
|
|
17095
16738
|
module: 'PolkadotXcm',
|
|
17096
16739
|
section: 'transfer_assets_using_type_and_then',
|
|
17097
16740
|
parameters: {
|
|
17098
16741
|
dest: this.createPolkadotXcmHeader('RelayToPara', versionOrDefault, destination, getParaId('AssetHubPolkadot')),
|
|
17099
|
-
assets: _defineProperty({}, versionOrDefault, [
|
|
16742
|
+
assets: _defineProperty({}, versionOrDefault, [createMultiAsset(versionOrDefault, asset.amount, DOT_MULTILOCATION)]),
|
|
17100
16743
|
assets_transfer_type: 'Teleport',
|
|
17101
16744
|
remote_fees_id: _defineProperty({}, versionOrDefault, {
|
|
17102
16745
|
Concrete: {
|
|
@@ -17125,7 +16768,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
17125
16768
|
key: "transferRelayToPara",
|
|
17126
16769
|
value: function transferRelayToPara(options) {
|
|
17127
16770
|
var _options$version = options.version,
|
|
17128
|
-
version = _options$version ===
|
|
16771
|
+
version = _options$version === void 0 ? exports.Version.V3 : _options$version,
|
|
17129
16772
|
api = options.api,
|
|
17130
16773
|
asset = options.asset,
|
|
17131
16774
|
address = options.address,
|
|
@@ -17136,7 +16779,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
17136
16779
|
section: 'transfer_assets_using_type_and_then',
|
|
17137
16780
|
parameters: {
|
|
17138
16781
|
dest: this.createPolkadotXcmHeader('RelayToPara', version, destination, getParaId('AssetHubPolkadot')),
|
|
17139
|
-
assets: _defineProperty({}, version, [
|
|
16782
|
+
assets: _defineProperty({}, version, [createMultiAsset(version, asset.amount, DOT_MULTILOCATION)]),
|
|
17140
16783
|
assets_transfer_type: 'Teleport',
|
|
17141
16784
|
remote_fees_id: _defineProperty({}, version, {
|
|
17142
16785
|
Concrete: {
|
|
@@ -17170,7 +16813,7 @@ var nodes = function nodes() {
|
|
|
17170
16813
|
Darwinia: new Darwinia$1(),
|
|
17171
16814
|
Hydration: new Hydration$1(),
|
|
17172
16815
|
Interlay: new Interlay$1(),
|
|
17173
|
-
|
|
16816
|
+
Heima: new Heima$1(),
|
|
17174
16817
|
Moonbeam: new Moonbeam$1(),
|
|
17175
16818
|
Parallel: new Parallel$1(),
|
|
17176
16819
|
AssetHubKusama: new AssetHubKusama$1(),
|
|
@@ -17205,7 +16848,6 @@ var nodes = function nodes() {
|
|
|
17205
16848
|
Pendulum: new Pendulum$1(),
|
|
17206
16849
|
Zeitgeist: new Zeitgeist$1(),
|
|
17207
16850
|
Collectives: new Collectives$1(),
|
|
17208
|
-
Khala: new Khala$1(),
|
|
17209
16851
|
Phala: new Phala$1(),
|
|
17210
16852
|
Subsocial: new Subsocial$1(),
|
|
17211
16853
|
KiltSpiritnet: new KiltSpiritnet$1(),
|
|
@@ -17259,7 +16901,7 @@ var findBestMatches = function findBestMatches(assets, value) {
|
|
|
17259
16901
|
// Case-insensitive match
|
|
17260
16902
|
matches = assets.filter(function (asset) {
|
|
17261
16903
|
var _asset$property;
|
|
17262
|
-
return ((_asset$property = asset[property]) === null || _asset$property ===
|
|
16904
|
+
return ((_asset$property = asset[property]) === null || _asset$property === void 0 ? void 0 : _asset$property.toLowerCase()) === lowerValue;
|
|
17263
16905
|
});
|
|
17264
16906
|
return matches;
|
|
17265
16907
|
};
|
|
@@ -17438,7 +17080,7 @@ var sanitizeMultiLocation = function sanitizeMultiLocation(multiLocation) {
|
|
|
17438
17080
|
var compareMultiLocations = function compareMultiLocations(input, asset) {
|
|
17439
17081
|
var _asset$multiLocation;
|
|
17440
17082
|
var sanitizedInput = sanitizeMultiLocation(input);
|
|
17441
|
-
var assetMLStr = JSON.stringify((_asset$multiLocation = asset.multiLocation) !== null && _asset$multiLocation !==
|
|
17083
|
+
var assetMLStr = JSON.stringify((_asset$multiLocation = asset.multiLocation) !== null && _asset$multiLocation !== void 0 ? _asset$multiLocation : '');
|
|
17442
17084
|
var sanitizedAssetMLStr = sanitizeMultiLocation(assetMLStr);
|
|
17443
17085
|
return (
|
|
17444
17086
|
// Compare sanitized input with sanitized asset values
|
|
@@ -17493,25 +17135,25 @@ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency, destina
|
|
|
17493
17135
|
// If not found, search Ethereum assets directly
|
|
17494
17136
|
if (isEthereumDestination) {
|
|
17495
17137
|
var _findAssetBySymbol;
|
|
17496
|
-
asset = (_findAssetBySymbol = findAssetBySymbol(node, destination, getFilteredEthereumAssets(), nativeAssets, currency.symbol)) !== null && _findAssetBySymbol !==
|
|
17138
|
+
asset = (_findAssetBySymbol = findAssetBySymbol(node, destination, getFilteredEthereumAssets(), nativeAssets, currency.symbol)) !== null && _findAssetBySymbol !== void 0 ? _findAssetBySymbol : findAssetBySymbol(node, destination, getEthereumAssets(), nativeAssets, currency.symbol);
|
|
17497
17139
|
} else {
|
|
17498
17140
|
asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, currency.symbol);
|
|
17499
17141
|
}
|
|
17500
17142
|
} else if ('multilocation' in currency && !isOverrideMultiLocationSpecifier(currency.multilocation)) {
|
|
17501
17143
|
var _findAssetByMultiLoca;
|
|
17502
17144
|
var resolvedAssets = isEthereumDestination ? getEthereumAssets() : otherAssets;
|
|
17503
|
-
asset = (_findAssetByMultiLoca = findAssetByMultiLocation(resolvedAssets, currency.multilocation)) !== null && _findAssetByMultiLoca !==
|
|
17145
|
+
asset = (_findAssetByMultiLoca = findAssetByMultiLocation(resolvedAssets, currency.multilocation)) !== null && _findAssetByMultiLoca !== void 0 ? _findAssetByMultiLoca : findAssetByMultiLocation(nativeAssets, currency.multilocation);
|
|
17504
17146
|
} else if ('id' in currency) {
|
|
17505
17147
|
if (isEthereumDestination) {
|
|
17506
17148
|
var _findAssetById;
|
|
17507
|
-
asset = (_findAssetById = findAssetById(getFilteredEthereumAssets(), currency.id)) !== null && _findAssetById !==
|
|
17149
|
+
asset = (_findAssetById = findAssetById(getFilteredEthereumAssets(), currency.id)) !== null && _findAssetById !== void 0 ? _findAssetById : findAssetById(getEthereumAssets(), currency.id);
|
|
17508
17150
|
} else {
|
|
17509
17151
|
asset = findAssetById(otherAssets, currency.id);
|
|
17510
17152
|
}
|
|
17511
17153
|
} else {
|
|
17512
17154
|
throw new Error('Invalid currency input');
|
|
17513
17155
|
}
|
|
17514
|
-
return asset !== null && asset !==
|
|
17156
|
+
return asset !== null && asset !== void 0 ? asset : null;
|
|
17515
17157
|
};
|
|
17516
17158
|
|
|
17517
17159
|
var getAssetMultiLocation = function getAssetMultiLocation(node, currency) {
|
|
@@ -17536,13 +17178,13 @@ var getExistentialDeposit = function getExistentialDeposit(node, currency) {
|
|
|
17536
17178
|
var assetsObject = getAssetsObject(node);
|
|
17537
17179
|
if (!currency) {
|
|
17538
17180
|
var _assetsObject$nativeA;
|
|
17539
|
-
return (_assetsObject$nativeA = assetsObject.nativeAssets[0].existentialDeposit) !== null && _assetsObject$nativeA !==
|
|
17181
|
+
return (_assetsObject$nativeA = assetsObject.nativeAssets[0].existentialDeposit) !== null && _assetsObject$nativeA !== void 0 ? _assetsObject$nativeA : null;
|
|
17540
17182
|
}
|
|
17541
|
-
var asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !==
|
|
17183
|
+
var asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
17542
17184
|
if (!asset) {
|
|
17543
17185
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency), " not found on ").concat(node));
|
|
17544
17186
|
}
|
|
17545
|
-
return (_asset$existentialDep = asset.existentialDeposit) !== null && _asset$existentialDep !==
|
|
17187
|
+
return (_asset$existentialDep = asset.existentialDeposit) !== null && _asset$existentialDep !== void 0 ? _asset$existentialDep : null;
|
|
17546
17188
|
};
|
|
17547
17189
|
|
|
17548
17190
|
var assetsMap = assetsMapJson;
|
|
@@ -17686,7 +17328,7 @@ var getAssetDecimals = function getAssetDecimals(node, symbol) {
|
|
|
17686
17328
|
var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
|
|
17687
17329
|
return o.symbol === symbol;
|
|
17688
17330
|
});
|
|
17689
|
-
return (asset === null || asset ===
|
|
17331
|
+
return (asset === null || asset === void 0 ? void 0 : asset.decimals) !== undefined ? asset.decimals : null;
|
|
17690
17332
|
};
|
|
17691
17333
|
/**
|
|
17692
17334
|
* Retrieves the node name corresponding to a specified parachain ID.
|
|
@@ -17704,7 +17346,10 @@ var getTNode = function getTNode(paraId, ecosystem) {
|
|
|
17704
17346
|
}
|
|
17705
17347
|
return (_NODE_NAMES_DOT_KSM$f = NODE_NAMES_DOT_KSM.find(function (nodeName) {
|
|
17706
17348
|
return getNode(nodeName).type === ecosystem && getParaId(nodeName) === paraId;
|
|
17707
|
-
})) !== null && _NODE_NAMES_DOT_KSM$f !==
|
|
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;
|
|
17708
17353
|
};
|
|
17709
17354
|
|
|
17710
17355
|
var AssetHubPolkadot = {
|
|
@@ -17804,15 +17449,11 @@ var ComposableFinance = {
|
|
|
17804
17449
|
]
|
|
17805
17450
|
};
|
|
17806
17451
|
var Darwinia = {
|
|
17807
|
-
defaultPallet: "
|
|
17452
|
+
defaultPallet: "PolkadotXcm",
|
|
17808
17453
|
supportedPallets: [
|
|
17809
17454
|
{
|
|
17810
17455
|
name: "PolkadotXcm",
|
|
17811
17456
|
index: 33
|
|
17812
|
-
},
|
|
17813
|
-
{
|
|
17814
|
-
name: "XTokens",
|
|
17815
|
-
index: 46
|
|
17816
17457
|
}
|
|
17817
17458
|
]
|
|
17818
17459
|
};
|
|
@@ -17842,7 +17483,7 @@ var Interlay = {
|
|
|
17842
17483
|
}
|
|
17843
17484
|
]
|
|
17844
17485
|
};
|
|
17845
|
-
var
|
|
17486
|
+
var Heima = {
|
|
17846
17487
|
defaultPallet: "PolkadotXcm",
|
|
17847
17488
|
supportedPallets: [
|
|
17848
17489
|
{
|
|
@@ -18222,19 +17863,6 @@ var Collectives = {
|
|
|
18222
17863
|
}
|
|
18223
17864
|
]
|
|
18224
17865
|
};
|
|
18225
|
-
var Khala = {
|
|
18226
|
-
defaultPallet: "XTransfer",
|
|
18227
|
-
supportedPallets: [
|
|
18228
|
-
{
|
|
18229
|
-
name: "PolkadotXcm",
|
|
18230
|
-
index: 33
|
|
18231
|
-
},
|
|
18232
|
-
{
|
|
18233
|
-
name: "XTransfer",
|
|
18234
|
-
index: 82
|
|
18235
|
-
}
|
|
18236
|
-
]
|
|
18237
|
-
};
|
|
18238
17866
|
var Phala = {
|
|
18239
17867
|
defaultPallet: "XTransfer",
|
|
18240
17868
|
supportedPallets: [
|
|
@@ -18394,7 +18022,7 @@ var pallets = {
|
|
|
18394
18022
|
Darwinia: Darwinia,
|
|
18395
18023
|
Hydration: Hydration,
|
|
18396
18024
|
Interlay: Interlay,
|
|
18397
|
-
|
|
18025
|
+
Heima: Heima,
|
|
18398
18026
|
Moonbeam: Moonbeam,
|
|
18399
18027
|
Parallel: Parallel,
|
|
18400
18028
|
AssetHubKusama: AssetHubKusama,
|
|
@@ -18426,7 +18054,6 @@ var pallets = {
|
|
|
18426
18054
|
Pendulum: Pendulum,
|
|
18427
18055
|
Zeitgeist: Zeitgeist,
|
|
18428
18056
|
Collectives: Collectives,
|
|
18429
|
-
Khala: Khala,
|
|
18430
18057
|
Phala: Phala,
|
|
18431
18058
|
Subsocial: Subsocial,
|
|
18432
18059
|
KiltSpiritnet: KiltSpiritnet,
|
|
@@ -18471,16 +18098,15 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
|
|
|
18471
18098
|
Curio: Curio,
|
|
18472
18099
|
Darwinia: Darwinia,
|
|
18473
18100
|
Encointer: Encointer,
|
|
18101
|
+
Heima: Heima,
|
|
18474
18102
|
Hydration: Hydration,
|
|
18475
18103
|
Imbue: Imbue,
|
|
18476
18104
|
Interlay: Interlay,
|
|
18477
18105
|
InvArchTinker: InvArchTinker,
|
|
18478
18106
|
Karura: Karura,
|
|
18479
|
-
Khala: Khala,
|
|
18480
18107
|
KiltSpiritnet: KiltSpiritnet,
|
|
18481
18108
|
Kintsugi: Kintsugi,
|
|
18482
18109
|
Kusama: Kusama,
|
|
18483
|
-
Litentry: Litentry,
|
|
18484
18110
|
Manta: Manta,
|
|
18485
18111
|
Moonbeam: Moonbeam,
|
|
18486
18112
|
Moonriver: Moonriver,
|
|
@@ -18645,7 +18271,7 @@ var getBalanceForeignInternal = /*#__PURE__*/function () {
|
|
|
18645
18271
|
_context.next = 3;
|
|
18646
18272
|
return api.init(node);
|
|
18647
18273
|
case 3:
|
|
18648
|
-
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !==
|
|
18274
|
+
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
18649
18275
|
if (asset) {
|
|
18650
18276
|
_context.next = 6;
|
|
18651
18277
|
break;
|
|
@@ -18822,7 +18448,7 @@ var getAssetBalanceInternal = /*#__PURE__*/function () {
|
|
|
18822
18448
|
_context.next = 16;
|
|
18823
18449
|
break;
|
|
18824
18450
|
}
|
|
18825
|
-
_context.t1 = _yield$getBalanceFore !==
|
|
18451
|
+
_context.t1 = _yield$getBalanceFore !== void 0;
|
|
18826
18452
|
case 16:
|
|
18827
18453
|
if (!_context.t1) {
|
|
18828
18454
|
_context.next = 20;
|
|
@@ -18902,7 +18528,7 @@ var buildClaimAssetsInput = function buildClaimAssetsInput(_ref) {
|
|
|
18902
18528
|
multiAssets = _ref.multiAssets,
|
|
18903
18529
|
address = _ref.address,
|
|
18904
18530
|
_ref$version = _ref.version,
|
|
18905
|
-
version = _ref$version ===
|
|
18531
|
+
version = _ref$version === void 0 ? exports.Version.V3 : _ref$version;
|
|
18906
18532
|
return {
|
|
18907
18533
|
assets: _defineProperty({}, version, multiAssets),
|
|
18908
18534
|
beneficiary: _defineProperty({}, version, buildBeneficiaryInput(api, address))
|
|
@@ -19023,10 +18649,26 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
|
|
|
19023
18649
|
return _build.apply(this, arguments);
|
|
19024
18650
|
}
|
|
19025
18651
|
return build;
|
|
19026
|
-
}()
|
|
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
|
+
*/
|
|
19027
18669
|
}, {
|
|
19028
18670
|
key: "disconnect",
|
|
19029
|
-
value: function () {
|
|
18671
|
+
value: (function () {
|
|
19030
18672
|
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
19031
18673
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
19032
18674
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -19042,7 +18684,7 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
|
|
|
19042
18684
|
return _disconnect.apply(this, arguments);
|
|
19043
18685
|
}
|
|
19044
18686
|
return disconnect;
|
|
19045
|
-
}()
|
|
18687
|
+
}())
|
|
19046
18688
|
}], [{
|
|
19047
18689
|
key: "create",
|
|
19048
18690
|
value: function create(api, node) {
|
|
@@ -19347,6 +18989,16 @@ var GeneralBuilder = /*#__PURE__*/function () {
|
|
|
19347
18989
|
}
|
|
19348
18990
|
return dryRun;
|
|
19349
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
|
+
}
|
|
19350
19002
|
}, {
|
|
19351
19003
|
key: "disconnect",
|
|
19352
19004
|
value: function () {
|
|
@@ -19385,7 +19037,7 @@ var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
|
|
|
19385
19037
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
19386
19038
|
while (1) switch (_context.prev = _context.next) {
|
|
19387
19039
|
case 0:
|
|
19388
|
-
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 ===
|
|
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;
|
|
19389
19041
|
_context.next = 3;
|
|
19390
19042
|
return api.init(origin);
|
|
19391
19043
|
case 3:
|
|
@@ -19406,7 +19058,7 @@ var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
|
|
|
19406
19058
|
});
|
|
19407
19059
|
case 12:
|
|
19408
19060
|
nativeBalance = _context.sent;
|
|
19409
|
-
existentialDeposit = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !==
|
|
19061
|
+
existentialDeposit = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== void 0 ? _getExistentialDeposi : '0');
|
|
19410
19062
|
sufficientForXCM = nativeBalance - existentialDeposit - xcmFeeWithMargin > 0;
|
|
19411
19063
|
return _context.abrupt("return", {
|
|
19412
19064
|
sufficientForXCM: sufficientForXCM,
|
|
@@ -19514,7 +19166,7 @@ var getMaxForeignTransferableAmount = /*#__PURE__*/function () {
|
|
|
19514
19166
|
case 0:
|
|
19515
19167
|
api = _ref3.api, address = _ref3.address, node = _ref3.node, currency = _ref3.currency;
|
|
19516
19168
|
validateAddress(address, node, false);
|
|
19517
|
-
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !==
|
|
19169
|
+
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
19518
19170
|
if (asset) {
|
|
19519
19171
|
_context2.next = 5;
|
|
19520
19172
|
break;
|
|
@@ -19565,7 +19217,7 @@ var getTransferableAmount = /*#__PURE__*/function () {
|
|
|
19565
19217
|
case 0:
|
|
19566
19218
|
api = _ref5.api, address = _ref5.address, node = _ref5.node, currency = _ref5.currency;
|
|
19567
19219
|
validateAddress(address, node, false);
|
|
19568
|
-
asset = (_getAssetBySymbolOrId2 = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId2 !==
|
|
19220
|
+
asset = (_getAssetBySymbolOrId2 = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId2 !== void 0 ? _getAssetBySymbolOrId2 : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
19569
19221
|
if (asset) {
|
|
19570
19222
|
_context3.next = 5;
|
|
19571
19223
|
break;
|
|
@@ -19639,7 +19291,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
19639
19291
|
case 14:
|
|
19640
19292
|
xcmFeeDetails = _context.sent;
|
|
19641
19293
|
expectedBalanceAfterXCMDelivery = originBalance - xcmFeeDetails.xcmFee;
|
|
19642
|
-
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(origin, currency, destination)) !== null && _getAssetBySymbolOrId !==
|
|
19294
|
+
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(origin, currency, destination)) !== null && _getAssetBySymbolOrId !== void 0 ? _getAssetBySymbolOrId : origin === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
19643
19295
|
if (asset) {
|
|
19644
19296
|
_context.next = 19;
|
|
19645
19297
|
break;
|
|
@@ -19660,7 +19312,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
19660
19312
|
});
|
|
19661
19313
|
case 22:
|
|
19662
19314
|
_context.t1 = _context.sent;
|
|
19663
|
-
_context.t2 = (_asset$symbol = asset === null || asset ===
|
|
19315
|
+
_context.t2 = (_asset$symbol = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _asset$symbol !== void 0 ? _asset$symbol : '';
|
|
19664
19316
|
_context.t3 = {
|
|
19665
19317
|
balance: _context.t1,
|
|
19666
19318
|
currency: _context.t2
|
|
@@ -19668,9 +19320,9 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
19668
19320
|
_context.t4 = originBalance;
|
|
19669
19321
|
_context.t5 = expectedBalanceAfterXCMDelivery;
|
|
19670
19322
|
_context.t6 = xcmFeeDetails;
|
|
19671
|
-
_context.t7 = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !==
|
|
19323
|
+
_context.t7 = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== void 0 ? _getExistentialDeposi : 0);
|
|
19672
19324
|
_context.t8 = getNativeAssetSymbol(origin);
|
|
19673
|
-
_context.t9 = BigInt((_getExistentialDeposi2 = getExistentialDeposit(origin)) !== null && _getExistentialDeposi2 !==
|
|
19325
|
+
_context.t9 = BigInt((_getExistentialDeposi2 = getExistentialDeposit(origin)) !== null && _getExistentialDeposi2 !== void 0 ? _getExistentialDeposi2 : 0);
|
|
19674
19326
|
_context.next = 33;
|
|
19675
19327
|
return getMaxNativeTransferableAmount({
|
|
19676
19328
|
api: api,
|
|
@@ -19697,7 +19349,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
19697
19349
|
case 37:
|
|
19698
19350
|
_context.t12 = _context.sent;
|
|
19699
19351
|
_context.t13 = getNativeAssetSymbol(destination);
|
|
19700
|
-
_context.t14 = BigInt((_getExistentialDeposi3 = getExistentialDeposit(destination)) !== null && _getExistentialDeposi3 !==
|
|
19352
|
+
_context.t14 = BigInt((_getExistentialDeposi3 = getExistentialDeposit(destination)) !== null && _getExistentialDeposi3 !== void 0 ? _getExistentialDeposi3 : 0);
|
|
19701
19353
|
_context.t15 = {
|
|
19702
19354
|
balance: _context.t12,
|
|
19703
19355
|
currency: _context.t13,
|
|
@@ -20027,7 +19679,7 @@ var getMultiLocationTokenId = function getMultiLocationTokenId(location, node) {
|
|
|
20027
19679
|
var assetId = location.interior.value[1].value;
|
|
20028
19680
|
return (_foreignAssets$find$a = (_foreignAssets$find = foreignAssets.find(function (asset) {
|
|
20029
19681
|
return asset.assetId === String(assetId);
|
|
20030
|
-
})) === null || _foreignAssets$find ===
|
|
19682
|
+
})) === null || _foreignAssets$find === void 0 ? void 0 : _foreignAssets$find.assetId) !== null && _foreignAssets$find$a !== void 0 ? _foreignAssets$find$a : null;
|
|
20031
19683
|
}
|
|
20032
19684
|
}
|
|
20033
19685
|
return null;
|
|
@@ -20096,7 +19748,7 @@ var getMultiLocationTokenIdPjs = function getMultiLocationTokenIdPjs(location, n
|
|
|
20096
19748
|
var assetId = junctions[1].GeneralIndex;
|
|
20097
19749
|
return (_foreignAssets$find$s = (_foreignAssets$find = foreignAssets.find(function (asset) {
|
|
20098
19750
|
return asset.assetId === String(assetId);
|
|
20099
|
-
})) === null || _foreignAssets$find ===
|
|
19751
|
+
})) === null || _foreignAssets$find === void 0 ? void 0 : _foreignAssets$find.symbol) !== null && _foreignAssets$find$s !== void 0 ? _foreignAssets$find$s : null;
|
|
20100
19752
|
}
|
|
20101
19753
|
}
|
|
20102
19754
|
return null;
|
|
@@ -20253,12 +19905,12 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
|
|
|
20253
19905
|
}
|
|
20254
19906
|
if ('symbol' in currency && nativeAssets.some(function (nativeAsset) {
|
|
20255
19907
|
var _asset$symbol;
|
|
20256
|
-
return nativeAsset.symbol.toLowerCase() === (asset === null || asset ===
|
|
19908
|
+
return nativeAsset.symbol.toLowerCase() === (asset === null || asset === void 0 || (_asset$symbol = asset.symbol) === null || _asset$symbol === void 0 ? void 0 : _asset$symbol.toLowerCase());
|
|
20257
19909
|
})) {
|
|
20258
|
-
throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset ===
|
|
19910
|
+
throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset === void 0 ? void 0 : asset.symbol), " is not supported for transfers to ").concat(destination, "."));
|
|
20259
19911
|
}
|
|
20260
19912
|
}
|
|
20261
|
-
if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset ===
|
|
19913
|
+
if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol)) {
|
|
20262
19914
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
20263
19915
|
}
|
|
20264
19916
|
if (!isBridge && asset === null && assetCheckEnabled) {
|
|
@@ -20330,8 +19982,8 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
|
|
|
20330
19982
|
var originTyped = origin;
|
|
20331
19983
|
var originNode = getNode(originTyped);
|
|
20332
19984
|
return _objectSpread2({
|
|
20333
|
-
isFeeAsset: (_currency$isFeeAsset = currency.isFeeAsset) !== null && _currency$isFeeAsset !==
|
|
20334
|
-
}, createMultiAsset(originNode.version, currency.amount, asset === null || asset ===
|
|
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));
|
|
20335
19987
|
});
|
|
20336
19988
|
return assets;
|
|
20337
19989
|
}
|
|
@@ -20395,7 +20047,7 @@ var send = /*#__PURE__*/function () {
|
|
|
20395
20047
|
return api.init(origin);
|
|
20396
20048
|
case 21:
|
|
20397
20049
|
// In case asset check is disabled, we create asset object from currency symbol
|
|
20398
|
-
resolvedAsset = asset !== null && asset !==
|
|
20050
|
+
resolvedAsset = asset !== null && asset !== void 0 ? asset : {
|
|
20399
20051
|
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
20400
20052
|
};
|
|
20401
20053
|
originNode = getNode(origin);
|
|
@@ -20469,8 +20121,8 @@ var formatAssetIdToERC20 = function formatAssetIdToERC20(id) {
|
|
|
20469
20121
|
if (id.startsWith('0x')) {
|
|
20470
20122
|
return id;
|
|
20471
20123
|
}
|
|
20472
|
-
if (
|
|
20473
|
-
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"));
|
|
20474
20126
|
}
|
|
20475
20127
|
return "0xffffffff".concat(BigInt(id).toString(16).padStart(32, '0'));
|
|
20476
20128
|
};
|
|
@@ -20662,7 +20314,7 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
|
|
|
20662
20314
|
break;
|
|
20663
20315
|
}
|
|
20664
20316
|
_context.next = 25;
|
|
20665
|
-
return createTx('transferMultiCurrencies', [[[asset, currency.amount], [formatAssetIdToERC20((_usdtAsset$assetId = usdtAsset.assetId) !== null && _usdtAsset$assetId !==
|
|
20317
|
+
return createTx('transferMultiCurrencies', [[[asset, currency.amount], [formatAssetIdToERC20((_usdtAsset$assetId = usdtAsset.assetId) !== null && _usdtAsset$assetId !== void 0 ? _usdtAsset$assetId : ''), '200000']], 1,
|
|
20666
20318
|
// index of the fee asset
|
|
20667
20319
|
destMultiLocation, weight]);
|
|
20668
20320
|
case 25:
|
|
@@ -20860,7 +20512,7 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
|
|
|
20860
20512
|
_context.next = 23;
|
|
20861
20513
|
break;
|
|
20862
20514
|
case 22:
|
|
20863
|
-
_context.t0 = (_signer$account = signer.account) === null || _signer$account ===
|
|
20515
|
+
_context.t0 = (_signer$account = signer.account) === null || _signer$account === void 0 ? void 0 : _signer$account.address;
|
|
20864
20516
|
case 23:
|
|
20865
20517
|
senderAddress = _context.t0;
|
|
20866
20518
|
if (senderAddress) {
|
|
@@ -20878,17 +20530,12 @@ var transferMoonbeamToEth = /*#__PURE__*/function () {
|
|
|
20878
20530
|
messageId = _context.sent;
|
|
20879
20531
|
customXcm = createCustomXcmOnDest({
|
|
20880
20532
|
api: api,
|
|
20881
|
-
destination: to,
|
|
20882
20533
|
address: address,
|
|
20883
20534
|
scenario: 'ParaToPara',
|
|
20884
20535
|
senderAddress: senderAddress,
|
|
20885
20536
|
asset: _objectSpread2(_objectSpread2({}, foundAsset), {}, {
|
|
20886
20537
|
amount: currency.amount
|
|
20887
|
-
}),
|
|
20888
|
-
header: {},
|
|
20889
|
-
currencySelection: {},
|
|
20890
|
-
addressSelection: {}
|
|
20891
|
-
}, exports.Version.V4, messageId);
|
|
20538
|
+
})}, exports.Version.V4, messageId);
|
|
20892
20539
|
_context.next = 34;
|
|
20893
20540
|
return api.objectToHex(customXcm, 'XcmVersionedXcm');
|
|
20894
20541
|
case 34:
|
|
@@ -21013,6 +20660,7 @@ exports.getSupportedPalletsDetails = getSupportedPalletsDetails;
|
|
|
21013
20660
|
exports.getTNode = getTNode;
|
|
21014
20661
|
exports.getTransferInfo = getTransferInfo;
|
|
21015
20662
|
exports.getTransferableAmount = getTransferableAmount;
|
|
20663
|
+
exports.hasDryRunSupport = hasDryRunSupport;
|
|
21016
20664
|
exports.hasSupportForAsset = hasSupportForAsset;
|
|
21017
20665
|
exports.isEthersContract = isEthersContract;
|
|
21018
20666
|
exports.isEthersSigner = isEthersSigner;
|