@paraspell/sdk 10.4.1 → 10.4.3
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 +105 -29
- package/dist/index.mjs +106 -30
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1359,38 +1359,121 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1359
1359
|
return getDryRunCall;
|
|
1360
1360
|
}()
|
|
1361
1361
|
}, {
|
|
1362
|
-
key: "
|
|
1362
|
+
key: "getXcmWeight",
|
|
1363
1363
|
value: function () {
|
|
1364
|
-
var
|
|
1365
|
-
var
|
|
1366
|
-
var originLocation, xcm, node, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, feeEvent, fee, actualWeight, weight, forwardedXcms, destParaId;
|
|
1364
|
+
var _getXcmWeight = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(xcm) {
|
|
1365
|
+
var weightResult, _weightResult$value, ref_time, proof_size;
|
|
1367
1366
|
return _regenerator().w(function (_context19) {
|
|
1368
1367
|
while (1) switch (_context19.n) {
|
|
1368
|
+
case 0:
|
|
1369
|
+
_context19.n = 1;
|
|
1370
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(!xcm.type ? _transform(xcm) : xcm);
|
|
1371
|
+
case 1:
|
|
1372
|
+
weightResult = _context19.v;
|
|
1373
|
+
_weightResult$value = weightResult.value, ref_time = _weightResult$value.ref_time, proof_size = _weightResult$value.proof_size;
|
|
1374
|
+
return _context19.a(2, {
|
|
1375
|
+
refTime: ref_time,
|
|
1376
|
+
proofSize: proof_size
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
}, _callee19, this);
|
|
1380
|
+
}));
|
|
1381
|
+
function getXcmWeight(_x33) {
|
|
1382
|
+
return _getXcmWeight.apply(this, arguments);
|
|
1383
|
+
}
|
|
1384
|
+
return getXcmWeight;
|
|
1385
|
+
}()
|
|
1386
|
+
}, {
|
|
1387
|
+
key: "getXcmPaymentApiFee",
|
|
1388
|
+
value: function () {
|
|
1389
|
+
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(xcm, asset) {
|
|
1390
|
+
var weight, transformedMultiLocation, feeResult;
|
|
1391
|
+
return _regenerator().w(function (_context20) {
|
|
1392
|
+
while (1) switch (_context20.n) {
|
|
1393
|
+
case 0:
|
|
1394
|
+
_context20.n = 1;
|
|
1395
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(xcm);
|
|
1396
|
+
case 1:
|
|
1397
|
+
weight = _context20.v;
|
|
1398
|
+
if (asset !== null && asset !== void 0 && asset.multiLocation) {
|
|
1399
|
+
_context20.n = 2;
|
|
1400
|
+
break;
|
|
1401
|
+
}
|
|
1402
|
+
throw new sdkCore.InvalidCurrencyError('This asset does not have a multiLocation defined. Cannot determine destination fee.');
|
|
1403
|
+
case 2:
|
|
1404
|
+
transformedMultiLocation = _transform(sdkCore.normalizeMultiLocation(asset.multiLocation));
|
|
1405
|
+
_context20.n = 3;
|
|
1406
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_weight_to_asset_fee(weight, {
|
|
1407
|
+
type: 'V4',
|
|
1408
|
+
value: transformedMultiLocation
|
|
1409
|
+
});
|
|
1410
|
+
case 3:
|
|
1411
|
+
feeResult = _context20.v;
|
|
1412
|
+
return _context20.a(2, feeResult.value);
|
|
1413
|
+
}
|
|
1414
|
+
}, _callee20, this);
|
|
1415
|
+
}));
|
|
1416
|
+
function getXcmPaymentApiFee(_x34, _x35) {
|
|
1417
|
+
return _getXcmPaymentApiFee.apply(this, arguments);
|
|
1418
|
+
}
|
|
1419
|
+
return getXcmPaymentApiFee;
|
|
1420
|
+
}()
|
|
1421
|
+
}, {
|
|
1422
|
+
key: "getDryRunXcm",
|
|
1423
|
+
value: function () {
|
|
1424
|
+
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(_ref9) {
|
|
1425
|
+
var _ref0, _ref1, _ref10, _ref11;
|
|
1426
|
+
var originLocation, xcm, node, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, feeEvent, fee;
|
|
1427
|
+
return _regenerator().w(function (_context21) {
|
|
1428
|
+
while (1) switch (_context21.n) {
|
|
1369
1429
|
case 0:
|
|
1370
1430
|
originLocation = _ref9.originLocation, xcm = _ref9.xcm, node = _ref9.node, origin = _ref9.origin, asset = _ref9.asset, feeAsset = _ref9.feeAsset, originFee = _ref9.originFee, amount = _ref9.amount;
|
|
1371
1431
|
supportsDryRunApi = sdkCore.getAssetsObject(node).supportsDryRunApi;
|
|
1372
1432
|
if (supportsDryRunApi) {
|
|
1373
|
-
|
|
1433
|
+
_context21.n = 1;
|
|
1374
1434
|
break;
|
|
1375
1435
|
}
|
|
1376
1436
|
throw new sdkCore.NodeNotSupportedError("DryRunApi is not available on node ".concat(node));
|
|
1377
1437
|
case 1:
|
|
1378
1438
|
transformedOriginLocation = _transform(originLocation);
|
|
1379
|
-
|
|
1439
|
+
_context21.n = 2;
|
|
1380
1440
|
return this.api.getUnsafeApi().apis.DryRunApi.dry_run_xcm(transformedOriginLocation, xcm);
|
|
1381
1441
|
case 2:
|
|
1382
|
-
result =
|
|
1442
|
+
result = _context21.v;
|
|
1383
1443
|
isSuccess = result.success && result.value.execution_result.type === 'Complete';
|
|
1384
1444
|
if (isSuccess) {
|
|
1385
|
-
|
|
1445
|
+
_context21.n = 3;
|
|
1386
1446
|
break;
|
|
1387
1447
|
}
|
|
1388
1448
|
failureReason = result.value.execution_result.value.error.type;
|
|
1389
|
-
return
|
|
1449
|
+
return _context21.a(2, Promise.resolve({
|
|
1390
1450
|
success: false,
|
|
1391
1451
|
failureReason: failureReason
|
|
1392
1452
|
}));
|
|
1393
1453
|
case 3:
|
|
1454
|
+
actualWeight = result.value.execution_result.value.used;
|
|
1455
|
+
weight = actualWeight ? {
|
|
1456
|
+
refTime: actualWeight.ref_time,
|
|
1457
|
+
proofSize: actualWeight.proof_size
|
|
1458
|
+
} : undefined;
|
|
1459
|
+
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1460
|
+
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1461
|
+
if (!(node === 'Moonbeam' || node === 'Moonriver')) {
|
|
1462
|
+
_context21.n = 5;
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
_context21.n = 4;
|
|
1466
|
+
return this.getXcmPaymentApiFee(xcm, asset);
|
|
1467
|
+
case 4:
|
|
1468
|
+
_fee = _context21.v;
|
|
1469
|
+
return _context21.a(2, {
|
|
1470
|
+
success: true,
|
|
1471
|
+
fee: _fee,
|
|
1472
|
+
weight: weight,
|
|
1473
|
+
forwardedXcms: forwardedXcms,
|
|
1474
|
+
destParaId: destParaId
|
|
1475
|
+
});
|
|
1476
|
+
case 5:
|
|
1394
1477
|
emitted = result.value.emitted_events; // We want to look for the last event
|
|
1395
1478
|
reversedEvents = _toConsumableArray(emitted).reverse();
|
|
1396
1479
|
palletsWithIssued = ['Balances', 'ForeignAssets', 'Assets'];
|
|
@@ -1414,26 +1497,19 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1414
1497
|
return ['Currencies', 'Tokens'].includes(event.type) && event.value.type === 'Deposited';
|
|
1415
1498
|
});
|
|
1416
1499
|
if (feeEvent) {
|
|
1417
|
-
|
|
1500
|
+
_context21.n = 6;
|
|
1418
1501
|
break;
|
|
1419
1502
|
}
|
|
1420
|
-
return
|
|
1503
|
+
return _context21.a(2, Promise.resolve({
|
|
1421
1504
|
success: false,
|
|
1422
1505
|
failureReason: 'Cannot determine destination fee. No Issued event found'
|
|
1423
1506
|
}));
|
|
1424
|
-
case
|
|
1507
|
+
case 6:
|
|
1425
1508
|
fee = feeEvent.type === 'AssetConversion' ? feeEvent.value.value.amount_in : feeEvent.value.value.amount;
|
|
1426
1509
|
if (feeAssetFeeEvent) {
|
|
1427
1510
|
fee = amount - originFee - feeEvent.value.value.amount;
|
|
1428
1511
|
}
|
|
1429
|
-
|
|
1430
|
-
weight = actualWeight ? {
|
|
1431
|
-
refTime: actualWeight.ref_time,
|
|
1432
|
-
proofSize: actualWeight.proof_size
|
|
1433
|
-
} : undefined;
|
|
1434
|
-
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1435
|
-
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1436
|
-
return _context19.a(2, Promise.resolve({
|
|
1512
|
+
return _context21.a(2, Promise.resolve({
|
|
1437
1513
|
success: true,
|
|
1438
1514
|
fee: fee,
|
|
1439
1515
|
weight: weight,
|
|
@@ -1441,9 +1517,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1441
1517
|
destParaId: destParaId
|
|
1442
1518
|
}));
|
|
1443
1519
|
}
|
|
1444
|
-
},
|
|
1520
|
+
}, _callee21, this);
|
|
1445
1521
|
}));
|
|
1446
|
-
function getDryRunXcm(
|
|
1522
|
+
function getDryRunXcm(_x36) {
|
|
1447
1523
|
return _getDryRunXcm.apply(this, arguments);
|
|
1448
1524
|
}
|
|
1449
1525
|
return getDryRunXcm;
|
|
@@ -1451,18 +1527,18 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1451
1527
|
}, {
|
|
1452
1528
|
key: "getBridgeStatus",
|
|
1453
1529
|
value: function () {
|
|
1454
|
-
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1530
|
+
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
|
|
1455
1531
|
var outboundOperatingMode;
|
|
1456
|
-
return _regenerator().w(function (
|
|
1457
|
-
while (1) switch (
|
|
1532
|
+
return _regenerator().w(function (_context22) {
|
|
1533
|
+
while (1) switch (_context22.n) {
|
|
1458
1534
|
case 0:
|
|
1459
|
-
|
|
1535
|
+
_context22.n = 1;
|
|
1460
1536
|
return this.api.getUnsafeApi().query.EthereumOutboundQueue.OperatingMode.getValue();
|
|
1461
1537
|
case 1:
|
|
1462
|
-
outboundOperatingMode =
|
|
1463
|
-
return
|
|
1538
|
+
outboundOperatingMode = _context22.v;
|
|
1539
|
+
return _context22.a(2, outboundOperatingMode.type);
|
|
1464
1540
|
}
|
|
1465
|
-
},
|
|
1541
|
+
}, _callee22, this);
|
|
1466
1542
|
}));
|
|
1467
1543
|
function getBridgeStatus() {
|
|
1468
1544
|
return _getBridgeStatus.apply(this, arguments);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvalidParameterError, BatchMode, getNodeProviders, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, isAssetEqual, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1 } from '@paraspell/sdk-core';
|
|
1
|
+
import { InvalidParameterError, BatchMode, getNodeProviders, createApiInstanceForNode as createApiInstanceForNode$1, NodeNotSupportedError, Parents, Version, getNode, isForeignAsset, computeFeeFromDryRun, getAssetsObject, normalizeMultiLocation, InvalidCurrencyError, isAssetEqual, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1, getOriginXcmFee as getOriginXcmFee$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { blake2b } from '@noble/hashes/blake2';
|
|
4
4
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
@@ -1358,38 +1358,121 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1358
1358
|
return getDryRunCall;
|
|
1359
1359
|
}()
|
|
1360
1360
|
}, {
|
|
1361
|
-
key: "
|
|
1361
|
+
key: "getXcmWeight",
|
|
1362
1362
|
value: function () {
|
|
1363
|
-
var
|
|
1364
|
-
var
|
|
1365
|
-
var originLocation, xcm, node, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, feeEvent, fee, actualWeight, weight, forwardedXcms, destParaId;
|
|
1363
|
+
var _getXcmWeight = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(xcm) {
|
|
1364
|
+
var weightResult, _weightResult$value, ref_time, proof_size;
|
|
1366
1365
|
return _regenerator().w(function (_context19) {
|
|
1367
1366
|
while (1) switch (_context19.n) {
|
|
1367
|
+
case 0:
|
|
1368
|
+
_context19.n = 1;
|
|
1369
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(!xcm.type ? _transform(xcm) : xcm);
|
|
1370
|
+
case 1:
|
|
1371
|
+
weightResult = _context19.v;
|
|
1372
|
+
_weightResult$value = weightResult.value, ref_time = _weightResult$value.ref_time, proof_size = _weightResult$value.proof_size;
|
|
1373
|
+
return _context19.a(2, {
|
|
1374
|
+
refTime: ref_time,
|
|
1375
|
+
proofSize: proof_size
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
}, _callee19, this);
|
|
1379
|
+
}));
|
|
1380
|
+
function getXcmWeight(_x33) {
|
|
1381
|
+
return _getXcmWeight.apply(this, arguments);
|
|
1382
|
+
}
|
|
1383
|
+
return getXcmWeight;
|
|
1384
|
+
}()
|
|
1385
|
+
}, {
|
|
1386
|
+
key: "getXcmPaymentApiFee",
|
|
1387
|
+
value: function () {
|
|
1388
|
+
var _getXcmPaymentApiFee = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(xcm, asset) {
|
|
1389
|
+
var weight, transformedMultiLocation, feeResult;
|
|
1390
|
+
return _regenerator().w(function (_context20) {
|
|
1391
|
+
while (1) switch (_context20.n) {
|
|
1392
|
+
case 0:
|
|
1393
|
+
_context20.n = 1;
|
|
1394
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_xcm_weight(xcm);
|
|
1395
|
+
case 1:
|
|
1396
|
+
weight = _context20.v;
|
|
1397
|
+
if (asset !== null && asset !== void 0 && asset.multiLocation) {
|
|
1398
|
+
_context20.n = 2;
|
|
1399
|
+
break;
|
|
1400
|
+
}
|
|
1401
|
+
throw new InvalidCurrencyError('This asset does not have a multiLocation defined. Cannot determine destination fee.');
|
|
1402
|
+
case 2:
|
|
1403
|
+
transformedMultiLocation = _transform(normalizeMultiLocation(asset.multiLocation));
|
|
1404
|
+
_context20.n = 3;
|
|
1405
|
+
return this.api.getUnsafeApi().apis.XcmPaymentApi.query_weight_to_asset_fee(weight, {
|
|
1406
|
+
type: 'V4',
|
|
1407
|
+
value: transformedMultiLocation
|
|
1408
|
+
});
|
|
1409
|
+
case 3:
|
|
1410
|
+
feeResult = _context20.v;
|
|
1411
|
+
return _context20.a(2, feeResult.value);
|
|
1412
|
+
}
|
|
1413
|
+
}, _callee20, this);
|
|
1414
|
+
}));
|
|
1415
|
+
function getXcmPaymentApiFee(_x34, _x35) {
|
|
1416
|
+
return _getXcmPaymentApiFee.apply(this, arguments);
|
|
1417
|
+
}
|
|
1418
|
+
return getXcmPaymentApiFee;
|
|
1419
|
+
}()
|
|
1420
|
+
}, {
|
|
1421
|
+
key: "getDryRunXcm",
|
|
1422
|
+
value: function () {
|
|
1423
|
+
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(_ref9) {
|
|
1424
|
+
var _ref0, _ref1, _ref10, _ref11;
|
|
1425
|
+
var originLocation, xcm, node, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, feeEvent, fee;
|
|
1426
|
+
return _regenerator().w(function (_context21) {
|
|
1427
|
+
while (1) switch (_context21.n) {
|
|
1368
1428
|
case 0:
|
|
1369
1429
|
originLocation = _ref9.originLocation, xcm = _ref9.xcm, node = _ref9.node, origin = _ref9.origin, asset = _ref9.asset, feeAsset = _ref9.feeAsset, originFee = _ref9.originFee, amount = _ref9.amount;
|
|
1370
1430
|
supportsDryRunApi = getAssetsObject(node).supportsDryRunApi;
|
|
1371
1431
|
if (supportsDryRunApi) {
|
|
1372
|
-
|
|
1432
|
+
_context21.n = 1;
|
|
1373
1433
|
break;
|
|
1374
1434
|
}
|
|
1375
1435
|
throw new NodeNotSupportedError("DryRunApi is not available on node ".concat(node));
|
|
1376
1436
|
case 1:
|
|
1377
1437
|
transformedOriginLocation = _transform(originLocation);
|
|
1378
|
-
|
|
1438
|
+
_context21.n = 2;
|
|
1379
1439
|
return this.api.getUnsafeApi().apis.DryRunApi.dry_run_xcm(transformedOriginLocation, xcm);
|
|
1380
1440
|
case 2:
|
|
1381
|
-
result =
|
|
1441
|
+
result = _context21.v;
|
|
1382
1442
|
isSuccess = result.success && result.value.execution_result.type === 'Complete';
|
|
1383
1443
|
if (isSuccess) {
|
|
1384
|
-
|
|
1444
|
+
_context21.n = 3;
|
|
1385
1445
|
break;
|
|
1386
1446
|
}
|
|
1387
1447
|
failureReason = result.value.execution_result.value.error.type;
|
|
1388
|
-
return
|
|
1448
|
+
return _context21.a(2, Promise.resolve({
|
|
1389
1449
|
success: false,
|
|
1390
1450
|
failureReason: failureReason
|
|
1391
1451
|
}));
|
|
1392
1452
|
case 3:
|
|
1453
|
+
actualWeight = result.value.execution_result.value.used;
|
|
1454
|
+
weight = actualWeight ? {
|
|
1455
|
+
refTime: actualWeight.ref_time,
|
|
1456
|
+
proofSize: actualWeight.proof_size
|
|
1457
|
+
} : undefined;
|
|
1458
|
+
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1459
|
+
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1460
|
+
if (!(node === 'Moonbeam' || node === 'Moonriver')) {
|
|
1461
|
+
_context21.n = 5;
|
|
1462
|
+
break;
|
|
1463
|
+
}
|
|
1464
|
+
_context21.n = 4;
|
|
1465
|
+
return this.getXcmPaymentApiFee(xcm, asset);
|
|
1466
|
+
case 4:
|
|
1467
|
+
_fee = _context21.v;
|
|
1468
|
+
return _context21.a(2, {
|
|
1469
|
+
success: true,
|
|
1470
|
+
fee: _fee,
|
|
1471
|
+
weight: weight,
|
|
1472
|
+
forwardedXcms: forwardedXcms,
|
|
1473
|
+
destParaId: destParaId
|
|
1474
|
+
});
|
|
1475
|
+
case 5:
|
|
1393
1476
|
emitted = result.value.emitted_events; // We want to look for the last event
|
|
1394
1477
|
reversedEvents = _toConsumableArray(emitted).reverse();
|
|
1395
1478
|
palletsWithIssued = ['Balances', 'ForeignAssets', 'Assets'];
|
|
@@ -1413,26 +1496,19 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1413
1496
|
return ['Currencies', 'Tokens'].includes(event.type) && event.value.type === 'Deposited';
|
|
1414
1497
|
});
|
|
1415
1498
|
if (feeEvent) {
|
|
1416
|
-
|
|
1499
|
+
_context21.n = 6;
|
|
1417
1500
|
break;
|
|
1418
1501
|
}
|
|
1419
|
-
return
|
|
1502
|
+
return _context21.a(2, Promise.resolve({
|
|
1420
1503
|
success: false,
|
|
1421
1504
|
failureReason: 'Cannot determine destination fee. No Issued event found'
|
|
1422
1505
|
}));
|
|
1423
|
-
case
|
|
1506
|
+
case 6:
|
|
1424
1507
|
fee = feeEvent.type === 'AssetConversion' ? feeEvent.value.value.amount_in : feeEvent.value.value.amount;
|
|
1425
1508
|
if (feeAssetFeeEvent) {
|
|
1426
1509
|
fee = amount - originFee - feeEvent.value.value.amount;
|
|
1427
1510
|
}
|
|
1428
|
-
|
|
1429
|
-
weight = actualWeight ? {
|
|
1430
|
-
refTime: actualWeight.ref_time,
|
|
1431
|
-
proofSize: actualWeight.proof_size
|
|
1432
|
-
} : undefined;
|
|
1433
|
-
forwardedXcms = result.value.forwarded_xcms.length > 0 ? result.value.forwarded_xcms[0] : [];
|
|
1434
|
-
destParaId = forwardedXcms.length === 0 ? undefined : forwardedXcms[0].value.interior.type === 'Here' ? 0 : forwardedXcms[0].value.interior.value.value;
|
|
1435
|
-
return _context19.a(2, Promise.resolve({
|
|
1511
|
+
return _context21.a(2, Promise.resolve({
|
|
1436
1512
|
success: true,
|
|
1437
1513
|
fee: fee,
|
|
1438
1514
|
weight: weight,
|
|
@@ -1440,9 +1516,9 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1440
1516
|
destParaId: destParaId
|
|
1441
1517
|
}));
|
|
1442
1518
|
}
|
|
1443
|
-
},
|
|
1519
|
+
}, _callee21, this);
|
|
1444
1520
|
}));
|
|
1445
|
-
function getDryRunXcm(
|
|
1521
|
+
function getDryRunXcm(_x36) {
|
|
1446
1522
|
return _getDryRunXcm.apply(this, arguments);
|
|
1447
1523
|
}
|
|
1448
1524
|
return getDryRunXcm;
|
|
@@ -1450,18 +1526,18 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1450
1526
|
}, {
|
|
1451
1527
|
key: "getBridgeStatus",
|
|
1452
1528
|
value: function () {
|
|
1453
|
-
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1529
|
+
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22() {
|
|
1454
1530
|
var outboundOperatingMode;
|
|
1455
|
-
return _regenerator().w(function (
|
|
1456
|
-
while (1) switch (
|
|
1531
|
+
return _regenerator().w(function (_context22) {
|
|
1532
|
+
while (1) switch (_context22.n) {
|
|
1457
1533
|
case 0:
|
|
1458
|
-
|
|
1534
|
+
_context22.n = 1;
|
|
1459
1535
|
return this.api.getUnsafeApi().query.EthereumOutboundQueue.OperatingMode.getValue();
|
|
1460
1536
|
case 1:
|
|
1461
|
-
outboundOperatingMode =
|
|
1462
|
-
return
|
|
1537
|
+
outboundOperatingMode = _context22.v;
|
|
1538
|
+
return _context22.a(2, outboundOperatingMode.type);
|
|
1463
1539
|
}
|
|
1464
|
-
},
|
|
1540
|
+
}, _callee22, this);
|
|
1465
1541
|
}));
|
|
1466
1542
|
function getBridgeStatus() {
|
|
1467
1543
|
return _getBridgeStatus.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.3",
|
|
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.30.5",
|
|
28
|
-
"@paraspell/sdk-core": "10.4.
|
|
28
|
+
"@paraspell/sdk-core": "10.4.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"polkadot-api": ">= 1.13.0 < 2"
|