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