@paraspell/sdk 11.14.9 → 12.0.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 +5 -33
- package/dist/index.d.ts +5 -39
- package/dist/index.mjs +11 -43
- package/package.json +4 -4
- package/dist/index.cjs +0 -2006
package/README.md
CHANGED
|
@@ -57,9 +57,6 @@ Other patterns:
|
|
|
57
57
|
```ts
|
|
58
58
|
// ESM
|
|
59
59
|
import * as paraspell from '@paraspell/sdk'
|
|
60
|
-
|
|
61
|
-
// CommonJS
|
|
62
|
-
const paraspell = require('@paraspell/sdk')
|
|
63
60
|
```
|
|
64
61
|
|
|
65
62
|
Interaction with further asset symbol abstraction:
|
|
@@ -70,16 +67,15 @@ import { Native, Foreign, ForeignAbstract } from '@paraspell/sdk'; //Only needed
|
|
|
70
67
|
|
|
71
68
|
```
|
|
72
69
|
NOTES:
|
|
73
|
-
- Local transfers are now available for every currency and every chain. To try them, simply use the same origin and destination parameters.
|
|
74
|
-
- Transfer info queries are now all in the Builder pattern and don't require any imports other than the builder.
|
|
75
70
|
- You can now query Ethereum asset balances on Ethereum via balance query
|
|
76
71
|
- The Builder() now accepts an optional configuration object (To enhance localhost experience and testing). This object can contain apiOverrides and a development flag. More information in the "Localhost test setup" section.
|
|
72
|
+
- V10 > V11 Migration guide https://paraspell.github.io/docs/migration/v10-to-v11.html
|
|
73
|
+
- Brand new asset decimal abstraction introduced. It can be turned on in Builder config. Will be turned on by default in next major release.
|
|
77
74
|
```
|
|
78
75
|
|
|
79
76
|
```
|
|
80
77
|
Latest news:
|
|
81
|
-
-
|
|
82
|
-
- Brand new asset decimal abstraction introduced. It can be turned on in Builder config. Will be turned on by default in next major release.
|
|
78
|
+
- V11 > V12 Migration guide https://paraspell.github.io/docs/migration/v11-to-v12.html
|
|
83
79
|
```
|
|
84
80
|
|
|
85
81
|
### Sending XCM
|
|
@@ -384,7 +380,6 @@ const ed = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array -
|
|
|
384
380
|
|
|
385
381
|
#### XCM Fee (Origin and Dest.)
|
|
386
382
|
|
|
387
|
-
##### More accurate query using DryRun
|
|
388
383
|
```ts
|
|
389
384
|
const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
390
385
|
.from(ORIGIN_CHAIN)
|
|
@@ -396,20 +391,8 @@ const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array
|
|
|
396
391
|
.getXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of a DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin or Destination chain do not support DryRun out of the box.
|
|
397
392
|
```
|
|
398
393
|
|
|
399
|
-
##### Less accurate query using Payment info
|
|
400
|
-
```ts
|
|
401
|
-
const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
402
|
-
.from(ORIGIN_CHAIN)
|
|
403
|
-
.to(DESTINATION_CHAIN)
|
|
404
|
-
.currency(CURRENCY)
|
|
405
|
-
.address(RECIPIENT_ADDRESS)
|
|
406
|
-
.senderAddress(SENDER_ADDRESS)
|
|
407
|
-
.getXcmFeeEstimate()
|
|
408
|
-
```
|
|
409
|
-
|
|
410
394
|
#### XCM Fee (Origin only)
|
|
411
395
|
|
|
412
|
-
##### More accurate query using DryRun
|
|
413
396
|
```ts
|
|
414
397
|
const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
415
398
|
.from(ORIGIN_CHAIN)
|
|
@@ -421,23 +404,12 @@ const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array
|
|
|
421
404
|
.getOriginXcmFee(/*{disableFallback: true / false}*/) //Fallback is optional. When fallback is disabled, you only get notified of a DryRun error, but no Payment info query fallback is performed. Payment info is still performed if Origin do not support DryRun out of the box.
|
|
422
405
|
```
|
|
423
406
|
|
|
424
|
-
##### Less accurate query using Payment info
|
|
425
|
-
```ts
|
|
426
|
-
const fee = await Builder(/*chain api/builder_config/ws_url_string/ws_url_array - optional*/)
|
|
427
|
-
.from(ORIGIN_CHAIN)
|
|
428
|
-
.to(DESTINATION_CHAIN)
|
|
429
|
-
.currency(CURRENCY)
|
|
430
|
-
.address(RECIPIENT_ADDRESS)
|
|
431
|
-
.senderAddress(SENDER_ADDRESS)
|
|
432
|
-
.getOriginXcmFeeEstimate()
|
|
433
|
-
```
|
|
434
|
-
|
|
435
407
|
#### Asset balance
|
|
436
408
|
```ts
|
|
437
|
-
import {
|
|
409
|
+
import { getBalance } from "@paraspell/sdk";
|
|
438
410
|
|
|
439
411
|
//Retrieves the asset balance for a given account on a specified chain (You do not need to specify if it is native or foreign).
|
|
440
|
-
const balance = await
|
|
412
|
+
const balance = await getBalance({address, chain, currency /*- {id: currencyID} | {symbol: currencySymbol} | {symbol: Native('currencySymbol')} | {symbol: Foreign('currencySymbol')} | {symbol: ForeignAbstract('currencySymbol')} | {location: AssetLocationString | AssetLocationJson}*/, api /* api/ws_url_string optional */});
|
|
441
413
|
```
|
|
442
414
|
|
|
443
415
|
#### Ethereum bridge fees
|
package/dist/index.d.ts
CHANGED
|
@@ -10,31 +10,13 @@ type TPapiApiOrUrl = TApiOrUrl<PolkadotClient>;
|
|
|
10
10
|
type TPapiTransaction = UnsafeTransaction<any, string, string, any>;
|
|
11
11
|
type TEvmChainFromPapi = Extract<TEvmChainFrom, 'Moonbeam' | 'Moonriver' | 'Darwinia'>;
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* Retrieves the native balance for a given account on a specified chain.
|
|
15
|
-
*
|
|
16
|
-
* @returns The native balance as a bigint.
|
|
17
|
-
*/
|
|
18
|
-
declare const getBalanceNative: (options: _paraspell_sdk_core.TGetBalanceNativeOptionsBase & {
|
|
19
|
-
api?: TPapiApiOrUrl;
|
|
20
|
-
}) => Promise<bigint>;
|
|
21
|
-
/**
|
|
22
|
-
* Retrieves the balance of a foreign asset for a given account on a specified chain.
|
|
23
|
-
*
|
|
24
|
-
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
25
|
-
*/
|
|
26
|
-
declare const getBalanceForeign: (options: _paraspell_sdk_core.TGetBalanceCommonOptions & {
|
|
27
|
-
currency: _paraspell_sdk_core.TCurrencyCore;
|
|
28
|
-
} & {
|
|
29
|
-
api?: TPapiApiOrUrl;
|
|
30
|
-
}) => Promise<bigint>;
|
|
31
13
|
/**
|
|
32
14
|
* Retrieves the asset balance for a given account on a specified chain.
|
|
33
15
|
*
|
|
34
16
|
* @returns The asset balance as a bigint.
|
|
35
17
|
*/
|
|
36
|
-
declare const
|
|
37
|
-
currency
|
|
18
|
+
declare const getBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOptions & {
|
|
19
|
+
currency?: _paraspell_sdk_core.TCurrencyCore;
|
|
38
20
|
} & {
|
|
39
21
|
api?: TPapiApiOrUrl;
|
|
40
22
|
}) => Promise<bigint>;
|
|
@@ -46,16 +28,6 @@ declare const getAssetBalance: (options: _paraspell_sdk_core.TGetBalanceCommonOp
|
|
|
46
28
|
declare const claimAssets: (options: _paraspell_sdk_core.TAssetClaimOptionsBase & {
|
|
47
29
|
api?: TPapiApiOrUrl;
|
|
48
30
|
}) => Promise<TPapiTransaction>;
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
51
|
-
* Please use `builder.getOriginXcmFee()` or `builder.getOriginXcmFeeEstimate()` instead,
|
|
52
|
-
* where `builder` is an instance of `Builder()`. Will be removed in v12
|
|
53
|
-
* For more details, please refer to the documentation:
|
|
54
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
55
|
-
*/
|
|
56
|
-
declare const getOriginFeeDetails: (options: _paraspell_sdk_core.TGetOriginFeeDetailsOptionsBase & {
|
|
57
|
-
api?: TPapiApiOrUrl;
|
|
58
|
-
}) => Promise<_paraspell_sdk_core.TOriginFeeDetails>;
|
|
59
31
|
|
|
60
32
|
declare const assets_Foreign: typeof Foreign;
|
|
61
33
|
declare const assets_ForeignAbstract: typeof ForeignAbstract;
|
|
@@ -64,17 +36,14 @@ declare const assets_Override: typeof Override;
|
|
|
64
36
|
declare const assets_claimAssets: typeof claimAssets;
|
|
65
37
|
declare const assets_findAssetInfo: typeof findAssetInfo;
|
|
66
38
|
declare const assets_getAllAssetsSymbols: typeof getAllAssetsSymbols;
|
|
67
|
-
declare const assets_getAssetBalance: typeof getAssetBalance;
|
|
68
39
|
declare const assets_getAssetDecimals: typeof getAssetDecimals;
|
|
69
40
|
declare const assets_getAssetId: typeof getAssetId;
|
|
70
41
|
declare const assets_getAssets: typeof getAssets;
|
|
71
42
|
declare const assets_getAssetsObject: typeof getAssetsObject;
|
|
72
|
-
declare const
|
|
73
|
-
declare const assets_getBalanceNative: typeof getBalanceNative;
|
|
43
|
+
declare const assets_getBalance: typeof getBalance;
|
|
74
44
|
declare const assets_getExistentialDeposit: typeof getExistentialDeposit;
|
|
75
45
|
declare const assets_getNativeAssetSymbol: typeof getNativeAssetSymbol;
|
|
76
46
|
declare const assets_getNativeAssets: typeof getNativeAssets;
|
|
77
|
-
declare const assets_getOriginFeeDetails: typeof getOriginFeeDetails;
|
|
78
47
|
declare const assets_getOtherAssets: typeof getOtherAssets;
|
|
79
48
|
declare const assets_getRelayChainSymbol: typeof getRelayChainSymbol;
|
|
80
49
|
declare const assets_getSupportedAssets: typeof getSupportedAssets;
|
|
@@ -90,17 +59,14 @@ declare namespace assets {
|
|
|
90
59
|
assets_claimAssets as claimAssets,
|
|
91
60
|
assets_findAssetInfo as findAssetInfo,
|
|
92
61
|
assets_getAllAssetsSymbols as getAllAssetsSymbols,
|
|
93
|
-
assets_getAssetBalance as getAssetBalance,
|
|
94
62
|
assets_getAssetDecimals as getAssetDecimals,
|
|
95
63
|
assets_getAssetId as getAssetId,
|
|
96
64
|
assets_getAssets as getAssets,
|
|
97
65
|
assets_getAssetsObject as getAssetsObject,
|
|
98
|
-
|
|
99
|
-
assets_getBalanceNative as getBalanceNative,
|
|
66
|
+
assets_getBalance as getBalance,
|
|
100
67
|
assets_getExistentialDeposit as getExistentialDeposit,
|
|
101
68
|
assets_getNativeAssetSymbol as getNativeAssetSymbol,
|
|
102
69
|
assets_getNativeAssets as getNativeAssets,
|
|
103
|
-
assets_getOriginFeeDetails as getOriginFeeDetails,
|
|
104
70
|
assets_getOtherAssets as getOtherAssets,
|
|
105
71
|
assets_getRelayChainSymbol as getRelayChainSymbol,
|
|
106
72
|
assets_getSupportedAssets as getSupportedAssets,
|
|
@@ -242,5 +208,5 @@ declare const createChainClient: (chain: TSubstrateChain, api?: TBuilderOptions<
|
|
|
242
208
|
declare const checkAndConvertToNumberOrBigInt: (input: string) => number | bigint;
|
|
243
209
|
declare const transform: (obj: any) => any;
|
|
244
210
|
|
|
245
|
-
export { Builder, EvmBuilder, assets, checkAndConvertToNumberOrBigInt, claimAssets, convertSs58, createChainClient, dryRun, dryRunOrigin,
|
|
211
|
+
export { Builder, EvmBuilder, assets, checkAndConvertToNumberOrBigInt, claimAssets, convertSs58, createChainClient, dryRun, dryRunOrigin, getBalance, getBridgeStatus, getOriginXcmFee, getParaEthTransferFees, getXcmFee, handleSwapExecuteTransfer, send, transform, transfer as xcmPallet };
|
|
246
212
|
export type { GeneralBuilder, TEvmChainFromPapi, TPapiApi, TPapiApiOrUrl, TPapiTransaction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberFormatError, isConfig, InvalidAddressError, BatchMode, getChainProviders, MissingChainApiError, Parents, Version, computeFeeFromDryRun, findNativeAssetInfoOrThrow, hasXcmPaymentApiSupport, replaceBigInt, getAssetsObject, RuntimeApiUnavailableError, wrapTxBypass, assertHasLocation, localizeLocation, isAssetXcEqual, padValueBy, isRelayChain, isAssetEqual, createChainClient as createChainClient$1, getBalance as getBalance$1, claimAssets as claimAssets$1, Foreign, ForeignAbstract, Native, Override, findAssetInfo, getAllAssetsSymbols, getAssetDecimals, getAssetId, getAssets, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getOtherAssets, getRelayChainSymbol, getSupportedAssets, getTChain, hasSupportForAsset, isChainEvm, convertSs58 as convertSs58$1, transferMoonbeamEvm, validateAddress, transferMoonbeamToEth, Builder as Builder$1, handleSwapExecuteTransfer as handleSwapExecuteTransfer$1, getParaEthTransferFees as getParaEthTransferFees$1, getBridgeStatus as getBridgeStatus$1, getXcmFee as getXcmFee$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
|
-
import { blake2b } from '@noble/hashes/blake2';
|
|
4
|
-
import { bytesToHex } from '@noble/hashes/utils';
|
|
3
|
+
import { blake2b } from '@noble/hashes/blake2.js';
|
|
4
|
+
import { bytesToHex } from '@noble/hashes/utils.js';
|
|
5
5
|
import { withLegacy } from '@polkadot-api/legacy-provider';
|
|
6
6
|
import { Binary, FixedSizeBinary, getSs58AddressInfo, AccountId, createClient } from 'polkadot-api';
|
|
7
7
|
import { withPolkadotSdkCompat } from 'polkadot-api/polkadot-sdk-compat';
|
|
@@ -361,7 +361,7 @@ var processAssetsDepositedEvents = function processAssetsDepositedEvents(events,
|
|
|
361
361
|
|
|
362
362
|
var checkAndConvertToNumberOrBigInt = function checkAndConvertToNumberOrBigInt(input) {
|
|
363
363
|
if (!/^-?\d+$/.test(input)) {
|
|
364
|
-
throw new
|
|
364
|
+
throw new NumberFormatError('Invalid integer string');
|
|
365
365
|
}
|
|
366
366
|
var bigIntValue = BigInt(input);
|
|
367
367
|
if (bigIntValue >= Number.MIN_SAFE_INTEGER && bigIntValue <= Number.MAX_SAFE_INTEGER) {
|
|
@@ -1152,7 +1152,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1152
1152
|
value: function () {
|
|
1153
1153
|
var _getDryRunCall = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(options) {
|
|
1154
1154
|
var _this = this;
|
|
1155
|
-
var tx, chain, destination, address, feeAsset, bypassOptions, _options$useRootOrigi, useRootOrigin, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, findFailureObjectFromResult, extractFailureReasonFromResult, result, isSuccess, failureOutputReason, initialFailureReason, usedAsset,
|
|
1155
|
+
var tx, chain, destination, address, feeAsset, bypassOptions, _options$useRootOrigi, useRootOrigin, supportsDryRunApi, DEFAULT_XCM_VERSION, basePayload, resolvedTx, performDryRunCall, getExecutionSuccessFromResult, findFailureObjectFromResult, extractFailureReasonFromResult, result, isSuccess, failureOutputReason, initialFailureReason, usedAsset, actualWeight, weight, forwardedXcms, destParaId, nativeAsset, hasLocation, xcmFee, executionFee, fee, _t2;
|
|
1156
1156
|
return _regenerator().w(function (_context0) {
|
|
1157
1157
|
while (1) switch (_context0.n) {
|
|
1158
1158
|
case 0:
|
|
@@ -1162,7 +1162,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1162
1162
|
_context0.n = 1;
|
|
1163
1163
|
break;
|
|
1164
1164
|
}
|
|
1165
|
-
throw new
|
|
1165
|
+
throw new RuntimeApiUnavailableError(chain, 'DryRunApi');
|
|
1166
1166
|
case 1:
|
|
1167
1167
|
DEFAULT_XCM_VERSION = 3;
|
|
1168
1168
|
basePayload = {
|
|
@@ -1285,7 +1285,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
case 7:
|
|
1287
1287
|
usedAsset = feeAsset !== null && feeAsset !== void 0 ? feeAsset : findNativeAssetInfoOrThrow(chain);
|
|
1288
|
-
usedSymbol = usedAsset.symbol;
|
|
1289
1288
|
if (isSuccess) {
|
|
1290
1289
|
_context0.n = 8;
|
|
1291
1290
|
break;
|
|
@@ -1294,7 +1293,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1294
1293
|
success: false,
|
|
1295
1294
|
failureReason: failureOutputReason.failureReason,
|
|
1296
1295
|
failureSubReason: failureOutputReason.failureSubReason,
|
|
1297
|
-
currency: usedSymbol,
|
|
1298
1296
|
asset: usedAsset
|
|
1299
1297
|
}));
|
|
1300
1298
|
case 8:
|
|
@@ -1322,7 +1320,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1322
1320
|
return _context0.a(2, Promise.resolve({
|
|
1323
1321
|
success: true,
|
|
1324
1322
|
fee: xcmFee,
|
|
1325
|
-
currency: usedSymbol,
|
|
1326
1323
|
asset: usedAsset,
|
|
1327
1324
|
weight: weight,
|
|
1328
1325
|
forwardedXcms: forwardedXcms,
|
|
@@ -1337,7 +1334,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1337
1334
|
return _context0.a(2, Promise.resolve({
|
|
1338
1335
|
success: true,
|
|
1339
1336
|
fee: fee,
|
|
1340
|
-
currency: usedSymbol,
|
|
1341
1337
|
asset: usedAsset,
|
|
1342
1338
|
weight: weight,
|
|
1343
1339
|
forwardedXcms: forwardedXcms,
|
|
@@ -1470,7 +1466,7 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1470
1466
|
value: function () {
|
|
1471
1467
|
var _getDryRunXcm = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(_ref0) {
|
|
1472
1468
|
var _ref1, _processAssetsDeposit, _ref10, _ref11, _ref12, _ref13, _ref14;
|
|
1473
|
-
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result,
|
|
1469
|
+
var originLocation, xcm, chain, origin, asset, feeAsset, originFee, amount, supportsDryRunApi, transformedOriginLocation, result, isSuccess, failureReason, actualWeight, weight, forwardedXcms, destParaId, _fee, emitted, reversedEvents, palletsWithIssued, isFeeAsset, feeAssetFeeEvent, processedAssetsAmount, feeEvent, fee, processedFee;
|
|
1474
1470
|
return _regenerator().w(function (_context11) {
|
|
1475
1471
|
while (1) switch (_context11.n) {
|
|
1476
1472
|
case 0:
|
|
@@ -1480,14 +1476,13 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1480
1476
|
_context11.n = 1;
|
|
1481
1477
|
break;
|
|
1482
1478
|
}
|
|
1483
|
-
throw new
|
|
1479
|
+
throw new RuntimeApiUnavailableError(chain, 'DryRunApi');
|
|
1484
1480
|
case 1:
|
|
1485
1481
|
transformedOriginLocation = _transform(originLocation);
|
|
1486
1482
|
_context11.n = 2;
|
|
1487
1483
|
return this.api.getUnsafeApi().apis.DryRunApi.dry_run_xcm(transformedOriginLocation, xcm);
|
|
1488
1484
|
case 2:
|
|
1489
1485
|
result = _context11.v;
|
|
1490
|
-
symbol = asset.symbol;
|
|
1491
1486
|
isSuccess = result.success && result.value.execution_result.type === 'Complete';
|
|
1492
1487
|
if (isSuccess) {
|
|
1493
1488
|
_context11.n = 3;
|
|
@@ -1497,7 +1492,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1497
1492
|
return _context11.a(2, {
|
|
1498
1493
|
success: false,
|
|
1499
1494
|
failureReason: failureReason,
|
|
1500
|
-
currency: symbol,
|
|
1501
1495
|
asset: asset
|
|
1502
1496
|
});
|
|
1503
1497
|
case 3:
|
|
@@ -1523,7 +1517,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1523
1517
|
return _context11.a(2, {
|
|
1524
1518
|
success: true,
|
|
1525
1519
|
fee: _fee,
|
|
1526
|
-
currency: symbol,
|
|
1527
1520
|
asset: asset,
|
|
1528
1521
|
weight: weight,
|
|
1529
1522
|
forwardedXcms: forwardedXcms,
|
|
@@ -1576,7 +1569,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1576
1569
|
return _context11.a(2, Promise.resolve({
|
|
1577
1570
|
success: false,
|
|
1578
1571
|
failureReason: 'Cannot determine destination fee. No fee event found',
|
|
1579
|
-
currency: symbol,
|
|
1580
1572
|
asset: asset
|
|
1581
1573
|
}));
|
|
1582
1574
|
case 6:
|
|
@@ -1588,7 +1580,6 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
1588
1580
|
return _context11.a(2, Promise.resolve({
|
|
1589
1581
|
success: true,
|
|
1590
1582
|
fee: processedFee,
|
|
1591
|
-
currency: symbol,
|
|
1592
1583
|
asset: asset,
|
|
1593
1584
|
weight: weight,
|
|
1594
1585
|
forwardedXcms: forwardedXcms,
|
|
@@ -1690,38 +1681,18 @@ var findFailingEvent = function findFailingEvent(result) {
|
|
|
1690
1681
|
});
|
|
1691
1682
|
};
|
|
1692
1683
|
|
|
1693
|
-
/**
|
|
1694
|
-
* Retrieves the native balance for a given account on a specified chain.
|
|
1695
|
-
*
|
|
1696
|
-
* @returns The native balance as a bigint.
|
|
1697
|
-
*/
|
|
1698
|
-
var getBalanceNative = createPapiApiCall(getBalanceNative$1);
|
|
1699
|
-
/**
|
|
1700
|
-
* Retrieves the balance of a foreign asset for a given account on a specified chain.
|
|
1701
|
-
*
|
|
1702
|
-
* @returns The balance of the foreign asset as a bigint, or null if not found.
|
|
1703
|
-
*/
|
|
1704
|
-
var getBalanceForeign = createPapiApiCall(getBalance);
|
|
1705
1684
|
/**
|
|
1706
1685
|
* Retrieves the asset balance for a given account on a specified chain.
|
|
1707
1686
|
*
|
|
1708
1687
|
* @returns The asset balance as a bigint.
|
|
1709
1688
|
*/
|
|
1710
|
-
var
|
|
1689
|
+
var getBalance = createPapiApiCall(getBalance$1);
|
|
1711
1690
|
/**
|
|
1712
1691
|
* Claims assets from a parachain.
|
|
1713
1692
|
*
|
|
1714
1693
|
* @returns An extrinsic representing the claim transaction.
|
|
1715
1694
|
*/
|
|
1716
1695
|
var claimAssets = createPapiApiCall(claimAssets$1);
|
|
1717
|
-
/**
|
|
1718
|
-
* @deprecated This function is deprecated and will be removed in a future version.
|
|
1719
|
-
* Please use `builder.getOriginXcmFee()` or `builder.getOriginXcmFeeEstimate()` instead,
|
|
1720
|
-
* where `builder` is an instance of `Builder()`. Will be removed in v12
|
|
1721
|
-
* For more details, please refer to the documentation:
|
|
1722
|
-
* {@link https://paraspell.github.io/docs/sdk/xcmPallet.html#xcm-fee-origin-and-dest}
|
|
1723
|
-
*/
|
|
1724
|
-
var getOriginFeeDetails = createPapiApiCall(getOriginFeeDetails$1);
|
|
1725
1696
|
|
|
1726
1697
|
var assets = /*#__PURE__*/Object.freeze({
|
|
1727
1698
|
__proto__: null,
|
|
@@ -1732,17 +1703,14 @@ var assets = /*#__PURE__*/Object.freeze({
|
|
|
1732
1703
|
claimAssets: claimAssets,
|
|
1733
1704
|
findAssetInfo: findAssetInfo,
|
|
1734
1705
|
getAllAssetsSymbols: getAllAssetsSymbols,
|
|
1735
|
-
getAssetBalance: getAssetBalance,
|
|
1736
1706
|
getAssetDecimals: getAssetDecimals,
|
|
1737
1707
|
getAssetId: getAssetId,
|
|
1738
1708
|
getAssets: getAssets,
|
|
1739
1709
|
getAssetsObject: getAssetsObject,
|
|
1740
|
-
|
|
1741
|
-
getBalanceNative: getBalanceNative,
|
|
1710
|
+
getBalance: getBalance,
|
|
1742
1711
|
getExistentialDeposit: getExistentialDeposit,
|
|
1743
1712
|
getNativeAssetSymbol: getNativeAssetSymbol,
|
|
1744
1713
|
getNativeAssets: getNativeAssets,
|
|
1745
|
-
getOriginFeeDetails: getOriginFeeDetails,
|
|
1746
1714
|
getOtherAssets: getOtherAssets,
|
|
1747
1715
|
getRelayChainSymbol: getRelayChainSymbol,
|
|
1748
1716
|
getSupportedAssets: getSupportedAssets,
|
|
@@ -1976,4 +1944,4 @@ var transfer = /*#__PURE__*/Object.freeze({
|
|
|
1976
1944
|
send: send
|
|
1977
1945
|
});
|
|
1978
1946
|
|
|
1979
|
-
export { Builder, EvmBuilder, assets, checkAndConvertToNumberOrBigInt, claimAssets, convertSs58, createChainClient, dryRun, dryRunOrigin,
|
|
1947
|
+
export { Builder, EvmBuilder, assets, checkAndConvertToNumberOrBigInt, claimAssets, convertSs58, createChainClient, dryRun, dryRunOrigin, getBalance, getBridgeStatus, getOriginXcmFee, getParaEthTransferFees, getXcmFee, handleSwapExecuteTransfer, send, _transform as transform, transfer as xcmPallet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "SDK for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@noble/hashes": "^
|
|
26
|
+
"@noble/hashes": "^2.0.1",
|
|
27
27
|
"@polkadot-api/legacy-provider": "^0.3.6",
|
|
28
28
|
"viem": "^2.40.3",
|
|
29
|
-
"@paraspell/sdk-core": "
|
|
29
|
+
"@paraspell/sdk-core": "12.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"polkadot-api": ">= 1.22.0 < 2"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|
|
36
36
|
"@babel/preset-env": "^7.28.5",
|
|
37
37
|
"@codecov/rollup-plugin": "^1.9.1",
|
|
38
|
-
"@noble/curves": "^
|
|
38
|
+
"@noble/curves": "^2.0.1",
|
|
39
39
|
"@polkadot-labs/hdkd": "^0.0.25",
|
|
40
40
|
"@polkadot-labs/hdkd-helpers": "^0.0.26",
|
|
41
41
|
"@rollup/plugin-babel": "^6.1.0",
|