@paraspell/sdk-core 8.0.2 → 8.1.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 +153 -69
- package/dist/index.d.ts +12 -5
- package/dist/index.mjs +153 -70
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -9654,6 +9654,81 @@ var Unique$3 = {
|
|
|
9654
9654
|
}
|
|
9655
9655
|
],
|
|
9656
9656
|
otherAssets: [
|
|
9657
|
+
{
|
|
9658
|
+
assetId: "459",
|
|
9659
|
+
symbol: "PINK",
|
|
9660
|
+
decimals: 10,
|
|
9661
|
+
multiLocation: {
|
|
9662
|
+
parents: 1,
|
|
9663
|
+
interior: {
|
|
9664
|
+
X3: [
|
|
9665
|
+
{
|
|
9666
|
+
Parachain: 1000
|
|
9667
|
+
},
|
|
9668
|
+
{
|
|
9669
|
+
PalletInstance: 50
|
|
9670
|
+
},
|
|
9671
|
+
{
|
|
9672
|
+
GeneralIndex: 23
|
|
9673
|
+
}
|
|
9674
|
+
]
|
|
9675
|
+
}
|
|
9676
|
+
},
|
|
9677
|
+
existentialDeposit: "0"
|
|
9678
|
+
},
|
|
9679
|
+
{
|
|
9680
|
+
assetId: "473",
|
|
9681
|
+
symbol: "USDt",
|
|
9682
|
+
decimals: 6,
|
|
9683
|
+
multiLocation: {
|
|
9684
|
+
parents: 1,
|
|
9685
|
+
interior: {
|
|
9686
|
+
X3: [
|
|
9687
|
+
{
|
|
9688
|
+
Parachain: 1000
|
|
9689
|
+
},
|
|
9690
|
+
{
|
|
9691
|
+
PalletInstance: 50
|
|
9692
|
+
},
|
|
9693
|
+
{
|
|
9694
|
+
GeneralIndex: 1984
|
|
9695
|
+
}
|
|
9696
|
+
]
|
|
9697
|
+
}
|
|
9698
|
+
},
|
|
9699
|
+
existentialDeposit: "0"
|
|
9700
|
+
},
|
|
9701
|
+
{
|
|
9702
|
+
assetId: "498",
|
|
9703
|
+
symbol: "GLMR",
|
|
9704
|
+
decimals: 18,
|
|
9705
|
+
multiLocation: {
|
|
9706
|
+
parents: 1,
|
|
9707
|
+
interior: {
|
|
9708
|
+
X2: [
|
|
9709
|
+
{
|
|
9710
|
+
Parachain: 2004
|
|
9711
|
+
},
|
|
9712
|
+
{
|
|
9713
|
+
PalletInstance: 10
|
|
9714
|
+
}
|
|
9715
|
+
]
|
|
9716
|
+
}
|
|
9717
|
+
},
|
|
9718
|
+
existentialDeposit: "0"
|
|
9719
|
+
},
|
|
9720
|
+
{
|
|
9721
|
+
assetId: "437",
|
|
9722
|
+
symbol: "DOT",
|
|
9723
|
+
decimals: 10,
|
|
9724
|
+
multiLocation: {
|
|
9725
|
+
parents: 1,
|
|
9726
|
+
interior: {
|
|
9727
|
+
Here: null
|
|
9728
|
+
}
|
|
9729
|
+
},
|
|
9730
|
+
existentialDeposit: "0"
|
|
9731
|
+
}
|
|
9657
9732
|
]
|
|
9658
9733
|
};
|
|
9659
9734
|
var Crust$3 = {
|
|
@@ -13111,8 +13186,7 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
|
|
|
13111
13186
|
includeFee: false
|
|
13112
13187
|
},
|
|
13113
13188
|
includeFee = _ref2.includeFee;
|
|
13114
|
-
var
|
|
13115
|
-
var paraId = !isRelayDestination && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
13189
|
+
var paraId = resolveParaId(paraIdTo, destination);
|
|
13116
13190
|
return _objectSpread2({
|
|
13117
13191
|
dest: createPolkadotXcmHeader('RelayToPara', version, destination, paraId),
|
|
13118
13192
|
beneficiary: generateAddressPayload(api, 'RelayToPara', null, address, version, paraId),
|
|
@@ -13362,6 +13436,13 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
13362
13436
|
}]);
|
|
13363
13437
|
}();
|
|
13364
13438
|
|
|
13439
|
+
var resolveParaId = function resolveParaId(paraId, destination) {
|
|
13440
|
+
if (isTMultiLocation(destination) || isRelayChain(destination) || destination === 'Ethereum') {
|
|
13441
|
+
return undefined;
|
|
13442
|
+
}
|
|
13443
|
+
return paraId !== null && paraId !== void 0 ? paraId : getParaId(destination);
|
|
13444
|
+
};
|
|
13445
|
+
|
|
13365
13446
|
var supportsXTokens = function supportsXTokens(obj) {
|
|
13366
13447
|
return _typeof(obj) === 'object' && obj !== null && 'transferXTokens' in obj;
|
|
13367
13448
|
};
|
|
@@ -13421,7 +13502,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
13421
13502
|
api = options.api, asset = options.asset, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, overriddenAsset = options.overriddenAsset, version = options.version, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method;
|
|
13422
13503
|
isRelayDestination = !isTMultiLocation(destination) && isRelayChain(destination);
|
|
13423
13504
|
scenario = isRelayDestination ? 'ParaToRelay' : 'ParaToPara';
|
|
13424
|
-
paraId =
|
|
13505
|
+
paraId = resolveParaId(paraIdTo, destination);
|
|
13425
13506
|
if (!(destination === 'Polimec' && this.node !== 'AssetHubPolkadot')) {
|
|
13426
13507
|
_context.next = 6;
|
|
13427
13508
|
break;
|
|
@@ -13580,16 +13661,17 @@ var Unique$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
13580
13661
|
key: "transferXTokens",
|
|
13581
13662
|
value: function transferXTokens(input) {
|
|
13582
13663
|
var asset = input.asset;
|
|
13664
|
+
if (asset.symbol === this.getNativeAssetSymbol()) {
|
|
13665
|
+
return XTokensTransferImpl.transferXTokens(input, Unique.NATIVE_ASSET_ID);
|
|
13666
|
+
}
|
|
13583
13667
|
if (!isForeignAsset(asset) || !asset.assetId) {
|
|
13584
13668
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
13585
13669
|
}
|
|
13586
|
-
|
|
13587
|
-
ForeignAssetId: BigInt(asset.assetId)
|
|
13588
|
-
};
|
|
13589
|
-
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
13670
|
+
return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
|
|
13590
13671
|
}
|
|
13591
13672
|
}]);
|
|
13592
13673
|
}(ParachainNode);
|
|
13674
|
+
Unique$1.NATIVE_ASSET_ID = 0;
|
|
13593
13675
|
|
|
13594
13676
|
var Crust$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
13595
13677
|
function Crust() {
|
|
@@ -14704,8 +14786,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14704
14786
|
destination = input.destination,
|
|
14705
14787
|
paraIdTo = input.paraIdTo;
|
|
14706
14788
|
var version = exports.Version.V2;
|
|
14707
|
-
var
|
|
14708
|
-
var paraId = !isRelayDestination && _typeof(destination) !== 'object' && destination !== 'Ethereum' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
14789
|
+
var paraId = resolveParaId(paraIdTo, destination);
|
|
14709
14790
|
var customMultiLocation = {
|
|
14710
14791
|
parents: exports.Parents.ONE,
|
|
14711
14792
|
interior: {
|
|
@@ -15133,20 +15214,25 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15133
15214
|
|
|
15134
15215
|
var Quartz$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
15135
15216
|
function Quartz() {
|
|
15136
|
-
var _this;
|
|
15137
15217
|
_classCallCheck(this, Quartz);
|
|
15138
|
-
|
|
15139
|
-
_this._assetCheckEnabled = false;
|
|
15140
|
-
return _this;
|
|
15218
|
+
return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', exports.Version.V3]);
|
|
15141
15219
|
}
|
|
15142
15220
|
_inherits(Quartz, _ParachainNode);
|
|
15143
15221
|
return _createClass(Quartz, [{
|
|
15144
15222
|
key: "transferXTokens",
|
|
15145
15223
|
value: function transferXTokens(input) {
|
|
15146
|
-
|
|
15224
|
+
var asset = input.asset;
|
|
15225
|
+
if (asset.symbol === this.getNativeAssetSymbol()) {
|
|
15226
|
+
return XTokensTransferImpl.transferXTokens(input, Quartz.NATIVE_ASSET_ID);
|
|
15227
|
+
}
|
|
15228
|
+
if (!isForeignAsset(asset) || !asset.assetId) {
|
|
15229
|
+
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
15230
|
+
}
|
|
15231
|
+
return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
|
|
15147
15232
|
}
|
|
15148
15233
|
}]);
|
|
15149
15234
|
}(ParachainNode);
|
|
15235
|
+
Quartz$1.NATIVE_ASSET_ID = 0;
|
|
15150
15236
|
|
|
15151
15237
|
var Shiden$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
15152
15238
|
function Shiden() {
|
|
@@ -15335,14 +15421,14 @@ var Collectives$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15335
15421
|
var determineDestWeight = function determineDestWeight(destNode) {
|
|
15336
15422
|
if (destNode === 'Astar') {
|
|
15337
15423
|
return {
|
|
15338
|
-
|
|
15339
|
-
|
|
15424
|
+
ref_time: 6000000000n,
|
|
15425
|
+
proof_size: 1000000n
|
|
15340
15426
|
};
|
|
15341
15427
|
}
|
|
15342
15428
|
if (destNode === 'Moonbeam' || destNode === 'Hydration') {
|
|
15343
15429
|
return {
|
|
15344
|
-
|
|
15345
|
-
|
|
15430
|
+
ref_time: 5000000000n,
|
|
15431
|
+
proof_size: 0n
|
|
15346
15432
|
};
|
|
15347
15433
|
}
|
|
15348
15434
|
throw new NodeNotSupportedError("Node ".concat(destNode, " is not supported"));
|
|
@@ -15422,7 +15508,7 @@ var Khala$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15422
15508
|
key: "transferXTransfer",
|
|
15423
15509
|
value: function transferXTransfer(input) {
|
|
15424
15510
|
var asset = input.asset;
|
|
15425
|
-
if (asset.symbol !==
|
|
15511
|
+
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
15426
15512
|
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(asset.symbol));
|
|
15427
15513
|
}
|
|
15428
15514
|
return XTransferTransferImpl.transferXTransfer(input);
|
|
@@ -15630,8 +15716,7 @@ var Peaq$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15630
15716
|
|
|
15631
15717
|
var GAS_LIMIT = 1000000000n;
|
|
15632
15718
|
var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, scenario, destination, paraIdTo, version) {
|
|
15633
|
-
var
|
|
15634
|
-
var paraId = !isRelayDestination && _typeof(destination) !== 'object' && destination !== 'Ethereum' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
15719
|
+
var paraId = resolveParaId(paraIdTo, destination);
|
|
15635
15720
|
return _defineProperty({}, version, [{
|
|
15636
15721
|
DepositReserveAsset: {
|
|
15637
15722
|
assets: {
|
|
@@ -17461,10 +17546,6 @@ var getAssetBalance = /*#__PURE__*/function () {
|
|
|
17461
17546
|
};
|
|
17462
17547
|
}();
|
|
17463
17548
|
|
|
17464
|
-
var isPjsClient = function isPjsClient(api) {
|
|
17465
|
-
return _typeof(api) === 'object' && api !== null && 'disconnect' in api && typeof api.disconnect === 'function';
|
|
17466
|
-
};
|
|
17467
|
-
|
|
17468
17549
|
var buildBeneficiaryInput = function buildBeneficiaryInput(api, address) {
|
|
17469
17550
|
if (isTMultiLocation(address)) {
|
|
17470
17551
|
return address;
|
|
@@ -17508,7 +17589,6 @@ var claimAssets = /*#__PURE__*/function () {
|
|
|
17508
17589
|
_context.next = 3;
|
|
17509
17590
|
return api.init(node);
|
|
17510
17591
|
case 3:
|
|
17511
|
-
_context.prev = 3;
|
|
17512
17592
|
args = buildClaimAssetsInput(options);
|
|
17513
17593
|
module = isRelayChain(node) ? 'XcmPallet' : 'PolkadotXcm';
|
|
17514
17594
|
call = {
|
|
@@ -17517,21 +17597,11 @@ var claimAssets = /*#__PURE__*/function () {
|
|
|
17517
17597
|
parameters: args
|
|
17518
17598
|
};
|
|
17519
17599
|
return _context.abrupt("return", api.callTxMethod(call));
|
|
17520
|
-
case
|
|
17521
|
-
_context.prev = 8;
|
|
17522
|
-
if (!isPjsClient(api.getApi())) {
|
|
17523
|
-
_context.next = 12;
|
|
17524
|
-
break;
|
|
17525
|
-
}
|
|
17526
|
-
_context.next = 12;
|
|
17527
|
-
return api.disconnect();
|
|
17528
|
-
case 12:
|
|
17529
|
-
return _context.finish(8);
|
|
17530
|
-
case 13:
|
|
17600
|
+
case 7:
|
|
17531
17601
|
case "end":
|
|
17532
17602
|
return _context.stop();
|
|
17533
17603
|
}
|
|
17534
|
-
}, _callee
|
|
17604
|
+
}, _callee);
|
|
17535
17605
|
}));
|
|
17536
17606
|
return function claimAssets(_x) {
|
|
17537
17607
|
return _ref.apply(this, arguments);
|
|
@@ -17624,6 +17694,25 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
|
|
|
17624
17694
|
}
|
|
17625
17695
|
return build;
|
|
17626
17696
|
}())
|
|
17697
|
+
}, {
|
|
17698
|
+
key: "disconnect",
|
|
17699
|
+
value: function () {
|
|
17700
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
17701
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
17702
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
17703
|
+
case 0:
|
|
17704
|
+
return _context2.abrupt("return", this.api.disconnect(true));
|
|
17705
|
+
case 1:
|
|
17706
|
+
case "end":
|
|
17707
|
+
return _context2.stop();
|
|
17708
|
+
}
|
|
17709
|
+
}, _callee2, this);
|
|
17710
|
+
}));
|
|
17711
|
+
function disconnect() {
|
|
17712
|
+
return _disconnect.apply(this, arguments);
|
|
17713
|
+
}
|
|
17714
|
+
return disconnect;
|
|
17715
|
+
}()
|
|
17627
17716
|
}], [{
|
|
17628
17717
|
key: "create",
|
|
17629
17718
|
value: function create(api, node) {
|
|
@@ -17940,6 +18029,25 @@ var GeneralBuilder = /*#__PURE__*/function () {
|
|
|
17940
18029
|
}
|
|
17941
18030
|
return dryRun;
|
|
17942
18031
|
}()
|
|
18032
|
+
}, {
|
|
18033
|
+
key: "disconnect",
|
|
18034
|
+
value: function () {
|
|
18035
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
18036
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
18037
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
18038
|
+
case 0:
|
|
18039
|
+
return _context4.abrupt("return", this.api.disconnect(true));
|
|
18040
|
+
case 1:
|
|
18041
|
+
case "end":
|
|
18042
|
+
return _context4.stop();
|
|
18043
|
+
}
|
|
18044
|
+
}, _callee4, this);
|
|
18045
|
+
}));
|
|
18046
|
+
function disconnect() {
|
|
18047
|
+
return _disconnect.apply(this, arguments);
|
|
18048
|
+
}
|
|
18049
|
+
return disconnect;
|
|
18050
|
+
}()
|
|
17943
18051
|
}]);
|
|
17944
18052
|
}();
|
|
17945
18053
|
/**
|
|
@@ -18762,7 +18870,6 @@ var transferRelayToPara = /*#__PURE__*/function () {
|
|
|
18762
18870
|
_context.next = 6;
|
|
18763
18871
|
return api.init(origin);
|
|
18764
18872
|
case 6:
|
|
18765
|
-
_context.prev = 6;
|
|
18766
18873
|
serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(origin, destination) : destination).transferRelayToPara({
|
|
18767
18874
|
api: api,
|
|
18768
18875
|
origin: origin,
|
|
@@ -18775,21 +18882,11 @@ var transferRelayToPara = /*#__PURE__*/function () {
|
|
|
18775
18882
|
method: method
|
|
18776
18883
|
});
|
|
18777
18884
|
return _context.abrupt("return", api.callTxMethod(serializedApiCall));
|
|
18778
|
-
case
|
|
18779
|
-
_context.prev = 9;
|
|
18780
|
-
if (!isPjsClient(api.getApi())) {
|
|
18781
|
-
_context.next = 13;
|
|
18782
|
-
break;
|
|
18783
|
-
}
|
|
18784
|
-
_context.next = 13;
|
|
18785
|
-
return api.disconnect();
|
|
18786
|
-
case 13:
|
|
18787
|
-
return _context.finish(9);
|
|
18788
|
-
case 14:
|
|
18885
|
+
case 8:
|
|
18789
18886
|
case "end":
|
|
18790
18887
|
return _context.stop();
|
|
18791
18888
|
}
|
|
18792
|
-
}, _callee
|
|
18889
|
+
}, _callee);
|
|
18793
18890
|
}));
|
|
18794
18891
|
return function transferRelayToPara(_x) {
|
|
18795
18892
|
return _ref.apply(this, arguments);
|
|
@@ -18883,14 +18980,12 @@ var send = /*#__PURE__*/function () {
|
|
|
18883
18980
|
_context.next = 20;
|
|
18884
18981
|
return api.init(origin);
|
|
18885
18982
|
case 20:
|
|
18886
|
-
_context.prev = 20;
|
|
18887
18983
|
// In case asset check is disabled, we create asset object from currency symbol
|
|
18888
18984
|
resolvedAsset = asset !== null && asset !== void 0 ? asset : {
|
|
18889
18985
|
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
18890
18986
|
};
|
|
18891
18987
|
originNode = getNode(origin);
|
|
18892
|
-
_context.
|
|
18893
|
-
return originNode.transfer({
|
|
18988
|
+
return _context.abrupt("return", originNode.transfer({
|
|
18894
18989
|
api: api,
|
|
18895
18990
|
asset: _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
18896
18991
|
amount: 'multiasset' in currency ? 0 : currency.amount
|
|
@@ -18903,24 +18998,12 @@ var send = /*#__PURE__*/function () {
|
|
|
18903
18998
|
ahAddress: ahAddress,
|
|
18904
18999
|
pallet: pallet,
|
|
18905
19000
|
method: method
|
|
18906
|
-
});
|
|
18907
|
-
case
|
|
18908
|
-
return _context.abrupt("return", _context.sent);
|
|
18909
|
-
case 26:
|
|
18910
|
-
_context.prev = 26;
|
|
18911
|
-
if (!isPjsClient(api.getApi())) {
|
|
18912
|
-
_context.next = 30;
|
|
18913
|
-
break;
|
|
18914
|
-
}
|
|
18915
|
-
_context.next = 30;
|
|
18916
|
-
return api.disconnect();
|
|
18917
|
-
case 30:
|
|
18918
|
-
return _context.finish(26);
|
|
18919
|
-
case 31:
|
|
19001
|
+
}));
|
|
19002
|
+
case 23:
|
|
18920
19003
|
case "end":
|
|
18921
19004
|
return _context.stop();
|
|
18922
19005
|
}
|
|
18923
|
-
}, _callee
|
|
19006
|
+
}, _callee);
|
|
18924
19007
|
}));
|
|
18925
19008
|
return function send(_x) {
|
|
18926
19009
|
return _ref.apply(this, arguments);
|
|
@@ -19265,6 +19348,7 @@ exports.isNodeEvm = isNodeEvm;
|
|
|
19265
19348
|
exports.isOverrideMultiLocationSpecifier = isOverrideMultiLocationSpecifier;
|
|
19266
19349
|
exports.isRelayChain = isRelayChain;
|
|
19267
19350
|
exports.resolveModuleError = resolveModuleError;
|
|
19351
|
+
exports.resolveParaId = resolveParaId;
|
|
19268
19352
|
exports.send = send;
|
|
19269
19353
|
exports.transferMoonbeamEvm = transferMoonbeamEvm;
|
|
19270
19354
|
exports.transferRelayToPara = transferRelayToPara;
|
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ declare class Acala<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXT
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
declare class Unique<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
57
|
+
private static NATIVE_ASSET_ID;
|
|
57
58
|
constructor();
|
|
58
59
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
59
60
|
}
|
|
@@ -640,8 +641,8 @@ type TSerializedApiCall = {
|
|
|
640
641
|
parameters: Record<string, unknown>;
|
|
641
642
|
};
|
|
642
643
|
type TDestWeight = {
|
|
643
|
-
|
|
644
|
-
|
|
644
|
+
ref_time: bigint;
|
|
645
|
+
proof_size: bigint;
|
|
645
646
|
};
|
|
646
647
|
type TXTransferSection = 'transfer';
|
|
647
648
|
type TXTokensSection = 'transfer' | 'transfer_multiasset' | 'transfer_multiassets';
|
|
@@ -736,8 +737,8 @@ declare class Crab<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPol
|
|
|
736
737
|
}
|
|
737
738
|
|
|
738
739
|
declare class Quartz<TApi, TRes> extends ParachainNode<TApi, TRes> implements IXTokensTransfer {
|
|
740
|
+
private static NATIVE_ASSET_ID;
|
|
739
741
|
constructor();
|
|
740
|
-
_assetCheckEnabled: boolean;
|
|
741
742
|
transferXTokens<TApi, TRes>(input: TXTokensTransferOptions<TApi, TRes>): TRes;
|
|
742
743
|
}
|
|
743
744
|
|
|
@@ -1059,6 +1060,7 @@ interface IFromBuilder<TApi, TRes> {
|
|
|
1059
1060
|
from: (node: TNodeDotKsmWithRelayChains) => IToBuilder<TApi, TRes>;
|
|
1060
1061
|
claimFrom: (node: TNodeWithRelayChains) => IFungibleBuilder<TRes>;
|
|
1061
1062
|
buildBatch: (options?: TBatchOptions) => Promise<TRes>;
|
|
1063
|
+
disconnect: () => Promise<void>;
|
|
1062
1064
|
}
|
|
1063
1065
|
interface IToBuilder<TApi, TRes> {
|
|
1064
1066
|
to: (node: TDestination, paraIdTo?: number) => ICurrencyBuilder<TApi, TRes>;
|
|
@@ -1067,6 +1069,7 @@ interface ICurrencyBuilder<TApi, TRes> {
|
|
|
1067
1069
|
currency: (currency: TCurrencyInputWithAmount) => IAddressBuilder<TApi, TRes>;
|
|
1068
1070
|
}
|
|
1069
1071
|
interface IFinalBuilder<TRes> {
|
|
1072
|
+
disconnect: () => Promise<void>;
|
|
1070
1073
|
build: () => Promise<TRes>;
|
|
1071
1074
|
}
|
|
1072
1075
|
interface IAddressBuilder<TApi, TRes> {
|
|
@@ -1087,6 +1090,7 @@ interface IAddToBatchBuilder<TApi, TRes> {
|
|
|
1087
1090
|
interface IFinalBuilderWithOptions<TApi, TRes> extends IAddToBatchBuilder<TApi, TRes> {
|
|
1088
1091
|
xcmVersion: (version: Version) => this;
|
|
1089
1092
|
customPallet: (pallet: string, method: string) => this;
|
|
1093
|
+
disconnect: () => Promise<void>;
|
|
1090
1094
|
build: () => Promise<TRes>;
|
|
1091
1095
|
dryRun: () => Promise<TDryRunResult>;
|
|
1092
1096
|
}
|
|
@@ -1301,7 +1305,7 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
1301
1305
|
getDryRun(options: TDryRunBaseOptions<TRes>): Promise<TDryRunResult>;
|
|
1302
1306
|
setDisconnectAllowed(allowed: boolean): void;
|
|
1303
1307
|
getDisconnectAllowed(): boolean;
|
|
1304
|
-
disconnect(): Promise<void>;
|
|
1308
|
+
disconnect(force?: boolean): Promise<void>;
|
|
1305
1309
|
}
|
|
1306
1310
|
|
|
1307
1311
|
declare const send: <TApi, TRes>(options: TSendOptions<TApi, TRes>) => Promise<TRes>;
|
|
@@ -1557,6 +1561,7 @@ declare class GeneralBuilder<TApi, TRes> implements IToBuilder<TApi, TRes>, ICur
|
|
|
1557
1561
|
*/
|
|
1558
1562
|
build(): Promise<TRes>;
|
|
1559
1563
|
dryRun(): Promise<TDryRunResult>;
|
|
1564
|
+
disconnect(): Promise<void>;
|
|
1560
1565
|
}
|
|
1561
1566
|
/**
|
|
1562
1567
|
* Creates a new Builder instance.
|
|
@@ -1596,6 +1601,8 @@ declare const computeFeeFromDryRunPjs: (dryRun: any, node: TNodeDotKsmWithRelayC
|
|
|
1596
1601
|
|
|
1597
1602
|
declare const isOverrideMultiLocationSpecifier: (multiLocationSpecifier: TMultiLocationValueWithOverride) => multiLocationSpecifier is TOverrideMultiLocationSpecifier;
|
|
1598
1603
|
|
|
1604
|
+
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
1605
|
+
|
|
1599
1606
|
/**
|
|
1600
1607
|
* Determines the relay chain for a given node.
|
|
1601
1608
|
*
|
|
@@ -1721,4 +1728,4 @@ declare const getNodeProviders: (node: TNodeDotKsmWithRelayChains) => string[];
|
|
|
1721
1728
|
*/
|
|
1722
1729
|
declare const getParaId: (node: TNodeDotKsmWithRelayChains) => number;
|
|
1723
1730
|
|
|
1724
|
-
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, resolveModuleError, send, transferMoonbeamEvm, transferRelayToPara };
|
|
1731
|
+
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, type IAccountBuilder, type IAddToBatchBuilder, type IAddressBuilder, type ICurrencyBuilder, type IFinalBuilder, type IFinalBuilderWithOptions, type IFromBuilder, type IFungibleBuilder, type IPolkadotApi, type IPolkadotXCMTransfer, type IToBuilder, type IVersionBuilder, type IXTokensTransfer, type IXTransferTransfer, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, type TAddress, type TAmount, type TApiOrUrl, type TAsset, type TAssetJsonMap, type TBalanceResponse, type TBatchOptions, type TBifrostToken, type TCurrency, type TCurrencyCore, type TCurrencyCoreV1, type TCurrencyCoreV1WithAmount, type TCurrencyCoreWithFee, type TCurrencyInput, type TCurrencyInputWithAmount, type TCurrencySelection, type TCurrencySelectionHeader, type TCurrencySelectionHeaderArr, type TCurrencySelectionV4, type TCurrencySymbol, type TCurrencySymbolValue, type TDestWeight, type TDestination, type TDryRunBaseOptions, type TDryRunOptions, type TDryRunResult, type TEdJsonMap, type TEvmBuilderOptions, type TEvmBuilderOptionsBase, type TForeignAsset, type TForeignAssetId, type TForeignOrNativeAsset, type TForeignOrTokenAsset, type TGetAssetBalanceOptions, type TGetAssetBalanceOptionsBase, type TGetBalanceForeignOptions, type TGetBalanceForeignOptionsBase, type TGetBalanceNativeOptions, type TGetBalanceNativeOptionsBase, type TGetMaxForeignTransferableAmountOptions, type TGetMaxForeignTransferableAmountOptionsBase, type TGetMaxNativeTransferableAmountOptions, type TGetMaxNativeTransferableAmountOptionsBase, type TGetOriginFeeDetailsOptions, type TGetOriginFeeDetailsOptionsBase, type TGetTransferInfoOptions, type TGetTransferInfoOptionsBase, type TGetTransferableAmountOptions, type TGetTransferableAmountOptionsBase, type TJunction, type TJunctionGeneralIndex, type TJunctionParachain, type TJunctionType, type TJunctions, type TMantaAsset, type TModuleError, type TMultiAsset, type TMultiAssetV3, type TMultiAssetV4, type TMultiAssetWithFee, type TMultiLocation, type TMultiLocationHeader, type TMultiLocationValue, type TMultiLocationValueWithOverride, type TNativeAsset, type TNativeTokenAsset, type TNode, type TNodeAssets, type TNodeConfig, type TNodeConfigMap, type TNodeDotKsmWithRelayChains, type TNodePolkadotKusama, type TNodeWithRelayChains, type TNodleAsset, type TOptionalEvmBuilderOptions, type TOriginFeeDetails, type TOtherReserveAsset, type TOverrideMultiLocationSpecifier, type TPallet, type TPalletDetails, type TPalletJsonMap, type TPalletMap, type TPolkadotXCMTransferOptions, type TPolkadotXcmSection, type TProviderEntry, type TRelayChainSymbol, type TRelayChainType, type TRelayToParaDestination, type TRelayToParaOptions, type TRelayToParaOverrides, type TRelaychain, type TReserveAsset, type TScenario, type TSelfReserveAsset, type TSendBaseOptions, type TSendInternalOptions, type TSendOptions, type TSerializeEthTransferOptions, type TSerializedApiCall, type TSerializedEthTransfer, type TSymbolSpecifier, type TTransferInfo, type TVersionClaimAssets, type TXTokensCurrencySelection, type TXTokensSection, type TXTokensTransferOptions, type TXTransferSection, type TXTransferTransferOptions, type TXcmAsset, type TXcmForeignAsset, type TXcmPalletSection, type TZeitgeistAsset, Version, type WithAmount, type WithApi, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
|
package/dist/index.mjs
CHANGED
|
@@ -9652,6 +9652,81 @@ var Unique$3 = {
|
|
|
9652
9652
|
}
|
|
9653
9653
|
],
|
|
9654
9654
|
otherAssets: [
|
|
9655
|
+
{
|
|
9656
|
+
assetId: "459",
|
|
9657
|
+
symbol: "PINK",
|
|
9658
|
+
decimals: 10,
|
|
9659
|
+
multiLocation: {
|
|
9660
|
+
parents: 1,
|
|
9661
|
+
interior: {
|
|
9662
|
+
X3: [
|
|
9663
|
+
{
|
|
9664
|
+
Parachain: 1000
|
|
9665
|
+
},
|
|
9666
|
+
{
|
|
9667
|
+
PalletInstance: 50
|
|
9668
|
+
},
|
|
9669
|
+
{
|
|
9670
|
+
GeneralIndex: 23
|
|
9671
|
+
}
|
|
9672
|
+
]
|
|
9673
|
+
}
|
|
9674
|
+
},
|
|
9675
|
+
existentialDeposit: "0"
|
|
9676
|
+
},
|
|
9677
|
+
{
|
|
9678
|
+
assetId: "473",
|
|
9679
|
+
symbol: "USDt",
|
|
9680
|
+
decimals: 6,
|
|
9681
|
+
multiLocation: {
|
|
9682
|
+
parents: 1,
|
|
9683
|
+
interior: {
|
|
9684
|
+
X3: [
|
|
9685
|
+
{
|
|
9686
|
+
Parachain: 1000
|
|
9687
|
+
},
|
|
9688
|
+
{
|
|
9689
|
+
PalletInstance: 50
|
|
9690
|
+
},
|
|
9691
|
+
{
|
|
9692
|
+
GeneralIndex: 1984
|
|
9693
|
+
}
|
|
9694
|
+
]
|
|
9695
|
+
}
|
|
9696
|
+
},
|
|
9697
|
+
existentialDeposit: "0"
|
|
9698
|
+
},
|
|
9699
|
+
{
|
|
9700
|
+
assetId: "498",
|
|
9701
|
+
symbol: "GLMR",
|
|
9702
|
+
decimals: 18,
|
|
9703
|
+
multiLocation: {
|
|
9704
|
+
parents: 1,
|
|
9705
|
+
interior: {
|
|
9706
|
+
X2: [
|
|
9707
|
+
{
|
|
9708
|
+
Parachain: 2004
|
|
9709
|
+
},
|
|
9710
|
+
{
|
|
9711
|
+
PalletInstance: 10
|
|
9712
|
+
}
|
|
9713
|
+
]
|
|
9714
|
+
}
|
|
9715
|
+
},
|
|
9716
|
+
existentialDeposit: "0"
|
|
9717
|
+
},
|
|
9718
|
+
{
|
|
9719
|
+
assetId: "437",
|
|
9720
|
+
symbol: "DOT",
|
|
9721
|
+
decimals: 10,
|
|
9722
|
+
multiLocation: {
|
|
9723
|
+
parents: 1,
|
|
9724
|
+
interior: {
|
|
9725
|
+
Here: null
|
|
9726
|
+
}
|
|
9727
|
+
},
|
|
9728
|
+
existentialDeposit: "0"
|
|
9729
|
+
}
|
|
9655
9730
|
]
|
|
9656
9731
|
};
|
|
9657
9732
|
var Crust$3 = {
|
|
@@ -13109,8 +13184,7 @@ var constructRelayToParaParameters = function constructRelayToParaParameters(_re
|
|
|
13109
13184
|
includeFee: false
|
|
13110
13185
|
},
|
|
13111
13186
|
includeFee = _ref2.includeFee;
|
|
13112
|
-
var
|
|
13113
|
-
var paraId = !isRelayDestination && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
13187
|
+
var paraId = resolveParaId(paraIdTo, destination);
|
|
13114
13188
|
return _objectSpread2({
|
|
13115
13189
|
dest: createPolkadotXcmHeader('RelayToPara', version, destination, paraId),
|
|
13116
13190
|
beneficiary: generateAddressPayload(api, 'RelayToPara', null, address, version, paraId),
|
|
@@ -13360,6 +13434,13 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
|
|
|
13360
13434
|
}]);
|
|
13361
13435
|
}();
|
|
13362
13436
|
|
|
13437
|
+
var resolveParaId = function resolveParaId(paraId, destination) {
|
|
13438
|
+
if (isTMultiLocation(destination) || isRelayChain(destination) || destination === 'Ethereum') {
|
|
13439
|
+
return undefined;
|
|
13440
|
+
}
|
|
13441
|
+
return paraId !== null && paraId !== void 0 ? paraId : getParaId(destination);
|
|
13442
|
+
};
|
|
13443
|
+
|
|
13363
13444
|
var supportsXTokens = function supportsXTokens(obj) {
|
|
13364
13445
|
return _typeof(obj) === 'object' && obj !== null && 'transferXTokens' in obj;
|
|
13365
13446
|
};
|
|
@@ -13419,7 +13500,7 @@ var ParachainNode = /*#__PURE__*/function () {
|
|
|
13419
13500
|
api = options.api, asset = options.asset, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, overriddenAsset = options.overriddenAsset, version = options.version, ahAddress = options.ahAddress, pallet = options.pallet, method = options.method;
|
|
13420
13501
|
isRelayDestination = !isTMultiLocation(destination) && isRelayChain(destination);
|
|
13421
13502
|
scenario = isRelayDestination ? 'ParaToRelay' : 'ParaToPara';
|
|
13422
|
-
paraId =
|
|
13503
|
+
paraId = resolveParaId(paraIdTo, destination);
|
|
13423
13504
|
if (!(destination === 'Polimec' && this.node !== 'AssetHubPolkadot')) {
|
|
13424
13505
|
_context.next = 6;
|
|
13425
13506
|
break;
|
|
@@ -13578,16 +13659,17 @@ var Unique$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
13578
13659
|
key: "transferXTokens",
|
|
13579
13660
|
value: function transferXTokens(input) {
|
|
13580
13661
|
var asset = input.asset;
|
|
13662
|
+
if (asset.symbol === this.getNativeAssetSymbol()) {
|
|
13663
|
+
return XTokensTransferImpl.transferXTokens(input, Unique.NATIVE_ASSET_ID);
|
|
13664
|
+
}
|
|
13581
13665
|
if (!isForeignAsset(asset) || !asset.assetId) {
|
|
13582
13666
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
13583
13667
|
}
|
|
13584
|
-
|
|
13585
|
-
ForeignAssetId: BigInt(asset.assetId)
|
|
13586
|
-
};
|
|
13587
|
-
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
13668
|
+
return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
|
|
13588
13669
|
}
|
|
13589
13670
|
}]);
|
|
13590
13671
|
}(ParachainNode);
|
|
13672
|
+
Unique$1.NATIVE_ASSET_ID = 0;
|
|
13591
13673
|
|
|
13592
13674
|
var Crust$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
13593
13675
|
function Crust() {
|
|
@@ -14702,8 +14784,7 @@ var AssetHubPolkadot$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
14702
14784
|
destination = input.destination,
|
|
14703
14785
|
paraIdTo = input.paraIdTo;
|
|
14704
14786
|
var version = Version.V2;
|
|
14705
|
-
var
|
|
14706
|
-
var paraId = !isRelayDestination && _typeof(destination) !== 'object' && destination !== 'Ethereum' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
14787
|
+
var paraId = resolveParaId(paraIdTo, destination);
|
|
14707
14788
|
var customMultiLocation = {
|
|
14708
14789
|
parents: Parents.ONE,
|
|
14709
14790
|
interior: {
|
|
@@ -15131,20 +15212,25 @@ var Crab$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15131
15212
|
|
|
15132
15213
|
var Quartz$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
15133
15214
|
function Quartz() {
|
|
15134
|
-
var _this;
|
|
15135
15215
|
_classCallCheck(this, Quartz);
|
|
15136
|
-
|
|
15137
|
-
_this._assetCheckEnabled = false;
|
|
15138
|
-
return _this;
|
|
15216
|
+
return _callSuper(this, Quartz, ['Quartz', 'quartz', 'kusama', Version.V3]);
|
|
15139
15217
|
}
|
|
15140
15218
|
_inherits(Quartz, _ParachainNode);
|
|
15141
15219
|
return _createClass(Quartz, [{
|
|
15142
15220
|
key: "transferXTokens",
|
|
15143
15221
|
value: function transferXTokens(input) {
|
|
15144
|
-
|
|
15222
|
+
var asset = input.asset;
|
|
15223
|
+
if (asset.symbol === this.getNativeAssetSymbol()) {
|
|
15224
|
+
return XTokensTransferImpl.transferXTokens(input, Quartz.NATIVE_ASSET_ID);
|
|
15225
|
+
}
|
|
15226
|
+
if (!isForeignAsset(asset) || !asset.assetId) {
|
|
15227
|
+
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
15228
|
+
}
|
|
15229
|
+
return XTokensTransferImpl.transferXTokens(input, Number(asset.assetId));
|
|
15145
15230
|
}
|
|
15146
15231
|
}]);
|
|
15147
15232
|
}(ParachainNode);
|
|
15233
|
+
Quartz$1.NATIVE_ASSET_ID = 0;
|
|
15148
15234
|
|
|
15149
15235
|
var Shiden$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
15150
15236
|
function Shiden() {
|
|
@@ -15333,14 +15419,14 @@ var Collectives$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15333
15419
|
var determineDestWeight = function determineDestWeight(destNode) {
|
|
15334
15420
|
if (destNode === 'Astar') {
|
|
15335
15421
|
return {
|
|
15336
|
-
|
|
15337
|
-
|
|
15422
|
+
ref_time: 6000000000n,
|
|
15423
|
+
proof_size: 1000000n
|
|
15338
15424
|
};
|
|
15339
15425
|
}
|
|
15340
15426
|
if (destNode === 'Moonbeam' || destNode === 'Hydration') {
|
|
15341
15427
|
return {
|
|
15342
|
-
|
|
15343
|
-
|
|
15428
|
+
ref_time: 5000000000n,
|
|
15429
|
+
proof_size: 0n
|
|
15344
15430
|
};
|
|
15345
15431
|
}
|
|
15346
15432
|
throw new NodeNotSupportedError("Node ".concat(destNode, " is not supported"));
|
|
@@ -15420,7 +15506,7 @@ var Khala$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15420
15506
|
key: "transferXTransfer",
|
|
15421
15507
|
value: function transferXTransfer(input) {
|
|
15422
15508
|
var asset = input.asset;
|
|
15423
|
-
if (asset.symbol !==
|
|
15509
|
+
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
15424
15510
|
throw new InvalidCurrencyError("Node ".concat(this.node, " does not support currency ").concat(asset.symbol));
|
|
15425
15511
|
}
|
|
15426
15512
|
return XTransferTransferImpl.transferXTransfer(input);
|
|
@@ -15628,8 +15714,7 @@ var Peaq$1 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
15628
15714
|
|
|
15629
15715
|
var GAS_LIMIT = 1000000000n;
|
|
15630
15716
|
var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, scenario, destination, paraIdTo, version) {
|
|
15631
|
-
var
|
|
15632
|
-
var paraId = !isRelayDestination && _typeof(destination) !== 'object' && destination !== 'Ethereum' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
|
|
15717
|
+
var paraId = resolveParaId(paraIdTo, destination);
|
|
15633
15718
|
return _defineProperty({}, version, [{
|
|
15634
15719
|
DepositReserveAsset: {
|
|
15635
15720
|
assets: {
|
|
@@ -17459,10 +17544,6 @@ var getAssetBalance = /*#__PURE__*/function () {
|
|
|
17459
17544
|
};
|
|
17460
17545
|
}();
|
|
17461
17546
|
|
|
17462
|
-
var isPjsClient = function isPjsClient(api) {
|
|
17463
|
-
return _typeof(api) === 'object' && api !== null && 'disconnect' in api && typeof api.disconnect === 'function';
|
|
17464
|
-
};
|
|
17465
|
-
|
|
17466
17547
|
var buildBeneficiaryInput = function buildBeneficiaryInput(api, address) {
|
|
17467
17548
|
if (isTMultiLocation(address)) {
|
|
17468
17549
|
return address;
|
|
@@ -17506,7 +17587,6 @@ var claimAssets = /*#__PURE__*/function () {
|
|
|
17506
17587
|
_context.next = 3;
|
|
17507
17588
|
return api.init(node);
|
|
17508
17589
|
case 3:
|
|
17509
|
-
_context.prev = 3;
|
|
17510
17590
|
args = buildClaimAssetsInput(options);
|
|
17511
17591
|
module = isRelayChain(node) ? 'XcmPallet' : 'PolkadotXcm';
|
|
17512
17592
|
call = {
|
|
@@ -17515,21 +17595,11 @@ var claimAssets = /*#__PURE__*/function () {
|
|
|
17515
17595
|
parameters: args
|
|
17516
17596
|
};
|
|
17517
17597
|
return _context.abrupt("return", api.callTxMethod(call));
|
|
17518
|
-
case
|
|
17519
|
-
_context.prev = 8;
|
|
17520
|
-
if (!isPjsClient(api.getApi())) {
|
|
17521
|
-
_context.next = 12;
|
|
17522
|
-
break;
|
|
17523
|
-
}
|
|
17524
|
-
_context.next = 12;
|
|
17525
|
-
return api.disconnect();
|
|
17526
|
-
case 12:
|
|
17527
|
-
return _context.finish(8);
|
|
17528
|
-
case 13:
|
|
17598
|
+
case 7:
|
|
17529
17599
|
case "end":
|
|
17530
17600
|
return _context.stop();
|
|
17531
17601
|
}
|
|
17532
|
-
}, _callee
|
|
17602
|
+
}, _callee);
|
|
17533
17603
|
}));
|
|
17534
17604
|
return function claimAssets(_x) {
|
|
17535
17605
|
return _ref.apply(this, arguments);
|
|
@@ -17622,6 +17692,25 @@ var AssetClaimBuilder = /*#__PURE__*/function () {
|
|
|
17622
17692
|
}
|
|
17623
17693
|
return build;
|
|
17624
17694
|
}())
|
|
17695
|
+
}, {
|
|
17696
|
+
key: "disconnect",
|
|
17697
|
+
value: function () {
|
|
17698
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
17699
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
17700
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
17701
|
+
case 0:
|
|
17702
|
+
return _context2.abrupt("return", this.api.disconnect(true));
|
|
17703
|
+
case 1:
|
|
17704
|
+
case "end":
|
|
17705
|
+
return _context2.stop();
|
|
17706
|
+
}
|
|
17707
|
+
}, _callee2, this);
|
|
17708
|
+
}));
|
|
17709
|
+
function disconnect() {
|
|
17710
|
+
return _disconnect.apply(this, arguments);
|
|
17711
|
+
}
|
|
17712
|
+
return disconnect;
|
|
17713
|
+
}()
|
|
17625
17714
|
}], [{
|
|
17626
17715
|
key: "create",
|
|
17627
17716
|
value: function create(api, node) {
|
|
@@ -17938,6 +18027,25 @@ var GeneralBuilder = /*#__PURE__*/function () {
|
|
|
17938
18027
|
}
|
|
17939
18028
|
return dryRun;
|
|
17940
18029
|
}()
|
|
18030
|
+
}, {
|
|
18031
|
+
key: "disconnect",
|
|
18032
|
+
value: function () {
|
|
18033
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
18034
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
18035
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
18036
|
+
case 0:
|
|
18037
|
+
return _context4.abrupt("return", this.api.disconnect(true));
|
|
18038
|
+
case 1:
|
|
18039
|
+
case "end":
|
|
18040
|
+
return _context4.stop();
|
|
18041
|
+
}
|
|
18042
|
+
}, _callee4, this);
|
|
18043
|
+
}));
|
|
18044
|
+
function disconnect() {
|
|
18045
|
+
return _disconnect.apply(this, arguments);
|
|
18046
|
+
}
|
|
18047
|
+
return disconnect;
|
|
18048
|
+
}()
|
|
17941
18049
|
}]);
|
|
17942
18050
|
}();
|
|
17943
18051
|
/**
|
|
@@ -18760,7 +18868,6 @@ var transferRelayToPara = /*#__PURE__*/function () {
|
|
|
18760
18868
|
_context.next = 6;
|
|
18761
18869
|
return api.init(origin);
|
|
18762
18870
|
case 6:
|
|
18763
|
-
_context.prev = 6;
|
|
18764
18871
|
serializedApiCall = getNode(isMultiLocationDestination ? resolveTNodeFromMultiLocation(origin, destination) : destination).transferRelayToPara({
|
|
18765
18872
|
api: api,
|
|
18766
18873
|
origin: origin,
|
|
@@ -18773,21 +18880,11 @@ var transferRelayToPara = /*#__PURE__*/function () {
|
|
|
18773
18880
|
method: method
|
|
18774
18881
|
});
|
|
18775
18882
|
return _context.abrupt("return", api.callTxMethod(serializedApiCall));
|
|
18776
|
-
case
|
|
18777
|
-
_context.prev = 9;
|
|
18778
|
-
if (!isPjsClient(api.getApi())) {
|
|
18779
|
-
_context.next = 13;
|
|
18780
|
-
break;
|
|
18781
|
-
}
|
|
18782
|
-
_context.next = 13;
|
|
18783
|
-
return api.disconnect();
|
|
18784
|
-
case 13:
|
|
18785
|
-
return _context.finish(9);
|
|
18786
|
-
case 14:
|
|
18883
|
+
case 8:
|
|
18787
18884
|
case "end":
|
|
18788
18885
|
return _context.stop();
|
|
18789
18886
|
}
|
|
18790
|
-
}, _callee
|
|
18887
|
+
}, _callee);
|
|
18791
18888
|
}));
|
|
18792
18889
|
return function transferRelayToPara(_x) {
|
|
18793
18890
|
return _ref.apply(this, arguments);
|
|
@@ -18881,14 +18978,12 @@ var send = /*#__PURE__*/function () {
|
|
|
18881
18978
|
_context.next = 20;
|
|
18882
18979
|
return api.init(origin);
|
|
18883
18980
|
case 20:
|
|
18884
|
-
_context.prev = 20;
|
|
18885
18981
|
// In case asset check is disabled, we create asset object from currency symbol
|
|
18886
18982
|
resolvedAsset = asset !== null && asset !== void 0 ? asset : {
|
|
18887
18983
|
symbol: 'symbol' in currency ? currency.symbol : undefined
|
|
18888
18984
|
};
|
|
18889
18985
|
originNode = getNode(origin);
|
|
18890
|
-
_context.
|
|
18891
|
-
return originNode.transfer({
|
|
18986
|
+
return _context.abrupt("return", originNode.transfer({
|
|
18892
18987
|
api: api,
|
|
18893
18988
|
asset: _objectSpread2(_objectSpread2({}, resolvedAsset), {}, {
|
|
18894
18989
|
amount: 'multiasset' in currency ? 0 : currency.amount
|
|
@@ -18901,24 +18996,12 @@ var send = /*#__PURE__*/function () {
|
|
|
18901
18996
|
ahAddress: ahAddress,
|
|
18902
18997
|
pallet: pallet,
|
|
18903
18998
|
method: method
|
|
18904
|
-
});
|
|
18905
|
-
case
|
|
18906
|
-
return _context.abrupt("return", _context.sent);
|
|
18907
|
-
case 26:
|
|
18908
|
-
_context.prev = 26;
|
|
18909
|
-
if (!isPjsClient(api.getApi())) {
|
|
18910
|
-
_context.next = 30;
|
|
18911
|
-
break;
|
|
18912
|
-
}
|
|
18913
|
-
_context.next = 30;
|
|
18914
|
-
return api.disconnect();
|
|
18915
|
-
case 30:
|
|
18916
|
-
return _context.finish(26);
|
|
18917
|
-
case 31:
|
|
18999
|
+
}));
|
|
19000
|
+
case 23:
|
|
18918
19001
|
case "end":
|
|
18919
19002
|
return _context.stop();
|
|
18920
19003
|
}
|
|
18921
|
-
}, _callee
|
|
19004
|
+
}, _callee);
|
|
18922
19005
|
}));
|
|
18923
19006
|
return function send(_x) {
|
|
18924
19007
|
return _ref.apply(this, arguments);
|
|
@@ -19195,4 +19278,4 @@ var transferMoonbeamEvm = /*#__PURE__*/function () {
|
|
|
19195
19278
|
};
|
|
19196
19279
|
}();
|
|
19197
19280
|
|
|
19198
|
-
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, _deepEqual as deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, resolveModuleError, send, transferMoonbeamEvm, transferRelayToPara };
|
|
19281
|
+
export { BatchMode, Builder, DuplicateAssetError, DuplicateAssetIdError, Foreign, ForeignAbstract, GeneralBuilder, IncompatibleNodesError, InvalidAddressError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, Native, NoXCMSupportImplementedError, NodeNotSupportedError, Override, Parents, PolkadotXcmError, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, XTokensError, claimAssets, computeFeeFromDryRun, computeFeeFromDryRunPjs, createApiInstanceForNode, createX1Payload, _deepEqual as deepEqual, determineRelayChain, generateAddressMultiLocationV4, generateAddressPayload, getAllAssetsSymbols, getAssetBalance, getAssetBalanceInternal, getAssetBySymbolOrId, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceForeignInternal, getBalanceNative, getBalanceNativeInternal, getDefaultPallet, getDryRun, getExistentialDeposit, getFees, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getNativeAssetSymbol, getNativeAssets, getNode, getNodeConfig, getNodeProviders, getOriginFeeDetails, getOriginFeeDetailsInternal, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getSupportedPalletsDetails, getTNode, getTransferInfo, getTransferableAmount, hasSupportForAsset, isForeignAsset, isNodeEvm, isOverrideMultiLocationSpecifier, isRelayChain, resolveModuleError, resolveParaId, send, transferMoonbeamEvm, transferRelayToPara };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
14
15
|
"import": "./dist/index.mjs",
|
|
15
|
-
"require": "./dist/index.cjs"
|
|
16
|
-
"types": "./dist/index.d.ts"
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"main": "dist/index.cjs",
|