@paraspell/sdk-core 11.14.10 → 11.14.11
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 +13 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +13 -7
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -6800,8 +6800,8 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
6800
6800
|
feeType: originFeeType
|
|
6801
6801
|
}), {}, {
|
|
6802
6802
|
sufficient: sufficientOriginFee,
|
|
6803
|
-
currency: originAsset.symbol,
|
|
6804
|
-
asset: originAsset
|
|
6803
|
+
currency: originFeeType === 'paymentInfo' ? assets.getNativeAssetSymbol(origin) : originAsset.symbol,
|
|
6804
|
+
asset: originFeeType === 'paymentInfo' ? assets.findNativeAssetInfoOrThrow(origin) : originAsset
|
|
6805
6805
|
}, originDryRunError && {
|
|
6806
6806
|
dryRunError: originDryRunError
|
|
6807
6807
|
}), originDryRunSubError && {
|
|
@@ -9339,7 +9339,7 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
9339
9339
|
instance = getPalletInstance(pallet);
|
|
9340
9340
|
_context5.p = 4;
|
|
9341
9341
|
_context5.n = 5;
|
|
9342
|
-
return instance.getBalance(api, address, asset, customCurrencyId);
|
|
9342
|
+
return instance.getBalance(api, address, asset, customCurrencyId, this.chain);
|
|
9343
9343
|
case 5:
|
|
9344
9344
|
return _context5.a(2, _context5.v);
|
|
9345
9345
|
case 6:
|
|
@@ -11726,6 +11726,11 @@ var EnergyWebX = /*#__PURE__*/function (_Parachain) {
|
|
|
11726
11726
|
value: function transferRelayToPara() {
|
|
11727
11727
|
throw new ChainNotSupportedError();
|
|
11728
11728
|
}
|
|
11729
|
+
}, {
|
|
11730
|
+
key: "getBalanceForeign",
|
|
11731
|
+
value: function getBalanceForeign(api, address, asset) {
|
|
11732
|
+
return getPalletInstance('Assets').getBalance(api, address, asset, this.chain);
|
|
11733
|
+
}
|
|
11729
11734
|
}]);
|
|
11730
11735
|
}(Parachain);
|
|
11731
11736
|
|
|
@@ -13576,21 +13581,22 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
13576
13581
|
}, {
|
|
13577
13582
|
key: "getBalance",
|
|
13578
13583
|
value: function () {
|
|
13579
|
-
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset) {
|
|
13584
|
+
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset, chain) {
|
|
13580
13585
|
var _this = this,
|
|
13581
13586
|
_balance$balance,
|
|
13582
13587
|
_balance2;
|
|
13583
|
-
var fetchBalance, balance, _t;
|
|
13588
|
+
var isEnergyWebX, fetchBalance, balance, _t;
|
|
13584
13589
|
return _regenerator().w(function (_context) {
|
|
13585
13590
|
while (1) switch (_context.p = _context.n) {
|
|
13586
13591
|
case 0:
|
|
13587
13592
|
assertHasId(asset);
|
|
13593
|
+
isEnergyWebX = chain === 'EnergyWebX';
|
|
13588
13594
|
fetchBalance = function fetchBalance() {
|
|
13589
13595
|
var useBigInt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
13590
13596
|
return api.queryState({
|
|
13591
13597
|
module: _this.palletName,
|
|
13592
13598
|
method: 'Account',
|
|
13593
|
-
params: [useBigInt ? BigInt(asset.assetId) : Number(asset.assetId), address]
|
|
13599
|
+
params: [isEnergyWebX ? asset.location : useBigInt ? BigInt(asset.assetId) : Number(asset.assetId), address]
|
|
13594
13600
|
});
|
|
13595
13601
|
}; // Try with number ID first, if it fails, try with bigint ID
|
|
13596
13602
|
_context.p = 1;
|
|
@@ -13620,7 +13626,7 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
13620
13626
|
}
|
|
13621
13627
|
}, _callee, null, [[1, 3]]);
|
|
13622
13628
|
}));
|
|
13623
|
-
function getBalance(_x, _x2, _x3) {
|
|
13629
|
+
function getBalance(_x, _x2, _x3, _x4) {
|
|
13624
13630
|
return _getBalance.apply(this, arguments);
|
|
13625
13631
|
}
|
|
13626
13632
|
return getBalance;
|
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
|
/**
|
|
@@ -1878,6 +1878,7 @@ declare class EnergyWebX<TApi, TRes> extends Parachain<TApi, TRes> implements IP
|
|
|
1878
1878
|
constructor(chain?: TParachain, info?: string, ecosystem?: TRelaychain, version?: Version);
|
|
1879
1879
|
transferPolkadotXCM<TApi, TRes>(input: TPolkadotXCMTransferOptions<TApi, TRes>): Promise<TRes>;
|
|
1880
1880
|
transferRelayToPara(): Promise<TSerializedExtrinsics>;
|
|
1881
|
+
getBalanceForeign<TApi, TRes>(api: IPolkadotApi<TApi, TRes>, address: string, asset: TAssetInfo): Promise<bigint>;
|
|
1881
1882
|
}
|
|
1882
1883
|
|
|
1883
1884
|
declare class EnergyWebXPaseo<TApi, TRes> extends EnergyWebX<TApi, TRes> {
|
package/dist/index.mjs
CHANGED
|
@@ -6801,8 +6801,8 @@ var getXcmFeeOnce = /*#__PURE__*/function () {
|
|
|
6801
6801
|
feeType: originFeeType
|
|
6802
6802
|
}), {}, {
|
|
6803
6803
|
sufficient: sufficientOriginFee,
|
|
6804
|
-
currency: originAsset.symbol,
|
|
6805
|
-
asset: originAsset
|
|
6804
|
+
currency: originFeeType === 'paymentInfo' ? getNativeAssetSymbol(origin) : originAsset.symbol,
|
|
6805
|
+
asset: originFeeType === 'paymentInfo' ? findNativeAssetInfoOrThrow(origin) : originAsset
|
|
6806
6806
|
}, originDryRunError && {
|
|
6807
6807
|
dryRunError: originDryRunError
|
|
6808
6808
|
}), originDryRunSubError && {
|
|
@@ -9340,7 +9340,7 @@ var Parachain = /*#__PURE__*/function () {
|
|
|
9340
9340
|
instance = getPalletInstance(pallet);
|
|
9341
9341
|
_context5.p = 4;
|
|
9342
9342
|
_context5.n = 5;
|
|
9343
|
-
return instance.getBalance(api, address, asset, customCurrencyId);
|
|
9343
|
+
return instance.getBalance(api, address, asset, customCurrencyId, this.chain);
|
|
9344
9344
|
case 5:
|
|
9345
9345
|
return _context5.a(2, _context5.v);
|
|
9346
9346
|
case 6:
|
|
@@ -11727,6 +11727,11 @@ var EnergyWebX = /*#__PURE__*/function (_Parachain) {
|
|
|
11727
11727
|
value: function transferRelayToPara() {
|
|
11728
11728
|
throw new ChainNotSupportedError();
|
|
11729
11729
|
}
|
|
11730
|
+
}, {
|
|
11731
|
+
key: "getBalanceForeign",
|
|
11732
|
+
value: function getBalanceForeign(api, address, asset) {
|
|
11733
|
+
return getPalletInstance('Assets').getBalance(api, address, asset, this.chain);
|
|
11734
|
+
}
|
|
11730
11735
|
}]);
|
|
11731
11736
|
}(Parachain);
|
|
11732
11737
|
|
|
@@ -13577,21 +13582,22 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
13577
13582
|
}, {
|
|
13578
13583
|
key: "getBalance",
|
|
13579
13584
|
value: function () {
|
|
13580
|
-
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset) {
|
|
13585
|
+
var _getBalance = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(api, address, asset, chain) {
|
|
13581
13586
|
var _this = this,
|
|
13582
13587
|
_balance$balance,
|
|
13583
13588
|
_balance2;
|
|
13584
|
-
var fetchBalance, balance, _t;
|
|
13589
|
+
var isEnergyWebX, fetchBalance, balance, _t;
|
|
13585
13590
|
return _regenerator().w(function (_context) {
|
|
13586
13591
|
while (1) switch (_context.p = _context.n) {
|
|
13587
13592
|
case 0:
|
|
13588
13593
|
assertHasId(asset);
|
|
13594
|
+
isEnergyWebX = chain === 'EnergyWebX';
|
|
13589
13595
|
fetchBalance = function fetchBalance() {
|
|
13590
13596
|
var useBigInt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
13591
13597
|
return api.queryState({
|
|
13592
13598
|
module: _this.palletName,
|
|
13593
13599
|
method: 'Account',
|
|
13594
|
-
params: [useBigInt ? BigInt(asset.assetId) : Number(asset.assetId), address]
|
|
13600
|
+
params: [isEnergyWebX ? asset.location : useBigInt ? BigInt(asset.assetId) : Number(asset.assetId), address]
|
|
13595
13601
|
});
|
|
13596
13602
|
}; // Try with number ID first, if it fails, try with bigint ID
|
|
13597
13603
|
_context.p = 1;
|
|
@@ -13621,7 +13627,7 @@ var AssetsPallet = /*#__PURE__*/function (_BaseAssetsPallet) {
|
|
|
13621
13627
|
}
|
|
13622
13628
|
}, _callee, null, [[1, 3]]);
|
|
13623
13629
|
}));
|
|
13624
|
-
function getBalance(_x, _x2, _x3) {
|
|
13630
|
+
function getBalance(_x, _x2, _x3, _x4) {
|
|
13625
13631
|
return _getBalance.apply(this, arguments);
|
|
13626
13632
|
}
|
|
13627
13633
|
return getBalance;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "11.14.
|
|
3
|
+
"version": "11.14.11",
|
|
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": "^1.8.0",
|
|
27
27
|
"@scure/base": "^2.0.0",
|
|
28
28
|
"viem": "^2.40.3",
|
|
29
|
-
"@paraspell/
|
|
30
|
-
"@paraspell/
|
|
31
|
-
"@paraspell/sdk-common": "11.14.
|
|
29
|
+
"@paraspell/pallets": "11.14.11",
|
|
30
|
+
"@paraspell/assets": "11.14.11",
|
|
31
|
+
"@paraspell/sdk-common": "11.14.11"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|