@paraspell/sdk-core 11.5.0 → 11.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +88 -56
- package/dist/index.d.ts +18 -9
- package/dist/index.mjs +89 -57
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1105,17 +1105,6 @@ var EnergyWebX$1 = {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
]
|
|
1107
1107
|
};
|
|
1108
|
-
var EnergyWebXPaseo$1 = {
|
|
1109
|
-
name: "PEX",
|
|
1110
|
-
info: "paseoEwx",
|
|
1111
|
-
paraId: 3345,
|
|
1112
|
-
providers: [
|
|
1113
|
-
{
|
|
1114
|
-
name: "Energy Web",
|
|
1115
|
-
endpoint: "wss://public-rpc.testnet.energywebx.com/"
|
|
1116
|
-
}
|
|
1117
|
-
]
|
|
1118
|
-
};
|
|
1119
1108
|
var Hydration$1 = {
|
|
1120
1109
|
name: "Hydration",
|
|
1121
1110
|
info: "hydradx",
|
|
@@ -1139,6 +1128,17 @@ var Hydration$1 = {
|
|
|
1139
1128
|
}
|
|
1140
1129
|
]
|
|
1141
1130
|
};
|
|
1131
|
+
var IntegriteePolkadot$1 = {
|
|
1132
|
+
name: "Integritee Network",
|
|
1133
|
+
info: "integritee",
|
|
1134
|
+
paraId: 2039,
|
|
1135
|
+
providers: [
|
|
1136
|
+
{
|
|
1137
|
+
name: "Integritee",
|
|
1138
|
+
endpoint: "wss://polkadot.api.integritee.network"
|
|
1139
|
+
}
|
|
1140
|
+
]
|
|
1141
|
+
};
|
|
1142
1142
|
var Interlay$1 = {
|
|
1143
1143
|
name: "Interlay",
|
|
1144
1144
|
info: "interlay",
|
|
@@ -2195,6 +2195,17 @@ var CoretimePaseo$1 = {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
]
|
|
2197
2197
|
};
|
|
2198
|
+
var EnergyWebXPaseo$1 = {
|
|
2199
|
+
name: "PEX",
|
|
2200
|
+
info: "paseoEwx",
|
|
2201
|
+
paraId: 3345,
|
|
2202
|
+
providers: [
|
|
2203
|
+
{
|
|
2204
|
+
name: "Energy Web",
|
|
2205
|
+
endpoint: "wss://public-rpc.testnet.energywebx.com/"
|
|
2206
|
+
}
|
|
2207
|
+
]
|
|
2208
|
+
};
|
|
2198
2209
|
var HeimaPaseo$1 = {
|
|
2199
2210
|
name: "Heima paseo",
|
|
2200
2211
|
info: "heima-paseo",
|
|
@@ -2500,8 +2511,8 @@ var configs = {
|
|
|
2500
2511
|
ComposableFinance: ComposableFinance$1,
|
|
2501
2512
|
Darwinia: Darwinia$1,
|
|
2502
2513
|
EnergyWebX: EnergyWebX$1,
|
|
2503
|
-
EnergyWebXPaseo: EnergyWebXPaseo$1,
|
|
2504
2514
|
Hydration: Hydration$1,
|
|
2515
|
+
IntegriteePolkadot: IntegriteePolkadot$1,
|
|
2505
2516
|
Interlay: Interlay$1,
|
|
2506
2517
|
Heima: Heima$1,
|
|
2507
2518
|
Jamton: Jamton$1,
|
|
@@ -2554,6 +2565,7 @@ var configs = {
|
|
|
2554
2565
|
BifrostPaseo: BifrostPaseo$1,
|
|
2555
2566
|
BridgeHubPaseo: BridgeHubPaseo$1,
|
|
2556
2567
|
CoretimePaseo: CoretimePaseo$1,
|
|
2568
|
+
EnergyWebXPaseo: EnergyWebXPaseo$1,
|
|
2557
2569
|
HeimaPaseo: HeimaPaseo$1,
|
|
2558
2570
|
HydrationPaseo: HydrationPaseo$1,
|
|
2559
2571
|
IntegriteePaseo: IntegriteePaseo$1,
|
|
@@ -3814,12 +3826,12 @@ var getBalanceForeignXTokens = /*#__PURE__*/function () {
|
|
|
3814
3826
|
return _regenerator().w(function (_context) {
|
|
3815
3827
|
while (1) switch (_context.n) {
|
|
3816
3828
|
case 0:
|
|
3817
|
-
if (!(chain === 'Astar' || chain === 'Shiden')) {
|
|
3829
|
+
if (!(chain === 'Astar' || chain === 'Shiden' || chain.startsWith('Integritee'))) {
|
|
3818
3830
|
_context.n = 1;
|
|
3819
3831
|
break;
|
|
3820
3832
|
}
|
|
3821
3833
|
assertHasId(asset);
|
|
3822
|
-
return _context.a(2, api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
|
|
3834
|
+
return _context.a(2, api.getBalanceAssetsPallet(address, chain.startsWith('Integritee') ? Number(asset.assetId) : BigInt(asset.assetId)));
|
|
3823
3835
|
case 1:
|
|
3824
3836
|
if (!(chain === 'BifrostPolkadot' || chain === 'BifrostKusama')) {
|
|
3825
3837
|
_context.n = 2;
|
|
@@ -4300,11 +4312,11 @@ var createOriginLocation = function createOriginLocation(origin, destination) {
|
|
|
4300
4312
|
};
|
|
4301
4313
|
var getDestXcmFee = /*#__PURE__*/function () {
|
|
4302
4314
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
4303
|
-
var api, origin, hopChain, destination, currency, forwardedXcms, asset, address, feeAsset, originFee, disableFallback, resolvedFeeAsset, calcPaymentInfoFee, _fee, sufficient, dryRunResult, _fee2, fee, newForwardedXcms, destParaId;
|
|
4315
|
+
var api, origin, hopChain, destination, currency, forwardedXcms, asset, address, feeAsset, originFee, tx, disableFallback, resolvedFeeAsset, calcPaymentInfoFee, _fee, sufficient, dryRunResult, _fee2, fee, newForwardedXcms, destParaId;
|
|
4304
4316
|
return _regenerator().w(function (_context2) {
|
|
4305
4317
|
while (1) switch (_context2.n) {
|
|
4306
4318
|
case 0:
|
|
4307
|
-
api = options.api, origin = options.origin, hopChain = options.prevChain, destination = options.destination, currency = options.currency, forwardedXcms = options.forwardedXcms, asset = options.asset, address = options.address, feeAsset = options.feeAsset, originFee = options.originFee, disableFallback = options.disableFallback;
|
|
4319
|
+
api = options.api, origin = options.origin, hopChain = options.prevChain, destination = options.destination, currency = options.currency, forwardedXcms = options.forwardedXcms, asset = options.asset, address = options.address, feeAsset = options.feeAsset, originFee = options.originFee, tx = options.tx, disableFallback = options.disableFallback;
|
|
4308
4320
|
resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
4309
4321
|
calcPaymentInfoFee = /*#__PURE__*/function () {
|
|
4310
4322
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
@@ -4386,6 +4398,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4386
4398
|
_context2.n = 4;
|
|
4387
4399
|
return api.getDryRunXcm({
|
|
4388
4400
|
originLocation: addXcmVersionHeader(createOriginLocation(hopChain, destination), sdkCommon.Version.V4),
|
|
4401
|
+
tx: tx,
|
|
4389
4402
|
xcm: forwardedXcms[1][0],
|
|
4390
4403
|
chain: destination,
|
|
4391
4404
|
origin: origin,
|
|
@@ -5263,6 +5276,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
5263
5276
|
_context.n = 2;
|
|
5264
5277
|
return hopApi.getDryRunXcm({
|
|
5265
5278
|
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, currentChain), sdkCommon.Version.V4),
|
|
5279
|
+
tx: tx,
|
|
5266
5280
|
xcm: forwardedXcms[1][0],
|
|
5267
5281
|
chain: currentChain,
|
|
5268
5282
|
origin: currentOrigin,
|
|
@@ -6013,7 +6027,7 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6013
6027
|
key: "transfer",
|
|
6014
6028
|
value: function () {
|
|
6015
6029
|
var _transfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(sendOptions) {
|
|
6016
|
-
var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, destChain, isLocalTransfer, isRelayAsset, supportsTypeThen, useTypeAndThen, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAhToOtherPara, isOtherParaToAh, isAHPOrigin, isAHPDest, isExternalAsset, isEthDest, isExternalAssetViaAh, isExternalAssetToAh, call;
|
|
6030
|
+
var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, destChain, isLocalTransfer, isRelayAsset, supportsTypeThen, useTypeAndThen, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAhToOtherPara, isOtherParaToAh, isAllowedAhTransfer, isAHPOrigin, isAHPDest, isExternalAsset, isEthDest, isExternalAssetViaAh, isExternalAssetToAh, call;
|
|
6017
6031
|
return _regenerator().w(function (_context) {
|
|
6018
6032
|
while (1) switch (_context.n) {
|
|
6019
6033
|
case 0:
|
|
@@ -6124,7 +6138,10 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6124
6138
|
shouldUseTeleport = this.shouldUseNativeAssetTeleport(sendOptions);
|
|
6125
6139
|
isAhToOtherPara = this.chain.startsWith('AssetHub') && destChain && !sdkCommon.isTrustedChain(destChain);
|
|
6126
6140
|
isOtherParaToAh = (destChain === null || destChain === void 0 ? void 0 : destChain.startsWith('AssetHub')) && !sdkCommon.isTrustedChain(this.chain);
|
|
6127
|
-
|
|
6141
|
+
isAllowedAhTransfer = function isAllowedAhTransfer(chain) {
|
|
6142
|
+
return chain === null || chain === void 0 ? void 0 : chain.startsWith('Integritee');
|
|
6143
|
+
};
|
|
6144
|
+
if (!((isAhToOtherPara || isOtherParaToAh) && shouldUseTeleport && !isAllowedAhTransfer(destChain) && !isAllowedAhTransfer(this.chain))) {
|
|
6128
6145
|
_context.n = 8;
|
|
6129
6146
|
break;
|
|
6130
6147
|
}
|
|
@@ -6756,9 +6773,16 @@ var AssetHubKusama = /*#__PURE__*/function (_Parachain) {
|
|
|
6756
6773
|
if (scenario === 'ParaToPara' && asset.symbol === 'DOT' && !assets.isForeignAsset(asset)) {
|
|
6757
6774
|
throw new ScenarioNotSupportedError(this.chain, scenario, 'Bridged DOT cannot currently be transfered from AssetHubKusama, if you are sending different DOT asset, please specify {id: <DOTID>}.');
|
|
6758
6775
|
}
|
|
6759
|
-
var method = scenario
|
|
6776
|
+
var method = this.getMethod(scenario, destination);
|
|
6760
6777
|
return transferPolkadotXcm(input, method, 'Unlimited');
|
|
6761
6778
|
}
|
|
6779
|
+
}, {
|
|
6780
|
+
key: "getMethod",
|
|
6781
|
+
value: function getMethod(scenario, destination) {
|
|
6782
|
+
var isTrusted = !sdkCommon.isTLocation(destination) && sdkCommon.isTrustedChain(destination);
|
|
6783
|
+
if (destination === 'IntegriteeKusama') return 'transfer_assets';
|
|
6784
|
+
return scenario === 'ParaToPara' && !isTrusted ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
|
|
6785
|
+
}
|
|
6762
6786
|
}, {
|
|
6763
6787
|
key: "getRelayToParaOverrides",
|
|
6764
6788
|
value: function getRelayToParaOverrides() {
|
|
@@ -6986,7 +7010,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
6986
7010
|
key: "getMethod",
|
|
6987
7011
|
value: function getMethod(scenario, destination) {
|
|
6988
7012
|
var isTrusted = !sdkCommon.isTLocation(destination) && sdkCommon.isTrustedChain(destination);
|
|
6989
|
-
if (destination === 'Polimec' || destination === 'Moonbeam') return 'transfer_assets';
|
|
7013
|
+
if (destination === 'Polimec' || destination === 'Moonbeam' || typeof destination === 'string' && destination.startsWith('Integritee')) return 'transfer_assets';
|
|
6990
7014
|
return scenario === 'ParaToPara' && !isTrusted ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
|
|
6991
7015
|
}
|
|
6992
7016
|
}, {
|
|
@@ -8317,28 +8341,20 @@ var HydrationPaseo = /*#__PURE__*/function (_Hydration) {
|
|
|
8317
8341
|
return _createClass(HydrationPaseo);
|
|
8318
8342
|
}(Hydration);
|
|
8319
8343
|
|
|
8320
|
-
var
|
|
8321
|
-
function
|
|
8322
|
-
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '
|
|
8344
|
+
var IntegriteePolkadot = /*#__PURE__*/function (_Parachain) {
|
|
8345
|
+
function IntegriteePolkadot() {
|
|
8346
|
+
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteePolkadot';
|
|
8323
8347
|
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
|
|
8324
|
-
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '
|
|
8325
|
-
var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.
|
|
8326
|
-
_classCallCheck(this,
|
|
8327
|
-
return _callSuper(this,
|
|
8348
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
|
|
8349
|
+
var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
|
|
8350
|
+
_classCallCheck(this, IntegriteePolkadot);
|
|
8351
|
+
return _callSuper(this, IntegriteePolkadot, [chain, info, type, version]);
|
|
8328
8352
|
}
|
|
8329
|
-
_inherits(
|
|
8330
|
-
return _createClass(
|
|
8331
|
-
key: "
|
|
8332
|
-
value: function
|
|
8333
|
-
|
|
8334
|
-
scenario = input.scenario;
|
|
8335
|
-
if (scenario !== 'ParaToPara') {
|
|
8336
|
-
throw new ScenarioNotSupportedError(this.chain, scenario);
|
|
8337
|
-
}
|
|
8338
|
-
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
8339
|
-
throw new assets.InvalidCurrencyError("Asset ".concat(asset.symbol, " is not supported by chain ").concat(this.chain, "."));
|
|
8340
|
-
}
|
|
8341
|
-
return transferXTokens(input, asset.symbol);
|
|
8353
|
+
_inherits(IntegriteePolkadot, _Parachain);
|
|
8354
|
+
return _createClass(IntegriteePolkadot, [{
|
|
8355
|
+
key: "transferPolkadotXCM",
|
|
8356
|
+
value: function transferPolkadotXCM(input) {
|
|
8357
|
+
return transferPolkadotXcm(input, 'transfer_assets', 'Unlimited');
|
|
8342
8358
|
}
|
|
8343
8359
|
}, {
|
|
8344
8360
|
key: "transferRelayToPara",
|
|
@@ -8367,6 +8383,19 @@ var IntegriteeKusama = /*#__PURE__*/function (_Parachain) {
|
|
|
8367
8383
|
}]);
|
|
8368
8384
|
}(Parachain);
|
|
8369
8385
|
|
|
8386
|
+
var IntegriteeKusama = /*#__PURE__*/function (_IntegriteePolkadot) {
|
|
8387
|
+
function IntegriteeKusama() {
|
|
8388
|
+
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteeKusama';
|
|
8389
|
+
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
|
|
8390
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Kusama';
|
|
8391
|
+
var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sdkCommon.Version.V5;
|
|
8392
|
+
_classCallCheck(this, IntegriteeKusama);
|
|
8393
|
+
return _callSuper(this, IntegriteeKusama, [chain, info, type, version]);
|
|
8394
|
+
}
|
|
8395
|
+
_inherits(IntegriteeKusama, _IntegriteePolkadot);
|
|
8396
|
+
return _createClass(IntegriteeKusama);
|
|
8397
|
+
}(IntegriteePolkadot);
|
|
8398
|
+
|
|
8370
8399
|
var IntegriteePaseo = /*#__PURE__*/function (_IntegriteeKusama) {
|
|
8371
8400
|
function IntegriteePaseo() {
|
|
8372
8401
|
_classCallCheck(this, IntegriteePaseo);
|
|
@@ -9484,6 +9513,7 @@ var chains = function chains() {
|
|
|
9484
9513
|
EnergyWebX: new EnergyWebX(),
|
|
9485
9514
|
Hydration: new Hydration(),
|
|
9486
9515
|
IntegriteeKusama: new IntegriteeKusama(),
|
|
9516
|
+
IntegriteePolkadot: new IntegriteePolkadot(),
|
|
9487
9517
|
Interlay: new Interlay(),
|
|
9488
9518
|
Heima: new Heima(),
|
|
9489
9519
|
Jamton: new Jamton(),
|
|
@@ -9570,7 +9600,7 @@ var RELAY_LOCATION = {
|
|
|
9570
9600
|
Here: null
|
|
9571
9601
|
}
|
|
9572
9602
|
};
|
|
9573
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['Acala', 'Karura', 'Polimec', 'Moonbeam', 'Hydration', 'HydrationPaseo', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna']);
|
|
9603
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Acala', 'Karura', 'Polimec', 'Moonbeam', 'Hydration', 'HydrationPaseo', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna', 'IntegriteePolkadot', 'IntegriteeKusama', 'IntegriteePaseo']);
|
|
9574
9604
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
9575
9605
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
9576
9606
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -10041,7 +10071,7 @@ var mintBonusForSent = function mintBonusForSent(chain, sent, feeAsset, mintFeeA
|
|
|
10041
10071
|
return true;
|
|
10042
10072
|
});
|
|
10043
10073
|
return preminted.some(function (a) {
|
|
10044
|
-
return assets.
|
|
10074
|
+
return assets.isAssetXcEqual(a, sent);
|
|
10045
10075
|
}) ? viem.parseUnits(MINT_AMOUNT.toString(), sent.decimals) : 0n;
|
|
10046
10076
|
};
|
|
10047
10077
|
var wrapTxBypass = /*#__PURE__*/function () {
|
|
@@ -10092,7 +10122,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
|
|
|
10092
10122
|
};
|
|
10093
10123
|
nativeInfo = mintFeeAssets ? assets.findNativeAssetInfo(chain) : null;
|
|
10094
10124
|
relayInfo = mintFeeAssets ? assets.findAssetInfo(chain, relayCurrency, null) : null;
|
|
10095
|
-
sameNativeRelay = !!(nativeInfo && relayInfo && assets.
|
|
10125
|
+
sameNativeRelay = !!(nativeInfo && relayInfo && assets.isAssetXcEqual(nativeInfo, relayInfo));
|
|
10096
10126
|
if (!mintFeeAssets) {
|
|
10097
10127
|
_context.n = 2;
|
|
10098
10128
|
break;
|
|
@@ -10582,6 +10612,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10582
10612
|
}),
|
|
10583
10613
|
address: address,
|
|
10584
10614
|
asset: asset,
|
|
10615
|
+
tx: tx,
|
|
10585
10616
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
10586
10617
|
senderAddress: senderAddress,
|
|
10587
10618
|
disableFallback: disableFallback
|
|
@@ -10651,6 +10682,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10651
10682
|
senderAddress: senderAddress,
|
|
10652
10683
|
asset: currentAsset,
|
|
10653
10684
|
feeAsset: feeAsset,
|
|
10685
|
+
tx: tx,
|
|
10654
10686
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
10655
10687
|
disableFallback: disableFallback
|
|
10656
10688
|
});
|
|
@@ -10743,6 +10775,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10743
10775
|
}),
|
|
10744
10776
|
address: address,
|
|
10745
10777
|
asset: asset,
|
|
10778
|
+
tx: tx,
|
|
10746
10779
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
10747
10780
|
senderAddress: senderAddress,
|
|
10748
10781
|
disableFallback: disableFallback
|
|
@@ -11153,18 +11186,17 @@ var send = /*#__PURE__*/function () {
|
|
|
11153
11186
|
|
|
11154
11187
|
var buildDestInfo = /*#__PURE__*/function () {
|
|
11155
11188
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
11156
|
-
var api, origin, destination, address, currency, originFee, isFeeAssetAh, destFeeDetail,
|
|
11189
|
+
var api, origin, destination, address, currency, originFee, isFeeAssetAh, destFeeDetail, totalHopFee, bridgeFee, destApi, destAsset, edDest, destCurrency, destBalance, destAmount, effectiveAmountForBalance, destBalanceSufficient, destBalanceSufficientResult, destBalanceAfter, destbalanceAfterResult, receivedAmount, isAssetHubToAssetHubRoute, nativeAssetOfOriginSymbol, isOriginAssetNative, destXcmFeeBalance, isDestFeeInNativeCurrency, destRecipientNativeBalance, destXcmFeeBalanceAfter;
|
|
11157
11190
|
return _regenerator().w(function (_context) {
|
|
11158
11191
|
while (1) switch (_context.n) {
|
|
11159
11192
|
case 0:
|
|
11160
|
-
api = _ref.api, origin = _ref.origin, destination = _ref.destination, address = _ref.address, currency = _ref.currency, originFee = _ref.originFee, isFeeAssetAh = _ref.isFeeAssetAh, destFeeDetail = _ref.destFeeDetail,
|
|
11193
|
+
api = _ref.api, origin = _ref.origin, destination = _ref.destination, address = _ref.address, currency = _ref.currency, originFee = _ref.originFee, isFeeAssetAh = _ref.isFeeAssetAh, destFeeDetail = _ref.destFeeDetail, totalHopFee = _ref.totalHopFee, bridgeFee = _ref.bridgeFee;
|
|
11161
11194
|
destApi = api.clone();
|
|
11162
11195
|
_context.n = 1;
|
|
11163
11196
|
return destApi.init(destination);
|
|
11164
11197
|
case 1:
|
|
11165
11198
|
destAsset = assets.findAssetOnDestOrThrow(origin, destination, currency);
|
|
11166
11199
|
edDest = assets.getEdFromAssetOrThrow(destAsset);
|
|
11167
|
-
edDestBn = BigInt(edDest);
|
|
11168
11200
|
destCurrency = destAsset.location ? {
|
|
11169
11201
|
location: destAsset.location
|
|
11170
11202
|
} : {
|
|
@@ -11179,12 +11211,9 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
11179
11211
|
});
|
|
11180
11212
|
case 2:
|
|
11181
11213
|
destBalance = _context.v;
|
|
11182
|
-
destAmount = isFeeAssetAh ?
|
|
11183
|
-
effectiveAmountForBalance = destAmount;
|
|
11184
|
-
|
|
11185
|
-
effectiveAmountForBalance -= assetHubFee;
|
|
11186
|
-
}
|
|
11187
|
-
destBalanceSufficient = effectiveAmountForBalance - destFeeDetail.fee > (destBalance < edDestBn ? edDestBn : 0);
|
|
11214
|
+
destAmount = isFeeAssetAh ? currency.amount - originFee : currency.amount;
|
|
11215
|
+
effectiveAmountForBalance = destAmount - totalHopFee;
|
|
11216
|
+
destBalanceSufficient = effectiveAmountForBalance - destFeeDetail.fee > (destBalance < edDest ? edDest : 0n);
|
|
11188
11217
|
destBalanceSufficientResult = destFeeDetail.currency !== destAsset.symbol && destination !== 'Ethereum' ? new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same') : destBalanceSufficient;
|
|
11189
11218
|
destBalanceAfter = destBalance - (destFeeDetail.currency === destAsset.symbol ? destFeeDetail.fee : 0n) + effectiveAmountForBalance;
|
|
11190
11219
|
destbalanceAfterResult = destFeeDetail.currency !== destAsset.symbol && destination !== 'Ethereum' ? new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same') : destBalanceAfter;
|
|
@@ -11199,7 +11228,7 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
11199
11228
|
if (bridgeFee === undefined) {
|
|
11200
11229
|
receivedAmount = new UnableToComputeError("bridgeFee is required for native asset transfer from ".concat(origin, " to ").concat(destination, " but was not provided."));
|
|
11201
11230
|
} else {
|
|
11202
|
-
receivedAmount =
|
|
11231
|
+
receivedAmount = currency.amount - originFee - bridgeFee;
|
|
11203
11232
|
}
|
|
11204
11233
|
} else {
|
|
11205
11234
|
receivedAmount = new UnableToComputeError("Unable to compute received amount: The transferred asset (".concat(destAsset.symbol, ") is not the native asset (").concat(nativeAssetOfOriginSymbol, ") of origin ").concat(origin, " for the ").concat(origin, "->").concat(destination, " route."));
|
|
@@ -11239,7 +11268,7 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
11239
11268
|
balanceAfter: destbalanceAfterResult,
|
|
11240
11269
|
currencySymbol: destAsset.symbol,
|
|
11241
11270
|
asset: destAsset,
|
|
11242
|
-
existentialDeposit:
|
|
11271
|
+
existentialDeposit: edDest
|
|
11243
11272
|
},
|
|
11244
11273
|
xcmFee: {
|
|
11245
11274
|
fee: destFeeDetail.fee,
|
|
@@ -11344,7 +11373,7 @@ var buildHopInfo = /*#__PURE__*/function () {
|
|
|
11344
11373
|
|
|
11345
11374
|
var getTransferInfo = /*#__PURE__*/function () {
|
|
11346
11375
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
11347
|
-
var api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset, resolvedFeeAsset, originAsset, amount, originBalanceFee, originBalance, edOrigin, _yield$getXcmFee, _yield$getXcmFee$orig, originFee, originFeeCurrency, originFeeAsset, assetHubFeeResult, bridgeHubFeeResult, destFeeDetail, hops, isFeeAssetAh, originBalanceAfter, originBalanceFeeAfter, originBalanceNativeSufficient, originBalanceSufficient, assetHub, bridgeHub, bridgeHubChain, builtHops, destinationInfo, _t;
|
|
11376
|
+
var api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset, resolvedFeeAsset, originAsset, amount, originBalanceFee, originBalance, edOrigin, _yield$getXcmFee, _yield$getXcmFee$orig, originFee, originFeeCurrency, originFeeAsset, assetHubFeeResult, bridgeHubFeeResult, destFeeDetail, hops, isFeeAssetAh, originBalanceAfter, originBalanceFeeAfter, originBalanceNativeSufficient, originBalanceSufficient, assetHub, bridgeHub, bridgeHubChain, builtHops, totalHopFee, destinationInfo, _t;
|
|
11348
11377
|
return _regenerator().w(function (_context2) {
|
|
11349
11378
|
while (1) switch (_context2.p = _context2.n) {
|
|
11350
11379
|
case 0:
|
|
@@ -11502,6 +11531,9 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
11502
11531
|
case 14:
|
|
11503
11532
|
builtHops = _context2.v;
|
|
11504
11533
|
case 15:
|
|
11534
|
+
totalHopFee = hops.reduce(function (acc, hop) {
|
|
11535
|
+
return assets.isAssetXcEqual(hop.result.asset, originAsset) ? acc + hop.result.fee : acc;
|
|
11536
|
+
}, 0n);
|
|
11505
11537
|
_context2.n = 16;
|
|
11506
11538
|
return buildDestInfo({
|
|
11507
11539
|
api: api,
|
|
@@ -11514,7 +11546,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
11514
11546
|
originFee: originFee,
|
|
11515
11547
|
isFeeAssetAh: !!isFeeAssetAh,
|
|
11516
11548
|
destFeeDetail: destFeeDetail,
|
|
11517
|
-
|
|
11549
|
+
totalHopFee: totalHopFee,
|
|
11518
11550
|
bridgeFee: bridgeHubFeeResult === null || bridgeHubFeeResult === void 0 ? void 0 : bridgeHubFeeResult.fee
|
|
11519
11551
|
});
|
|
11520
11552
|
case 16:
|
package/dist/index.d.ts
CHANGED
|
@@ -846,12 +846,14 @@ type TDryRunCallBaseOptions<TRes> = {
|
|
|
846
846
|
};
|
|
847
847
|
type TDryRunBypassOptions<TApi, TRes> = WithApi<Omit<TDryRunCallBaseOptions<TRes>, 'useRootOrigin'>, TApi, TRes>;
|
|
848
848
|
type TDryRunCallOptions<TApi, TRes> = WithApi<TDryRunCallBaseOptions<TRes>, TApi, TRes>;
|
|
849
|
-
type TDryRunXcmBaseOptions = {
|
|
849
|
+
type TDryRunXcmBaseOptions<TRes> = {
|
|
850
850
|
originLocation: any;
|
|
851
851
|
/**
|
|
852
852
|
* The XCM instructions
|
|
853
853
|
*/
|
|
854
854
|
xcm: any;
|
|
855
|
+
/** The transaction to dry-run */
|
|
856
|
+
tx: TRes;
|
|
855
857
|
/**
|
|
856
858
|
* The chain to dry-run on
|
|
857
859
|
*/
|
|
@@ -865,7 +867,7 @@ type TDryRunXcmBaseOptions = {
|
|
|
865
867
|
amount: bigint;
|
|
866
868
|
originFee: bigint;
|
|
867
869
|
};
|
|
868
|
-
type TDryRunXcmOptions<TApi, TRes> = WithApi<TDryRunXcmBaseOptions
|
|
870
|
+
type TDryRunXcmOptions<TApi, TRes> = WithApi<TDryRunXcmBaseOptions<TRes>, TApi, TRes>;
|
|
869
871
|
type TDryRunResBase = {
|
|
870
872
|
/** @deprecated Use `asset` property instead. */
|
|
871
873
|
currency: string;
|
|
@@ -1177,7 +1179,7 @@ type TGetOriginXcmFeeOptions<TApi, TRes> = WithApi<TGetOriginXcmFeeBaseOptions<T
|
|
|
1177
1179
|
type TAttemptDryRunFeeOptions<TApi, TRes> = Omit<TGetOriginXcmFeeOptions<TApi, TRes>, 'tx'> & {
|
|
1178
1180
|
builder: GeneralBuilder<TApi, TRes, TSendBaseOptions>;
|
|
1179
1181
|
};
|
|
1180
|
-
type TGetFeeForDestChainBaseOptions = {
|
|
1182
|
+
type TGetFeeForDestChainBaseOptions<TRes> = {
|
|
1181
1183
|
prevChain: TSubstrateChain;
|
|
1182
1184
|
origin: TSubstrateChain;
|
|
1183
1185
|
destination: TChain;
|
|
@@ -1185,12 +1187,13 @@ type TGetFeeForDestChainBaseOptions = {
|
|
|
1185
1187
|
address: string;
|
|
1186
1188
|
currency: WithAmount<TCurrencyCore>;
|
|
1187
1189
|
forwardedXcms: any;
|
|
1190
|
+
tx: TRes;
|
|
1188
1191
|
asset: TAssetInfo;
|
|
1189
1192
|
originFee: bigint;
|
|
1190
1193
|
feeAsset?: TCurrencyInput;
|
|
1191
1194
|
disableFallback: boolean;
|
|
1192
1195
|
};
|
|
1193
|
-
type TGetFeeForDestChainOptions<TApi, TRes> = WithApi<TGetFeeForDestChainBaseOptions
|
|
1196
|
+
type TGetFeeForDestChainOptions<TApi, TRes> = WithApi<TGetFeeForDestChainBaseOptions<TRes>, TApi, TRes>;
|
|
1194
1197
|
type TGetReverseTxFeeOptions<TApi, TRes> = Omit<TGetFeeForDestChainOptions<TApi, TRes>, 'destination' | 'disableFallback' | 'forwardedXcms' | 'asset' | 'originFee' | 'prevChain'> & {
|
|
1195
1198
|
destination: TSubstrateChain;
|
|
1196
1199
|
};
|
|
@@ -1353,7 +1356,7 @@ type TBuildDestInfoOptions<TApi, TRes> = {
|
|
|
1353
1356
|
originFee: bigint;
|
|
1354
1357
|
isFeeAssetAh: boolean;
|
|
1355
1358
|
destFeeDetail: TXcmFeeDetail;
|
|
1356
|
-
|
|
1359
|
+
totalHopFee: bigint;
|
|
1357
1360
|
bridgeFee?: bigint;
|
|
1358
1361
|
};
|
|
1359
1362
|
type TOriginFeeDetails = {
|
|
@@ -1423,7 +1426,7 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
1423
1426
|
clone(): IPolkadotApi<TApi, TRes>;
|
|
1424
1427
|
createApiForChain(chain: TSubstrateChain): Promise<IPolkadotApi<TApi, TRes>>;
|
|
1425
1428
|
getDryRunCall(options: TDryRunCallBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
1426
|
-
getDryRunXcm(options: TDryRunXcmBaseOptions): Promise<TDryRunChainResult>;
|
|
1429
|
+
getDryRunXcm(options: TDryRunXcmBaseOptions<TRes>): Promise<TDryRunChainResult>;
|
|
1427
1430
|
getBridgeStatus(): Promise<TBridgeStatus>;
|
|
1428
1431
|
setDisconnectAllowed(allowed: boolean): void;
|
|
1429
1432
|
getDisconnectAllowed(): boolean;
|
|
@@ -1522,6 +1525,7 @@ declare class Amplitude<TApi, TRes> extends Parachain<TApi, TRes> implements IXT
|
|
|
1522
1525
|
declare class AssetHubKusama<TApi, TRes> extends Parachain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1523
1526
|
constructor();
|
|
1524
1527
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1528
|
+
getMethod(scenario: TScenario, destination: TDestination): TPolkadotXcmMethod;
|
|
1525
1529
|
getRelayToParaOverrides(): TRelayToParaOverrides;
|
|
1526
1530
|
createCurrencySpec(amount: bigint, scenario: TScenario, version: Version, asset?: TAssetInfo, isOverridenAsset?: boolean): _paraspell_assets.TAsset;
|
|
1527
1531
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
@@ -1764,13 +1768,17 @@ declare class HydrationPaseo<TApi, TRes> extends Hydration<TApi, TRes> {
|
|
|
1764
1768
|
constructor();
|
|
1765
1769
|
}
|
|
1766
1770
|
|
|
1767
|
-
declare class
|
|
1771
|
+
declare class IntegriteePolkadot<TApi, TRes> extends Parachain<TApi, TRes> implements IPolkadotXCMTransfer {
|
|
1768
1772
|
constructor(chain?: TParachain, info?: string, type?: TRelaychain, version?: Version);
|
|
1769
|
-
|
|
1773
|
+
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1770
1774
|
transferRelayToPara(): Promise<TSerializedApiCall>;
|
|
1771
1775
|
transferLocalNonNativeAsset(options: TTransferLocalOptions<TApi, TRes>): TRes;
|
|
1772
1776
|
}
|
|
1773
1777
|
|
|
1778
|
+
declare class IntegriteeKusama<TApi, TRes> extends IntegriteePolkadot<TApi, TRes> {
|
|
1779
|
+
constructor(chain?: TParachain, info?: string, type?: TRelaychain, version?: Version);
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1774
1782
|
declare class IntegriteePaseo<TApi, TRes> extends IntegriteeKusama<TApi, TRes> {
|
|
1775
1783
|
constructor();
|
|
1776
1784
|
}
|
|
@@ -1991,6 +1999,7 @@ declare const chains: <TApi, TRes>() => {
|
|
|
1991
1999
|
EnergyWebX: EnergyWebX<TApi, TRes>;
|
|
1992
2000
|
Hydration: Hydration<TApi, TRes>;
|
|
1993
2001
|
IntegriteeKusama: IntegriteeKusama<TApi, TRes>;
|
|
2002
|
+
IntegriteePolkadot: IntegriteePolkadot<TApi, TRes>;
|
|
1994
2003
|
Interlay: Interlay<TApi, TRes>;
|
|
1995
2004
|
Heima: Heima<TApi, TRes>;
|
|
1996
2005
|
Jamton: Jamton<TApi, TRes>;
|
|
@@ -2208,7 +2217,7 @@ declare const localizeLocation: (chain: TChain, location: TLocation) => TLocatio
|
|
|
2208
2217
|
|
|
2209
2218
|
declare const reverseTransformLocation: (location: TLocation) => TLocation;
|
|
2210
2219
|
|
|
2211
|
-
declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "ComposableFinance" | "Darwinia" | "EnergyWebX" | "Hydration" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "Manta" | "Nodle" | "NeuroWeb" | "Pendulum" | "Phala" | "Subsocial" | "KiltSpiritnet" | "Curio" | "Mythos" | "Peaq" | "Polimec" | "RobonomicsPolkadot" | "PeoplePolkadot" | "Unique" | "AssetHubKusama" | "BridgeHubKusama" | "IntegriteeKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Altair" | "Amplitude" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Laos" | "Quartz" | "RobonomicsKusama" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "IntegriteePaseo" | "KiltPaseo" | "LaosPaseo" | "NeuroWebPaseo" | "NodlePaseo" | "PAssetHub" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
|
|
2220
|
+
declare const resolveDestChain: (originChain: TSubstrateChain, paraId: number | undefined) => "AssetHubPolkadot" | "Acala" | "Ajuna" | "Astar" | "BifrostPolkadot" | "BridgeHubPolkadot" | "Centrifuge" | "ComposableFinance" | "Darwinia" | "EnergyWebX" | "Hydration" | "IntegriteePolkadot" | "Interlay" | "Heima" | "Jamton" | "Moonbeam" | "CoretimePolkadot" | "Collectives" | "Crust" | "Manta" | "Nodle" | "NeuroWeb" | "Pendulum" | "Phala" | "Subsocial" | "KiltSpiritnet" | "Curio" | "Mythos" | "Peaq" | "Polimec" | "RobonomicsPolkadot" | "PeoplePolkadot" | "Unique" | "AssetHubKusama" | "BridgeHubKusama" | "IntegriteeKusama" | "Karura" | "Kintsugi" | "Moonriver" | "CoretimeKusama" | "Encointer" | "Altair" | "Amplitude" | "Basilisk" | "BifrostKusama" | "CrustShadow" | "Crab" | "Laos" | "Quartz" | "RobonomicsKusama" | "PeopleKusama" | "Shiden" | "Zeitgeist" | "AssetHubWestend" | "BridgeHubWestend" | "CollectivesWestend" | "CoretimeWestend" | "Penpal" | "PeopleWestend" | "AjunaPaseo" | "AssetHubPaseo" | "BifrostPaseo" | "BridgeHubPaseo" | "CoretimePaseo" | "EnergyWebXPaseo" | "HeimaPaseo" | "HydrationPaseo" | "IntegriteePaseo" | "KiltPaseo" | "LaosPaseo" | "NeuroWebPaseo" | "NodlePaseo" | "PAssetHub" | "PeoplePaseo" | "ZeitgeistPaseo" | undefined;
|
|
2212
2221
|
|
|
2213
2222
|
declare const resolveParaId: (paraId: number | undefined, destination: TDestination) => number | undefined;
|
|
2214
2223
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { blake2b } from '@noble/hashes/blake2';
|
|
2
|
-
import { isChainEvm, getAssetsObject, InvalidCurrencyError, isForeignAsset, extractAssetLocation, getNativeAssetSymbol, getOtherAssets, isAssetEqual, findAssetInfo, isTAsset, findAssetInfoOrThrow, getExistentialDeposit, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, isOverrideLocationSpecifier, findAssetInfoByLoc, findAssetOnDestOrThrow, findNativeAssetInfoOrThrow, Native, hasXcmPaymentApiSupport, getRelayChainSymbol, getNativeAssets, findNativeAssetInfo, hasSupportForAsset, isSymbolSpecifier, normalizeLocation, getEdFromAssetOrThrow, normalizeSymbol } from '@paraspell/assets';
|
|
2
|
+
import { isChainEvm, getAssetsObject, InvalidCurrencyError, isForeignAsset, extractAssetLocation, getNativeAssetSymbol, getOtherAssets, isAssetEqual, findAssetInfo, isTAsset, findAssetInfoOrThrow, getExistentialDeposit, getExistentialDepositOrThrow, isSymbolMatch, hasDryRunSupport, isOverrideLocationSpecifier, findAssetInfoByLoc, findAssetOnDestOrThrow, findNativeAssetInfoOrThrow, Native, hasXcmPaymentApiSupport, getRelayChainSymbol, getNativeAssets, findNativeAssetInfo, isAssetXcEqual, hasSupportForAsset, isSymbolSpecifier, normalizeLocation, getEdFromAssetOrThrow, normalizeSymbol } from '@paraspell/assets';
|
|
3
3
|
export * from '@paraspell/assets';
|
|
4
4
|
import { base58 } from '@scure/base';
|
|
5
5
|
import { isAddress, parseUnits, createPublicClient, http, getContract, pad, toHex, getAddress, concat, keccak256 } from 'viem';
|
|
@@ -1106,17 +1106,6 @@ var EnergyWebX$1 = {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
]
|
|
1108
1108
|
};
|
|
1109
|
-
var EnergyWebXPaseo$1 = {
|
|
1110
|
-
name: "PEX",
|
|
1111
|
-
info: "paseoEwx",
|
|
1112
|
-
paraId: 3345,
|
|
1113
|
-
providers: [
|
|
1114
|
-
{
|
|
1115
|
-
name: "Energy Web",
|
|
1116
|
-
endpoint: "wss://public-rpc.testnet.energywebx.com/"
|
|
1117
|
-
}
|
|
1118
|
-
]
|
|
1119
|
-
};
|
|
1120
1109
|
var Hydration$1 = {
|
|
1121
1110
|
name: "Hydration",
|
|
1122
1111
|
info: "hydradx",
|
|
@@ -1140,6 +1129,17 @@ var Hydration$1 = {
|
|
|
1140
1129
|
}
|
|
1141
1130
|
]
|
|
1142
1131
|
};
|
|
1132
|
+
var IntegriteePolkadot$1 = {
|
|
1133
|
+
name: "Integritee Network",
|
|
1134
|
+
info: "integritee",
|
|
1135
|
+
paraId: 2039,
|
|
1136
|
+
providers: [
|
|
1137
|
+
{
|
|
1138
|
+
name: "Integritee",
|
|
1139
|
+
endpoint: "wss://polkadot.api.integritee.network"
|
|
1140
|
+
}
|
|
1141
|
+
]
|
|
1142
|
+
};
|
|
1143
1143
|
var Interlay$1 = {
|
|
1144
1144
|
name: "Interlay",
|
|
1145
1145
|
info: "interlay",
|
|
@@ -2196,6 +2196,17 @@ var CoretimePaseo$1 = {
|
|
|
2196
2196
|
}
|
|
2197
2197
|
]
|
|
2198
2198
|
};
|
|
2199
|
+
var EnergyWebXPaseo$1 = {
|
|
2200
|
+
name: "PEX",
|
|
2201
|
+
info: "paseoEwx",
|
|
2202
|
+
paraId: 3345,
|
|
2203
|
+
providers: [
|
|
2204
|
+
{
|
|
2205
|
+
name: "Energy Web",
|
|
2206
|
+
endpoint: "wss://public-rpc.testnet.energywebx.com/"
|
|
2207
|
+
}
|
|
2208
|
+
]
|
|
2209
|
+
};
|
|
2199
2210
|
var HeimaPaseo$1 = {
|
|
2200
2211
|
name: "Heima paseo",
|
|
2201
2212
|
info: "heima-paseo",
|
|
@@ -2501,8 +2512,8 @@ var configs = {
|
|
|
2501
2512
|
ComposableFinance: ComposableFinance$1,
|
|
2502
2513
|
Darwinia: Darwinia$1,
|
|
2503
2514
|
EnergyWebX: EnergyWebX$1,
|
|
2504
|
-
EnergyWebXPaseo: EnergyWebXPaseo$1,
|
|
2505
2515
|
Hydration: Hydration$1,
|
|
2516
|
+
IntegriteePolkadot: IntegriteePolkadot$1,
|
|
2506
2517
|
Interlay: Interlay$1,
|
|
2507
2518
|
Heima: Heima$1,
|
|
2508
2519
|
Jamton: Jamton$1,
|
|
@@ -2555,6 +2566,7 @@ var configs = {
|
|
|
2555
2566
|
BifrostPaseo: BifrostPaseo$1,
|
|
2556
2567
|
BridgeHubPaseo: BridgeHubPaseo$1,
|
|
2557
2568
|
CoretimePaseo: CoretimePaseo$1,
|
|
2569
|
+
EnergyWebXPaseo: EnergyWebXPaseo$1,
|
|
2558
2570
|
HeimaPaseo: HeimaPaseo$1,
|
|
2559
2571
|
HydrationPaseo: HydrationPaseo$1,
|
|
2560
2572
|
IntegriteePaseo: IntegriteePaseo$1,
|
|
@@ -3815,12 +3827,12 @@ var getBalanceForeignXTokens = /*#__PURE__*/function () {
|
|
|
3815
3827
|
return _regenerator().w(function (_context) {
|
|
3816
3828
|
while (1) switch (_context.n) {
|
|
3817
3829
|
case 0:
|
|
3818
|
-
if (!(chain === 'Astar' || chain === 'Shiden')) {
|
|
3830
|
+
if (!(chain === 'Astar' || chain === 'Shiden' || chain.startsWith('Integritee'))) {
|
|
3819
3831
|
_context.n = 1;
|
|
3820
3832
|
break;
|
|
3821
3833
|
}
|
|
3822
3834
|
assertHasId(asset);
|
|
3823
|
-
return _context.a(2, api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
|
|
3835
|
+
return _context.a(2, api.getBalanceAssetsPallet(address, chain.startsWith('Integritee') ? Number(asset.assetId) : BigInt(asset.assetId)));
|
|
3824
3836
|
case 1:
|
|
3825
3837
|
if (!(chain === 'BifrostPolkadot' || chain === 'BifrostKusama')) {
|
|
3826
3838
|
_context.n = 2;
|
|
@@ -4301,11 +4313,11 @@ var createOriginLocation = function createOriginLocation(origin, destination) {
|
|
|
4301
4313
|
};
|
|
4302
4314
|
var getDestXcmFee = /*#__PURE__*/function () {
|
|
4303
4315
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
|
|
4304
|
-
var api, origin, hopChain, destination, currency, forwardedXcms, asset, address, feeAsset, originFee, disableFallback, resolvedFeeAsset, calcPaymentInfoFee, _fee, sufficient, dryRunResult, _fee2, fee, newForwardedXcms, destParaId;
|
|
4316
|
+
var api, origin, hopChain, destination, currency, forwardedXcms, asset, address, feeAsset, originFee, tx, disableFallback, resolvedFeeAsset, calcPaymentInfoFee, _fee, sufficient, dryRunResult, _fee2, fee, newForwardedXcms, destParaId;
|
|
4305
4317
|
return _regenerator().w(function (_context2) {
|
|
4306
4318
|
while (1) switch (_context2.n) {
|
|
4307
4319
|
case 0:
|
|
4308
|
-
api = options.api, origin = options.origin, hopChain = options.prevChain, destination = options.destination, currency = options.currency, forwardedXcms = options.forwardedXcms, asset = options.asset, address = options.address, feeAsset = options.feeAsset, originFee = options.originFee, disableFallback = options.disableFallback;
|
|
4320
|
+
api = options.api, origin = options.origin, hopChain = options.prevChain, destination = options.destination, currency = options.currency, forwardedXcms = options.forwardedXcms, asset = options.asset, address = options.address, feeAsset = options.feeAsset, originFee = options.originFee, tx = options.tx, disableFallback = options.disableFallback;
|
|
4309
4321
|
resolvedFeeAsset = feeAsset ? resolveFeeAsset(feeAsset, origin, destination, currency) : undefined;
|
|
4310
4322
|
calcPaymentInfoFee = /*#__PURE__*/function () {
|
|
4311
4323
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
@@ -4387,6 +4399,7 @@ var getDestXcmFee = /*#__PURE__*/function () {
|
|
|
4387
4399
|
_context2.n = 4;
|
|
4388
4400
|
return api.getDryRunXcm({
|
|
4389
4401
|
originLocation: addXcmVersionHeader(createOriginLocation(hopChain, destination), Version.V4),
|
|
4402
|
+
tx: tx,
|
|
4390
4403
|
xcm: forwardedXcms[1][0],
|
|
4391
4404
|
chain: destination,
|
|
4392
4405
|
origin: origin,
|
|
@@ -5264,6 +5277,7 @@ var dryRunInternal = /*#__PURE__*/function () {
|
|
|
5264
5277
|
_context.n = 2;
|
|
5265
5278
|
return hopApi.getDryRunXcm({
|
|
5266
5279
|
originLocation: addXcmVersionHeader(createOriginLocation(currentOrigin, currentChain), Version.V4),
|
|
5280
|
+
tx: tx,
|
|
5267
5281
|
xcm: forwardedXcms[1][0],
|
|
5268
5282
|
chain: currentChain,
|
|
5269
5283
|
origin: currentOrigin,
|
|
@@ -6014,7 +6028,7 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6014
6028
|
key: "transfer",
|
|
6015
6029
|
value: function () {
|
|
6016
6030
|
var _transfer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(sendOptions) {
|
|
6017
|
-
var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, destChain, isLocalTransfer, isRelayAsset, supportsTypeThen, useTypeAndThen, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAhToOtherPara, isOtherParaToAh, isAHPOrigin, isAHPDest, isExternalAsset, isEthDest, isExternalAssetViaAh, isExternalAssetToAh, call;
|
|
6031
|
+
var api, asset, currency, feeAsset, feeCurrency, address, destination, paraIdTo, overriddenAsset, version, senderAddress, ahAddress, pallet, method, scenario, paraId, destChain, isLocalTransfer, isRelayAsset, supportsTypeThen, useTypeAndThen, isBifrostOrigin, isJamtonOrigin, isAssetHubDest, useMultiAssets, input, options, shouldUseTeleport, isAhToOtherPara, isOtherParaToAh, isAllowedAhTransfer, isAHPOrigin, isAHPDest, isExternalAsset, isEthDest, isExternalAssetViaAh, isExternalAssetToAh, call;
|
|
6018
6032
|
return _regenerator().w(function (_context) {
|
|
6019
6033
|
while (1) switch (_context.n) {
|
|
6020
6034
|
case 0:
|
|
@@ -6125,7 +6139,10 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
6125
6139
|
shouldUseTeleport = this.shouldUseNativeAssetTeleport(sendOptions);
|
|
6126
6140
|
isAhToOtherPara = this.chain.startsWith('AssetHub') && destChain && !isTrustedChain(destChain);
|
|
6127
6141
|
isOtherParaToAh = (destChain === null || destChain === void 0 ? void 0 : destChain.startsWith('AssetHub')) && !isTrustedChain(this.chain);
|
|
6128
|
-
|
|
6142
|
+
isAllowedAhTransfer = function isAllowedAhTransfer(chain) {
|
|
6143
|
+
return chain === null || chain === void 0 ? void 0 : chain.startsWith('Integritee');
|
|
6144
|
+
};
|
|
6145
|
+
if (!((isAhToOtherPara || isOtherParaToAh) && shouldUseTeleport && !isAllowedAhTransfer(destChain) && !isAllowedAhTransfer(this.chain))) {
|
|
6129
6146
|
_context.n = 8;
|
|
6130
6147
|
break;
|
|
6131
6148
|
}
|
|
@@ -6757,9 +6774,16 @@ var AssetHubKusama = /*#__PURE__*/function (_Parachain) {
|
|
|
6757
6774
|
if (scenario === 'ParaToPara' && asset.symbol === 'DOT' && !isForeignAsset(asset)) {
|
|
6758
6775
|
throw new ScenarioNotSupportedError(this.chain, scenario, 'Bridged DOT cannot currently be transfered from AssetHubKusama, if you are sending different DOT asset, please specify {id: <DOTID>}.');
|
|
6759
6776
|
}
|
|
6760
|
-
var method = scenario
|
|
6777
|
+
var method = this.getMethod(scenario, destination);
|
|
6761
6778
|
return transferPolkadotXcm(input, method, 'Unlimited');
|
|
6762
6779
|
}
|
|
6780
|
+
}, {
|
|
6781
|
+
key: "getMethod",
|
|
6782
|
+
value: function getMethod(scenario, destination) {
|
|
6783
|
+
var isTrusted = !isTLocation(destination) && isTrustedChain(destination);
|
|
6784
|
+
if (destination === 'IntegriteeKusama') return 'transfer_assets';
|
|
6785
|
+
return scenario === 'ParaToPara' && !isTrusted ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
|
|
6786
|
+
}
|
|
6763
6787
|
}, {
|
|
6764
6788
|
key: "getRelayToParaOverrides",
|
|
6765
6789
|
value: function getRelayToParaOverrides() {
|
|
@@ -6987,7 +7011,7 @@ var AssetHubPolkadot = /*#__PURE__*/function (_Parachain) {
|
|
|
6987
7011
|
key: "getMethod",
|
|
6988
7012
|
value: function getMethod(scenario, destination) {
|
|
6989
7013
|
var isTrusted = !isTLocation(destination) && isTrustedChain(destination);
|
|
6990
|
-
if (destination === 'Polimec' || destination === 'Moonbeam') return 'transfer_assets';
|
|
7014
|
+
if (destination === 'Polimec' || destination === 'Moonbeam' || typeof destination === 'string' && destination.startsWith('Integritee')) return 'transfer_assets';
|
|
6991
7015
|
return scenario === 'ParaToPara' && !isTrusted ? 'limited_reserve_transfer_assets' : 'limited_teleport_assets';
|
|
6992
7016
|
}
|
|
6993
7017
|
}, {
|
|
@@ -8318,28 +8342,20 @@ var HydrationPaseo = /*#__PURE__*/function (_Hydration) {
|
|
|
8318
8342
|
return _createClass(HydrationPaseo);
|
|
8319
8343
|
}(Hydration);
|
|
8320
8344
|
|
|
8321
|
-
var
|
|
8322
|
-
function
|
|
8323
|
-
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '
|
|
8345
|
+
var IntegriteePolkadot = /*#__PURE__*/function (_Parachain) {
|
|
8346
|
+
function IntegriteePolkadot() {
|
|
8347
|
+
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteePolkadot';
|
|
8324
8348
|
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
|
|
8325
|
-
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '
|
|
8326
|
-
var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Version.
|
|
8327
|
-
_classCallCheck(this,
|
|
8328
|
-
return _callSuper(this,
|
|
8349
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Polkadot';
|
|
8350
|
+
var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Version.V5;
|
|
8351
|
+
_classCallCheck(this, IntegriteePolkadot);
|
|
8352
|
+
return _callSuper(this, IntegriteePolkadot, [chain, info, type, version]);
|
|
8329
8353
|
}
|
|
8330
|
-
_inherits(
|
|
8331
|
-
return _createClass(
|
|
8332
|
-
key: "
|
|
8333
|
-
value: function
|
|
8334
|
-
|
|
8335
|
-
scenario = input.scenario;
|
|
8336
|
-
if (scenario !== 'ParaToPara') {
|
|
8337
|
-
throw new ScenarioNotSupportedError(this.chain, scenario);
|
|
8338
|
-
}
|
|
8339
|
-
if (asset.symbol !== this.getNativeAssetSymbol()) {
|
|
8340
|
-
throw new InvalidCurrencyError("Asset ".concat(asset.symbol, " is not supported by chain ").concat(this.chain, "."));
|
|
8341
|
-
}
|
|
8342
|
-
return transferXTokens(input, asset.symbol);
|
|
8354
|
+
_inherits(IntegriteePolkadot, _Parachain);
|
|
8355
|
+
return _createClass(IntegriteePolkadot, [{
|
|
8356
|
+
key: "transferPolkadotXCM",
|
|
8357
|
+
value: function transferPolkadotXCM(input) {
|
|
8358
|
+
return transferPolkadotXcm(input, 'transfer_assets', 'Unlimited');
|
|
8343
8359
|
}
|
|
8344
8360
|
}, {
|
|
8345
8361
|
key: "transferRelayToPara",
|
|
@@ -8368,6 +8384,19 @@ var IntegriteeKusama = /*#__PURE__*/function (_Parachain) {
|
|
|
8368
8384
|
}]);
|
|
8369
8385
|
}(Parachain);
|
|
8370
8386
|
|
|
8387
|
+
var IntegriteeKusama = /*#__PURE__*/function (_IntegriteePolkadot) {
|
|
8388
|
+
function IntegriteeKusama() {
|
|
8389
|
+
var chain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'IntegriteeKusama';
|
|
8390
|
+
var info = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'integritee';
|
|
8391
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Kusama';
|
|
8392
|
+
var version = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Version.V5;
|
|
8393
|
+
_classCallCheck(this, IntegriteeKusama);
|
|
8394
|
+
return _callSuper(this, IntegriteeKusama, [chain, info, type, version]);
|
|
8395
|
+
}
|
|
8396
|
+
_inherits(IntegriteeKusama, _IntegriteePolkadot);
|
|
8397
|
+
return _createClass(IntegriteeKusama);
|
|
8398
|
+
}(IntegriteePolkadot);
|
|
8399
|
+
|
|
8371
8400
|
var IntegriteePaseo = /*#__PURE__*/function (_IntegriteeKusama) {
|
|
8372
8401
|
function IntegriteePaseo() {
|
|
8373
8402
|
_classCallCheck(this, IntegriteePaseo);
|
|
@@ -9485,6 +9514,7 @@ var chains = function chains() {
|
|
|
9485
9514
|
EnergyWebX: new EnergyWebX(),
|
|
9486
9515
|
Hydration: new Hydration(),
|
|
9487
9516
|
IntegriteeKusama: new IntegriteeKusama(),
|
|
9517
|
+
IntegriteePolkadot: new IntegriteePolkadot(),
|
|
9488
9518
|
Interlay: new Interlay(),
|
|
9489
9519
|
Heima: new Heima(),
|
|
9490
9520
|
Jamton: new Jamton(),
|
|
@@ -9571,7 +9601,7 @@ var RELAY_LOCATION = {
|
|
|
9571
9601
|
Here: null
|
|
9572
9602
|
}
|
|
9573
9603
|
};
|
|
9574
|
-
var CHAINS_DOT_RESERVE_AH = new Set(['Acala', 'Karura', 'Polimec', 'Moonbeam', 'Hydration', 'HydrationPaseo', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna']);
|
|
9604
|
+
var CHAINS_DOT_RESERVE_AH = new Set(['Acala', 'Karura', 'Polimec', 'Moonbeam', 'Hydration', 'HydrationPaseo', 'AssetHubPolkadot', 'AssetHubKusama', 'AssetHubWestend', 'AssetHubPaseo', 'BifrostPolkadot', 'BifrostKusama', 'PeoplePolkadot', 'PeopleKusama', 'Ajuna', 'IntegriteePolkadot', 'IntegriteeKusama', 'IntegriteePaseo']);
|
|
9575
9605
|
var ASSET_HUB_EXECUTION_FEE = 2200000000n; // 0.22 DOT
|
|
9576
9606
|
var TX_CLIENT_TIMEOUT_MS = 20 * 60 * 1000; // 20 minutes
|
|
9577
9607
|
var DRY_RUN_CLIENT_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
|
@@ -10042,7 +10072,7 @@ var mintBonusForSent = function mintBonusForSent(chain, sent, feeAsset, mintFeeA
|
|
|
10042
10072
|
return true;
|
|
10043
10073
|
});
|
|
10044
10074
|
return preminted.some(function (a) {
|
|
10045
|
-
return
|
|
10075
|
+
return isAssetXcEqual(a, sent);
|
|
10046
10076
|
}) ? parseUnits(MINT_AMOUNT.toString(), sent.decimals) : 0n;
|
|
10047
10077
|
};
|
|
10048
10078
|
var wrapTxBypass = /*#__PURE__*/function () {
|
|
@@ -10093,7 +10123,7 @@ var wrapTxBypass = /*#__PURE__*/function () {
|
|
|
10093
10123
|
};
|
|
10094
10124
|
nativeInfo = mintFeeAssets ? findNativeAssetInfo(chain) : null;
|
|
10095
10125
|
relayInfo = mintFeeAssets ? findAssetInfo(chain, relayCurrency, null) : null;
|
|
10096
|
-
sameNativeRelay = !!(nativeInfo && relayInfo &&
|
|
10126
|
+
sameNativeRelay = !!(nativeInfo && relayInfo && isAssetXcEqual(nativeInfo, relayInfo));
|
|
10097
10127
|
if (!mintFeeAssets) {
|
|
10098
10128
|
_context.n = 2;
|
|
10099
10129
|
break;
|
|
@@ -10583,6 +10613,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10583
10613
|
}),
|
|
10584
10614
|
address: address,
|
|
10585
10615
|
asset: asset,
|
|
10616
|
+
tx: tx,
|
|
10586
10617
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
10587
10618
|
senderAddress: senderAddress,
|
|
10588
10619
|
disableFallback: disableFallback
|
|
@@ -10652,6 +10683,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10652
10683
|
senderAddress: senderAddress,
|
|
10653
10684
|
asset: currentAsset,
|
|
10654
10685
|
feeAsset: feeAsset,
|
|
10686
|
+
tx: tx,
|
|
10655
10687
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
10656
10688
|
disableFallback: disableFallback
|
|
10657
10689
|
});
|
|
@@ -10744,6 +10776,7 @@ var getXcmFeeInternal = /*#__PURE__*/function () {
|
|
|
10744
10776
|
}),
|
|
10745
10777
|
address: address,
|
|
10746
10778
|
asset: asset,
|
|
10779
|
+
tx: tx,
|
|
10747
10780
|
originFee: originFee !== null && originFee !== void 0 ? originFee : 0n,
|
|
10748
10781
|
senderAddress: senderAddress,
|
|
10749
10782
|
disableFallback: disableFallback
|
|
@@ -11154,18 +11187,17 @@ var send = /*#__PURE__*/function () {
|
|
|
11154
11187
|
|
|
11155
11188
|
var buildDestInfo = /*#__PURE__*/function () {
|
|
11156
11189
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
11157
|
-
var api, origin, destination, address, currency, originFee, isFeeAssetAh, destFeeDetail,
|
|
11190
|
+
var api, origin, destination, address, currency, originFee, isFeeAssetAh, destFeeDetail, totalHopFee, bridgeFee, destApi, destAsset, edDest, destCurrency, destBalance, destAmount, effectiveAmountForBalance, destBalanceSufficient, destBalanceSufficientResult, destBalanceAfter, destbalanceAfterResult, receivedAmount, isAssetHubToAssetHubRoute, nativeAssetOfOriginSymbol, isOriginAssetNative, destXcmFeeBalance, isDestFeeInNativeCurrency, destRecipientNativeBalance, destXcmFeeBalanceAfter;
|
|
11158
11191
|
return _regenerator().w(function (_context) {
|
|
11159
11192
|
while (1) switch (_context.n) {
|
|
11160
11193
|
case 0:
|
|
11161
|
-
api = _ref.api, origin = _ref.origin, destination = _ref.destination, address = _ref.address, currency = _ref.currency, originFee = _ref.originFee, isFeeAssetAh = _ref.isFeeAssetAh, destFeeDetail = _ref.destFeeDetail,
|
|
11194
|
+
api = _ref.api, origin = _ref.origin, destination = _ref.destination, address = _ref.address, currency = _ref.currency, originFee = _ref.originFee, isFeeAssetAh = _ref.isFeeAssetAh, destFeeDetail = _ref.destFeeDetail, totalHopFee = _ref.totalHopFee, bridgeFee = _ref.bridgeFee;
|
|
11162
11195
|
destApi = api.clone();
|
|
11163
11196
|
_context.n = 1;
|
|
11164
11197
|
return destApi.init(destination);
|
|
11165
11198
|
case 1:
|
|
11166
11199
|
destAsset = findAssetOnDestOrThrow(origin, destination, currency);
|
|
11167
11200
|
edDest = getEdFromAssetOrThrow(destAsset);
|
|
11168
|
-
edDestBn = BigInt(edDest);
|
|
11169
11201
|
destCurrency = destAsset.location ? {
|
|
11170
11202
|
location: destAsset.location
|
|
11171
11203
|
} : {
|
|
@@ -11180,12 +11212,9 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
11180
11212
|
});
|
|
11181
11213
|
case 2:
|
|
11182
11214
|
destBalance = _context.v;
|
|
11183
|
-
destAmount = isFeeAssetAh ?
|
|
11184
|
-
effectiveAmountForBalance = destAmount;
|
|
11185
|
-
|
|
11186
|
-
effectiveAmountForBalance -= assetHubFee;
|
|
11187
|
-
}
|
|
11188
|
-
destBalanceSufficient = effectiveAmountForBalance - destFeeDetail.fee > (destBalance < edDestBn ? edDestBn : 0);
|
|
11215
|
+
destAmount = isFeeAssetAh ? currency.amount - originFee : currency.amount;
|
|
11216
|
+
effectiveAmountForBalance = destAmount - totalHopFee;
|
|
11217
|
+
destBalanceSufficient = effectiveAmountForBalance - destFeeDetail.fee > (destBalance < edDest ? edDest : 0n);
|
|
11189
11218
|
destBalanceSufficientResult = destFeeDetail.currency !== destAsset.symbol && destination !== 'Ethereum' ? new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same') : destBalanceSufficient;
|
|
11190
11219
|
destBalanceAfter = destBalance - (destFeeDetail.currency === destAsset.symbol ? destFeeDetail.fee : 0n) + effectiveAmountForBalance;
|
|
11191
11220
|
destbalanceAfterResult = destFeeDetail.currency !== destAsset.symbol && destination !== 'Ethereum' ? new UnableToComputeError('Unable to compute if dest balance will be sufficient. Fee currency is not the same') : destBalanceAfter;
|
|
@@ -11200,7 +11229,7 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
11200
11229
|
if (bridgeFee === undefined) {
|
|
11201
11230
|
receivedAmount = new UnableToComputeError("bridgeFee is required for native asset transfer from ".concat(origin, " to ").concat(destination, " but was not provided."));
|
|
11202
11231
|
} else {
|
|
11203
|
-
receivedAmount =
|
|
11232
|
+
receivedAmount = currency.amount - originFee - bridgeFee;
|
|
11204
11233
|
}
|
|
11205
11234
|
} else {
|
|
11206
11235
|
receivedAmount = new UnableToComputeError("Unable to compute received amount: The transferred asset (".concat(destAsset.symbol, ") is not the native asset (").concat(nativeAssetOfOriginSymbol, ") of origin ").concat(origin, " for the ").concat(origin, "->").concat(destination, " route."));
|
|
@@ -11240,7 +11269,7 @@ var buildDestInfo = /*#__PURE__*/function () {
|
|
|
11240
11269
|
balanceAfter: destbalanceAfterResult,
|
|
11241
11270
|
currencySymbol: destAsset.symbol,
|
|
11242
11271
|
asset: destAsset,
|
|
11243
|
-
existentialDeposit:
|
|
11272
|
+
existentialDeposit: edDest
|
|
11244
11273
|
},
|
|
11245
11274
|
xcmFee: {
|
|
11246
11275
|
fee: destFeeDetail.fee,
|
|
@@ -11345,7 +11374,7 @@ var buildHopInfo = /*#__PURE__*/function () {
|
|
|
11345
11374
|
|
|
11346
11375
|
var getTransferInfo = /*#__PURE__*/function () {
|
|
11347
11376
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref) {
|
|
11348
|
-
var api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset, resolvedFeeAsset, originAsset, amount, originBalanceFee, originBalance, edOrigin, _yield$getXcmFee, _yield$getXcmFee$orig, originFee, originFeeCurrency, originFeeAsset, assetHubFeeResult, bridgeHubFeeResult, destFeeDetail, hops, isFeeAssetAh, originBalanceAfter, originBalanceFeeAfter, originBalanceNativeSufficient, originBalanceSufficient, assetHub, bridgeHub, bridgeHubChain, builtHops, destinationInfo, _t;
|
|
11377
|
+
var api, tx, origin, destination, senderAddress, ahAddress, address, currency, feeAsset, resolvedFeeAsset, originAsset, amount, originBalanceFee, originBalance, edOrigin, _yield$getXcmFee, _yield$getXcmFee$orig, originFee, originFeeCurrency, originFeeAsset, assetHubFeeResult, bridgeHubFeeResult, destFeeDetail, hops, isFeeAssetAh, originBalanceAfter, originBalanceFeeAfter, originBalanceNativeSufficient, originBalanceSufficient, assetHub, bridgeHub, bridgeHubChain, builtHops, totalHopFee, destinationInfo, _t;
|
|
11349
11378
|
return _regenerator().w(function (_context2) {
|
|
11350
11379
|
while (1) switch (_context2.p = _context2.n) {
|
|
11351
11380
|
case 0:
|
|
@@ -11503,6 +11532,9 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
11503
11532
|
case 14:
|
|
11504
11533
|
builtHops = _context2.v;
|
|
11505
11534
|
case 15:
|
|
11535
|
+
totalHopFee = hops.reduce(function (acc, hop) {
|
|
11536
|
+
return isAssetXcEqual(hop.result.asset, originAsset) ? acc + hop.result.fee : acc;
|
|
11537
|
+
}, 0n);
|
|
11506
11538
|
_context2.n = 16;
|
|
11507
11539
|
return buildDestInfo({
|
|
11508
11540
|
api: api,
|
|
@@ -11515,7 +11547,7 @@ var getTransferInfo = /*#__PURE__*/function () {
|
|
|
11515
11547
|
originFee: originFee,
|
|
11516
11548
|
isFeeAssetAh: !!isFeeAssetAh,
|
|
11517
11549
|
destFeeDetail: destFeeDetail,
|
|
11518
|
-
|
|
11550
|
+
totalHopFee: totalHopFee,
|
|
11519
11551
|
bridgeFee: bridgeHubFeeResult === null || bridgeHubFeeResult === void 0 ? void 0 : bridgeHubFeeResult.fee
|
|
11520
11552
|
});
|
|
11521
11553
|
case 16:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.6.0",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"@scure/base": "^2.0.0",
|
|
28
28
|
"viem": "^2.36.0",
|
|
29
|
-
"@paraspell/assets": "11.
|
|
30
|
-
"@paraspell/
|
|
31
|
-
"@paraspell/
|
|
29
|
+
"@paraspell/assets": "11.6.0",
|
|
30
|
+
"@paraspell/sdk-common": "11.6.0",
|
|
31
|
+
"@paraspell/pallets": "11.6.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|