@paraspell/sdk-pjs 13.7.1 → 13.8.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.d.ts +3 -3
- package/dist/index.mjs +8 -14
- package/package.json +4 -5
package/dist/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ type TPjsEvmBuilderOptions<TApi, TRes, TSigner> = WithApi<TEvmBuilderOptionsBase
|
|
|
51
51
|
*
|
|
52
52
|
* @returns The asset balance as a bigint.
|
|
53
53
|
*/
|
|
54
|
-
declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions & {
|
|
54
|
+
declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions<never> & {
|
|
55
55
|
currency?: _paraspell_sdk_core.TCurrencyCore;
|
|
56
56
|
} & {
|
|
57
57
|
api?: _paraspell_sdk_core.TApiOrUrl<TPjsApi>;
|
|
@@ -209,10 +209,10 @@ declare const transferEthToPolkadot$1: <TApi, TRes, TSigner>({ api, provider, si
|
|
|
209
209
|
|
|
210
210
|
declare const getTokenBalance: (signer: Signer$1, symbol: string) => Promise<bigint>;
|
|
211
211
|
|
|
212
|
-
declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<Extrinsic> & {
|
|
212
|
+
declare const dryRun: (options: _paraspell_sdk_core.TDryRunBaseOptions<Extrinsic, never> & {
|
|
213
213
|
api?: TApiOrUrl<TPjsApi>;
|
|
214
214
|
}) => Promise<_paraspell_sdk_core.TDryRunResult>;
|
|
215
|
-
declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<Extrinsic> & {
|
|
215
|
+
declare const dryRunOrigin: (options: _paraspell_sdk_core.TDryRunCallBaseOptions<Extrinsic, never> & {
|
|
216
216
|
api?: TApiOrUrl<TPjsApi>;
|
|
217
217
|
}) => Promise<_paraspell_sdk_core.TDryRunChainResult>;
|
|
218
218
|
declare const transferEthToPolkadot: (options: Omit<TPjsEvmBuilderOptions<TPjsApi, Extrinsic, TPjsSigner>, "api">) => ReturnType<typeof transferEthToPolkadot$1>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getNativeAssetSymbol, getOtherAssets, hasJunction, getJunctionValue, getEvmPrivateKeyHex, UnsupportedOperationError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, getChainProvidersImpl, isSenderSigner, PolkadotApi, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, resolveModuleError, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, normalizeLocation, localizeLocation, createAssetId, addXcmVersionHeader, isAssetXcEqual, RELAY_LOCATION, getRelayChainOfImpl, SubmitTransactionError, 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, findAssetInfoOrThrow, assertHasId, getParaId, RoutingResolutionError, abstractDecimals, MissingParameterError, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress as validateAddress$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';
|
|
1
|
+
import { getNativeAssetSymbol, getOtherAssets, hasJunction, getJunctionValue, getEvmPrivateKeyHex, UnsupportedOperationError, createClientCache, MAX_CLIENTS, EXTENSION_MS, createClientPoolHelpers, BatchMode, isConfig, findNativeAssetInfoOrThrowImpl, isCustomChain, getChainProvidersImpl, isSenderSigner, PolkadotApi, findAssetInfoOrThrowImpl, hasXcmPaymentApiSupportImpl, resolveModuleError, hasDryRunSupportImpl, RuntimeApiUnavailableError, wrapTxBypass, normalizeLocation, localizeLocation, createAssetId, addXcmVersionHeader, isAssetXcEqual, RELAY_LOCATION, getRelayChainOfImpl, SubmitTransactionError, 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, findAssetInfoOrThrow, assertHasId, getParaId, RoutingResolutionError, abstractDecimals, MissingParameterError, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress as validateAddress$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 { Keyring, WsProvider, ApiPromise } from '@polkadot/api';
|
|
4
|
+
import { snakeToCamel, lowercaseFirstLetter } from '@paraspell/sdk-common';
|
|
4
5
|
import { u8aConcat, compactToU8a, u8aEq, isHex, u8aToHex, hexToU8a, stringToU8a } from '@polkadot/util';
|
|
5
6
|
import { decodeAddress, blake2AsHex, validateAddress } from '@polkadot/util-crypto';
|
|
6
7
|
import { WETH9__factory } from '@snowbridge/contract-types';
|
|
@@ -393,15 +394,6 @@ var createKeyringPair = function createKeyringPair(path) {
|
|
|
393
394
|
return evmPrivateKey ? keyring.createFromUri(evmPrivateKey, undefined, 'ethereum') : keyring.addFromUri(path);
|
|
394
395
|
};
|
|
395
396
|
|
|
396
|
-
var lowercaseFirstLetter = function lowercaseFirstLetter(value) {
|
|
397
|
-
return value.charAt(0).toLowerCase() + value.slice(1);
|
|
398
|
-
};
|
|
399
|
-
var snakeToCamel = function snakeToCamel(str) {
|
|
400
|
-
return str.toLowerCase().replace(/([-_][a-z])/g, function (group) {
|
|
401
|
-
return group.toUpperCase().replace('-', '').replace('_', '');
|
|
402
|
-
});
|
|
403
|
-
};
|
|
404
|
-
|
|
405
397
|
var txFromHex = function txFromHex(api, hex) {
|
|
406
398
|
var _api$tx$section;
|
|
407
399
|
// Try as full extrinsic
|
|
@@ -1490,9 +1482,10 @@ var PolkadotJsApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1490
1482
|
value: function disconnect() {
|
|
1491
1483
|
var _this$_config$apiOver;
|
|
1492
1484
|
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
1493
|
-
|
|
1485
|
+
var chain = this._chain;
|
|
1486
|
+
if (!chain) return Promise.resolve();
|
|
1494
1487
|
if (!force && !this.disconnectAllowed) return Promise.resolve();
|
|
1495
|
-
var api = isConfig(this._config) ? (_this$_config$apiOver = this._config.apiOverrides) === null || _this$_config$apiOver === void 0 ? void 0 : _this$_config$apiOver[
|
|
1488
|
+
var api = isConfig(this._config) ? isCustomChain(chain) ? undefined : (_this$_config$apiOver = this._config.apiOverrides) === null || _this$_config$apiOver === void 0 ? void 0 : _this$_config$apiOver[chain] : this._config;
|
|
1496
1489
|
// Own client provided, destroy only if force true
|
|
1497
1490
|
if (force && _typeof(api) === 'object') {
|
|
1498
1491
|
void this.api.disconnect();
|
|
@@ -1502,7 +1495,7 @@ var PolkadotJsApi = /*#__PURE__*/function (_PolkadotApi) {
|
|
|
1502
1495
|
if (force) {
|
|
1503
1496
|
void this.api.disconnect();
|
|
1504
1497
|
} else {
|
|
1505
|
-
var key = api === undefined ? getChainProvidersImpl(
|
|
1498
|
+
var key = api === undefined ? getChainProvidersImpl(chain, this._customCtx) : api;
|
|
1506
1499
|
releaseClient(key);
|
|
1507
1500
|
}
|
|
1508
1501
|
}
|
|
@@ -2095,8 +2088,9 @@ var EvmBuilder = function EvmBuilder(provider, api) {
|
|
|
2095
2088
|
var dryRun = createPolkadotJsApiCall(dryRun$1);
|
|
2096
2089
|
var dryRunOrigin = createPolkadotJsApiCall(dryRunOrigin$1);
|
|
2097
2090
|
var transferEthToPolkadot = function transferEthToPolkadot(options) {
|
|
2091
|
+
var api = new PolkadotJsApi();
|
|
2098
2092
|
return transferEthToPolkadot$1(_objectSpread2(_objectSpread2({}, options), {}, {
|
|
2099
|
-
api:
|
|
2093
|
+
api: api
|
|
2100
2094
|
}));
|
|
2101
2095
|
};
|
|
2102
2096
|
var getParaEthTransferFees = /*#__PURE__*/function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-pjs",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.8.0",
|
|
4
4
|
"description": "Polkadot.js based SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"@snowbridge/registry": "^1.1.6",
|
|
30
30
|
"ethers": "^6.16.0",
|
|
31
31
|
"viem": "^2.51.3",
|
|
32
|
-
"@paraspell/sdk-
|
|
32
|
+
"@paraspell/sdk-common": "13.8.0",
|
|
33
|
+
"@paraspell/sdk-core": "13.8.0"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
36
|
"@polkadot/api": ">= 16.0 < 17",
|
|
@@ -46,11 +47,9 @@
|
|
|
46
47
|
"@rollup/plugin-json": "^6.1.0",
|
|
47
48
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
48
49
|
"@vitest/coverage-v8": "^4.1.7",
|
|
49
|
-
"axios": "^1.16.1",
|
|
50
50
|
"dotenv": "^17.4.2",
|
|
51
51
|
"rollup": "^4.60.4",
|
|
52
|
-
"rollup-plugin-dts": "^6.4.1"
|
|
53
|
-
"tslib": "^2.8.1"
|
|
52
|
+
"rollup-plugin-dts": "^6.4.1"
|
|
54
53
|
},
|
|
55
54
|
"scripts": {
|
|
56
55
|
"compile": "tsc --noEmit",
|