@paraspell/sdk-pjs 11.9.3 → 11.11.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 +12 -0
- package/dist/index.cjs +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -356,6 +356,18 @@ const transferable = await Builder(/*chain api/builder_config/ws_url_string/ws_u
|
|
|
356
356
|
.getMinTransferableAmount()
|
|
357
357
|
```
|
|
358
358
|
|
|
359
|
+
#### Receivable amount
|
|
360
|
+
```ts
|
|
361
|
+
const receivable = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
362
|
+
.from(ORIGIN_CHAIN)
|
|
363
|
+
.to(DESTINATION_CHAIN)
|
|
364
|
+
.currency(CURRENCY)
|
|
365
|
+
/*.feeAsset(CURRENCY) - Optional parameter when origin === AssetHubPolkadot and TX is supposed to be paid in the same fee asset as selected currency.*/
|
|
366
|
+
.address(RECIPIENT_ADDRESS)
|
|
367
|
+
.senderAddress(SENDER_ADDRESS)
|
|
368
|
+
.getReceivableAmount()
|
|
369
|
+
```
|
|
370
|
+
|
|
359
371
|
#### Verify ED on destination
|
|
360
372
|
```ts
|
|
361
373
|
const ed = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
package/dist/index.cjs
CHANGED
|
@@ -340,6 +340,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
340
340
|
key: "resolveApi",
|
|
341
341
|
value: function () {
|
|
342
342
|
var _resolveApi = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(apiConfig, chain) {
|
|
343
|
+
var wsUrl;
|
|
343
344
|
return _regenerator().w(function (_context2) {
|
|
344
345
|
while (1) switch (_context2.n) {
|
|
345
346
|
case 0:
|
|
@@ -347,7 +348,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
347
348
|
_context2.n = 1;
|
|
348
349
|
break;
|
|
349
350
|
}
|
|
350
|
-
|
|
351
|
+
wsUrl = sdkCore.getChainProviders(chain);
|
|
352
|
+
return _context2.a(2, this.createApiInstance(wsUrl, chain));
|
|
351
353
|
case 1:
|
|
352
354
|
if (!(typeof apiConfig === 'string' || apiConfig instanceof Array)) {
|
|
353
355
|
_context2.n = 2;
|
|
@@ -1296,8 +1298,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1296
1298
|
}]);
|
|
1297
1299
|
}();
|
|
1298
1300
|
|
|
1299
|
-
var createChainClient = function createChainClient(chain) {
|
|
1300
|
-
var pjsApi = new PolkadotJsApi();
|
|
1301
|
+
var createChainClient = function createChainClient(chain, builderOptions) {
|
|
1302
|
+
var pjsApi = new PolkadotJsApi(builderOptions);
|
|
1301
1303
|
return sdkCore.createChainClient(pjsApi, chain);
|
|
1302
1304
|
};
|
|
1303
1305
|
var createPolkadotJsApiCall = function createPolkadotJsApiCall(apiCall) {
|
package/dist/index.d.ts
CHANGED
|
@@ -282,7 +282,7 @@ declare namespace transfer {
|
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
declare const createChainClient: (chain: TSubstrateChain) => Promise<_polkadot_api.ApiPromise>;
|
|
285
|
+
declare const createChainClient: (chain: TSubstrateChain, builderOptions?: TBuilderOptions<TPjsApiOrUrl>) => Promise<_polkadot_api.ApiPromise>;
|
|
286
286
|
|
|
287
287
|
export { Builder, EvmBuilder, approveToken, assets, claimAssets, convertSs58, createChainClient, depositToken, dryRun, dryRunOrigin, getAssetBalance, getBalanceForeign, getBalanceNative, getBridgeStatus, getOriginFeeDetails, getParaEthTransferFees, getTokenBalance, send, transferEthToPolkadot, transfer as xcmPallet };
|
|
288
288
|
export type { Extrinsic, GeneralBuilder, TBalanceResponse, TPjsApi, TPjsApiOrUrl, TPjsEvmBuilderOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isConfig, BatchMode, MissingChainApiError,
|
|
1
|
+
import { isConfig, BatchMode, MissingChainApiError, getChainProviders, assertHasId, getChain, isForeignAsset, InvalidParameterError, computeFeeFromDryRunPjs, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, resolveModuleError, getAssetsObject, ChainNotSupportedError, wrapTxBypass, assertHasLocation, localizeLocation, isAssetXcEqual, addXcmVersionHeader, Version, createChainClient as createChainClient$1, getBalanceNative as getBalanceNative$1, getBalanceForeign as getBalanceForeign$1, getAssetBalance as getAssetBalance$1, claimAssets as claimAssets$1, getOriginFeeDetails as getOriginFeeDetails$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, getParaId, ETH_CHAIN_ID, findAssetInfoOrThrow, abstractDecimals, isOverrideLocationSpecifier, transferMoonbeamEvm, transferMoonbeamToEth, validateAddress, Builder as Builder$1, getParaEthTransferFees as getParaEthTransferFees$1, DRY_RUN_CLIENT_TIMEOUT_MS, getBridgeStatus as getBridgeStatus$1, send as send$1, dryRun as dryRun$1, dryRunOrigin as dryRunOrigin$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';
|
|
@@ -339,6 +339,7 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
339
339
|
key: "resolveApi",
|
|
340
340
|
value: function () {
|
|
341
341
|
var _resolveApi = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(apiConfig, chain) {
|
|
342
|
+
var wsUrl;
|
|
342
343
|
return _regenerator().w(function (_context2) {
|
|
343
344
|
while (1) switch (_context2.n) {
|
|
344
345
|
case 0:
|
|
@@ -346,7 +347,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
346
347
|
_context2.n = 1;
|
|
347
348
|
break;
|
|
348
349
|
}
|
|
349
|
-
|
|
350
|
+
wsUrl = getChainProviders(chain);
|
|
351
|
+
return _context2.a(2, this.createApiInstance(wsUrl, chain));
|
|
350
352
|
case 1:
|
|
351
353
|
if (!(typeof apiConfig === 'string' || apiConfig instanceof Array)) {
|
|
352
354
|
_context2.n = 2;
|
|
@@ -1295,8 +1297,8 @@ var PolkadotJsApi = /*#__PURE__*/function () {
|
|
|
1295
1297
|
}]);
|
|
1296
1298
|
}();
|
|
1297
1299
|
|
|
1298
|
-
var createChainClient = function createChainClient(chain) {
|
|
1299
|
-
var pjsApi = new PolkadotJsApi();
|
|
1300
|
+
var createChainClient = function createChainClient(chain, builderOptions) {
|
|
1301
|
+
var pjsApi = new PolkadotJsApi(builderOptions);
|
|
1300
1302
|
return createChainClient$1(pjsApi, chain);
|
|
1301
1303
|
};
|
|
1302
1304
|
var createPolkadotJsApiCall = function createPolkadotJsApiCall(apiCall) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-pjs",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.11.0",
|
|
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.2.0",
|
|
28
28
|
"ethers": "^6.15.0",
|
|
29
29
|
"viem": "^2.37.9",
|
|
30
|
-
"@paraspell/sdk-core": "11.
|
|
30
|
+
"@paraspell/sdk-core": "11.11.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@polkadot/api": ">= 16.0 < 17",
|