@paraspell/sdk-core 11.12.8 → 11.12.10
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 +60 -374
- package/dist/index.d.ts +1 -19
- package/dist/index.mjs +60 -374
- package/package.json +14 -14
package/dist/index.cjs
CHANGED
|
@@ -1635,10 +1635,6 @@ var Moonbeam$1 = {
|
|
|
1635
1635
|
name: "Blast",
|
|
1636
1636
|
endpoint: "wss://moonbeam.public.blastapi.io"
|
|
1637
1637
|
},
|
|
1638
|
-
{
|
|
1639
|
-
name: "Dwellir",
|
|
1640
|
-
endpoint: "wss://moonbeam-rpc.n.dwellir.com"
|
|
1641
|
-
},
|
|
1642
1638
|
{
|
|
1643
1639
|
name: "IBP1",
|
|
1644
1640
|
endpoint: "wss://moonbeam.ibp.network"
|
|
@@ -1837,17 +1833,6 @@ var Phala$1 = {
|
|
|
1837
1833
|
}
|
|
1838
1834
|
]
|
|
1839
1835
|
};
|
|
1840
|
-
var Subsocial$1 = {
|
|
1841
|
-
name: "Subsocial",
|
|
1842
|
-
info: "subsocial",
|
|
1843
|
-
paraId: 2101,
|
|
1844
|
-
providers: [
|
|
1845
|
-
{
|
|
1846
|
-
name: "Dappforce",
|
|
1847
|
-
endpoint: "wss://para.subsocial.network"
|
|
1848
|
-
}
|
|
1849
|
-
]
|
|
1850
|
-
};
|
|
1851
1836
|
var KiltSpiritnet$1 = {
|
|
1852
1837
|
name: "KILT Spiritnet",
|
|
1853
1838
|
info: "kilt",
|
|
@@ -1912,33 +1897,6 @@ var Peaq$1 = {
|
|
|
1912
1897
|
}
|
|
1913
1898
|
]
|
|
1914
1899
|
};
|
|
1915
|
-
var Polimec$1 = {
|
|
1916
|
-
name: "Polimec",
|
|
1917
|
-
info: "polimec",
|
|
1918
|
-
paraId: 3344,
|
|
1919
|
-
providers: [
|
|
1920
|
-
{
|
|
1921
|
-
name: "Amforc",
|
|
1922
|
-
endpoint: "wss://polimec.rpc.amforc.com"
|
|
1923
|
-
},
|
|
1924
|
-
{
|
|
1925
|
-
name: "Helikon",
|
|
1926
|
-
endpoint: "wss://rpc.helikon.io/polimec"
|
|
1927
|
-
},
|
|
1928
|
-
{
|
|
1929
|
-
name: "IBP1",
|
|
1930
|
-
endpoint: "wss://polimec.ibp.network"
|
|
1931
|
-
},
|
|
1932
|
-
{
|
|
1933
|
-
name: "IBP2",
|
|
1934
|
-
endpoint: "wss://polimec.dotters.network"
|
|
1935
|
-
},
|
|
1936
|
-
{
|
|
1937
|
-
name: "Polimec Foundation",
|
|
1938
|
-
endpoint: "wss://rpc.polimec.org"
|
|
1939
|
-
}
|
|
1940
|
-
]
|
|
1941
|
-
};
|
|
1942
1900
|
var RobonomicsPolkadot$1 = {
|
|
1943
1901
|
name: "Robonomics",
|
|
1944
1902
|
info: "robonomics",
|
|
@@ -2001,18 +1959,6 @@ var Unique$1 = {
|
|
|
2001
1959
|
{
|
|
2002
1960
|
name: "IBP2",
|
|
2003
1961
|
endpoint: "wss://unique.dotters.network"
|
|
2004
|
-
},
|
|
2005
|
-
{
|
|
2006
|
-
name: "Unique America",
|
|
2007
|
-
endpoint: "wss://us-ws.unique.network"
|
|
2008
|
-
},
|
|
2009
|
-
{
|
|
2010
|
-
name: "Unique Asia",
|
|
2011
|
-
endpoint: "wss://asia-ws.unique.network"
|
|
2012
|
-
},
|
|
2013
|
-
{
|
|
2014
|
-
name: "Unique Europe",
|
|
2015
|
-
endpoint: "wss://eu-ws.unique.network"
|
|
2016
1962
|
}
|
|
2017
1963
|
]
|
|
2018
1964
|
};
|
|
@@ -2183,10 +2129,6 @@ var Moonriver$1 = {
|
|
|
2183
2129
|
name: "Allnodes",
|
|
2184
2130
|
endpoint: "wss://moonriver-rpc.publicnode.com"
|
|
2185
2131
|
},
|
|
2186
|
-
{
|
|
2187
|
-
name: "Dwellir",
|
|
2188
|
-
endpoint: "wss://moonriver-rpc.n.dwellir.com"
|
|
2189
|
-
},
|
|
2190
2132
|
{
|
|
2191
2133
|
name: "Moonbeam Foundation",
|
|
2192
2134
|
endpoint: "wss://wss.api.moonriver.moonbeam.network"
|
|
@@ -2376,10 +2318,6 @@ var Quartz$1 = {
|
|
|
2376
2318
|
{
|
|
2377
2319
|
name: "Geo Load Balancer",
|
|
2378
2320
|
endpoint: "wss://ws-quartz.unique.network"
|
|
2379
|
-
},
|
|
2380
|
-
{
|
|
2381
|
-
name: "Unique Europe",
|
|
2382
|
-
endpoint: "wss://eu-ws-quartz.unique.network"
|
|
2383
2321
|
}
|
|
2384
2322
|
]
|
|
2385
2323
|
};
|
|
@@ -2978,12 +2916,10 @@ var configs = {
|
|
|
2978
2916
|
NeuroWeb: NeuroWeb$1,
|
|
2979
2917
|
Pendulum: Pendulum$1,
|
|
2980
2918
|
Phala: Phala$1,
|
|
2981
|
-
Subsocial: Subsocial$1,
|
|
2982
2919
|
KiltSpiritnet: KiltSpiritnet$1,
|
|
2983
2920
|
Curio: Curio$1,
|
|
2984
2921
|
Mythos: Mythos$1,
|
|
2985
2922
|
Peaq: Peaq$1,
|
|
2986
|
-
Polimec: Polimec$1,
|
|
2987
2923
|
RobonomicsPolkadot: RobonomicsPolkadot$1,
|
|
2988
2924
|
PeoplePolkadot: PeoplePolkadot$1,
|
|
2989
2925
|
Unique: Unique$1,
|
|
@@ -3899,27 +3835,20 @@ var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
|
3899
3835
|
return _context.a(2, api.getMythosForeignBalance(address));
|
|
3900
3836
|
case 2:
|
|
3901
3837
|
assertIsForeign(asset);
|
|
3902
|
-
if (!(chain === 'Polimec')) {
|
|
3903
|
-
_context.n = 3;
|
|
3904
|
-
break;
|
|
3905
|
-
}
|
|
3906
|
-
assertHasLocation(asset);
|
|
3907
|
-
return _context.a(2, api.getBalanceForeignAssetsPallet(address, asset.location));
|
|
3908
|
-
case 3:
|
|
3909
3838
|
if (!chain.startsWith('AssetHub')) {
|
|
3910
|
-
_context.n =
|
|
3839
|
+
_context.n = 4;
|
|
3911
3840
|
break;
|
|
3912
3841
|
}
|
|
3913
3842
|
ASSETS_PALLET_ID = 50;
|
|
3914
3843
|
hasRequiredJunctions = asset.location && sdkCommon.hasJunction(asset.location, 'PalletInstance', ASSETS_PALLET_ID) && sdkCommon.hasJunction(asset.location, 'GeneralIndex');
|
|
3915
3844
|
if (!(!asset.location || hasRequiredJunctions)) {
|
|
3916
|
-
_context.n =
|
|
3845
|
+
_context.n = 3;
|
|
3917
3846
|
break;
|
|
3918
3847
|
}
|
|
3919
3848
|
return _context.a(2, api.getBalanceAssetsPallet(address, Number(asset.assetId)));
|
|
3920
|
-
case
|
|
3849
|
+
case 3:
|
|
3921
3850
|
return _context.a(2, api.getBalanceForeignAssetsPallet(address, asset.location));
|
|
3922
|
-
case
|
|
3851
|
+
case 4:
|
|
3923
3852
|
return _context.a(2, api.getBalanceForeignPolkadotXcm(chain, address, asset));
|
|
3924
3853
|
}
|
|
3925
3854
|
}, _callee);
|
|
@@ -4541,8 +4470,7 @@ var resolveHopAsset = function resolveHopAsset(_ref) {
|
|
|
4541
4470
|
hasPassedExchange = _ref.hasPassedExchange,
|
|
4542
4471
|
currency = _ref.currency;
|
|
4543
4472
|
var isRelayAssetIncluded = api.getTypeThenAssetCount(tx) === 2;
|
|
4544
|
-
var
|
|
4545
|
-
var useRelayAssetAsFee = destination === 'Ethereum' || isSubBridge || isRelayAssetIncluded;
|
|
4473
|
+
var useRelayAssetAsFee = destination === 'Ethereum' || isRelayAssetIncluded;
|
|
4546
4474
|
if (useRelayAssetAsFee) {
|
|
4547
4475
|
return assets.findNativeAssetInfoOrThrow(getRelayChainOf(currentChain));
|
|
4548
4476
|
}
|
|
@@ -6300,8 +6228,16 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
6300
6228
|
assertHasId(asset);
|
|
6301
6229
|
var assetId = asset.assetId,
|
|
6302
6230
|
amount = asset.amount;
|
|
6303
|
-
var
|
|
6304
|
-
var
|
|
6231
|
+
var bigintIdChains = ['Astar', 'Shiden', 'Moonbeam', 'NeuroWeb'];
|
|
6232
|
+
var notUseAddressIdChains = ['NeuroWeb'];
|
|
6233
|
+
var useBigInt = bigintIdChains.some(function (prefix) {
|
|
6234
|
+
return chain.startsWith(prefix);
|
|
6235
|
+
});
|
|
6236
|
+
var id = useBigInt ? BigInt(assetId) : Number(assetId);
|
|
6237
|
+
var notUseId = notUseAddressIdChains.some(function (prefix) {
|
|
6238
|
+
return chain.startsWith(prefix);
|
|
6239
|
+
}) || assets.isChainEvm(chain);
|
|
6240
|
+
var addr = notUseId ? address : {
|
|
6305
6241
|
Id: address
|
|
6306
6242
|
};
|
|
6307
6243
|
return Promise.resolve({
|
|
@@ -6461,37 +6397,31 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6461
6397
|
api = sendOptions.api, asset = sendOptions.assetInfo, currency = sendOptions.currency, feeAsset = sendOptions.feeAsset, feeCurrency = sendOptions.feeCurrency, address = sendOptions.address, destination = sendOptions.to, paraIdTo = sendOptions.paraIdTo, overriddenAsset = sendOptions.overriddenAsset, version = sendOptions.version, senderAddress = sendOptions.senderAddress, ahAddress = sendOptions.ahAddress, pallet = sendOptions.pallet, method = sendOptions.method;
|
|
6462
6398
|
scenario = resolveScenario(this.chain, destination);
|
|
6463
6399
|
paraId = resolveParaId(paraIdTo, destination);
|
|
6464
|
-
destChain = resolveDestChain(this.chain, paraId);
|
|
6465
|
-
if (!(destination === 'Polimec' && this.chain !== 'AssetHubPolkadot' && this.chain !== 'Hydration' && this.chain !== destination)) {
|
|
6466
|
-
_context.n = 1;
|
|
6467
|
-
break;
|
|
6468
|
-
}
|
|
6469
|
-
throw new InvalidParameterError('Sending assets to Polimec is supported only from AssetHubPolkadot and Hydration');
|
|
6470
|
-
case 1:
|
|
6400
|
+
destChain = resolveDestChain(this.chain, paraId);
|
|
6471
6401
|
isLocalTransfer = this.chain === destination;
|
|
6472
6402
|
if (!isLocalTransfer) {
|
|
6473
|
-
_context.n =
|
|
6403
|
+
_context.n = 1;
|
|
6474
6404
|
break;
|
|
6475
6405
|
}
|
|
6476
6406
|
return _context.a(2, this.transferLocal(sendOptions));
|
|
6477
|
-
case
|
|
6407
|
+
case 1:
|
|
6478
6408
|
this.throwIfTempDisabled(sendOptions, destChain);
|
|
6479
6409
|
this.throwIfCantReceive(destChain);
|
|
6480
6410
|
isRelayAsset = sdkCommon.deepEqual(asset.location, RELAY_LOCATION) && assets.isSymbolMatch(assets.getRelayChainSymbol(this.chain), asset.symbol);
|
|
6481
|
-
_context.n =
|
|
6411
|
+
_context.n = 2;
|
|
6482
6412
|
return api.hasMethod('PolkadotXcm', 'transfer_assets_using_type_and_then');
|
|
6483
|
-
case
|
|
6413
|
+
case 2:
|
|
6484
6414
|
supportsTypeThen = _context.v;
|
|
6485
6415
|
if (!(isRelayAsset && !supportsTypeThen)) {
|
|
6486
|
-
_context.n =
|
|
6416
|
+
_context.n = 3;
|
|
6487
6417
|
break;
|
|
6488
6418
|
}
|
|
6489
6419
|
throw new InvalidParameterError('Relaychain assets can only be transferred using the type-and-then method which is not supported by this chain');
|
|
6490
|
-
case
|
|
6420
|
+
case 3:
|
|
6491
6421
|
isSubBridge = !sdkCommon.isTLocation(destination) && sdkCommon.isSubstrateBridge(this.chain, destination);
|
|
6492
6422
|
useTypeAndThen = isRelayAsset && supportsTypeThen && destChain && !feeAsset && (!sdkCommon.isTrustedChain(this.chain) || !sdkCommon.isTrustedChain(destChain)) || isSubBridge;
|
|
6493
6423
|
if (!(supportsXTokens(this) && this.canUseXTokens(sendOptions) && !useTypeAndThen)) {
|
|
6494
|
-
_context.n =
|
|
6424
|
+
_context.n = 5;
|
|
6495
6425
|
break;
|
|
6496
6426
|
}
|
|
6497
6427
|
isBifrostOrigin = this.chain === 'BifrostPolkadot' || this.chain === 'BifrostKusama';
|
|
@@ -6512,15 +6442,15 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6512
6442
|
method: method
|
|
6513
6443
|
};
|
|
6514
6444
|
if (!useMultiAssets) {
|
|
6515
|
-
_context.n =
|
|
6445
|
+
_context.n = 4;
|
|
6516
6446
|
break;
|
|
6517
6447
|
}
|
|
6518
6448
|
return _context.a(2, transferXTokens(input, undefined));
|
|
6519
|
-
case
|
|
6449
|
+
case 4:
|
|
6520
6450
|
return _context.a(2, this.transferXTokens(input));
|
|
6521
|
-
case
|
|
6451
|
+
case 5:
|
|
6522
6452
|
if (!supportsXTransfer(this)) {
|
|
6523
|
-
_context.n =
|
|
6453
|
+
_context.n = 6;
|
|
6524
6454
|
break;
|
|
6525
6455
|
}
|
|
6526
6456
|
return _context.a(2, this.transferXTransfer({
|
|
@@ -6534,9 +6464,9 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6534
6464
|
pallet: pallet,
|
|
6535
6465
|
method: method
|
|
6536
6466
|
}));
|
|
6537
|
-
case
|
|
6467
|
+
case 6:
|
|
6538
6468
|
if (!(supportsPolkadotXCM(this) || useTypeAndThen)) {
|
|
6539
|
-
_context.n =
|
|
6469
|
+
_context.n = 15;
|
|
6540
6470
|
break;
|
|
6541
6471
|
}
|
|
6542
6472
|
options = {
|
|
@@ -6571,17 +6501,17 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6571
6501
|
return chain === null || chain === void 0 ? void 0 : chain.startsWith('Integritee');
|
|
6572
6502
|
};
|
|
6573
6503
|
if (!((isAhToOtherPara || isOtherParaToAh) && shouldUseTeleport && !isAllowedAhTransfer(destChain) && !isAllowedAhTransfer(this.chain))) {
|
|
6574
|
-
_context.n =
|
|
6504
|
+
_context.n = 7;
|
|
6575
6505
|
break;
|
|
6576
6506
|
}
|
|
6577
6507
|
throw new TransferToAhNotSupported('Native asset transfers to or from AssetHub are temporarily disabled');
|
|
6578
|
-
case
|
|
6508
|
+
case 7:
|
|
6579
6509
|
if (!(this.chain === 'Astar' && isRelayAsset)) {
|
|
6580
|
-
_context.n =
|
|
6510
|
+
_context.n = 8;
|
|
6581
6511
|
break;
|
|
6582
6512
|
}
|
|
6583
6513
|
throw new InvalidParameterError('Astar system asset transfers are temporarily disabled');
|
|
6584
|
-
case
|
|
6514
|
+
case 8:
|
|
6585
6515
|
isAHOrigin = this.chain.includes('AssetHub');
|
|
6586
6516
|
isAHDest = !sdkCommon.isTLocation(destination) && destination.includes('AssetHub'); // Handle common cases
|
|
6587
6517
|
isExternalAsset = ((_asset$location2 = asset.location) === null || _asset$location2 === void 0 ? void 0 : _asset$location2.parents) === sdkCommon.Parents.TWO;
|
|
@@ -6589,43 +6519,43 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6589
6519
|
isExternalAssetViaAh = isExternalAsset && !isAHOrigin && !isAHDest && !isEthDest && !feeAsset; // External asset - Any origin to AHP - DestinationReserve - one DepositAsset instruction
|
|
6590
6520
|
isExternalAssetToAh = isExternalAsset && isAHDest && !isAHOrigin && !isEthDest && !feeAsset;
|
|
6591
6521
|
if (!(isExternalAssetViaAh || isExternalAssetToAh || useTypeAndThen)) {
|
|
6592
|
-
_context.n =
|
|
6522
|
+
_context.n = 14;
|
|
6593
6523
|
break;
|
|
6594
6524
|
}
|
|
6595
6525
|
if (!(useTypeAndThen && supportsPolkadotXCM(this) && !isSubBridge)) {
|
|
6596
|
-
_context.n =
|
|
6526
|
+
_context.n = 9;
|
|
6597
6527
|
break;
|
|
6598
6528
|
}
|
|
6599
|
-
_context.n =
|
|
6529
|
+
_context.n = 9;
|
|
6600
6530
|
return this.transferPolkadotXCM(options);
|
|
6601
|
-
case
|
|
6531
|
+
case 9:
|
|
6602
6532
|
if (!isRelayAsset) {
|
|
6603
|
-
_context.n =
|
|
6533
|
+
_context.n = 11;
|
|
6604
6534
|
break;
|
|
6605
6535
|
}
|
|
6606
|
-
_context.n =
|
|
6536
|
+
_context.n = 10;
|
|
6607
6537
|
return createTypeThenAutoReserve(this.chain, options);
|
|
6608
|
-
case
|
|
6538
|
+
case 10:
|
|
6609
6539
|
_t = _context.v;
|
|
6610
|
-
_context.n = 14;
|
|
6611
|
-
break;
|
|
6612
|
-
case 12:
|
|
6613
6540
|
_context.n = 13;
|
|
6541
|
+
break;
|
|
6542
|
+
case 11:
|
|
6543
|
+
_context.n = 12;
|
|
6614
6544
|
return createTypeAndThenCall(this.chain, options);
|
|
6615
|
-
case
|
|
6545
|
+
case 12:
|
|
6616
6546
|
_t = _context.v;
|
|
6617
|
-
case
|
|
6547
|
+
case 13:
|
|
6618
6548
|
call = _t;
|
|
6619
6549
|
return _context.a(2, api.callTxMethod(call));
|
|
6620
|
-
case
|
|
6550
|
+
case 14:
|
|
6621
6551
|
if (!supportsPolkadotXCM(this)) {
|
|
6622
|
-
_context.n =
|
|
6552
|
+
_context.n = 15;
|
|
6623
6553
|
break;
|
|
6624
6554
|
}
|
|
6625
6555
|
return _context.a(2, this.transferPolkadotXCM(options));
|
|
6626
|
-
case
|
|
6556
|
+
case 15:
|
|
6627
6557
|
throw new NoXCMSupportImplementedError(this._chain);
|
|
6628
|
-
case
|
|
6558
|
+
case 16:
|
|
6629
6559
|
return _context.a(2);
|
|
6630
6560
|
}
|
|
6631
6561
|
}, _callee, this);
|
|
@@ -7520,7 +7450,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
7520
7450
|
var assetInfo = input.assetInfo,
|
|
7521
7451
|
destination = input.destination,
|
|
7522
7452
|
version = input.version;
|
|
7523
|
-
|
|
7453
|
+
// TODO: Refactor this
|
|
7454
|
+
if ((destination === 'Hydration' || destination === 'Moonbeam' || destination === 'BifrostPolkadot') && assetInfo.symbol === this.getNativeAssetSymbol()) {
|
|
7524
7455
|
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
7525
7456
|
asset: createAsset(version, assetInfo.amount, DOT_LOCATION)
|
|
7526
7457
|
});
|
|
@@ -7531,7 +7462,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
7531
7462
|
key: "getMethod",
|
|
7532
7463
|
value: function getMethod(scenario, destination) {
|
|
7533
7464
|
var isTrusted = !sdkCommon.isTLocation(destination) && sdkCommon.isTrustedChain(destination);
|
|
7534
|
-
if (destination === '
|
|
7465
|
+
if (destination === 'Moonbeam' || typeof destination === 'string' && destination.startsWith('Integritee')) return 'transfer_assets';
|
|
7535
7466
|
return scenario === 'ParaToPara' && !isTrusted ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
|
|
7536
7467
|
}
|
|
7537
7468
|
}, {
|
|
@@ -8588,198 +8519,6 @@ var HeimaPaseo = /*#__PURE__*/function (_Heima) {
|
|
|
8588
8519
|
return _createClass(HeimaPaseo);
|
|
8589
8520
|
}(Heima);
|
|
8590
8521
|
|
|
8591
|
-
var GAS_LIMIT = 1000000000n;
|
|
8592
|
-
var getAssetLocation = function getAssetLocation(asset) {
|
|
8593
|
-
if (!assets.isForeignAsset(asset) && asset.symbol === assets.getNativeAssetSymbol('Polimec')) {
|
|
8594
|
-
return {
|
|
8595
|
-
parents: sdkCommon.Parents.ZERO,
|
|
8596
|
-
interior: 'Here'
|
|
8597
|
-
};
|
|
8598
|
-
}
|
|
8599
|
-
if (assets.isForeignAsset(asset) && asset.location !== undefined) {
|
|
8600
|
-
return asset.location;
|
|
8601
|
-
}
|
|
8602
|
-
throw new assets.InvalidCurrencyError("Transfer of asset ".concat(JSON.stringify(asset, sdkCommon.replaceBigInt), " is not supported yet"));
|
|
8603
|
-
};
|
|
8604
|
-
var createTransferAssetsTransfer = function createTransferAssetsTransfer(options, version) {
|
|
8605
|
-
var asset = options.assetInfo;
|
|
8606
|
-
var location = getAssetLocation(asset);
|
|
8607
|
-
return transferPolkadotXcm(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
8608
|
-
asset: createAsset(version, asset.amount, location)
|
|
8609
|
-
}), 'transfer_assets', 'Unlimited');
|
|
8610
|
-
};
|
|
8611
|
-
var createTypeAndThenDest = function createTypeAndThenDest(destination, scenario, version) {
|
|
8612
|
-
return sdkCommon.isTLocation(destination) ? destination : {
|
|
8613
|
-
parents: scenario === 'ParaToPara' ? sdkCommon.Parents.ONE : sdkCommon.Parents.ZERO,
|
|
8614
|
-
interior: createX1Payload(version, {
|
|
8615
|
-
Parachain: getParaId('AssetHubPolkadot')
|
|
8616
|
-
})
|
|
8617
|
-
};
|
|
8618
|
-
};
|
|
8619
|
-
var createTypeAndThenTransfer$1 = function createTypeAndThenTransfer(_ref, version) {
|
|
8620
|
-
var api = _ref.api,
|
|
8621
|
-
asset = _ref.assetInfo,
|
|
8622
|
-
address = _ref.address,
|
|
8623
|
-
scenario = _ref.scenario,
|
|
8624
|
-
destination = _ref.destination,
|
|
8625
|
-
paraIdTo = _ref.paraIdTo;
|
|
8626
|
-
var transferType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'DestinationReserve';
|
|
8627
|
-
return {
|
|
8628
|
-
module: scenario === 'RelayToPara' ? 'XcmPallet' : 'PolkadotXcm',
|
|
8629
|
-
method: 'transfer_assets_using_type_and_then',
|
|
8630
|
-
parameters: {
|
|
8631
|
-
dest: _defineProperty({}, version, createTypeAndThenDest(destination, scenario, version)),
|
|
8632
|
-
assets: _defineProperty({}, version, [createAsset(version, asset.amount, {
|
|
8633
|
-
parents: scenario === 'RelayToPara' ? sdkCommon.Parents.ZERO : sdkCommon.Parents.ONE,
|
|
8634
|
-
interior: 'Here'
|
|
8635
|
-
})]),
|
|
8636
|
-
assets_transfer_type: transferType,
|
|
8637
|
-
remote_fees_id: _defineProperty({}, version, {
|
|
8638
|
-
parents: scenario === 'ParaToPara' ? sdkCommon.Parents.ONE : sdkCommon.Parents.ZERO,
|
|
8639
|
-
interior: 'Here'
|
|
8640
|
-
}),
|
|
8641
|
-
fees_transfer_type: transferType,
|
|
8642
|
-
custom_xcm_on_dest: createCustomXcmPolimec(api, address, destination, paraIdTo, version),
|
|
8643
|
-
weight_limit: 'Unlimited'
|
|
8644
|
-
}
|
|
8645
|
-
};
|
|
8646
|
-
};
|
|
8647
|
-
var createCustomXcmPolimec = function createCustomXcmPolimec(api, address, destination, paraIdTo, version) {
|
|
8648
|
-
var paraId = resolveParaId(paraIdTo, destination);
|
|
8649
|
-
return _defineProperty({}, version, [{
|
|
8650
|
-
DepositReserveAsset: {
|
|
8651
|
-
assets: {
|
|
8652
|
-
Wild: {
|
|
8653
|
-
AllCounted: 1
|
|
8654
|
-
}
|
|
8655
|
-
},
|
|
8656
|
-
dest: createDestination(version, 'Polimec', destination, paraId, undefined, sdkCommon.Parents.ONE),
|
|
8657
|
-
xcm: [{
|
|
8658
|
-
BuyExecution: {
|
|
8659
|
-
fees: {
|
|
8660
|
-
id: {
|
|
8661
|
-
parents: sdkCommon.Parents.ONE,
|
|
8662
|
-
interior: 'Here'
|
|
8663
|
-
},
|
|
8664
|
-
fun: {
|
|
8665
|
-
Fungible: GAS_LIMIT
|
|
8666
|
-
}
|
|
8667
|
-
},
|
|
8668
|
-
weight_limit: 'Unlimited'
|
|
8669
|
-
}
|
|
8670
|
-
}, {
|
|
8671
|
-
DepositAsset: {
|
|
8672
|
-
assets: {
|
|
8673
|
-
Wild: {
|
|
8674
|
-
AllCounted: 1
|
|
8675
|
-
}
|
|
8676
|
-
},
|
|
8677
|
-
beneficiary: createBeneficiaryLocation({
|
|
8678
|
-
api: api,
|
|
8679
|
-
address: address,
|
|
8680
|
-
version: version
|
|
8681
|
-
})
|
|
8682
|
-
}
|
|
8683
|
-
}]
|
|
8684
|
-
}
|
|
8685
|
-
}]);
|
|
8686
|
-
};
|
|
8687
|
-
var Polimec = /*#__PURE__*/function (_Parachain) {
|
|
8688
|
-
function Polimec() {
|
|
8689
|
-
_classCallCheck(this, Polimec);
|
|
8690
|
-
return _callSuper(this, Polimec, ['Polimec', 'polimec', 'Polkadot', sdkCommon.Version.V5]);
|
|
8691
|
-
}
|
|
8692
|
-
_inherits(Polimec, _Parachain);
|
|
8693
|
-
return _createClass(Polimec, [{
|
|
8694
|
-
key: "transferPolkadotXCM",
|
|
8695
|
-
value: function () {
|
|
8696
|
-
var _transferPolkadotXCM = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(input) {
|
|
8697
|
-
var api, version, assetInfo, destination, scenario, _call, call;
|
|
8698
|
-
return _regenerator().w(function (_context) {
|
|
8699
|
-
while (1) switch (_context.n) {
|
|
8700
|
-
case 0:
|
|
8701
|
-
api = input.api, version = input.version, assetInfo = input.assetInfo, destination = input.destination, scenario = input.scenario;
|
|
8702
|
-
if (!(scenario === 'ParaToPara' && destination === 'Hydration' && assetInfo.symbol === 'DOT')) {
|
|
8703
|
-
_context.n = 1;
|
|
8704
|
-
break;
|
|
8705
|
-
}
|
|
8706
|
-
_call = createTypeAndThenTransfer$1(input, version);
|
|
8707
|
-
return _context.a(2, api.callTxMethod(_call));
|
|
8708
|
-
case 1:
|
|
8709
|
-
if (!(scenario === 'ParaToPara' && (destination === 'AssetHubPolkadot' || destination === 'Hydration'))) {
|
|
8710
|
-
_context.n = 2;
|
|
8711
|
-
break;
|
|
8712
|
-
}
|
|
8713
|
-
return _context.a(2, createTransferAssetsTransfer(input, version));
|
|
8714
|
-
case 2:
|
|
8715
|
-
if (!(scenario !== 'ParaToRelay')) {
|
|
8716
|
-
_context.n = 3;
|
|
8717
|
-
break;
|
|
8718
|
-
}
|
|
8719
|
-
throw new ScenarioNotSupportedError(this.chain, scenario);
|
|
8720
|
-
case 3:
|
|
8721
|
-
call = createTypeAndThenTransfer$1(input, version, 'Teleport');
|
|
8722
|
-
return _context.a(2, api.callTxMethod(call));
|
|
8723
|
-
}
|
|
8724
|
-
}, _callee, this);
|
|
8725
|
-
}));
|
|
8726
|
-
function transferPolkadotXCM(_x) {
|
|
8727
|
-
return _transferPolkadotXCM.apply(this, arguments);
|
|
8728
|
-
}
|
|
8729
|
-
return transferPolkadotXCM;
|
|
8730
|
-
}()
|
|
8731
|
-
}, {
|
|
8732
|
-
key: "isSendingTempDisabled",
|
|
8733
|
-
value: function isSendingTempDisabled(_ref3) {
|
|
8734
|
-
var assetInfo = _ref3.assetInfo;
|
|
8735
|
-
return assets.isSymbolMatch(assetInfo.symbol, this.getNativeAssetSymbol());
|
|
8736
|
-
}
|
|
8737
|
-
}, {
|
|
8738
|
-
key: "transferRelayToPara",
|
|
8739
|
-
value: function transferRelayToPara(options) {
|
|
8740
|
-
var version = options.version;
|
|
8741
|
-
var call = createTypeAndThenTransfer$1(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
8742
|
-
scenario: 'RelayToPara'
|
|
8743
|
-
}), version, 'Teleport');
|
|
8744
|
-
return Promise.resolve(call);
|
|
8745
|
-
}
|
|
8746
|
-
}, {
|
|
8747
|
-
key: "transferLocalNonNativeAsset",
|
|
8748
|
-
value: function transferLocalNonNativeAsset(options) {
|
|
8749
|
-
var api = options.api,
|
|
8750
|
-
asset = options.assetInfo,
|
|
8751
|
-
address = options.address,
|
|
8752
|
-
isAmountAll = options.isAmountAll;
|
|
8753
|
-
assertIsForeign(asset);
|
|
8754
|
-
assertHasLocation(asset);
|
|
8755
|
-
if (isAmountAll) {
|
|
8756
|
-
return api.callTxMethod({
|
|
8757
|
-
module: 'ForeignAssets',
|
|
8758
|
-
method: 'transfer_all',
|
|
8759
|
-
parameters: {
|
|
8760
|
-
id: asset.location,
|
|
8761
|
-
target: {
|
|
8762
|
-
Id: address
|
|
8763
|
-
},
|
|
8764
|
-
keep_alive: false
|
|
8765
|
-
}
|
|
8766
|
-
});
|
|
8767
|
-
}
|
|
8768
|
-
return api.callTxMethod({
|
|
8769
|
-
module: 'ForeignAssets',
|
|
8770
|
-
method: 'transfer',
|
|
8771
|
-
parameters: {
|
|
8772
|
-
id: asset.location,
|
|
8773
|
-
target: {
|
|
8774
|
-
Id: address
|
|
8775
|
-
},
|
|
8776
|
-
amount: asset.amount
|
|
8777
|
-
}
|
|
8778
|
-
});
|
|
8779
|
-
}
|
|
8780
|
-
}]);
|
|
8781
|
-
}(Parachain);
|
|
8782
|
-
|
|
8783
8522
|
var createCustomXcmAh = function createCustomXcmAh(_ref, version) {
|
|
8784
8523
|
var api = _ref.api,
|
|
8785
8524
|
address = _ref.address;
|
|
@@ -8833,23 +8572,6 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
|
|
|
8833
8572
|
};
|
|
8834
8573
|
return api.callTxMethod(call);
|
|
8835
8574
|
}
|
|
8836
|
-
}, {
|
|
8837
|
-
key: "transferToPolimec",
|
|
8838
|
-
value: function transferToPolimec(options) {
|
|
8839
|
-
var api = options.api,
|
|
8840
|
-
assetInfo = options.assetInfo,
|
|
8841
|
-
_options$version = options.version,
|
|
8842
|
-
version = _options$version === void 0 ? this.version : _options$version;
|
|
8843
|
-
var symbol = assetInfo.symbol.toUpperCase();
|
|
8844
|
-
if (symbol === 'DOT') {
|
|
8845
|
-
var call = createTypeAndThenTransfer$1(options, version);
|
|
8846
|
-
return Promise.resolve(api.callTxMethod(call));
|
|
8847
|
-
}
|
|
8848
|
-
if ((symbol === 'USDC' || symbol === 'USDT') && !sdkCommon.hasJunction(assetInfo.location, 'Parachain', getParaId('AssetHubPolkadot'))) {
|
|
8849
|
-
throw new assets.InvalidCurrencyError('The selected asset is not supported for transfer to Polimec');
|
|
8850
|
-
}
|
|
8851
|
-
return createTransferAssetsTransfer(options, version);
|
|
8852
|
-
}
|
|
8853
8575
|
}, {
|
|
8854
8576
|
key: "transferPolkadotXCM",
|
|
8855
8577
|
value: function () {
|
|
@@ -8887,12 +8609,6 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
|
|
|
8887
8609
|
case 3:
|
|
8888
8610
|
return _context.a(2, _t.callTxMethod.call(_t, _context.v));
|
|
8889
8611
|
case 4:
|
|
8890
|
-
if (!(destination === 'Polimec')) {
|
|
8891
|
-
_context.n = 5;
|
|
8892
|
-
break;
|
|
8893
|
-
}
|
|
8894
|
-
return _context.a(2, this.transferToPolimec(input));
|
|
8895
|
-
case 5:
|
|
8896
8612
|
return _context.a(2, this.transferToAssetHub(input));
|
|
8897
8613
|
}
|
|
8898
8614
|
}, _callee, this);
|
|
@@ -8941,7 +8657,7 @@ var Hydration = /*#__PURE__*/function (_Parachain) {
|
|
|
8941
8657
|
assetInfo = options.assetInfo,
|
|
8942
8658
|
feeAsset = options.feeAsset;
|
|
8943
8659
|
var baseCanUseXTokens = _superPropGet(Hydration, "canUseXTokens", this, 3)([options]);
|
|
8944
|
-
return destination !== 'Ethereum' &&
|
|
8660
|
+
return destination !== 'Ethereum' && !(destination === 'AssetHubPolkadot' && assetInfo.symbol === 'DOT') && baseCanUseXTokens && !feeAsset;
|
|
8945
8661
|
}
|
|
8946
8662
|
}, {
|
|
8947
8663
|
key: "transferLocalNativeAsset",
|
|
@@ -10175,38 +9891,6 @@ var Shiden = /*#__PURE__*/function (_Parachain) {
|
|
|
10175
9891
|
}]);
|
|
10176
9892
|
}(Parachain);
|
|
10177
9893
|
|
|
10178
|
-
var Subsocial = /*#__PURE__*/function (_Parachain) {
|
|
10179
|
-
function Subsocial() {
|
|
10180
|
-
_classCallCheck(this, Subsocial);
|
|
10181
|
-
return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'Polkadot', sdkCommon.Version.V3]);
|
|
10182
|
-
}
|
|
10183
|
-
_inherits(Subsocial, _Parachain);
|
|
10184
|
-
return _createClass(Subsocial, [{
|
|
10185
|
-
key: "transferPolkadotXCM",
|
|
10186
|
-
value: function transferPolkadotXCM(input) {
|
|
10187
|
-
var scenario = input.scenario,
|
|
10188
|
-
asset = input.assetInfo;
|
|
10189
|
-
if (scenario !== 'ParaToPara') {
|
|
10190
|
-
throw new ScenarioNotSupportedError(this.chain, scenario);
|
|
10191
|
-
}
|
|
10192
|
-
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
10193
|
-
throw new assets.InvalidCurrencyError("Asset ".concat(asset.symbol, " is not supported by chain ").concat(this.chain, "."));
|
|
10194
|
-
}
|
|
10195
|
-
return transferPolkadotXcm(input, 'limited_reserve_transfer_assets', 'Unlimited');
|
|
10196
|
-
}
|
|
10197
|
-
}, {
|
|
10198
|
-
key: "isSendingTempDisabled",
|
|
10199
|
-
value: function isSendingTempDisabled(_options) {
|
|
10200
|
-
return true;
|
|
10201
|
-
}
|
|
10202
|
-
}, {
|
|
10203
|
-
key: "isReceivingTempDisabled",
|
|
10204
|
-
value: function isReceivingTempDisabled(_scenario) {
|
|
10205
|
-
return true;
|
|
10206
|
-
}
|
|
10207
|
-
}]);
|
|
10208
|
-
}(Parachain);
|
|
10209
|
-
|
|
10210
9894
|
var Unique = /*#__PURE__*/function (_Parachain) {
|
|
10211
9895
|
function Unique() {
|
|
10212
9896
|
_classCallCheck(this, Unique);
|
|
@@ -10355,12 +10039,10 @@ var chains = function chains() {
|
|
|
10355
10039
|
Pendulum: new Pendulum(),
|
|
10356
10040
|
Collectives: new Collectives(),
|
|
10357
10041
|
Phala: new Phala(),
|
|
10358
|
-
Subsocial: new Subsocial(),
|
|
10359
10042
|
KiltSpiritnet: new KiltSpiritnet(),
|
|
10360
10043
|
Curio: new Curio(),
|
|
10361
10044
|
Mythos: new Mythos(),
|
|
10362
10045
|
Peaq: new Peaq(),
|
|
10363
|
-
Polimec: new Polimec(),
|
|
10364
10046
|
Xode: new Xode(),
|
|
10365
10047
|
// Kusama chains
|
|
10366
10048
|
AssetHubKusama: new AssetHubKusama(),
|
|
@@ -10432,7 +10114,7 @@ var RELAY_LOCATION = {
|
|
|
10432
10114
|
Here: null
|
|
10433
10115
|
}
|
|
10434
10116
|
};
|
|
10435
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['Acala', 'Karura', '
|
|
10117
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Acala', 'Karura', 'Moonbeam', 'Hydration', 'HydrationPaseo', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna', 'IntegriteePolkadot', 'IntegriteeKusama', 'IntegriteePaseo']);
|
|
10436
10118
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
10437
10119
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
10438
10120
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -10640,7 +10322,10 @@ var BalancesPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
10640
10322
|
key: "mint",
|
|
10641
10323
|
value: function mint(address, assetInfo, balance, chain) {
|
|
10642
10324
|
var amount = assetInfo.amount;
|
|
10643
|
-
var
|
|
10325
|
+
var noIdPrefixes = ['Hydration', 'NeuroWeb', 'Basilisk'];
|
|
10326
|
+
var notUseId = noIdPrefixes.some(function (prefix) {
|
|
10327
|
+
return chain.startsWith(prefix);
|
|
10328
|
+
}) || assets.isChainEvm(chain);
|
|
10644
10329
|
return Promise.resolve({
|
|
10645
10330
|
balanceTx: {
|
|
10646
10331
|
module: this.palletName,
|
|
@@ -11061,6 +10746,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
|
|
|
11061
10746
|
|
|
11062
10747
|
var MAX_INCREASE_RETRIES = 5;
|
|
11063
10748
|
var INCREASE_BUMP_STEP = 100;
|
|
10749
|
+
var FIRST_INCREASE_BUMP_STEP = 1;
|
|
11064
10750
|
var DECREASE_START_AMOUNT = 1;
|
|
11065
10751
|
var MAX_DECREASE_RETRIES = 5;
|
|
11066
10752
|
var DECREASE_DIVIDE_FACTOR = 5;
|
|
@@ -11221,7 +10907,7 @@ var getBypassResultWithRetries = /*#__PURE__*/function () {
|
|
|
11221
10907
|
_context3.n = 15;
|
|
11222
10908
|
break;
|
|
11223
10909
|
}
|
|
11224
|
-
amount = bumpStep * i;
|
|
10910
|
+
amount = i === 1 ? FIRST_INCREASE_BUMP_STEP : bumpStep * i;
|
|
11225
10911
|
_context3.p = 7;
|
|
11226
10912
|
_context3.n = 8;
|
|
11227
10913
|
return attempt(amount.toString());
|