@paraspell/sdk 11.3.2 → 11.4.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/README.md +15 -0
- package/dist/index.cjs +21 -19
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +21 -19
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -277,6 +277,21 @@ import { hasDryRunSupport } from "@paraspell/sdk";
|
|
|
277
277
|
const result = hasDryRunSupport(chain)
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
+
#### Dry run preview:
|
|
281
|
+
More on this feature in [official documentation](https://paraspell.github.io/docs/sdk/xcmPallet.html#preview-your-call-results)
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
//Builder pattern
|
|
285
|
+
const result = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
286
|
+
.from(CHAIN)
|
|
287
|
+
.to(CHAIN_2)
|
|
288
|
+
.currency({id: currencyID, amount: amount} | {symbol: currencySymbol, amount: amount} | {symbol: Native('currencySymbol'), amount: amount} | {symbol: Foreign('currencySymbol'), amount: amount} | {symbol: ForeignAbstract('currencySymbol'), amount: amount} | {location: AssetLocationString, amount: amount | AssetLocationJson, amount: amount} | {location: Override('Custom Location'), amount: amount} | {[{currencySelection, isFeeAsset?: true /* for example symbol: symbol or id: id, or Location: Location*/, amount: amount}]})
|
|
289
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in same fee asset as selected currency.*/
|
|
290
|
+
.address(ADDRESS)
|
|
291
|
+
.senderAddress(SENDER_ADDRESS)
|
|
292
|
+
.dryRunPreview(/*{ mintFeeAssets: true } - false by default - Mints fee assets also, if user does not have enough to cover fees on origin.*/)
|
|
293
|
+
```
|
|
294
|
+
|
|
280
295
|
### Localhost test setup
|
|
281
296
|
|
|
282
297
|
SDK offers enhanced localhost support. You can pass an object containing overrides for all WS endpoints (Including hops) used in the test transfer. This allows for advanced localhost testing such as localhost dry-run or xcm-fee queries. More information about available options can be found in the [official documentation](https://paraspell.github.io/docs/sdk/xcmPallet.html#localhost-testing-setup).
|
package/dist/index.cjs
CHANGED
|
@@ -1373,14 +1373,14 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1373
1373
|
}, {
|
|
1374
1374
|
key: "getDryRunCall",
|
|
1375
1375
|
value: function () {
|
|
1376
|
-
var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(
|
|
1376
|
+
var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(options) {
|
|
1377
1377
|
var _this = this,
|
|
1378
1378
|
_feeAsset$symbol;
|
|
1379
|
-
var tx,
|
|
1379
|
+
var tx, chain, address, asset, feeAsset, bypassOptions, _options$useRootOrigi, useRootOrigin, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, result, isSuccess, failureOutputReason, initialFailureReason, usedSymbol, usedAsset, actualWeight, weight, forwardedXcms, destParaId, executionFee, nativeAsset, hasLocation, xcmFee, fee, _t4;
|
|
1380
1380
|
return _regenerator().w(function (_context20) {
|
|
1381
1381
|
while (1) switch (_context20.n) {
|
|
1382
1382
|
case 0:
|
|
1383
|
-
tx =
|
|
1383
|
+
tx = options.tx, chain = options.chain, address = options.address, asset = options.asset, feeAsset = options.feeAsset, bypassOptions = options.bypassOptions, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi;
|
|
1384
1384
|
supportsDryRunApi = sdkCore.getAssetsObject(chain).supportsDryRunApi;
|
|
1385
1385
|
if (supportsDryRunApi) {
|
|
1386
1386
|
_context20.n = 1;
|
|
@@ -1403,7 +1403,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1403
1403
|
break;
|
|
1404
1404
|
}
|
|
1405
1405
|
_context20.n = 2;
|
|
1406
|
-
return sdkCore.wrapTxBypass(
|
|
1406
|
+
return sdkCore.wrapTxBypass(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
1407
|
+
api: this
|
|
1408
|
+
}), bypassOptions);
|
|
1407
1409
|
case 2:
|
|
1408
1410
|
_t4 = _context20.v;
|
|
1409
1411
|
_context20.n = 4;
|
|
@@ -1413,7 +1415,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1413
1415
|
case 4:
|
|
1414
1416
|
resolvedTx = _t4;
|
|
1415
1417
|
performDryRunCall = /*#__PURE__*/function () {
|
|
1416
|
-
var
|
|
1418
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(includeVersion) {
|
|
1417
1419
|
var _this$api$getUnsafeAp;
|
|
1418
1420
|
var callArgs;
|
|
1419
1421
|
return _regenerator().w(function (_context19) {
|
|
@@ -1428,7 +1430,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1428
1430
|
}, _callee19);
|
|
1429
1431
|
}));
|
|
1430
1432
|
return function performDryRunCall(_x36) {
|
|
1431
|
-
return
|
|
1433
|
+
return _ref6.apply(this, arguments);
|
|
1432
1434
|
};
|
|
1433
1435
|
}();
|
|
1434
1436
|
getExecutionSuccessFromResult = function getExecutionSuccessFromResult(result) {
|
|
@@ -1437,7 +1439,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1437
1439
|
return (result === null || result === void 0 ? void 0 : result.success) && ((_result$value = result.value) === null || _result$value === void 0 || (_result$value = _result$value.execution_result) === null || _result$value === void 0 ? void 0 : _result$value.success) && !errorInEvents;
|
|
1438
1440
|
};
|
|
1439
1441
|
extractFailureReasonFromResult = function extractFailureReasonFromResult(result) {
|
|
1440
|
-
var _result$value2, _executionResultValue, _executionResultValue2, _result$value3,
|
|
1442
|
+
var _result$value2, _executionResultValue, _executionResultValue2, _result$value3, _ref7, _result$value4;
|
|
1441
1443
|
var executionResultValue = result === null || result === void 0 || (_result$value2 = result.value) === null || _result$value2 === void 0 || (_result$value2 = _result$value2.execution_result) === null || _result$value2 === void 0 ? void 0 : _result$value2.value;
|
|
1442
1444
|
if (executionResultValue !== null && executionResultValue !== void 0 && (_executionResultValue = executionResultValue.error) !== null && _executionResultValue !== void 0 && (_executionResultValue = _executionResultValue.value) !== null && _executionResultValue !== void 0 && (_executionResultValue = _executionResultValue.value) !== null && _executionResultValue !== void 0 && _executionResultValue.type) {
|
|
1443
1445
|
return String(executionResultValue.error.value.value.type);
|
|
@@ -1452,7 +1454,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1452
1454
|
if (erroredEvent) {
|
|
1453
1455
|
return erroredEvent.value.value.result.value.value.value.type;
|
|
1454
1456
|
}
|
|
1455
|
-
return JSON.stringify((
|
|
1457
|
+
return JSON.stringify((_ref7 = (_result$value4 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value4 !== void 0 ? _result$value4 : result) !== null && _ref7 !== void 0 ? _ref7 : 'Unknown error structure', sdkCore.replaceBigInt);
|
|
1456
1458
|
};
|
|
1457
1459
|
failureOutputReason = '';
|
|
1458
1460
|
_context20.n = 5;
|
|
@@ -1614,13 +1616,13 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1614
1616
|
}, {
|
|
1615
1617
|
key: "getDryRunXcm",
|
|
1616
1618
|
value: function () {
|
|
1617
|
-
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(
|
|
1618
|
-
var
|
|
1619
|
+
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(_ref8) {
|
|
1620
|
+
var _ref9, _processAssetsDeposit, _ref0, _ref1, _ref10, _ref11, _ref12;
|
|
1619
1621
|
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, symbol, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1620
1622
|
return _regenerator().w(function (_context23) {
|
|
1621
1623
|
while (1) switch (_context23.n) {
|
|
1622
1624
|
case 0:
|
|
1623
|
-
originLocation =
|
|
1625
|
+
originLocation = _ref8.originLocation, xcm = _ref8.xcm, chain = _ref8.chain, origin = _ref8.origin, asset = _ref8.asset, feeAsset = _ref8.feeAsset, originFee = _ref8.originFee, amount = _ref8.amount;
|
|
1624
1626
|
supportsDryRunApi = sdkCore.getAssetsObject(chain).supportsDryRunApi;
|
|
1625
1627
|
if (supportsDryRunApi) {
|
|
1626
1628
|
_context23.n = 1;
|
|
@@ -1680,13 +1682,13 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1680
1682
|
reversedEvents = _toConsumableArray(emitted).reverse();
|
|
1681
1683
|
palletsWithIssued = ['Balances', 'ForeignAssets', 'Assets'];
|
|
1682
1684
|
isFeeAsset = origin === 'AssetHubPolkadot' && feeAsset && asset && sdkCore.isAssetEqual(feeAsset, asset);
|
|
1683
|
-
feeAssetFeeEvent = (
|
|
1685
|
+
feeAssetFeeEvent = (_ref9 = isFeeAsset ? _toConsumableArray(emitted).find(function (event) {
|
|
1684
1686
|
return (event.type === 'ForeignAssets' || event.type === 'Assets') && event.value.type === 'Issued';
|
|
1685
|
-
}) : undefined) !== null &&
|
|
1687
|
+
}) : undefined) !== null && _ref9 !== void 0 ? _ref9 : isFeeAsset ? _toConsumableArray(emitted).find(function (event) {
|
|
1686
1688
|
return event.type === 'Tokens' && event.value.type === 'Deposited';
|
|
1687
1689
|
}) : undefined;
|
|
1688
1690
|
processedAssetsAmount = chain === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? processAssetsDepositedEvents(emitted, amount, 'Assets', 'Deposited', true) : (_processAssetsDeposit = processAssetsDepositedEvents(emitted, amount, 'Balances', 'Minted', false)) !== null && _processAssetsDeposit !== void 0 ? _processAssetsDeposit : processAssetsDepositedEvents(emitted, amount, 'Balances', 'Issued', false);
|
|
1689
|
-
feeEvent = (_ref1 = (_ref10 = (_ref11 = (_ref12 =
|
|
1691
|
+
feeEvent = (_ref0 = (_ref1 = (_ref10 = (_ref11 = (_ref12 = feeAssetFeeEvent !== null && feeAssetFeeEvent !== void 0 ? feeAssetFeeEvent :
|
|
1690
1692
|
//
|
|
1691
1693
|
processedAssetsAmount !== undefined ? {
|
|
1692
1694
|
type: 'Assets',
|
|
@@ -1696,23 +1698,23 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1696
1698
|
amount: processedAssetsAmount
|
|
1697
1699
|
}
|
|
1698
1700
|
}
|
|
1699
|
-
} : undefined) !== null &&
|
|
1701
|
+
} : undefined) !== null && _ref12 !== void 0 ? _ref12 :
|
|
1700
1702
|
//
|
|
1701
1703
|
chain === 'Mythos' ? reversedEvents.find(function (event) {
|
|
1702
1704
|
return event.type === 'Balances' && event.value.type === 'Issued';
|
|
1703
|
-
}) : undefined) !== null &&
|
|
1705
|
+
}) : undefined) !== null && _ref11 !== void 0 ? _ref11 :
|
|
1704
1706
|
//
|
|
1705
1707
|
origin === 'Mythos' || chain === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? reversedEvents.find(function (event) {
|
|
1706
1708
|
return event.type === 'AssetConversion' && event.value.type === 'SwapCreditExecuted';
|
|
1707
|
-
}) : undefined) !== null &&
|
|
1709
|
+
}) : undefined) !== null && _ref10 !== void 0 ? _ref10 :
|
|
1708
1710
|
// Prefer to Minted event
|
|
1709
1711
|
reversedEvents.find(function (event) {
|
|
1710
1712
|
return ['Balances', 'ForeignAssets'].includes(event.type) && event.value.type === 'Minted';
|
|
1711
|
-
})) !== null &&
|
|
1713
|
+
})) !== null && _ref1 !== void 0 ? _ref1 :
|
|
1712
1714
|
// Fallback an Issued event
|
|
1713
1715
|
reversedEvents.find(function (event) {
|
|
1714
1716
|
return palletsWithIssued.includes(event.type) && event.value.type === 'Issued';
|
|
1715
|
-
})) !== null &&
|
|
1717
|
+
})) !== null && _ref0 !== void 0 ? _ref0 : reversedEvents.find(function (event) {
|
|
1716
1718
|
return ['Currencies', 'Tokens'].includes(event.type) && event.value.type === 'Deposited';
|
|
1717
1719
|
});
|
|
1718
1720
|
if (feeEvent) {
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ declare const getBalanceNative: (options: _paraspell_sdk_core.TGetBalanceNativeO
|
|
|
25
25
|
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
26
26
|
*/
|
|
27
27
|
declare const getBalanceForeign: (options: _paraspell_sdk_core.TGetBalanceForeignOptionsBase & {
|
|
28
|
+
currency: _paraspell_sdk_core.TCurrencyCore;
|
|
29
|
+
} & {
|
|
28
30
|
api?: TPapiApiOrUrl;
|
|
29
31
|
}) => Promise<bigint>;
|
|
30
32
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1372,14 +1372,14 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1372
1372
|
}, {
|
|
1373
1373
|
key: "getDryRunCall",
|
|
1374
1374
|
value: function () {
|
|
1375
|
-
var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(
|
|
1375
|
+
var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(options) {
|
|
1376
1376
|
var _this = this,
|
|
1377
1377
|
_feeAsset$symbol;
|
|
1378
|
-
var tx,
|
|
1378
|
+
var tx, chain, address, asset, feeAsset, bypassOptions, _options$useRootOrigi, useRootOrigin, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, extractFailureReasonFromResult, result, isSuccess, failureOutputReason, initialFailureReason, usedSymbol, usedAsset, actualWeight, weight, forwardedXcms, destParaId, executionFee, nativeAsset, hasLocation, xcmFee, fee, _t4;
|
|
1379
1379
|
return _regenerator().w(function (_context20) {
|
|
1380
1380
|
while (1) switch (_context20.n) {
|
|
1381
1381
|
case 0:
|
|
1382
|
-
tx =
|
|
1382
|
+
tx = options.tx, chain = options.chain, address = options.address, asset = options.asset, feeAsset = options.feeAsset, bypassOptions = options.bypassOptions, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi;
|
|
1383
1383
|
supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
|
|
1384
1384
|
if (supportsDryRunApi) {
|
|
1385
1385
|
_context20.n = 1;
|
|
@@ -1402,7 +1402,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1402
1402
|
break;
|
|
1403
1403
|
}
|
|
1404
1404
|
_context20.n = 2;
|
|
1405
|
-
return wrapTxBypass(
|
|
1405
|
+
return wrapTxBypass(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
1406
|
+
api: this
|
|
1407
|
+
}), bypassOptions);
|
|
1406
1408
|
case 2:
|
|
1407
1409
|
_t4 = _context20.v;
|
|
1408
1410
|
_context20.n = 4;
|
|
@@ -1412,7 +1414,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1412
1414
|
case 4:
|
|
1413
1415
|
resolvedTx = _t4;
|
|
1414
1416
|
performDryRunCall = /*#__PURE__*/function () {
|
|
1415
|
-
var
|
|
1417
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(includeVersion) {
|
|
1416
1418
|
var _this$api$getUnsafeAp;
|
|
1417
1419
|
var callArgs;
|
|
1418
1420
|
return _regenerator().w(function (_context19) {
|
|
@@ -1427,7 +1429,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1427
1429
|
}, _callee19);
|
|
1428
1430
|
}));
|
|
1429
1431
|
return function performDryRunCall(_x36) {
|
|
1430
|
-
return
|
|
1432
|
+
return _ref6.apply(this, arguments);
|
|
1431
1433
|
};
|
|
1432
1434
|
}();
|
|
1433
1435
|
getExecutionSuccessFromResult = function getExecutionSuccessFromResult(result) {
|
|
@@ -1436,7 +1438,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1436
1438
|
return (result === null || result === void 0 ? void 0 : result.success) && ((_result$value = result.value) === null || _result$value === void 0 || (_result$value = _result$value.execution_result) === null || _result$value === void 0 ? void 0 : _result$value.success) && !errorInEvents;
|
|
1437
1439
|
};
|
|
1438
1440
|
extractFailureReasonFromResult = function extractFailureReasonFromResult(result) {
|
|
1439
|
-
var _result$value2, _executionResultValue, _executionResultValue2, _result$value3,
|
|
1441
|
+
var _result$value2, _executionResultValue, _executionResultValue2, _result$value3, _ref7, _result$value4;
|
|
1440
1442
|
var executionResultValue = result === null || result === void 0 || (_result$value2 = result.value) === null || _result$value2 === void 0 || (_result$value2 = _result$value2.execution_result) === null || _result$value2 === void 0 ? void 0 : _result$value2.value;
|
|
1441
1443
|
if (executionResultValue !== null && executionResultValue !== void 0 && (_executionResultValue = executionResultValue.error) !== null && _executionResultValue !== void 0 && (_executionResultValue = _executionResultValue.value) !== null && _executionResultValue !== void 0 && (_executionResultValue = _executionResultValue.value) !== null && _executionResultValue !== void 0 && _executionResultValue.type) {
|
|
1442
1444
|
return String(executionResultValue.error.value.value.type);
|
|
@@ -1451,7 +1453,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1451
1453
|
if (erroredEvent) {
|
|
1452
1454
|
return erroredEvent.value.value.result.value.value.value.type;
|
|
1453
1455
|
}
|
|
1454
|
-
return JSON.stringify((
|
|
1456
|
+
return JSON.stringify((_ref7 = (_result$value4 = result === null || result === void 0 ? void 0 : result.value) !== null && _result$value4 !== void 0 ? _result$value4 : result) !== null && _ref7 !== void 0 ? _ref7 : 'Unknown error structure', replaceBigInt);
|
|
1455
1457
|
};
|
|
1456
1458
|
failureOutputReason = '';
|
|
1457
1459
|
_context20.n = 5;
|
|
@@ -1613,13 +1615,13 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1613
1615
|
}, {
|
|
1614
1616
|
key: "getDryRunXcm",
|
|
1615
1617
|
value: function () {
|
|
1616
|
-
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(
|
|
1617
|
-
var
|
|
1618
|
+
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(_ref8) {
|
|
1619
|
+
var _ref9, _processAssetsDeposit, _ref0, _ref1, _ref10, _ref11, _ref12;
|
|
1618
1620
|
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, symbol, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1619
1621
|
return _regenerator().w(function (_context23) {
|
|
1620
1622
|
while (1) switch (_context23.n) {
|
|
1621
1623
|
case 0:
|
|
1622
|
-
originLocation =
|
|
1624
|
+
originLocation = _ref8.originLocation, xcm = _ref8.xcm, chain = _ref8.chain, origin = _ref8.origin, asset = _ref8.asset, feeAsset = _ref8.feeAsset, originFee = _ref8.originFee, amount = _ref8.amount;
|
|
1623
1625
|
supportsDryRunApi = getAssetsObject(chain).supportsDryRunApi;
|
|
1624
1626
|
if (supportsDryRunApi) {
|
|
1625
1627
|
_context23.n = 1;
|
|
@@ -1679,13 +1681,13 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1679
1681
|
reversedEvents = _toConsumableArray(emitted).reverse();
|
|
1680
1682
|
palletsWithIssued = ['Balances', 'ForeignAssets', 'Assets'];
|
|
1681
1683
|
isFeeAsset = origin === 'AssetHubPolkadot' && feeAsset && asset && isAssetEqual(feeAsset, asset);
|
|
1682
|
-
feeAssetFeeEvent = (
|
|
1684
|
+
feeAssetFeeEvent = (_ref9 = isFeeAsset ? _toConsumableArray(emitted).find(function (event) {
|
|
1683
1685
|
return (event.type === 'ForeignAssets' || event.type === 'Assets') && event.value.type === 'Issued';
|
|
1684
|
-
}) : undefined) !== null &&
|
|
1686
|
+
}) : undefined) !== null && _ref9 !== void 0 ? _ref9 : isFeeAsset ? _toConsumableArray(emitted).find(function (event) {
|
|
1685
1687
|
return event.type === 'Tokens' && event.value.type === 'Deposited';
|
|
1686
1688
|
}) : undefined;
|
|
1687
1689
|
processedAssetsAmount = chain === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? processAssetsDepositedEvents(emitted, amount, 'Assets', 'Deposited', true) : (_processAssetsDeposit = processAssetsDepositedEvents(emitted, amount, 'Balances', 'Minted', false)) !== null && _processAssetsDeposit !== void 0 ? _processAssetsDeposit : processAssetsDepositedEvents(emitted, amount, 'Balances', 'Issued', false);
|
|
1688
|
-
feeEvent = (_ref1 = (_ref10 = (_ref11 = (_ref12 =
|
|
1690
|
+
feeEvent = (_ref0 = (_ref1 = (_ref10 = (_ref11 = (_ref12 = feeAssetFeeEvent !== null && feeAssetFeeEvent !== void 0 ? feeAssetFeeEvent :
|
|
1689
1691
|
//
|
|
1690
1692
|
processedAssetsAmount !== undefined ? {
|
|
1691
1693
|
type: 'Assets',
|
|
@@ -1695,23 +1697,23 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1695
1697
|
amount: processedAssetsAmount
|
|
1696
1698
|
}
|
|
1697
1699
|
}
|
|
1698
|
-
} : undefined) !== null &&
|
|
1700
|
+
} : undefined) !== null && _ref12 !== void 0 ? _ref12 :
|
|
1699
1701
|
//
|
|
1700
1702
|
chain === 'Mythos' ? reversedEvents.find(function (event) {
|
|
1701
1703
|
return event.type === 'Balances' && event.value.type === 'Issued';
|
|
1702
|
-
}) : undefined) !== null &&
|
|
1704
|
+
}) : undefined) !== null && _ref11 !== void 0 ? _ref11 :
|
|
1703
1705
|
//
|
|
1704
1706
|
origin === 'Mythos' || chain === 'AssetHubPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== 'DOT' ? reversedEvents.find(function (event) {
|
|
1705
1707
|
return event.type === 'AssetConversion' && event.value.type === 'SwapCreditExecuted';
|
|
1706
|
-
}) : undefined) !== null &&
|
|
1708
|
+
}) : undefined) !== null && _ref10 !== void 0 ? _ref10 :
|
|
1707
1709
|
// Prefer to Minted event
|
|
1708
1710
|
reversedEvents.find(function (event) {
|
|
1709
1711
|
return ['Balances', 'ForeignAssets'].includes(event.type) && event.value.type === 'Minted';
|
|
1710
|
-
})) !== null &&
|
|
1712
|
+
})) !== null && _ref1 !== void 0 ? _ref1 :
|
|
1711
1713
|
// Fallback an Issued event
|
|
1712
1714
|
reversedEvents.find(function (event) {
|
|
1713
1715
|
return palletsWithIssued.includes(event.type) && event.value.type === 'Issued';
|
|
1714
|
-
})) !== null &&
|
|
1716
|
+
})) !== null && _ref0 !== void 0 ? _ref0 : reversedEvents.find(function (event) {
|
|
1715
1717
|
return ['Currencies', 'Tokens'].includes(event.type) && event.value.type === 'Deposited';
|
|
1716
1718
|
});
|
|
1717
1719
|
if (feeEvent) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.4.0",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@noble/hashes": "^1.8.0",
|
|
27
27
|
"viem": "^2.36.0",
|
|
28
|
-
"@paraspell/sdk-core": "11.
|
|
28
|
+
"@paraspell/sdk-core": "11.4.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.16.3 < 2"
|