@paraspell/sdk-dedot 13.6.0 → 13.7.1
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 +3 -0
- package/dist/index.mjs +30 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -341,6 +341,7 @@ SDK features ability to add custom chain and/or custom assets simply by adding i
|
|
|
341
341
|
{
|
|
342
342
|
symbol: 'USDC',
|
|
343
343
|
decimals: 6,
|
|
344
|
+
existentialDeposit: 0.1,
|
|
344
345
|
location: {
|
|
345
346
|
parents: 1,
|
|
346
347
|
interior: { X3: [{ Parachain: 1000 }, { PalletInstance: 50 }, {
|
|
@@ -359,6 +360,7 @@ SDK features ability to add custom chain and/or custom assets simply by adding i
|
|
|
359
360
|
symbol: 'MYNEWUSD',
|
|
360
361
|
decimals: 6,
|
|
361
362
|
assetId: '9999',
|
|
363
|
+
existentialDeposit: 0.1,
|
|
362
364
|
location: {
|
|
363
365
|
parents: 0,
|
|
364
366
|
interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 9999 }] }
|
|
@@ -369,6 +371,7 @@ SDK features ability to add custom chain and/or custom assets simply by adding i
|
|
|
369
371
|
symbol: 'USDT',
|
|
370
372
|
decimals: 6,
|
|
371
373
|
assetId: '1984',
|
|
374
|
+
existentialDeposit: 0.1,
|
|
372
375
|
location: {
|
|
373
376
|
parents: 0,
|
|
374
377
|
interior: { X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }] }
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig,
|
|
1
|
+
import { getEvmPrivateKeyHex, getNativeAssetSymbol, getOtherAssets, NumberFormatError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, getChainProvidersImpl, isSenderSigner, PolkadotApi, UnsupportedOperationError, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, resolveModuleError, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, localizeLocation, createAssetId, addXcmVersionHeader, isAssetXcEqual, RELAY_LOCATION, getRelayChainOfImpl, replaceBigInt, createChainClient as createChainClient$1, getBalance as getBalance$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getExistentialDeposit, getNativeAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, Builder as Builder$1, getBridgeStatus as getBridgeStatus$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { stringPascalCase, isEvmAddress, decodeAddress, isHex, u8aToHex, hexToU8a, stringToU8a, blake2AsHex } from 'dedot/utils';
|
|
4
4
|
import { Keyring } from '@polkadot/keyring';
|
|
@@ -936,10 +936,14 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
936
936
|
}, {
|
|
937
937
|
key: "hasMethod",
|
|
938
938
|
value: function hasMethod(pallet, method) {
|
|
939
|
-
var _this$api$tx$palletFo;
|
|
940
939
|
var palletFormatted = lowercaseFirstLetter(pallet);
|
|
941
940
|
var methodFormatted = snakeToCamel(method);
|
|
942
|
-
|
|
941
|
+
try {
|
|
942
|
+
var _this$api$tx$palletFo;
|
|
943
|
+
return Promise.resolve(((_this$api$tx$palletFo = this.api.tx[palletFormatted]) === null || _this$api$tx$palletFo === void 0 ? void 0 : _this$api$tx$palletFo[methodFormatted]) !== undefined);
|
|
944
|
+
} catch (_unused) {
|
|
945
|
+
return Promise.resolve(false);
|
|
946
|
+
}
|
|
943
947
|
}
|
|
944
948
|
}, {
|
|
945
949
|
key: "hasRuntimeApi",
|
|
@@ -1028,7 +1032,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1028
1032
|
value: function resolveDefaultFeeAsset(_ref0) {
|
|
1029
1033
|
var chain = _ref0.chain,
|
|
1030
1034
|
feeAsset = _ref0.feeAsset;
|
|
1031
|
-
return feeAsset !== null && feeAsset !== void 0 ? feeAsset :
|
|
1035
|
+
return feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
|
|
1032
1036
|
}
|
|
1033
1037
|
}, {
|
|
1034
1038
|
key: "resolveFeeAsset",
|
|
@@ -1063,9 +1067,9 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1063
1067
|
case 3:
|
|
1064
1068
|
return _context6.a(2, {
|
|
1065
1069
|
isCustomAsset: true,
|
|
1066
|
-
asset:
|
|
1070
|
+
asset: findAssetInfoOrThrowImpl(chain, {
|
|
1067
1071
|
id: assetId
|
|
1068
|
-
})
|
|
1072
|
+
}, undefined, this._customCtx)
|
|
1069
1073
|
});
|
|
1070
1074
|
}
|
|
1071
1075
|
}, _callee6, this);
|
|
@@ -1083,12 +1087,12 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1083
1087
|
_result,
|
|
1084
1088
|
_resValue$executionRe,
|
|
1085
1089
|
_execRes$actualWeight;
|
|
1086
|
-
var tx, address, feeAsset, chain, destination, version, _options$useRootOrigi, useRootOrigin, bypassOptions,
|
|
1090
|
+
var tx, address, feeAsset, chain, destination, version, _options$useRootOrigi, useRootOrigin, bypassOptions, supportsDryRunApi, basePayload, resolvedTx, resolvedFeeAsset, performDryRunCall, findFailingEventInResult, getExecutionSuccessFromResult, extractFailureReasonFromResult, result, isSuccess, failureErr, shouldRetryWithVersion, msg, _msg, resValue, execRes, forwardedXcms, actualWeight, weight, destParaId, localXcm, USE_XCM_PAYMENT_API_CHAINS, overriddenWeight, xcmFee, _yield$this$getPaymen, executionFee, fee, _t, _t2, _t3, _t4;
|
|
1087
1091
|
return _regenerator().w(function (_context7) {
|
|
1088
1092
|
while (1) switch (_context7.p = _context7.n) {
|
|
1089
1093
|
case 0:
|
|
1090
1094
|
tx = options.tx, address = options.address, feeAsset = options.feeAsset, chain = options.chain, destination = options.destination, version = options.version, _options$useRootOrigi = options.useRootOrigin, useRootOrigin = _options$useRootOrigi === void 0 ? false : _options$useRootOrigi, bypassOptions = options.bypassOptions;
|
|
1091
|
-
|
|
1095
|
+
supportsDryRunApi = hasDryRunSupportImpl(chain, this._customCtx);
|
|
1092
1096
|
if (supportsDryRunApi) {
|
|
1093
1097
|
_context7.n = 1;
|
|
1094
1098
|
break;
|
|
@@ -1277,7 +1281,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1277
1281
|
destParaId = this.extractDestParaId(forwardedXcms);
|
|
1278
1282
|
localXcm = resValue === null || resValue === void 0 ? void 0 : resValue.localXcm;
|
|
1279
1283
|
USE_XCM_PAYMENT_API_CHAINS = ["Astar"];
|
|
1280
|
-
if (!(
|
|
1284
|
+
if (!(hasXcmPaymentApiSupportImpl(chain, this._customCtx) && localXcm && (feeAsset || USE_XCM_PAYMENT_API_CHAINS.includes(chain) || chain.startsWith("AssetHub") && destination === "Ethereum") || resolvedFeeAsset.isCustomAsset)) {
|
|
1281
1285
|
_context7.n = 21;
|
|
1282
1286
|
break;
|
|
1283
1287
|
}
|
|
@@ -1474,7 +1478,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1474
1478
|
case 6:
|
|
1475
1479
|
assets = (_deliveryFeeRes = deliveryFeeRes) === null || _deliveryFeeRes === void 0 || (_deliveryFeeRes = _deliveryFeeRes.value) === null || _deliveryFeeRes === void 0 ? void 0 : _deliveryFeeRes.value;
|
|
1476
1480
|
deliveryFeeResolved = deliveryFeeRes && (assets === null || assets === void 0 ? void 0 : assets.length) > 0 ? (_assets$0$fun$value = (_assets$ = assets[0]) === null || _assets$ === void 0 || (_assets$ = _assets$.fun) === null || _assets$ === void 0 ? void 0 : _assets$.value) !== null && _assets$0$fun$value !== void 0 ? _assets$0$fun$value : 0n : 0n;
|
|
1477
|
-
nativeAsset =
|
|
1481
|
+
nativeAsset = findNativeAssetInfoOrThrowImpl(chain, this._customCtx);
|
|
1478
1482
|
if (!(isAssetXcEqual(asset, nativeAsset) || usedThirdParam)) {
|
|
1479
1483
|
_context0.n = 7;
|
|
1480
1484
|
break;
|
|
@@ -1524,7 +1528,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1524
1528
|
return _context1.a(2, undefined);
|
|
1525
1529
|
case 2:
|
|
1526
1530
|
ahApi = this.clone();
|
|
1527
|
-
assetHubChain = "AssetHub".concat(
|
|
1531
|
+
assetHubChain = "AssetHub".concat(getRelayChainOfImpl(this, chain));
|
|
1528
1532
|
_context1.n = 3;
|
|
1529
1533
|
return ahApi.init(assetHubChain);
|
|
1530
1534
|
case 3:
|
|
@@ -1591,12 +1595,12 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1591
1595
|
value: function () {
|
|
1592
1596
|
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(_ref10) {
|
|
1593
1597
|
var _result$value5;
|
|
1594
|
-
var originLocation, xcm, asset, chain, version,
|
|
1598
|
+
var originLocation, xcm, asset, chain, version, supportsDryRunApi, transformedOriginLocation, result, executionResult, isSuccess, actualWeight, weight, forwardedXcms, destParaId, fee;
|
|
1595
1599
|
return _regenerator().w(function (_context11) {
|
|
1596
1600
|
while (1) switch (_context11.n) {
|
|
1597
1601
|
case 0:
|
|
1598
1602
|
originLocation = _ref10.originLocation, xcm = _ref10.xcm, asset = _ref10.asset, chain = _ref10.chain, version = _ref10.version;
|
|
1599
|
-
|
|
1603
|
+
supportsDryRunApi = hasDryRunSupportImpl(chain, this._customCtx);
|
|
1600
1604
|
if (supportsDryRunApi) {
|
|
1601
1605
|
_context11.n = 1;
|
|
1602
1606
|
break;
|
|
@@ -1624,7 +1628,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1624
1628
|
weight = actualWeight ? actualWeight : undefined;
|
|
1625
1629
|
forwardedXcms = result.value.forwardedXcms.length > 0 ? result.value.forwardedXcms[0] : [];
|
|
1626
1630
|
destParaId = this.extractDestParaId(forwardedXcms);
|
|
1627
|
-
if (!
|
|
1631
|
+
if (!hasXcmPaymentApiSupportImpl(chain, this._customCtx)) {
|
|
1628
1632
|
_context11.n = 6;
|
|
1629
1633
|
break;
|
|
1630
1634
|
}
|
|
@@ -1685,6 +1689,17 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1685
1689
|
}
|
|
1686
1690
|
return getBridgeStatus;
|
|
1687
1691
|
}()
|
|
1692
|
+
}, {
|
|
1693
|
+
key: "getConstant",
|
|
1694
|
+
value: function getConstant(pallet, name) {
|
|
1695
|
+
try {
|
|
1696
|
+
var palletConsts = this.api.consts[lowercaseFirstLetter(pallet)];
|
|
1697
|
+
var value = palletConsts ? palletConsts[lowercaseFirstLetter(name)] : undefined;
|
|
1698
|
+
return Promise.resolve(value);
|
|
1699
|
+
} catch (_unused2) {
|
|
1700
|
+
return Promise.resolve(undefined);
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1688
1703
|
}, {
|
|
1689
1704
|
key: "getSystemProperties",
|
|
1690
1705
|
value: function () {
|
|
@@ -1739,7 +1754,7 @@ var DedotApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1739
1754
|
try {
|
|
1740
1755
|
decodeAddress(address);
|
|
1741
1756
|
return true;
|
|
1742
|
-
} catch (
|
|
1757
|
+
} catch (_unused3) {
|
|
1743
1758
|
return false;
|
|
1744
1759
|
}
|
|
1745
1760
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-dedot",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.7.1",
|
|
4
4
|
"description": "Dedot-based SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@paraspell/sdk-core": "13.
|
|
25
|
+
"@paraspell/sdk-core": "13.7.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"dedot": ">= 1.3.0",
|