@paraspell/sdk-pjs 8.9.8 → 8.9.9
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 +61 -13
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +62 -15
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1004,6 +1004,30 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1004
1004
|
}
|
|
1005
1005
|
return getDryRun;
|
|
1006
1006
|
}()
|
|
1007
|
+
}, {
|
|
1008
|
+
key: "getBridgeStatus",
|
|
1009
|
+
value: function () {
|
|
1010
|
+
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1011
|
+
var outboundOperatingMode;
|
|
1012
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1013
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1014
|
+
case 0:
|
|
1015
|
+
_context17.next = 2;
|
|
1016
|
+
return this.api.query.ethereumOutboundQueue.operatingMode();
|
|
1017
|
+
case 2:
|
|
1018
|
+
outboundOperatingMode = _context17.sent;
|
|
1019
|
+
return _context17.abrupt("return", outboundOperatingMode.toPrimitive());
|
|
1020
|
+
case 4:
|
|
1021
|
+
case "end":
|
|
1022
|
+
return _context17.stop();
|
|
1023
|
+
}
|
|
1024
|
+
}, _callee17, this);
|
|
1025
|
+
}));
|
|
1026
|
+
function getBridgeStatus() {
|
|
1027
|
+
return _getBridgeStatus.apply(this, arguments);
|
|
1028
|
+
}
|
|
1029
|
+
return getBridgeStatus;
|
|
1030
|
+
}()
|
|
1007
1031
|
}, {
|
|
1008
1032
|
key: "setDisconnectAllowed",
|
|
1009
1033
|
value: function setDisconnectAllowed(allowed) {
|
|
@@ -1017,36 +1041,36 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1017
1041
|
}, {
|
|
1018
1042
|
key: "disconnect",
|
|
1019
1043
|
value: function () {
|
|
1020
|
-
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1044
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1021
1045
|
var force,
|
|
1022
|
-
|
|
1023
|
-
return _regeneratorRuntime().wrap(function
|
|
1024
|
-
while (1) switch (
|
|
1046
|
+
_args18 = arguments;
|
|
1047
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1048
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1025
1049
|
case 0:
|
|
1026
|
-
force =
|
|
1050
|
+
force = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : false;
|
|
1027
1051
|
if (this.initialized) {
|
|
1028
|
-
|
|
1052
|
+
_context18.next = 3;
|
|
1029
1053
|
break;
|
|
1030
1054
|
}
|
|
1031
|
-
return
|
|
1055
|
+
return _context18.abrupt("return", Promise.resolve());
|
|
1032
1056
|
case 3:
|
|
1033
1057
|
if (!(!force && !this.disconnectAllowed)) {
|
|
1034
|
-
|
|
1058
|
+
_context18.next = 5;
|
|
1035
1059
|
break;
|
|
1036
1060
|
}
|
|
1037
|
-
return
|
|
1061
|
+
return _context18.abrupt("return");
|
|
1038
1062
|
case 5:
|
|
1039
1063
|
if (!(force || typeof this._api === 'string' || this._api === undefined)) {
|
|
1040
|
-
|
|
1064
|
+
_context18.next = 8;
|
|
1041
1065
|
break;
|
|
1042
1066
|
}
|
|
1043
|
-
|
|
1067
|
+
_context18.next = 8;
|
|
1044
1068
|
return this.api.disconnect();
|
|
1045
1069
|
case 8:
|
|
1046
1070
|
case "end":
|
|
1047
|
-
return
|
|
1071
|
+
return _context18.stop();
|
|
1048
1072
|
}
|
|
1049
|
-
},
|
|
1073
|
+
}, _callee18, this);
|
|
1050
1074
|
}));
|
|
1051
1075
|
function disconnect() {
|
|
1052
1076
|
return _disconnect.apply(this, arguments);
|
|
@@ -1677,11 +1701,34 @@ var getParaEthTransferFees = /*#__PURE__*/function () {
|
|
|
1677
1701
|
return _ref.apply(this, arguments);
|
|
1678
1702
|
};
|
|
1679
1703
|
}();
|
|
1704
|
+
/**
|
|
1705
|
+
* Gets the Ethereum bridge status.
|
|
1706
|
+
*/
|
|
1707
|
+
var getBridgeStatus = /*#__PURE__*/function () {
|
|
1708
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(api) {
|
|
1709
|
+
var pjsApi;
|
|
1710
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1711
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1712
|
+
case 0:
|
|
1713
|
+
pjsApi = new PolkadotJsApi();
|
|
1714
|
+
pjsApi.setApi(api);
|
|
1715
|
+
return _context2.abrupt("return", sdkCore.getBridgeStatus(pjsApi));
|
|
1716
|
+
case 3:
|
|
1717
|
+
case "end":
|
|
1718
|
+
return _context2.stop();
|
|
1719
|
+
}
|
|
1720
|
+
}, _callee2);
|
|
1721
|
+
}));
|
|
1722
|
+
return function getBridgeStatus(_x2) {
|
|
1723
|
+
return _ref2.apply(this, arguments);
|
|
1724
|
+
};
|
|
1725
|
+
}();
|
|
1680
1726
|
|
|
1681
1727
|
var transfer = /*#__PURE__*/Object.freeze({
|
|
1682
1728
|
__proto__: null,
|
|
1683
1729
|
approveToken: approveToken,
|
|
1684
1730
|
depositToken: depositToken,
|
|
1731
|
+
getBridgeStatus: getBridgeStatus,
|
|
1685
1732
|
getDryRun: getDryRun,
|
|
1686
1733
|
getParaEthTransferFees: getParaEthTransferFees,
|
|
1687
1734
|
getTokenBalance: getTokenBalance,
|
|
@@ -1699,6 +1746,7 @@ exports.depositToken = depositToken;
|
|
|
1699
1746
|
exports.getAssetBalance = getAssetBalance;
|
|
1700
1747
|
exports.getBalanceForeign = getBalanceForeign;
|
|
1701
1748
|
exports.getBalanceNative = getBalanceNative;
|
|
1749
|
+
exports.getBridgeStatus = getBridgeStatus;
|
|
1702
1750
|
exports.getDryRun = getDryRun;
|
|
1703
1751
|
exports.getMaxForeignTransferableAmount = getMaxForeignTransferableAmount;
|
|
1704
1752
|
exports.getMaxNativeTransferableAmount = getMaxNativeTransferableAmount;
|
package/dist/index.d.ts
CHANGED
|
@@ -227,9 +227,14 @@ declare const transferEthToPolkadot: (options: Omit<TEvmBuilderOptions<TPjsApi,
|
|
|
227
227
|
messageReceipt: _snowbridge_api_dist_toPolkadot_v2.MessageReceipt;
|
|
228
228
|
}>;
|
|
229
229
|
declare const getParaEthTransferFees: (api?: TPjsApiOrUrl) => Promise<[bigint, bigint]>;
|
|
230
|
+
/**
|
|
231
|
+
* Gets the Ethereum bridge status.
|
|
232
|
+
*/
|
|
233
|
+
declare const getBridgeStatus: (api?: TPjsApiOrUrl) => Promise<_paraspell_sdk_core.TBridgeStatus>;
|
|
230
234
|
|
|
231
235
|
declare const transfer_approveToken: typeof approveToken;
|
|
232
236
|
declare const transfer_depositToken: typeof depositToken;
|
|
237
|
+
declare const transfer_getBridgeStatus: typeof getBridgeStatus;
|
|
233
238
|
declare const transfer_getDryRun: typeof getDryRun;
|
|
234
239
|
declare const transfer_getParaEthTransferFees: typeof getParaEthTransferFees;
|
|
235
240
|
declare const transfer_getTokenBalance: typeof getTokenBalance;
|
|
@@ -239,6 +244,7 @@ declare namespace transfer {
|
|
|
239
244
|
export {
|
|
240
245
|
transfer_approveToken as approveToken,
|
|
241
246
|
transfer_depositToken as depositToken,
|
|
247
|
+
transfer_getBridgeStatus as getBridgeStatus,
|
|
242
248
|
transfer_getDryRun as getDryRun,
|
|
243
249
|
transfer_getParaEthTransferFees as getParaEthTransferFees,
|
|
244
250
|
transfer_getTokenBalance as getTokenBalance,
|
|
@@ -249,5 +255,5 @@ declare namespace transfer {
|
|
|
249
255
|
|
|
250
256
|
declare const createApiInstanceForNode: (node: TNodeDotKsmWithRelayChains) => Promise<_polkadot_api.ApiPromise>;
|
|
251
257
|
|
|
252
|
-
export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
|
|
258
|
+
export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
|
|
253
259
|
export type { Extrinsic, GeneralBuilder, TPjsApi, TPjsApiOrUrl };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isEthersSigner, isOverrideMultiLocationSpecifier, validateAddress, transferMoonbeamToEth, transferMoonbeamEvm, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, send as send$1, getDryRun as getDryRun$1 } from '@paraspell/sdk-core';
|
|
1
|
+
import { BatchMode, createApiInstanceForNode as createApiInstanceForNode$1, getNode, isForeignAsset, computeFeeFromDryRunPjs, resolveModuleError, getAssetsObject, NodeNotSupportedError, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getTransferInfo as getTransferInfo$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, getMaxNativeTransferableAmount as getMaxNativeTransferableAmount$1, getMaxForeignTransferableAmount as getMaxForeignTransferableAmount$1, getTransferableAmount as getTransferableAmount$1, verifyEdOnDestination as verifyEdOnDestination$1, Foreign, ForeignAbstract, Native, Override, findAsset, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTNode, hasSupportForAsset, isNodeEvm, getParaId, ETH_CHAIN_ID, InvalidCurrencyError, isEthersSigner, isOverrideMultiLocationSpecifier, validateAddress, transferMoonbeamToEth, transferMoonbeamEvm, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, send as send$1, getDryRun as getDryRun$1 } from '@paraspell/sdk-core';
|
|
2
2
|
export * from '@paraspell/sdk-core';
|
|
3
3
|
import { WsProvider, ApiPromise } from '@polkadot/api';
|
|
4
4
|
import { u32 } from '@polkadot/types';
|
|
@@ -1003,6 +1003,30 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
return getDryRun;
|
|
1005
1005
|
}()
|
|
1006
|
+
}, {
|
|
1007
|
+
key: "getBridgeStatus",
|
|
1008
|
+
value: function () {
|
|
1009
|
+
var _getBridgeStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1010
|
+
var outboundOperatingMode;
|
|
1011
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1012
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1013
|
+
case 0:
|
|
1014
|
+
_context17.next = 2;
|
|
1015
|
+
return this.api.query.ethereumOutboundQueue.operatingMode();
|
|
1016
|
+
case 2:
|
|
1017
|
+
outboundOperatingMode = _context17.sent;
|
|
1018
|
+
return _context17.abrupt("return", outboundOperatingMode.toPrimitive());
|
|
1019
|
+
case 4:
|
|
1020
|
+
case "end":
|
|
1021
|
+
return _context17.stop();
|
|
1022
|
+
}
|
|
1023
|
+
}, _callee17, this);
|
|
1024
|
+
}));
|
|
1025
|
+
function getBridgeStatus() {
|
|
1026
|
+
return _getBridgeStatus.apply(this, arguments);
|
|
1027
|
+
}
|
|
1028
|
+
return getBridgeStatus;
|
|
1029
|
+
}()
|
|
1006
1030
|
}, {
|
|
1007
1031
|
key: "setDisconnectAllowed",
|
|
1008
1032
|
value: function setDisconnectAllowed(allowed) {
|
|
@@ -1016,36 +1040,36 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1016
1040
|
}, {
|
|
1017
1041
|
key: "disconnect",
|
|
1018
1042
|
value: function () {
|
|
1019
|
-
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1043
|
+
var _disconnect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1020
1044
|
var force,
|
|
1021
|
-
|
|
1022
|
-
return _regeneratorRuntime().wrap(function
|
|
1023
|
-
while (1) switch (
|
|
1045
|
+
_args18 = arguments;
|
|
1046
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1047
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1024
1048
|
case 0:
|
|
1025
|
-
force =
|
|
1049
|
+
force = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : false;
|
|
1026
1050
|
if (this.initialized) {
|
|
1027
|
-
|
|
1051
|
+
_context18.next = 3;
|
|
1028
1052
|
break;
|
|
1029
1053
|
}
|
|
1030
|
-
return
|
|
1054
|
+
return _context18.abrupt("return", Promise.resolve());
|
|
1031
1055
|
case 3:
|
|
1032
1056
|
if (!(!force && !this.disconnectAllowed)) {
|
|
1033
|
-
|
|
1057
|
+
_context18.next = 5;
|
|
1034
1058
|
break;
|
|
1035
1059
|
}
|
|
1036
|
-
return
|
|
1060
|
+
return _context18.abrupt("return");
|
|
1037
1061
|
case 5:
|
|
1038
1062
|
if (!(force || typeof this._api === 'string' || this._api === undefined)) {
|
|
1039
|
-
|
|
1063
|
+
_context18.next = 8;
|
|
1040
1064
|
break;
|
|
1041
1065
|
}
|
|
1042
|
-
|
|
1066
|
+
_context18.next = 8;
|
|
1043
1067
|
return this.api.disconnect();
|
|
1044
1068
|
case 8:
|
|
1045
1069
|
case "end":
|
|
1046
|
-
return
|
|
1070
|
+
return _context18.stop();
|
|
1047
1071
|
}
|
|
1048
|
-
},
|
|
1072
|
+
}, _callee18, this);
|
|
1049
1073
|
}));
|
|
1050
1074
|
function disconnect() {
|
|
1051
1075
|
return _disconnect.apply(this, arguments);
|
|
@@ -1676,11 +1700,34 @@ var getParaEthTransferFees = /*#__PURE__*/function () {
|
|
|
1676
1700
|
return _ref.apply(this, arguments);
|
|
1677
1701
|
};
|
|
1678
1702
|
}();
|
|
1703
|
+
/**
|
|
1704
|
+
* Gets the Ethereum bridge status.
|
|
1705
|
+
*/
|
|
1706
|
+
var getBridgeStatus = /*#__PURE__*/function () {
|
|
1707
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(api) {
|
|
1708
|
+
var pjsApi;
|
|
1709
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1710
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
1711
|
+
case 0:
|
|
1712
|
+
pjsApi = new PolkadotJsApi();
|
|
1713
|
+
pjsApi.setApi(api);
|
|
1714
|
+
return _context2.abrupt("return", getBridgeStatus$1(pjsApi));
|
|
1715
|
+
case 3:
|
|
1716
|
+
case "end":
|
|
1717
|
+
return _context2.stop();
|
|
1718
|
+
}
|
|
1719
|
+
}, _callee2);
|
|
1720
|
+
}));
|
|
1721
|
+
return function getBridgeStatus(_x2) {
|
|
1722
|
+
return _ref2.apply(this, arguments);
|
|
1723
|
+
};
|
|
1724
|
+
}();
|
|
1679
1725
|
|
|
1680
1726
|
var transfer = /*#__PURE__*/Object.freeze({
|
|
1681
1727
|
__proto__: null,
|
|
1682
1728
|
approveToken: approveToken,
|
|
1683
1729
|
depositToken: depositToken,
|
|
1730
|
+
getBridgeStatus: getBridgeStatus,
|
|
1684
1731
|
getDryRun: getDryRun,
|
|
1685
1732
|
getParaEthTransferFees: getParaEthTransferFees,
|
|
1686
1733
|
getTokenBalance: getTokenBalance,
|
|
@@ -1688,4 +1735,4 @@ var transfer = /*#__PURE__*/Object.freeze({
|
|
|
1688
1735
|
transferEthToPolkadot: transferEthToPolkadot
|
|
1689
1736
|
});
|
|
1690
1737
|
|
|
1691
|
-
export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, getAssetBalance, getBalanceForeign, getBalanceNative, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
|
|
1738
|
+
export { Builder, EvmBuilder, approveToken, assets, claimAssets, createApiInstanceForNode, depositToken, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getDryRun, getMaxForeignTransferableAmount, getMaxNativeTransferableAmount, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, getTransferInfo, getTransferableAmount, send, transferEthToPolkadot, verifyEdOnDestination, transfer as xcmPallet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-pjs",
|
|
3
|
-
"version": "8.9.
|
|
3
|
+
"version": "8.9.9",
|
|
4
4
|
"description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@snowbridge/contract-types": "0.1.45",
|
|
28
28
|
"ethers": "^6.13.5",
|
|
29
29
|
"viem": "^2.23.15",
|
|
30
|
-
"@paraspell/sdk-core": "8.9.
|
|
30
|
+
"@paraspell/sdk-core": "8.9.9"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@polkadot/api": ">= 15.0 < 16",
|