@paraspell/sdk-core 8.1.0 → 8.2.1
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 +420 -139
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +420 -139
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ function _arrayWithoutHoles(r) {
|
|
|
10
10
|
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
11
11
|
}
|
|
12
12
|
function _assertThisInitialized(e) {
|
|
13
|
-
if (
|
|
13
|
+
if (undefined === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
14
14
|
return e;
|
|
15
15
|
}
|
|
16
16
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -34,7 +34,7 @@ function _asyncToGenerator(n) {
|
|
|
34
34
|
function _throw(n) {
|
|
35
35
|
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
36
36
|
}
|
|
37
|
-
_next(
|
|
37
|
+
_next(undefined);
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -54,12 +54,12 @@ function _construct(t, e, r) {
|
|
|
54
54
|
function _defineProperties(e, r) {
|
|
55
55
|
for (var t = 0; t < r.length; t++) {
|
|
56
56
|
var o = r[t];
|
|
57
|
-
o.enumerable = o.enumerable ||
|
|
57
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function _createClass(e, r, t) {
|
|
61
61
|
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
62
|
-
writable:
|
|
62
|
+
writable: false
|
|
63
63
|
}), e;
|
|
64
64
|
}
|
|
65
65
|
function _createForOfIteratorHelper(r, e) {
|
|
@@ -73,9 +73,9 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
73
73
|
s: F,
|
|
74
74
|
n: function () {
|
|
75
75
|
return n >= r.length ? {
|
|
76
|
-
done:
|
|
76
|
+
done: true
|
|
77
77
|
} : {
|
|
78
|
-
done:
|
|
78
|
+
done: false,
|
|
79
79
|
value: r[n++]
|
|
80
80
|
};
|
|
81
81
|
},
|
|
@@ -88,8 +88,8 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
88
88
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
89
89
|
}
|
|
90
90
|
var o,
|
|
91
|
-
a =
|
|
92
|
-
u =
|
|
91
|
+
a = true,
|
|
92
|
+
u = false;
|
|
93
93
|
return {
|
|
94
94
|
s: function () {
|
|
95
95
|
t = t.call(r);
|
|
@@ -99,7 +99,7 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
99
99
|
return a = r.done, r;
|
|
100
100
|
},
|
|
101
101
|
e: function (r) {
|
|
102
|
-
u =
|
|
102
|
+
u = true, o = r;
|
|
103
103
|
},
|
|
104
104
|
f: function () {
|
|
105
105
|
try {
|
|
@@ -113,9 +113,9 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
113
113
|
function _defineProperty(e, r, t) {
|
|
114
114
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
115
115
|
value: t,
|
|
116
|
-
enumerable:
|
|
117
|
-
configurable:
|
|
118
|
-
writable:
|
|
116
|
+
enumerable: true,
|
|
117
|
+
configurable: true,
|
|
118
|
+
writable: true
|
|
119
119
|
}) : e[r] = t, e;
|
|
120
120
|
}
|
|
121
121
|
function _get() {
|
|
@@ -137,11 +137,11 @@ function _inherits(t, e) {
|
|
|
137
137
|
t.prototype = Object.create(e && e.prototype, {
|
|
138
138
|
constructor: {
|
|
139
139
|
value: t,
|
|
140
|
-
writable:
|
|
141
|
-
configurable:
|
|
140
|
+
writable: true,
|
|
141
|
+
configurable: true
|
|
142
142
|
}
|
|
143
143
|
}), Object.defineProperty(t, "prototype", {
|
|
144
|
-
writable:
|
|
144
|
+
writable: false
|
|
145
145
|
}), e && _setPrototypeOf(t, e);
|
|
146
146
|
}
|
|
147
147
|
function _isNativeFunction(t) {
|
|
@@ -178,7 +178,7 @@ function ownKeys(e, r) {
|
|
|
178
178
|
function _objectSpread2(e) {
|
|
179
179
|
for (var r = 1; r < arguments.length; r++) {
|
|
180
180
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
181
|
-
r % 2 ? ownKeys(Object(t),
|
|
181
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
182
182
|
_defineProperty(e, r, t[r]);
|
|
183
183
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
184
184
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
@@ -188,7 +188,7 @@ function _objectSpread2(e) {
|
|
|
188
188
|
}
|
|
189
189
|
function _possibleConstructorReturn(t, e) {
|
|
190
190
|
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
191
|
-
if (
|
|
191
|
+
if (undefined !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
192
192
|
return _assertThisInitialized(t);
|
|
193
193
|
}
|
|
194
194
|
function _regeneratorRuntime() {
|
|
@@ -209,9 +209,9 @@ function _regeneratorRuntime() {
|
|
|
209
209
|
function define(t, e, r) {
|
|
210
210
|
return Object.defineProperty(t, e, {
|
|
211
211
|
value: r,
|
|
212
|
-
enumerable:
|
|
213
|
-
configurable:
|
|
214
|
-
writable:
|
|
212
|
+
enumerable: true,
|
|
213
|
+
configurable: true,
|
|
214
|
+
writable: true
|
|
215
215
|
}), t[e];
|
|
216
216
|
}
|
|
217
217
|
try {
|
|
@@ -304,7 +304,7 @@ function _regeneratorRuntime() {
|
|
|
304
304
|
if ("throw" === i) throw a;
|
|
305
305
|
return {
|
|
306
306
|
value: t,
|
|
307
|
-
done:
|
|
307
|
+
done: true
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
310
|
for (n.method = i, n.arg = a;;) {
|
|
@@ -355,7 +355,7 @@ function _regeneratorRuntime() {
|
|
|
355
355
|
function Context(t) {
|
|
356
356
|
this.tryEntries = [{
|
|
357
357
|
tryLoc: "root"
|
|
358
|
-
}], t.forEach(pushTryEntry, this), this.reset(
|
|
358
|
+
}], t.forEach(pushTryEntry, this), this.reset(true);
|
|
359
359
|
}
|
|
360
360
|
function values(e) {
|
|
361
361
|
if (e || "" === e) {
|
|
@@ -365,8 +365,8 @@ function _regeneratorRuntime() {
|
|
|
365
365
|
if (!isNaN(e.length)) {
|
|
366
366
|
var o = -1,
|
|
367
367
|
i = function next() {
|
|
368
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done =
|
|
369
|
-
return next.value = t, next.done =
|
|
368
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
|
|
369
|
+
return next.value = t, next.done = true, next;
|
|
370
370
|
};
|
|
371
371
|
return i.next = i;
|
|
372
372
|
}
|
|
@@ -375,10 +375,10 @@ function _regeneratorRuntime() {
|
|
|
375
375
|
}
|
|
376
376
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
377
377
|
value: GeneratorFunctionPrototype,
|
|
378
|
-
configurable:
|
|
378
|
+
configurable: true
|
|
379
379
|
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
380
380
|
value: GeneratorFunction,
|
|
381
|
-
configurable:
|
|
381
|
+
configurable: true
|
|
382
382
|
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
383
383
|
var e = "function" == typeof t && t.constructor;
|
|
384
384
|
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
@@ -391,7 +391,7 @@ function _regeneratorRuntime() {
|
|
|
391
391
|
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
392
392
|
return this;
|
|
393
393
|
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
394
|
-
|
|
394
|
+
undefined === i && (i = Promise);
|
|
395
395
|
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
396
396
|
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
397
397
|
return t.done ? t.value : a.next();
|
|
@@ -407,17 +407,17 @@ function _regeneratorRuntime() {
|
|
|
407
407
|
return r.reverse(), function next() {
|
|
408
408
|
for (; r.length;) {
|
|
409
409
|
var t = r.pop();
|
|
410
|
-
if (t in e) return next.value = t, next.done =
|
|
410
|
+
if (t in e) return next.value = t, next.done = false, next;
|
|
411
411
|
}
|
|
412
|
-
return next.done =
|
|
412
|
+
return next.done = true, next;
|
|
413
413
|
};
|
|
414
414
|
}, e.values = values, Context.prototype = {
|
|
415
415
|
constructor: Context,
|
|
416
416
|
reset: function (e) {
|
|
417
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done =
|
|
417
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
418
418
|
},
|
|
419
419
|
stop: function () {
|
|
420
|
-
this.done =
|
|
420
|
+
this.done = true;
|
|
421
421
|
var t = this.tryEntries[0].completion;
|
|
422
422
|
if ("throw" === t.type) throw t.arg;
|
|
423
423
|
return this.rval;
|
|
@@ -436,10 +436,10 @@ function _regeneratorRuntime() {
|
|
|
436
436
|
var c = n.call(i, "catchLoc"),
|
|
437
437
|
u = n.call(i, "finallyLoc");
|
|
438
438
|
if (c && u) {
|
|
439
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
439
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
440
440
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
441
441
|
} else if (c) {
|
|
442
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc,
|
|
442
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
443
443
|
} else {
|
|
444
444
|
if (!u) throw Error("try statement without catch or finally");
|
|
445
445
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
@@ -513,7 +513,7 @@ function _toConsumableArray(r) {
|
|
|
513
513
|
function _toPrimitive(t, r) {
|
|
514
514
|
if ("object" != typeof t || !t) return t;
|
|
515
515
|
var e = t[Symbol.toPrimitive];
|
|
516
|
-
if (
|
|
516
|
+
if (undefined !== e) {
|
|
517
517
|
var i = e.call(t, r || "default");
|
|
518
518
|
if ("object" != typeof i) return i;
|
|
519
519
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
@@ -537,15 +537,15 @@ function _unsupportedIterableToArray(r, a) {
|
|
|
537
537
|
if (r) {
|
|
538
538
|
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
539
539
|
var t = {}.toString.call(r).slice(8, -1);
|
|
540
|
-
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) :
|
|
540
|
+
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;
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
function _wrapNativeSuper(t) {
|
|
544
|
-
var r = "function" == typeof Map ? new Map() :
|
|
544
|
+
var r = "function" == typeof Map ? new Map() : undefined;
|
|
545
545
|
return _wrapNativeSuper = function (t) {
|
|
546
546
|
if (null === t || !_isNativeFunction(t)) return t;
|
|
547
547
|
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
548
|
-
if (
|
|
548
|
+
if (undefined !== r) {
|
|
549
549
|
if (r.has(t)) return r.get(t);
|
|
550
550
|
r.set(t, Wrapper);
|
|
551
551
|
}
|
|
@@ -555,9 +555,9 @@ function _wrapNativeSuper(t) {
|
|
|
555
555
|
return Wrapper.prototype = Object.create(t.prototype, {
|
|
556
556
|
constructor: {
|
|
557
557
|
value: Wrapper,
|
|
558
|
-
enumerable:
|
|
559
|
-
writable:
|
|
560
|
-
configurable:
|
|
558
|
+
enumerable: false,
|
|
559
|
+
writable: true,
|
|
560
|
+
configurable: true
|
|
561
561
|
}
|
|
562
562
|
}), _setPrototypeOf(Wrapper, t);
|
|
563
563
|
}, _wrapNativeSuper(t);
|
|
@@ -597,7 +597,7 @@ var Polimec$3 = {
|
|
|
597
597
|
relayChainAssetSymbol: "DOT",
|
|
598
598
|
nativeAssetSymbol: "PLMC",
|
|
599
599
|
isEVM: false,
|
|
600
|
-
supportsDryRunApi:
|
|
600
|
+
supportsDryRunApi: true,
|
|
601
601
|
nativeAssets: [
|
|
602
602
|
{
|
|
603
603
|
symbol: "PLMC",
|
|
@@ -696,6 +696,28 @@ var Acala$3 = {
|
|
|
696
696
|
}
|
|
697
697
|
],
|
|
698
698
|
otherAssets: [
|
|
699
|
+
{
|
|
700
|
+
assetId: "18",
|
|
701
|
+
symbol: "LOVA",
|
|
702
|
+
decimals: 12,
|
|
703
|
+
multiLocation: {
|
|
704
|
+
parents: 1,
|
|
705
|
+
interior: {
|
|
706
|
+
X3: [
|
|
707
|
+
{
|
|
708
|
+
Parachain: 1000
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
PalletInstance: 50
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
GeneralIndex: 50000028
|
|
715
|
+
}
|
|
716
|
+
]
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
existentialDeposit: "1"
|
|
720
|
+
},
|
|
699
721
|
{
|
|
700
722
|
assetId: "14",
|
|
701
723
|
symbol: "USDC",
|
|
@@ -806,6 +828,50 @@ var Acala$3 = {
|
|
|
806
828
|
},
|
|
807
829
|
existentialDeposit: "3000"
|
|
808
830
|
},
|
|
831
|
+
{
|
|
832
|
+
assetId: "19",
|
|
833
|
+
symbol: "DAMN",
|
|
834
|
+
decimals: 12,
|
|
835
|
+
multiLocation: {
|
|
836
|
+
parents: 1,
|
|
837
|
+
interior: {
|
|
838
|
+
X3: [
|
|
839
|
+
{
|
|
840
|
+
Parachain: 1000
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
PalletInstance: 50
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
GeneralIndex: 22222012
|
|
847
|
+
}
|
|
848
|
+
]
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
existentialDeposit: "1"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
assetId: "20",
|
|
855
|
+
symbol: "LOTY",
|
|
856
|
+
decimals: 12,
|
|
857
|
+
multiLocation: {
|
|
858
|
+
parents: 1,
|
|
859
|
+
interior: {
|
|
860
|
+
X3: [
|
|
861
|
+
{
|
|
862
|
+
Parachain: 1000
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
PalletInstance: 50
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
GeneralIndex: 50000069
|
|
869
|
+
}
|
|
870
|
+
]
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
existentialDeposit: "100000000"
|
|
874
|
+
},
|
|
809
875
|
{
|
|
810
876
|
assetId: "0",
|
|
811
877
|
symbol: "GLMR",
|
|
@@ -2698,12 +2764,55 @@ var Hydration$3 = {
|
|
|
2698
2764
|
}
|
|
2699
2765
|
],
|
|
2700
2766
|
otherAssets: [
|
|
2767
|
+
{
|
|
2768
|
+
assetId: "1000771",
|
|
2769
|
+
symbol: "KSM",
|
|
2770
|
+
decimals: 12,
|
|
2771
|
+
multiLocation: {
|
|
2772
|
+
parents: 1,
|
|
2773
|
+
interior: {
|
|
2774
|
+
X1: {
|
|
2775
|
+
GlobalConsensus: {
|
|
2776
|
+
kusama: null
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
},
|
|
2781
|
+
existentialDeposit: "313283208"
|
|
2782
|
+
},
|
|
2783
|
+
{
|
|
2784
|
+
assetId: "1000766",
|
|
2785
|
+
symbol: "USDC",
|
|
2786
|
+
decimals: 6,
|
|
2787
|
+
multiLocation: {
|
|
2788
|
+
parents: 2,
|
|
2789
|
+
interior: {
|
|
2790
|
+
X2: [
|
|
2791
|
+
{
|
|
2792
|
+
GlobalConsensus: {
|
|
2793
|
+
Ethereum: {
|
|
2794
|
+
chainId: 1
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
AccountKey20: {
|
|
2800
|
+
network: null,
|
|
2801
|
+
key: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
]
|
|
2805
|
+
}
|
|
2806
|
+
},
|
|
2807
|
+
existentialDeposit: "10000",
|
|
2808
|
+
alias: "USDC1"
|
|
2809
|
+
},
|
|
2701
2810
|
{
|
|
2702
2811
|
assetId: "1000625",
|
|
2703
2812
|
symbol: "sUSDe",
|
|
2704
2813
|
decimals: 18,
|
|
2705
2814
|
multiLocation: {
|
|
2706
|
-
parents:
|
|
2815
|
+
parents: 2,
|
|
2707
2816
|
interior: {
|
|
2708
2817
|
X2: [
|
|
2709
2818
|
{
|
|
@@ -2741,7 +2850,7 @@ var Hydration$3 = {
|
|
|
2741
2850
|
symbol: "AAVE",
|
|
2742
2851
|
decimals: 18,
|
|
2743
2852
|
multiLocation: {
|
|
2744
|
-
parents:
|
|
2853
|
+
parents: 2,
|
|
2745
2854
|
interior: {
|
|
2746
2855
|
X2: [
|
|
2747
2856
|
{
|
|
@@ -2767,7 +2876,7 @@ var Hydration$3 = {
|
|
|
2767
2876
|
symbol: "WBTC",
|
|
2768
2877
|
decimals: 8,
|
|
2769
2878
|
multiLocation: {
|
|
2770
|
-
parents:
|
|
2879
|
+
parents: 2,
|
|
2771
2880
|
interior: {
|
|
2772
2881
|
X2: [
|
|
2773
2882
|
{
|
|
@@ -2794,7 +2903,7 @@ var Hydration$3 = {
|
|
|
2794
2903
|
symbol: "sUSDS",
|
|
2795
2904
|
decimals: 18,
|
|
2796
2905
|
multiLocation: {
|
|
2797
|
-
parents:
|
|
2906
|
+
parents: 2,
|
|
2798
2907
|
interior: {
|
|
2799
2908
|
X2: [
|
|
2800
2909
|
{
|
|
@@ -2816,6 +2925,59 @@ var Hydration$3 = {
|
|
|
2816
2925
|
existentialDeposit: "9910802775024780",
|
|
2817
2926
|
alias: "sUSDS1"
|
|
2818
2927
|
},
|
|
2928
|
+
{
|
|
2929
|
+
assetId: "1000767",
|
|
2930
|
+
symbol: "USDT",
|
|
2931
|
+
decimals: 6,
|
|
2932
|
+
multiLocation: {
|
|
2933
|
+
parents: 2,
|
|
2934
|
+
interior: {
|
|
2935
|
+
X2: [
|
|
2936
|
+
{
|
|
2937
|
+
GlobalConsensus: {
|
|
2938
|
+
Ethereum: {
|
|
2939
|
+
chainId: 1
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
AccountKey20: {
|
|
2945
|
+
network: null,
|
|
2946
|
+
key: "0xdac17f958d2ee523a2206206994597c13d831ec7"
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
]
|
|
2950
|
+
}
|
|
2951
|
+
},
|
|
2952
|
+
existentialDeposit: "10000",
|
|
2953
|
+
alias: "USDT2"
|
|
2954
|
+
},
|
|
2955
|
+
{
|
|
2956
|
+
assetId: "1000765",
|
|
2957
|
+
symbol: "tBTC",
|
|
2958
|
+
decimals: 18,
|
|
2959
|
+
multiLocation: {
|
|
2960
|
+
parents: 2,
|
|
2961
|
+
interior: {
|
|
2962
|
+
X2: [
|
|
2963
|
+
{
|
|
2964
|
+
GlobalConsensus: {
|
|
2965
|
+
Ethereum: {
|
|
2966
|
+
chainId: 1
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
},
|
|
2970
|
+
{
|
|
2971
|
+
AccountKey20: {
|
|
2972
|
+
network: null,
|
|
2973
|
+
key: "0x18084fba666a33d37592fa2633fd49a74dd93a88"
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
]
|
|
2977
|
+
}
|
|
2978
|
+
},
|
|
2979
|
+
existentialDeposit: "106803374987"
|
|
2980
|
+
},
|
|
2819
2981
|
{
|
|
2820
2982
|
assetId: "1000189",
|
|
2821
2983
|
symbol: "WETH",
|
|
@@ -2909,7 +3071,7 @@ var Hydration$3 = {
|
|
|
2909
3071
|
}
|
|
2910
3072
|
},
|
|
2911
3073
|
existentialDeposit: "10000",
|
|
2912
|
-
alias: "
|
|
3074
|
+
alias: "USDC3"
|
|
2913
3075
|
},
|
|
2914
3076
|
{
|
|
2915
3077
|
assetId: "4",
|
|
@@ -3022,7 +3184,7 @@ var Hydration$3 = {
|
|
|
3022
3184
|
}
|
|
3023
3185
|
},
|
|
3024
3186
|
existentialDeposit: "10000",
|
|
3025
|
-
alias: "
|
|
3187
|
+
alias: "USDC4"
|
|
3026
3188
|
},
|
|
3027
3189
|
{
|
|
3028
3190
|
assetId: "1000100",
|
|
@@ -3093,7 +3255,7 @@ var Hydration$3 = {
|
|
|
3093
3255
|
}
|
|
3094
3256
|
},
|
|
3095
3257
|
existentialDeposit: "10000",
|
|
3096
|
-
alias: "
|
|
3258
|
+
alias: "USDC2"
|
|
3097
3259
|
},
|
|
3098
3260
|
{
|
|
3099
3261
|
assetId: "20",
|
|
@@ -3267,7 +3429,7 @@ var Hydration$3 = {
|
|
|
3267
3429
|
}
|
|
3268
3430
|
},
|
|
3269
3431
|
existentialDeposit: "10000",
|
|
3270
|
-
alias: "
|
|
3432
|
+
alias: "USDT3"
|
|
3271
3433
|
},
|
|
3272
3434
|
{
|
|
3273
3435
|
assetId: "1000752",
|
|
@@ -3539,6 +3701,28 @@ var Hydration$3 = {
|
|
|
3539
3701
|
},
|
|
3540
3702
|
existentialDeposit: "0"
|
|
3541
3703
|
},
|
|
3704
|
+
{
|
|
3705
|
+
assetId: "1005",
|
|
3706
|
+
symbol: "avDOT",
|
|
3707
|
+
decimals: 10,
|
|
3708
|
+
multiLocation: {
|
|
3709
|
+
parents: 1,
|
|
3710
|
+
interior: {
|
|
3711
|
+
X2: [
|
|
3712
|
+
{
|
|
3713
|
+
Parachain: 2034
|
|
3714
|
+
},
|
|
3715
|
+
{
|
|
3716
|
+
AccountKey20: {
|
|
3717
|
+
network: null,
|
|
3718
|
+
key: "0x0e13b904f4168f93814216b6874ca8349457f263"
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
]
|
|
3722
|
+
}
|
|
3723
|
+
},
|
|
3724
|
+
existentialDeposit: "0"
|
|
3725
|
+
},
|
|
3542
3726
|
{
|
|
3543
3727
|
assetId: "1004",
|
|
3544
3728
|
symbol: "aWBTC",
|
|
@@ -5605,6 +5789,26 @@ var AssetHubPolkadot$3 = {
|
|
|
5605
5789
|
],
|
|
5606
5790
|
existentialDeposit: "3000"
|
|
5607
5791
|
},
|
|
5792
|
+
{
|
|
5793
|
+
assetId: "22222012",
|
|
5794
|
+
symbol: "DAMN",
|
|
5795
|
+
decimals: 12,
|
|
5796
|
+
xcmInterior: [
|
|
5797
|
+
{
|
|
5798
|
+
Network: "polkadot"
|
|
5799
|
+
},
|
|
5800
|
+
{
|
|
5801
|
+
Parachain: 1000
|
|
5802
|
+
},
|
|
5803
|
+
{
|
|
5804
|
+
PalletInstance: 50
|
|
5805
|
+
},
|
|
5806
|
+
{
|
|
5807
|
+
GeneralIndex: 22222012
|
|
5808
|
+
}
|
|
5809
|
+
],
|
|
5810
|
+
existentialDeposit: "1000000000000"
|
|
5811
|
+
},
|
|
5608
5812
|
{
|
|
5609
5813
|
assetId: "23",
|
|
5610
5814
|
symbol: "PINK",
|
|
@@ -5685,6 +5889,46 @@ var AssetHubPolkadot$3 = {
|
|
|
5685
5889
|
],
|
|
5686
5890
|
existentialDeposit: "1000000"
|
|
5687
5891
|
},
|
|
5892
|
+
{
|
|
5893
|
+
assetId: "50000028",
|
|
5894
|
+
symbol: "LOVA",
|
|
5895
|
+
decimals: 12,
|
|
5896
|
+
xcmInterior: [
|
|
5897
|
+
{
|
|
5898
|
+
Network: "polkadot"
|
|
5899
|
+
},
|
|
5900
|
+
{
|
|
5901
|
+
Parachain: 1000
|
|
5902
|
+
},
|
|
5903
|
+
{
|
|
5904
|
+
PalletInstance: 50
|
|
5905
|
+
},
|
|
5906
|
+
{
|
|
5907
|
+
GeneralIndex: 50000028
|
|
5908
|
+
}
|
|
5909
|
+
],
|
|
5910
|
+
existentialDeposit: "1000000000000"
|
|
5911
|
+
},
|
|
5912
|
+
{
|
|
5913
|
+
assetId: "50000069",
|
|
5914
|
+
symbol: "LOTY",
|
|
5915
|
+
decimals: 12,
|
|
5916
|
+
xcmInterior: [
|
|
5917
|
+
{
|
|
5918
|
+
Network: "polkadot"
|
|
5919
|
+
},
|
|
5920
|
+
{
|
|
5921
|
+
Parachain: 1000
|
|
5922
|
+
},
|
|
5923
|
+
{
|
|
5924
|
+
PalletInstance: 50
|
|
5925
|
+
},
|
|
5926
|
+
{
|
|
5927
|
+
GeneralIndex: 50000069
|
|
5928
|
+
}
|
|
5929
|
+
],
|
|
5930
|
+
existentialDeposit: "100000000"
|
|
5931
|
+
},
|
|
5688
5932
|
{
|
|
5689
5933
|
assetId: "555",
|
|
5690
5934
|
symbol: "GAME",
|
|
@@ -5777,6 +6021,21 @@ var AssetHubPolkadot$3 = {
|
|
|
5777
6021
|
},
|
|
5778
6022
|
existentialDeposit: "1000000000"
|
|
5779
6023
|
},
|
|
6024
|
+
{
|
|
6025
|
+
symbol: "PLMC",
|
|
6026
|
+
decimals: 10,
|
|
6027
|
+
multiLocation: {
|
|
6028
|
+
parents: 1,
|
|
6029
|
+
interior: {
|
|
6030
|
+
X1: [
|
|
6031
|
+
{
|
|
6032
|
+
Parachain: 3344
|
|
6033
|
+
}
|
|
6034
|
+
]
|
|
6035
|
+
}
|
|
6036
|
+
},
|
|
6037
|
+
existentialDeposit: "1000000000"
|
|
6038
|
+
},
|
|
5780
6039
|
{
|
|
5781
6040
|
symbol: "LAOS",
|
|
5782
6041
|
decimals: 18,
|
|
@@ -6856,7 +7115,7 @@ var Crab$3 = {
|
|
|
6856
7115
|
relayChainAssetSymbol: "KSM",
|
|
6857
7116
|
nativeAssetSymbol: "CRAB",
|
|
6858
7117
|
isEVM: true,
|
|
6859
|
-
supportsDryRunApi:
|
|
7118
|
+
supportsDryRunApi: true,
|
|
6860
7119
|
nativeAssets: [
|
|
6861
7120
|
{
|
|
6862
7121
|
symbol: "CRAB",
|
|
@@ -10947,6 +11206,30 @@ var Ethereum = {
|
|
|
10947
11206
|
]
|
|
10948
11207
|
}
|
|
10949
11208
|
}
|
|
11209
|
+
},
|
|
11210
|
+
{
|
|
11211
|
+
symbol: "AAVE",
|
|
11212
|
+
assetId: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
|
|
11213
|
+
existentialDeposit: "1",
|
|
11214
|
+
multiLocation: {
|
|
11215
|
+
parents: 2,
|
|
11216
|
+
interior: {
|
|
11217
|
+
X2: [
|
|
11218
|
+
{
|
|
11219
|
+
GlobalConsensus: {
|
|
11220
|
+
Ethereum: {
|
|
11221
|
+
chain_id: 1
|
|
11222
|
+
}
|
|
11223
|
+
}
|
|
11224
|
+
},
|
|
11225
|
+
{
|
|
11226
|
+
AccountKey20: {
|
|
11227
|
+
key: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"
|
|
11228
|
+
}
|
|
11229
|
+
}
|
|
11230
|
+
]
|
|
11231
|
+
}
|
|
11232
|
+
}
|
|
10950
11233
|
}
|
|
10951
11234
|
]
|
|
10952
11235
|
};
|
|
@@ -11615,7 +11898,7 @@ var NodeNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
|
11615
11898
|
function NodeNotSupportedError(message) {
|
|
11616
11899
|
var _this;
|
|
11617
11900
|
_classCallCheck(this, NodeNotSupportedError);
|
|
11618
|
-
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !==
|
|
11901
|
+
_this = _callSuper(this, NodeNotSupportedError, [message !== null && message !== undefined ? message : 'These nodes do not support XCM transfers from Relay / to Relay chain.']);
|
|
11619
11902
|
_this.name = 'NodeNotSupported';
|
|
11620
11903
|
return _this;
|
|
11621
11904
|
}
|
|
@@ -11637,7 +11920,7 @@ var ScenarioNotSupportedError = /*#__PURE__*/function (_Error) {
|
|
|
11637
11920
|
function ScenarioNotSupportedError(node, scenario, message) {
|
|
11638
11921
|
var _this;
|
|
11639
11922
|
_classCallCheck(this, ScenarioNotSupportedError);
|
|
11640
|
-
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !==
|
|
11923
|
+
_this = _callSuper(this, ScenarioNotSupportedError, [message !== null && message !== undefined ? message : "Scenario ".concat(scenario, " not supported for node ").concat(node)]);
|
|
11641
11924
|
_this.name = 'ScenarioNotSupported';
|
|
11642
11925
|
return _this;
|
|
11643
11926
|
}
|
|
@@ -11657,7 +11940,7 @@ var IncompatibleNodesError = /*#__PURE__*/function (_Error) {
|
|
|
11657
11940
|
function IncompatibleNodesError(message) {
|
|
11658
11941
|
var _this;
|
|
11659
11942
|
_classCallCheck(this, IncompatibleNodesError);
|
|
11660
|
-
_this = _callSuper(this, IncompatibleNodesError, [message !== null && message !==
|
|
11943
|
+
_this = _callSuper(this, IncompatibleNodesError, [message !== null && message !== undefined ? message : 'Transactions between nodes on different relaychains are not yet possible.']);
|
|
11661
11944
|
_this.name = 'IncompatibleNodes';
|
|
11662
11945
|
return _this;
|
|
11663
11946
|
}
|
|
@@ -13246,8 +13529,8 @@ var createCurrencySpec = function createCurrencySpec(amount, version, parents, o
|
|
|
13246
13529
|
_defineProperty({}, version, overriddenCurrency);
|
|
13247
13530
|
};
|
|
13248
13531
|
var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
|
|
13249
|
-
var parentsResolved = parents !== null && parents !==
|
|
13250
|
-
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !==
|
|
13532
|
+
var parentsResolved = parents !== null && parents !== undefined ? parents : scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
|
|
13533
|
+
var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== undefined ? junction : {
|
|
13251
13534
|
Parachain: nodeId
|
|
13252
13535
|
});
|
|
13253
13536
|
var isMultiLocationDestination = _typeof(destination) === 'object';
|
|
@@ -13278,7 +13561,7 @@ var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(relay
|
|
|
13278
13561
|
}
|
|
13279
13562
|
var node = (_NODE_NAMES_DOT_KSM$f = NODE_NAMES_DOT_KSM.find(function (nodeName) {
|
|
13280
13563
|
return getParaId(nodeName) === parachainId && determineRelayChain(nodeName) === relayChain;
|
|
13281
|
-
})) !== null && _NODE_NAMES_DOT_KSM$f !==
|
|
13564
|
+
})) !== null && _NODE_NAMES_DOT_KSM$f !== undefined ? _NODE_NAMES_DOT_KSM$f : null;
|
|
13282
13565
|
if (node === null) {
|
|
13283
13566
|
throw new Error('Node with specified paraId not found in destination multi location.');
|
|
13284
13567
|
}
|
|
@@ -13311,7 +13594,7 @@ var buildMultiLocation = function buildMultiLocation(_ref) {
|
|
|
13311
13594
|
// If it is a native asset, search by symbol on AssetHub and use the multiLocation from there
|
|
13312
13595
|
var assetHubAsset = getOtherAssets(destination).find(function (ahAsset) {
|
|
13313
13596
|
var _ahAsset$symbol, _asset$symbol;
|
|
13314
|
-
return ((_ahAsset$symbol = ahAsset.symbol) === null || _ahAsset$symbol ===
|
|
13597
|
+
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());
|
|
13315
13598
|
});
|
|
13316
13599
|
if (assetHubAsset === undefined) {
|
|
13317
13600
|
throw new InvalidCurrencyError("Asset ".concat(asset.symbol, " not found in AssetHub"));
|
|
@@ -13425,8 +13708,8 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
13425
13708
|
var section = shouldUseMultiasset ? isMultiAsset ? 'transfer_multiassets' : 'transfer_multiasset' : 'transfer';
|
|
13426
13709
|
var parameters = getXTokensParameters(shouldUseMultiasset, modifiedCurrencySelection, addressSelection, asset.amount, fees, overriddenAsset);
|
|
13427
13710
|
var call = {
|
|
13428
|
-
module: pallet !== null && pallet !==
|
|
13429
|
-
section: method !== null && method !==
|
|
13711
|
+
module: pallet !== null && pallet !== undefined ? pallet : 'XTokens',
|
|
13712
|
+
section: method !== null && method !== undefined ? method : section,
|
|
13430
13713
|
parameters: parameters
|
|
13431
13714
|
};
|
|
13432
13715
|
return api.callTxMethod(call);
|
|
@@ -13438,7 +13721,7 @@ var resolveParaId = function resolveParaId(paraId, destination) {
|
|
|
13438
13721
|
if (isTMultiLocation(destination) || isRelayChain(destination) || destination === 'Ethereum') {
|
|
13439
13722
|
return undefined;
|
|
13440
13723
|
}
|
|
13441
|
-
return paraId !== null && paraId !==
|
|
13724
|
+
return paraId !== null && paraId !== undefined ? paraId : getParaId(destination);
|
|
13442
13725
|
};
|
|
13443
13726
|
|
|
13444
13727
|
var supportsXTokens = function supportsXTokens(obj) {
|
|
@@ -13507,7 +13790,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
13507
13790
|
}
|
|
13508
13791
|
throw new Error('Sending assets to Polimec is supported only from AssetHubPolkadot');
|
|
13509
13792
|
case 6:
|
|
13510
|
-
versionOrDefault = version !== null && version !==
|
|
13793
|
+
versionOrDefault = version !== null && version !== undefined ? version : this.version;
|
|
13511
13794
|
if (!(supportsXTokens(this) && this.canUseXTokens(options))) {
|
|
13512
13795
|
_context.next = 17;
|
|
13513
13796
|
break;
|
|
@@ -13597,15 +13880,15 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
13597
13880
|
key: "transferRelayToPara",
|
|
13598
13881
|
value: function transferRelayToPara(options) {
|
|
13599
13882
|
var _options$version = options.version,
|
|
13600
|
-
version = _options$version ===
|
|
13883
|
+
version = _options$version === undefined ? Version.V3 : _options$version,
|
|
13601
13884
|
pallet = options.pallet,
|
|
13602
13885
|
method = options.method;
|
|
13603
13886
|
var _this$getRelayToParaO = this.getRelayToParaOverrides(),
|
|
13604
13887
|
section = _this$getRelayToParaO.section,
|
|
13605
13888
|
includeFee = _this$getRelayToParaO.includeFee;
|
|
13606
13889
|
return {
|
|
13607
|
-
module: pallet !== null && pallet !==
|
|
13608
|
-
section: method !== null && method !==
|
|
13890
|
+
module: pallet !== null && pallet !== undefined ? pallet : 'XcmPallet',
|
|
13891
|
+
section: method !== null && method !== undefined ? method : section,
|
|
13609
13892
|
parameters: constructRelayToParaParameters(options, version, {
|
|
13610
13893
|
includeFee: includeFee
|
|
13611
13894
|
})
|
|
@@ -13719,8 +14002,8 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
|
13719
14002
|
return asset.isFeeAsset;
|
|
13720
14003
|
});
|
|
13721
14004
|
var call = {
|
|
13722
|
-
module: pallet !== null && pallet !==
|
|
13723
|
-
section: method !== null && method !==
|
|
14005
|
+
module: pallet !== null && pallet !== undefined ? pallet : 'PolkadotXcm',
|
|
14006
|
+
section: method !== null && method !== undefined ? method : section,
|
|
13724
14007
|
parameters: _objectSpread2({
|
|
13725
14008
|
dest: header,
|
|
13726
14009
|
beneficiary: addressSelection,
|
|
@@ -13789,7 +14072,7 @@ var BifrostPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
13789
14072
|
currencySelection: createCurrencySpec(asset.amount, this.version, asset.symbol === 'DOT' ? Parents.ONE : Parents.TWO, overriddenAsset, asset.symbol === 'WETH' ? {
|
|
13790
14073
|
X2: [ETHEREUM_JUNCTION, {
|
|
13791
14074
|
AccountKey20: {
|
|
13792
|
-
key: (_getAssetId = getAssetId('Ethereum', 'WETH')) !== null && _getAssetId !==
|
|
14075
|
+
key: (_getAssetId = getAssetId('Ethereum', 'WETH')) !== null && _getAssetId !== undefined ? _getAssetId : ''
|
|
13793
14076
|
}
|
|
13794
14077
|
}]
|
|
13795
14078
|
} : undefined)
|
|
@@ -13933,7 +14216,7 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref4, version) {
|
|
|
13933
14216
|
assets: {
|
|
13934
14217
|
Wild: 'All'
|
|
13935
14218
|
},
|
|
13936
|
-
beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', ahAddress !== null && ahAddress !==
|
|
14219
|
+
beneficiary: Object.values(generateAddressPayload(api, scenario, 'PolkadotXcm', ahAddress !== null && ahAddress !== undefined ? ahAddress : '', version, undefined))[0]
|
|
13937
14220
|
}
|
|
13938
14221
|
}]
|
|
13939
14222
|
}, {
|
|
@@ -13941,7 +14224,7 @@ var createCustomXcmOnDest = function createCustomXcmOnDest(_ref4, version) {
|
|
|
13941
14224
|
assets: {
|
|
13942
14225
|
Wild: {
|
|
13943
14226
|
AllOf: {
|
|
13944
|
-
id: createEthereumTokenLocation((_asset$assetId = asset.assetId) !== null && _asset$assetId !==
|
|
14227
|
+
id: createEthereumTokenLocation((_asset$assetId = asset.assetId) !== null && _asset$assetId !== undefined ? _asset$assetId : ''),
|
|
13945
14228
|
fun: 'Fungible'
|
|
13946
14229
|
}
|
|
13947
14230
|
}
|
|
@@ -14017,7 +14300,7 @@ var Hydration$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14017
14300
|
}
|
|
14018
14301
|
throw new Error('Only Ethereum addresses are supported for Ethereum transfers');
|
|
14019
14302
|
case 3:
|
|
14020
|
-
if (!(((_asset$symbol = asset.symbol) === null || _asset$symbol ===
|
|
14303
|
+
if (!(((_asset$symbol = asset.symbol) === null || _asset$symbol === undefined ? undefined : _asset$symbol.toUpperCase()) !== 'WETH')) {
|
|
14021
14304
|
_context2.next = 5;
|
|
14022
14305
|
break;
|
|
14023
14306
|
}
|
|
@@ -14035,8 +14318,8 @@ var Hydration$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14035
14318
|
}
|
|
14036
14319
|
throw new Error('AssetHub address is required for Ethereum transfers');
|
|
14037
14320
|
case 9:
|
|
14038
|
-
versionOrDefault = version !== null && version !==
|
|
14039
|
-
ethMultiAsset = Object.values(createCurrencySpec(asset.amount, versionOrDefault, Parents.TWO, createEthereumTokenLocation((_asset$assetId2 = asset.assetId) !== null && _asset$assetId2 !==
|
|
14321
|
+
versionOrDefault = version !== null && version !== undefined ? version : Version.V4;
|
|
14322
|
+
ethMultiAsset = Object.values(createCurrencySpec(asset.amount, versionOrDefault, Parents.TWO, createEthereumTokenLocation((_asset$assetId2 = asset.assetId) !== null && _asset$assetId2 !== undefined ? _asset$assetId2 : '')))[0][0];
|
|
14040
14323
|
_context2.next = 13;
|
|
14041
14324
|
return calculateFee(api);
|
|
14042
14325
|
case 13:
|
|
@@ -14077,7 +14360,7 @@ var Hydration$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14077
14360
|
scenario = input.scenario,
|
|
14078
14361
|
version = input.version,
|
|
14079
14362
|
destination = input.destination;
|
|
14080
|
-
var versionOrDefault = version !== null && version !==
|
|
14363
|
+
var versionOrDefault = version !== null && version !== undefined ? version : Version.V3;
|
|
14081
14364
|
var call = {
|
|
14082
14365
|
module: 'PolkadotXcm',
|
|
14083
14366
|
section: 'transfer_assets_using_type_and_then',
|
|
@@ -14176,10 +14459,17 @@ var Litentry$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14176
14459
|
}
|
|
14177
14460
|
_inherits(Litentry, _ParachainNode);
|
|
14178
14461
|
return _createClass(Litentry, [{
|
|
14179
|
-
key: "
|
|
14180
|
-
value: function
|
|
14181
|
-
var
|
|
14182
|
-
|
|
14462
|
+
key: "transferPolkadotXCM",
|
|
14463
|
+
value: function transferPolkadotXCM(input) {
|
|
14464
|
+
var scenario = input.scenario,
|
|
14465
|
+
asset = input.asset;
|
|
14466
|
+
if (scenario !== 'ParaToPara') {
|
|
14467
|
+
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
14468
|
+
}
|
|
14469
|
+
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
14470
|
+
throw new InvalidCurrencyError("Asset ".concat(asset.symbol, " is not supported by node ").concat(this.node, "."));
|
|
14471
|
+
}
|
|
14472
|
+
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limited_reserve_transfer_assets', 'Unlimited'));
|
|
14183
14473
|
}
|
|
14184
14474
|
}]);
|
|
14185
14475
|
}(ParachainNode);
|
|
@@ -14213,7 +14503,7 @@ var Moonbeam$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14213
14503
|
var asset = input.asset,
|
|
14214
14504
|
scenario = input.scenario,
|
|
14215
14505
|
_input$version = input.version,
|
|
14216
|
-
version = _input$version ===
|
|
14506
|
+
version = _input$version === undefined ? this.version : _input$version,
|
|
14217
14507
|
overriddenAsset = input.overriddenAsset;
|
|
14218
14508
|
var multiLocation = this.getJunctions(asset, scenario);
|
|
14219
14509
|
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
|
|
@@ -14436,7 +14726,7 @@ var Moonriver$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14436
14726
|
var asset = input.asset,
|
|
14437
14727
|
scenario = input.scenario,
|
|
14438
14728
|
_input$version = input.version,
|
|
14439
|
-
version = _input$version ===
|
|
14729
|
+
version = _input$version === undefined ? this.version : _input$version,
|
|
14440
14730
|
overriddenAsset = input.overriddenAsset;
|
|
14441
14731
|
var multiLocation = this.getJunctions(asset, scenario);
|
|
14442
14732
|
return Promise.resolve(PolkadotXCMTransferImpl.transferPolkadotXCM(_objectSpread2(_objectSpread2({}, input), {}, {
|
|
@@ -14695,8 +14985,8 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14695
14985
|
if (!isForeignAsset(asset)) {
|
|
14696
14986
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
14697
14987
|
}
|
|
14698
|
-
var versionOrDefault = version !== null && version !==
|
|
14699
|
-
var ethereumTokenLocation = createEthereumTokenLocation((_asset$assetId = asset.assetId) !== null && _asset$assetId !==
|
|
14988
|
+
var versionOrDefault = version !== null && version !== undefined ? version : _this.version;
|
|
14989
|
+
var ethereumTokenLocation = createEthereumTokenLocation((_asset$assetId = asset.assetId) !== null && _asset$assetId !== undefined ? _asset$assetId : '');
|
|
14700
14990
|
var call = {
|
|
14701
14991
|
module: 'PolkadotXcm',
|
|
14702
14992
|
section: 'transfer_assets_using_type_and_then',
|
|
@@ -14721,14 +15011,14 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14721
15011
|
key: "handleBridgeTransfer",
|
|
14722
15012
|
value: function handleBridgeTransfer(input, targetChain) {
|
|
14723
15013
|
var _input$asset$symbol, _input$asset$symbol2, _input$asset$symbol3, _input$asset$symbol4;
|
|
14724
|
-
if (targetChain === 'Kusama' && ((_input$asset$symbol = input.asset.symbol) === null || _input$asset$symbol ===
|
|
15014
|
+
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') {
|
|
14725
15015
|
var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
14726
15016
|
header: createBridgePolkadotXcmDest(Version.V4, targetChain, input.destination, input.paraIdTo),
|
|
14727
15017
|
addressSelection: generateAddressMultiLocationV4(input.api, input.address),
|
|
14728
15018
|
currencySelection: createBridgeCurrencySpec(input.asset.amount, targetChain)
|
|
14729
15019
|
});
|
|
14730
15020
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'transfer_assets', 'Unlimited');
|
|
14731
|
-
} else if (targetChain === 'Polkadot' && ((_input$asset$symbol3 = input.asset.symbol) === null || _input$asset$symbol3 ===
|
|
15021
|
+
} 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') {
|
|
14732
15022
|
var _modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
14733
15023
|
header: createBridgePolkadotXcmDest(Version.V3, targetChain, input.destination, input.paraIdTo),
|
|
14734
15024
|
currencySelection: createCurrencySpec(input.asset.amount, Version.V3, Parents.ONE, input.overriddenAsset)
|
|
@@ -14765,7 +15055,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14765
15055
|
interior: {
|
|
14766
15056
|
X2: [ETHEREUM_JUNCTION, {
|
|
14767
15057
|
AccountKey20: {
|
|
14768
|
-
key: (_ethAsset$assetId = ethAsset.assetId) !== null && _ethAsset$assetId !==
|
|
15058
|
+
key: (_ethAsset$assetId = ethAsset.assetId) !== null && _ethAsset$assetId !== undefined ? _ethAsset$assetId : ''
|
|
14769
15059
|
}
|
|
14770
15060
|
}]
|
|
14771
15061
|
}
|
|
@@ -14796,7 +15086,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14796
15086
|
var modifiedInput = _objectSpread2(_objectSpread2({}, input), {}, {
|
|
14797
15087
|
header: this.createPolkadotXcmHeader(scenario, version, destination, paraId),
|
|
14798
15088
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, version, paraId),
|
|
14799
|
-
currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== null && overriddenAsset !==
|
|
15089
|
+
currencySelection: this.createCurrencySpec(asset.amount, scenario, version, asset, overriddenAsset !== null && overriddenAsset !== undefined ? overriddenAsset : customMultiLocation)
|
|
14800
15090
|
});
|
|
14801
15091
|
return PolkadotXCMTransferImpl.transferPolkadotXCM(modifiedInput, 'limited_teleport_assets', 'Unlimited');
|
|
14802
15092
|
}
|
|
@@ -14812,9 +15102,9 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14812
15102
|
api = input.api,
|
|
14813
15103
|
version = input.version,
|
|
14814
15104
|
address = input.address;
|
|
14815
|
-
if ((((_asset$symbol = asset.symbol) === null || _asset$symbol ===
|
|
15105
|
+
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') {
|
|
14816
15106
|
var _input$version;
|
|
14817
|
-
var versionOrDefault = (_input$version = input.version) !== null && _input$version !==
|
|
15107
|
+
var versionOrDefault = (_input$version = input.version) !== null && _input$version !== undefined ? _input$version : Version.V2;
|
|
14818
15108
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
14819
15109
|
header: this.createPolkadotXcmHeader(scenario, versionOrDefault, destination, paraIdTo),
|
|
14820
15110
|
addressSelection: generateAddressPayload(api, scenario, 'PolkadotXcm', address, versionOrDefault, paraIdTo),
|
|
@@ -14822,7 +15112,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14822
15112
|
});
|
|
14823
15113
|
}
|
|
14824
15114
|
if ((destination === 'Hydration' || destination === 'Polimec') && asset.symbol === 'DOT') {
|
|
14825
|
-
var _versionOrDefault = version !== null && version !==
|
|
15115
|
+
var _versionOrDefault = version !== null && version !== undefined ? version : this.version;
|
|
14826
15116
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
14827
15117
|
currencySelection: _superPropGet(AssetHubPolkadot, "createCurrencySpec", this, 3)([asset.amount, 'ParaToRelay', _versionOrDefault, asset, overriddenAsset])
|
|
14828
15118
|
});
|
|
@@ -15483,8 +15773,8 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
|
|
|
15483
15773
|
var section = 'transfer';
|
|
15484
15774
|
var destWeight = origin === 'Khala' ? null : determineDestWeight(destination);
|
|
15485
15775
|
var call = {
|
|
15486
|
-
module: pallet !== null && pallet !==
|
|
15487
|
-
section: method !== null && method !==
|
|
15776
|
+
module: pallet !== null && pallet !== undefined ? pallet : 'XTransfer',
|
|
15777
|
+
section: method !== null && method !== undefined ? method : section,
|
|
15488
15778
|
parameters: {
|
|
15489
15779
|
asset: currencySpec,
|
|
15490
15780
|
dest: dest,
|
|
@@ -15776,7 +16066,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15776
16066
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15777
16067
|
while (1) switch (_context.prev = _context.next) {
|
|
15778
16068
|
case 0:
|
|
15779
|
-
api = input.api, _input$version = input.version, version = _input$version ===
|
|
16069
|
+
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;
|
|
15780
16070
|
if (!(scenario === 'ParaToPara' && destination === 'AssetHubPolkadot')) {
|
|
15781
16071
|
_context.next = 4;
|
|
15782
16072
|
break;
|
|
@@ -15792,7 +16082,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15792
16082
|
}
|
|
15793
16083
|
throw new ScenarioNotSupportedError(this.node, scenario);
|
|
15794
16084
|
case 6:
|
|
15795
|
-
versionOrDefault = version !== null && version !==
|
|
16085
|
+
versionOrDefault = version !== null && version !== undefined ? version : Version.V3;
|
|
15796
16086
|
call = {
|
|
15797
16087
|
module: 'PolkadotXcm',
|
|
15798
16088
|
section: 'transfer_assets_using_type_and_then',
|
|
@@ -15827,7 +16117,7 @@ var Polimec$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15827
16117
|
key: "transferRelayToPara",
|
|
15828
16118
|
value: function transferRelayToPara(options) {
|
|
15829
16119
|
var _options$version = options.version,
|
|
15830
|
-
version = _options$version ===
|
|
16120
|
+
version = _options$version === undefined ? Version.V3 : _options$version,
|
|
15831
16121
|
api = options.api,
|
|
15832
16122
|
asset = options.asset,
|
|
15833
16123
|
address = options.address,
|
|
@@ -15965,7 +16255,7 @@ var findBestMatches = function findBestMatches(assets, value) {
|
|
|
15965
16255
|
// Case-insensitive match
|
|
15966
16256
|
matches = assets.filter(function (asset) {
|
|
15967
16257
|
var _asset$property;
|
|
15968
|
-
return ((_asset$property = asset[property]) === null || _asset$property ===
|
|
16258
|
+
return ((_asset$property = asset[property]) === null || _asset$property === undefined ? undefined : _asset$property.toLowerCase()) === lowerValue;
|
|
15969
16259
|
});
|
|
15970
16260
|
return matches;
|
|
15971
16261
|
};
|
|
@@ -16146,8 +16436,8 @@ var findAssetByMultiLocation = function findAssetByMultiLocation(foreignAssets,
|
|
|
16146
16436
|
var sanitizedInput = sanitizeMultiLocation(multiLocation);
|
|
16147
16437
|
return foreignAssets.find(function (asset) {
|
|
16148
16438
|
var _asset$multiLocation, _asset$xcmInterior;
|
|
16149
|
-
var assetMLStr = JSON.stringify((_asset$multiLocation = asset.multiLocation) !== null && _asset$multiLocation !==
|
|
16150
|
-
var assetMLInteriorStr = JSON.stringify((_asset$xcmInterior = asset.xcmInterior) !== null && _asset$xcmInterior !==
|
|
16439
|
+
var assetMLStr = JSON.stringify((_asset$multiLocation = asset.multiLocation) !== null && _asset$multiLocation !== undefined ? _asset$multiLocation : '');
|
|
16440
|
+
var assetMLInteriorStr = JSON.stringify((_asset$xcmInterior = asset.xcmInterior) !== null && _asset$xcmInterior !== undefined ? _asset$xcmInterior : '');
|
|
16151
16441
|
var sanitizedAssetMLStr = sanitizeMultiLocation(assetMLStr);
|
|
16152
16442
|
var sanitizedAssetMLInteriorStr = sanitizeMultiLocation(assetMLInteriorStr);
|
|
16153
16443
|
return (
|
|
@@ -16207,13 +16497,13 @@ var getExistentialDeposit = function getExistentialDeposit(node, currency) {
|
|
|
16207
16497
|
var assetsObject = getAssetsObject(node);
|
|
16208
16498
|
if (!currency) {
|
|
16209
16499
|
var _assetsObject$nativeA;
|
|
16210
|
-
return (_assetsObject$nativeA = assetsObject.nativeAssets[0].existentialDeposit) !== null && _assetsObject$nativeA !==
|
|
16500
|
+
return (_assetsObject$nativeA = assetsObject.nativeAssets[0].existentialDeposit) !== null && _assetsObject$nativeA !== undefined ? _assetsObject$nativeA : null;
|
|
16211
16501
|
}
|
|
16212
|
-
var asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !==
|
|
16502
|
+
var asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
16213
16503
|
if (!asset) {
|
|
16214
16504
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(currency), " not found on ").concat(node));
|
|
16215
16505
|
}
|
|
16216
|
-
return (_asset$existentialDep = asset.existentialDeposit) !== null && _asset$existentialDep !==
|
|
16506
|
+
return (_asset$existentialDep = asset.existentialDeposit) !== null && _asset$existentialDep !== undefined ? _asset$existentialDep : null;
|
|
16217
16507
|
};
|
|
16218
16508
|
|
|
16219
16509
|
var assetsMap = assetsMapJson;
|
|
@@ -16357,7 +16647,7 @@ var getAssetDecimals = function getAssetDecimals(node, symbol) {
|
|
|
16357
16647
|
var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
|
|
16358
16648
|
return o.symbol === symbol;
|
|
16359
16649
|
});
|
|
16360
|
-
return (asset === null || asset ===
|
|
16650
|
+
return (asset === null || asset === undefined ? undefined : asset.decimals) !== undefined ? asset.decimals : null;
|
|
16361
16651
|
};
|
|
16362
16652
|
/**
|
|
16363
16653
|
* Retrieves the node name corresponding to a specified parachain ID.
|
|
@@ -16372,7 +16662,7 @@ var getTNode = function getTNode(paraId, ecosystem) {
|
|
|
16372
16662
|
}
|
|
16373
16663
|
return (_NODE_NAMES_DOT_KSM$f = NODE_NAMES_DOT_KSM.find(function (nodeName) {
|
|
16374
16664
|
return getNode(nodeName).type === ecosystem && getParaId(nodeName) === paraId;
|
|
16375
|
-
})) !== null && _NODE_NAMES_DOT_KSM$f !==
|
|
16665
|
+
})) !== null && _NODE_NAMES_DOT_KSM$f !== undefined ? _NODE_NAMES_DOT_KSM$f : null;
|
|
16376
16666
|
};
|
|
16377
16667
|
|
|
16378
16668
|
var AssetHubPolkadot = {
|
|
@@ -17313,7 +17603,7 @@ var getBalanceForeignInternal = /*#__PURE__*/function () {
|
|
|
17313
17603
|
_context.next = 3;
|
|
17314
17604
|
return api.init(node);
|
|
17315
17605
|
case 3:
|
|
17316
|
-
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !==
|
|
17606
|
+
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
17317
17607
|
if (asset) {
|
|
17318
17608
|
_context.next = 6;
|
|
17319
17609
|
break;
|
|
@@ -17490,7 +17780,7 @@ var getAssetBalanceInternal = /*#__PURE__*/function () {
|
|
|
17490
17780
|
_context.next = 16;
|
|
17491
17781
|
break;
|
|
17492
17782
|
}
|
|
17493
|
-
_context.t1 = _yield$getBalanceFore !==
|
|
17783
|
+
_context.t1 = _yield$getBalanceFore !== undefined;
|
|
17494
17784
|
case 16:
|
|
17495
17785
|
if (!_context.t1) {
|
|
17496
17786
|
_context.next = 20;
|
|
@@ -17570,7 +17860,7 @@ var buildClaimAssetsInput = function buildClaimAssetsInput(_ref) {
|
|
|
17570
17860
|
multiAssets = _ref.multiAssets,
|
|
17571
17861
|
address = _ref.address,
|
|
17572
17862
|
_ref$version = _ref.version,
|
|
17573
|
-
version = _ref$version ===
|
|
17863
|
+
version = _ref$version === undefined ? Version.V3 : _ref$version;
|
|
17574
17864
|
return {
|
|
17575
17865
|
assets: _defineProperty({}, version, multiAssets),
|
|
17576
17866
|
beneficiary: _defineProperty({}, version, buildBeneficiaryInput(api, address))
|
|
@@ -17776,13 +18066,7 @@ var BatchTransactionManager = /*#__PURE__*/function () {
|
|
|
17776
18066
|
return Promise.all(results);
|
|
17777
18067
|
case 12:
|
|
17778
18068
|
txs = _context.sent;
|
|
17779
|
-
return _context.abrupt("return", api.
|
|
17780
|
-
module: 'Utility',
|
|
17781
|
-
section: mode === BatchMode.BATCH_ALL ? 'batch_all' : 'batch',
|
|
17782
|
-
parameters: {
|
|
17783
|
-
data: [txs]
|
|
17784
|
-
}
|
|
17785
|
-
}));
|
|
18069
|
+
return _context.abrupt("return", api.callBatchMethod(txs, mode));
|
|
17786
18070
|
case 14:
|
|
17787
18071
|
case "end":
|
|
17788
18072
|
return _context.stop();
|
|
@@ -17993,7 +18277,7 @@ var GeneralBuilder = /*#__PURE__*/function () {
|
|
|
17993
18277
|
}, {
|
|
17994
18278
|
key: "dryRun",
|
|
17995
18279
|
value: function () {
|
|
17996
|
-
var _dryRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
18280
|
+
var _dryRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(senderAddress) {
|
|
17997
18281
|
var tx;
|
|
17998
18282
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
17999
18283
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -18003,26 +18287,20 @@ var GeneralBuilder = /*#__PURE__*/function () {
|
|
|
18003
18287
|
return this.build();
|
|
18004
18288
|
case 3:
|
|
18005
18289
|
tx = _context3.sent;
|
|
18006
|
-
if (!(typeof this._address !== 'string')) {
|
|
18007
|
-
_context3.next = 6;
|
|
18008
|
-
break;
|
|
18009
|
-
}
|
|
18010
|
-
throw new Error('Address must be a string when using dryRun');
|
|
18011
|
-
case 6:
|
|
18012
18290
|
this.api.setDisconnectAllowed(true);
|
|
18013
18291
|
return _context3.abrupt("return", getDryRun({
|
|
18014
18292
|
api: this.api,
|
|
18015
18293
|
tx: tx,
|
|
18016
|
-
address:
|
|
18294
|
+
address: senderAddress,
|
|
18017
18295
|
node: this._from
|
|
18018
18296
|
}));
|
|
18019
|
-
case
|
|
18297
|
+
case 6:
|
|
18020
18298
|
case "end":
|
|
18021
18299
|
return _context3.stop();
|
|
18022
18300
|
}
|
|
18023
18301
|
}, _callee3, this);
|
|
18024
18302
|
}));
|
|
18025
|
-
function dryRun() {
|
|
18303
|
+
function dryRun(_x2) {
|
|
18026
18304
|
return _dryRun.apply(this, arguments);
|
|
18027
18305
|
}
|
|
18028
18306
|
return dryRun;
|
|
@@ -18065,7 +18343,7 @@ var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
|
|
|
18065
18343
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
18066
18344
|
while (1) switch (_context.prev = _context.next) {
|
|
18067
18345
|
case 0:
|
|
18068
|
-
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 ===
|
|
18346
|
+
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 === undefined ? 10 : _ref$feeMarginPercent;
|
|
18069
18347
|
_context.next = 3;
|
|
18070
18348
|
return api.init(origin);
|
|
18071
18349
|
case 3:
|
|
@@ -18086,7 +18364,7 @@ var getOriginFeeDetailsInternal = /*#__PURE__*/function () {
|
|
|
18086
18364
|
});
|
|
18087
18365
|
case 12:
|
|
18088
18366
|
nativeBalance = _context.sent;
|
|
18089
|
-
existentialDeposit = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !==
|
|
18367
|
+
existentialDeposit = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== undefined ? _getExistentialDeposi : '0');
|
|
18090
18368
|
sufficientForXCM = nativeBalance - existentialDeposit - xcmFeeWithMargin > 0;
|
|
18091
18369
|
return _context.abrupt("return", {
|
|
18092
18370
|
sufficientForXCM: sufficientForXCM,
|
|
@@ -18194,7 +18472,7 @@ var getMaxForeignTransferableAmount = /*#__PURE__*/function () {
|
|
|
18194
18472
|
case 0:
|
|
18195
18473
|
api = _ref3.api, address = _ref3.address, node = _ref3.node, currency = _ref3.currency;
|
|
18196
18474
|
validateAddress(address, node, false);
|
|
18197
|
-
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !==
|
|
18475
|
+
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
18198
18476
|
if (asset) {
|
|
18199
18477
|
_context2.next = 5;
|
|
18200
18478
|
break;
|
|
@@ -18245,7 +18523,7 @@ var getTransferableAmount = /*#__PURE__*/function () {
|
|
|
18245
18523
|
case 0:
|
|
18246
18524
|
api = _ref5.api, address = _ref5.address, node = _ref5.node, currency = _ref5.currency;
|
|
18247
18525
|
validateAddress(address, node, false);
|
|
18248
|
-
asset = (_getAssetBySymbolOrId2 = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId2 !==
|
|
18526
|
+
asset = (_getAssetBySymbolOrId2 = getAssetBySymbolOrId(node, currency, null)) !== null && _getAssetBySymbolOrId2 !== undefined ? _getAssetBySymbolOrId2 : node === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
18249
18527
|
if (asset) {
|
|
18250
18528
|
_context3.next = 5;
|
|
18251
18529
|
break;
|
|
@@ -18319,7 +18597,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
18319
18597
|
case 14:
|
|
18320
18598
|
xcmFeeDetails = _context.sent;
|
|
18321
18599
|
expectedBalanceAfterXCMDelivery = originBalance - xcmFeeDetails.xcmFee;
|
|
18322
|
-
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(origin, currency, destination)) !== null && _getAssetBySymbolOrId !==
|
|
18600
|
+
asset = (_getAssetBySymbolOrId = getAssetBySymbolOrId(origin, currency, destination)) !== null && _getAssetBySymbolOrId !== undefined ? _getAssetBySymbolOrId : origin === 'AssetHubPolkadot' ? getAssetBySymbolOrId('Ethereum', currency, null) : null;
|
|
18323
18601
|
if (asset) {
|
|
18324
18602
|
_context.next = 19;
|
|
18325
18603
|
break;
|
|
@@ -18340,7 +18618,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
18340
18618
|
});
|
|
18341
18619
|
case 22:
|
|
18342
18620
|
_context.t1 = _context.sent;
|
|
18343
|
-
_context.t2 = (_asset$symbol = asset === null || asset ===
|
|
18621
|
+
_context.t2 = (_asset$symbol = asset === null || asset === undefined ? undefined : asset.symbol) !== null && _asset$symbol !== undefined ? _asset$symbol : '';
|
|
18344
18622
|
_context.t3 = {
|
|
18345
18623
|
balance: _context.t1,
|
|
18346
18624
|
currency: _context.t2
|
|
@@ -18348,9 +18626,9 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
18348
18626
|
_context.t4 = originBalance;
|
|
18349
18627
|
_context.t5 = expectedBalanceAfterXCMDelivery;
|
|
18350
18628
|
_context.t6 = xcmFeeDetails;
|
|
18351
|
-
_context.t7 = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !==
|
|
18629
|
+
_context.t7 = BigInt((_getExistentialDeposi = getExistentialDeposit(origin)) !== null && _getExistentialDeposi !== undefined ? _getExistentialDeposi : 0);
|
|
18352
18630
|
_context.t8 = getNativeAssetSymbol(origin);
|
|
18353
|
-
_context.t9 = BigInt((_getExistentialDeposi2 = getExistentialDeposit(origin)) !== null && _getExistentialDeposi2 !==
|
|
18631
|
+
_context.t9 = BigInt((_getExistentialDeposi2 = getExistentialDeposit(origin)) !== null && _getExistentialDeposi2 !== undefined ? _getExistentialDeposi2 : 0);
|
|
18354
18632
|
_context.next = 33;
|
|
18355
18633
|
return getMaxNativeTransferableAmount({
|
|
18356
18634
|
api: api,
|
|
@@ -18377,7 +18655,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
18377
18655
|
case 37:
|
|
18378
18656
|
_context.t12 = _context.sent;
|
|
18379
18657
|
_context.t13 = getNativeAssetSymbol(destination);
|
|
18380
|
-
_context.t14 = BigInt((_getExistentialDeposi3 = getExistentialDeposit(destination)) !== null && _getExistentialDeposi3 !==
|
|
18658
|
+
_context.t14 = BigInt((_getExistentialDeposi3 = getExistentialDeposit(destination)) !== null && _getExistentialDeposi3 !== undefined ? _getExistentialDeposi3 : 0);
|
|
18381
18659
|
_context.t15 = {
|
|
18382
18660
|
balance: _context.t12,
|
|
18383
18661
|
currency: _context.t13,
|
|
@@ -18615,7 +18893,7 @@ var getMultiLocationTokenId = function getMultiLocationTokenId(location, node) {
|
|
|
18615
18893
|
var assetId = location.interior.value[1].value;
|
|
18616
18894
|
return (_foreignAssets$find$a = (_foreignAssets$find = foreignAssets.find(function (asset) {
|
|
18617
18895
|
return asset.assetId === String(assetId);
|
|
18618
|
-
})) === null || _foreignAssets$find ===
|
|
18896
|
+
})) === null || _foreignAssets$find === undefined ? undefined : _foreignAssets$find.assetId) !== null && _foreignAssets$find$a !== undefined ? _foreignAssets$find$a : null;
|
|
18619
18897
|
}
|
|
18620
18898
|
}
|
|
18621
18899
|
return null;
|
|
@@ -18684,7 +18962,7 @@ var getMultiLocationTokenIdPjs = function getMultiLocationTokenIdPjs(location, n
|
|
|
18684
18962
|
var assetId = junctions[1].GeneralIndex;
|
|
18685
18963
|
return (_foreignAssets$find$s = (_foreignAssets$find = foreignAssets.find(function (asset) {
|
|
18686
18964
|
return asset.assetId === String(assetId);
|
|
18687
|
-
})) === null || _foreignAssets$find ===
|
|
18965
|
+
})) === null || _foreignAssets$find === undefined ? undefined : _foreignAssets$find.symbol) !== null && _foreignAssets$find$s !== undefined ? _foreignAssets$find$s : null;
|
|
18688
18966
|
}
|
|
18689
18967
|
}
|
|
18690
18968
|
return null;
|
|
@@ -18798,6 +19076,9 @@ var validateCurrency = function validateCurrency(currency) {
|
|
|
18798
19076
|
}
|
|
18799
19077
|
};
|
|
18800
19078
|
var validateDestination = function validateDestination(origin, destination) {
|
|
19079
|
+
if (isRelayChain(origin) && !isTMultiLocation(destination) && isRelayChain(destination)) {
|
|
19080
|
+
throw new IncompatibleNodesError('Direct relay chain to relay chain transfers are not supported. Please use Polkadot <-> Kusama bridge through AssetHub.');
|
|
19081
|
+
}
|
|
18801
19082
|
if (destination === 'Ethereum' && origin !== 'AssetHubPolkadot' && origin !== 'Hydration') {
|
|
18802
19083
|
throw new IncompatibleNodesError('Transfers to Ethereum are only supported from AssetHubPolkadot and Hydration.');
|
|
18803
19084
|
}
|
|
@@ -18838,12 +19119,12 @@ var validateAssetSupport = function validateAssetSupport(_ref, assetCheckEnabled
|
|
|
18838
19119
|
}
|
|
18839
19120
|
if ('symbol' in currency && nativeAssets.some(function (nativeAsset) {
|
|
18840
19121
|
var _asset$symbol;
|
|
18841
|
-
return nativeAsset.symbol.toLowerCase() === (asset === null || asset ===
|
|
19122
|
+
return nativeAsset.symbol.toLowerCase() === (asset === null || asset === undefined || (_asset$symbol = asset.symbol) === null || _asset$symbol === undefined ? undefined : _asset$symbol.toLowerCase());
|
|
18842
19123
|
})) {
|
|
18843
|
-
throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset ===
|
|
19124
|
+
throw new InvalidCurrencyError("".concat(JSON.stringify(asset === null || asset === undefined ? undefined : asset.symbol), " is not supported for transfers to ").concat(destination, "."));
|
|
18844
19125
|
}
|
|
18845
19126
|
}
|
|
18846
|
-
if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset ===
|
|
19127
|
+
if (!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === undefined ? undefined : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol)) {
|
|
18847
19128
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
18848
19129
|
}
|
|
18849
19130
|
if (!isBridge && asset === null && assetCheckEnabled) {
|
|
@@ -18915,8 +19196,8 @@ var resolveOverriddenAsset = function resolveOverriddenAsset(options, isBridge,
|
|
|
18915
19196
|
var originTyped = origin;
|
|
18916
19197
|
var originNode = getNode(originTyped);
|
|
18917
19198
|
return _objectSpread2({
|
|
18918
|
-
isFeeAsset: (_currency$isFeeAsset = currency.isFeeAsset) !== null && _currency$isFeeAsset !==
|
|
18919
|
-
}, createMultiAsset(originNode.version, currency.amount, asset === null || asset ===
|
|
19199
|
+
isFeeAsset: (_currency$isFeeAsset = currency.isFeeAsset) !== null && _currency$isFeeAsset !== undefined ? _currency$isFeeAsset : false
|
|
19200
|
+
}, createMultiAsset(originNode.version, currency.amount, asset === null || asset === undefined ? undefined : asset.multiLocation));
|
|
18920
19201
|
});
|
|
18921
19202
|
return assets;
|
|
18922
19203
|
}
|
|
@@ -18979,7 +19260,7 @@ var send = /*#__PURE__*/function () {
|
|
|
18979
19260
|
return api.init(origin);
|
|
18980
19261
|
case 20:
|
|
18981
19262
|
// In case asset check is disabled, we create asset object from currency symbol
|
|
18982
|
-
resolvedAsset = asset !== null && asset !==
|
|
19263
|
+
resolvedAsset = asset !== null && asset !== undefined ? asset : {
|
|
18983
19264
|
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
18984
19265
|
};
|
|
18985
19266
|
originNode = getNode(origin);
|
|
@@ -19252,7 +19533,7 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
|
|
|
19252
19533
|
break;
|
|
19253
19534
|
}
|
|
19254
19535
|
_context.next = 25;
|
|
19255
|
-
return createTx('transferMultiCurrencies', [[[asset, currency.amount], [formatAssetIdToERC20((_usdtAsset$assetId = usdtAsset.assetId) !== null && _usdtAsset$assetId !==
|
|
19536
|
+
return createTx('transferMultiCurrencies', [[[asset, currency.amount], [formatAssetIdToERC20((_usdtAsset$assetId = usdtAsset.assetId) !== null && _usdtAsset$assetId !== undefined ? _usdtAsset$assetId : ''), '200000']], 1,
|
|
19256
19537
|
// index of the fee asset
|
|
19257
19538
|
destMultiLocation, weight]);
|
|
19258
19539
|
case 25:
|