@paraspell/sdk-core 12.0.1 → 12.0.3
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 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +12 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -56,9 +56,8 @@ Published under [MIT License](https://github.com/paraspell/xcm-tools/blob/main/p
|
|
|
56
56
|
|
|
57
57
|
## Supported by
|
|
58
58
|
|
|
59
|
-
<div
|
|
60
|
-
|
|
61
|
-
<img width="
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</div>
|
|
59
|
+
<div>
|
|
60
|
+
<div align="center" style="margin-top: 20px;">
|
|
61
|
+
<img width="750" alt="version" src="https://github.com/user-attachments/assets/29e4b099-d90c-46d6-a3ce-94edfbda003c" />
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -292,7 +292,7 @@ declare abstract class BaseAssetsPallet {
|
|
|
292
292
|
protected palletName: TAssetsPallet;
|
|
293
293
|
constructor(palletName: TAssetsPallet);
|
|
294
294
|
abstract mint<TApi, TRes>(address: string, assetInfo: WithAmount<TAssetInfo>, balance: bigint, chain: TSubstrateChain, api: IPolkadotApi<TApi, TRes>): Promise<TSetBalanceRes>;
|
|
295
|
-
abstract getBalance<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo, customCurrencyId?: unknown): Promise<bigint>;
|
|
295
|
+
abstract getBalance<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo, customCurrencyId?: unknown, chain?: TSubstrateChain): Promise<bigint>;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
/**
|
|
@@ -1794,6 +1794,7 @@ declare class EnergyWebX<TApi, TRes> extends Parachain<TApi, TRes> implements IP
|
|
|
1794
1794
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1795
1795
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1796
1796
|
transferRelayToPara(): Promise<TSerializedExtrinsics>;
|
|
1797
|
+
getBalanceForeign<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1797
1798
|
}
|
|
1798
1799
|
|
|
1799
1800
|
declare class EnergyWebXPaseo<TApi, TRes> extends EnergyWebX<TApi, TRes> {
|
package/dist/index.mjs
CHANGED
|
@@ -6765,7 +6765,7 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
6765
6765
|
feeType: originFeeType
|
|
6766
6766
|
}), {}, {
|
|
6767
6767
|
sufficient: sufficientOriginFee,
|
|
6768
|
-
asset: originAsset
|
|
6768
|
+
asset: originFeeType === 'paymentInfo' ? findNativeAssetInfoOrThrow(origin) : originAsset
|
|
6769
6769
|
}, originDryRunError && {
|
|
6770
6770
|
dryRunError: originDryRunError
|
|
6771
6771
|
}), originDryRunSubError && {
|
|
@@ -9222,7 +9222,7 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
9222
9222
|
instance = getPalletInstance(pallet);
|
|
9223
9223
|
_context5.p = 4;
|
|
9224
9224
|
_context5.n = 5;
|
|
9225
|
-
return instance.getBalance(api, address, asset, customCurrencyId);
|
|
9225
|
+
return instance.getBalance(api, address, asset, customCurrencyId, this.chain);
|
|
9226
9226
|
case 5:
|
|
9227
9227
|
return _context5.a(2, _context5.v);
|
|
9228
9228
|
case 6:
|
|
@@ -11645,6 +11645,11 @@ var EnergyWebX = /*#__PURE__*/function (_Parachain) {
|
|
|
11645
11645
|
scenario: 'RelayToPara'
|
|
11646
11646
|
});
|
|
11647
11647
|
}
|
|
11648
|
+
}, {
|
|
11649
|
+
key: "getBalanceForeign",
|
|
11650
|
+
value: function getBalanceForeign(api, address, asset) {
|
|
11651
|
+
return getPalletInstance('Assets').getBalance(api, address, asset, this.chain);
|
|
11652
|
+
}
|
|
11648
11653
|
}]);
|
|
11649
11654
|
}(Parachain);
|
|
11650
11655
|
|
|
@@ -13534,21 +13539,22 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
13534
13539
|
}, {
|
|
13535
13540
|
key: "getBalance",
|
|
13536
13541
|
value: function () {
|
|
13537
|
-
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset) {
|
|
13542
|
+
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset, chain) {
|
|
13538
13543
|
var _this = this,
|
|
13539
13544
|
_balance$balance,
|
|
13540
13545
|
_balance2;
|
|
13541
|
-
var fetchBalance, balance, _t;
|
|
13546
|
+
var isEnergyWebX, fetchBalance, balance, _t;
|
|
13542
13547
|
return _regenerator().w(function (_context) {
|
|
13543
13548
|
while (1) switch (_context.p = _context.n) {
|
|
13544
13549
|
case 0:
|
|
13545
13550
|
assertHasId(asset);
|
|
13551
|
+
isEnergyWebX = chain === 'EnergyWebX';
|
|
13546
13552
|
fetchBalance = function fetchBalance() {
|
|
13547
13553
|
var useBigInt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
13548
13554
|
return api.queryState({
|
|
13549
13555
|
module: _this.palletName,
|
|
13550
13556
|
method: 'Account',
|
|
13551
|
-
params: [useBigInt ? BigInt(asset.assetId) : Number(asset.assetId), address]
|
|
13557
|
+
params: [isEnergyWebX ? asset.location : useBigInt ? BigInt(asset.assetId) : Number(asset.assetId), address]
|
|
13552
13558
|
});
|
|
13553
13559
|
}; // Try with number ID first, if it fails, try with bigint ID
|
|
13554
13560
|
_context.p = 1;
|
|
@@ -13578,7 +13584,7 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
13578
13584
|
}
|
|
13579
13585
|
}, _callee, null, [[1, 3]]);
|
|
13580
13586
|
}));
|
|
13581
|
-
function getBalance(_x, _x2, _x3) {
|
|
13587
|
+
function getBalance(_x, _x2, _x3, _x4) {
|
|
13582
13588
|
return _getBalance.apply(this, arguments);
|
|
13583
13589
|
}
|
|
13584
13590
|
return getBalance;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.3",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@noble/hashes": "^2.0.1",
|
|
27
27
|
"@scure/base": "^2.0.0",
|
|
28
28
|
"viem": "^2.40.3",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
31
|
-
"@paraspell/
|
|
29
|
+
"@paraspell/assets": "12.0.3",
|
|
30
|
+
"@paraspell/pallets": "12.0.3",
|
|
31
|
+
"@paraspell/sdk-common": "12.0.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|