@paraspell/sdk-core 8.13.0 → 8.13.1
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 +9 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +9 -6
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -8658,6 +8658,7 @@ var Builder = function Builder(api) {
|
|
|
8658
8658
|
|
|
8659
8659
|
var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
8660
8660
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, node, address, asset) {
|
|
8661
|
+
var ASSETS_PALLET_ID, hasRequiredJunctions;
|
|
8661
8662
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8662
8663
|
while (1) switch (_context.prev = _context.next) {
|
|
8663
8664
|
case 0:
|
|
@@ -8671,7 +8672,7 @@ var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
|
8671
8672
|
}
|
|
8672
8673
|
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
8673
8674
|
case 3:
|
|
8674
|
-
return _context.abrupt("return", api.
|
|
8675
|
+
return _context.abrupt("return", api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
|
|
8675
8676
|
case 4:
|
|
8676
8677
|
if (!(node === 'Mythos')) {
|
|
8677
8678
|
_context.next = 6;
|
|
@@ -8695,19 +8696,21 @@ var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
|
8695
8696
|
}
|
|
8696
8697
|
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multi-location"));
|
|
8697
8698
|
case 11:
|
|
8698
|
-
return _context.abrupt("return", api.
|
|
8699
|
+
return _context.abrupt("return", api.getBalanceForeignAssetsPallet(address, asset.multiLocation));
|
|
8699
8700
|
case 12:
|
|
8700
8701
|
if (!(node === 'AssetHubPolkadot')) {
|
|
8701
8702
|
_context.next = 18;
|
|
8702
8703
|
break;
|
|
8703
8704
|
}
|
|
8704
|
-
|
|
8705
|
+
ASSETS_PALLET_ID = 50;
|
|
8706
|
+
hasRequiredJunctions = asset.multiLocation && sdkCommon.hasJunction(asset.multiLocation, 'PalletInstance', ASSETS_PALLET_ID) && sdkCommon.hasJunction(asset.multiLocation, 'GeneralIndex');
|
|
8707
|
+
if (!(!asset.multiLocation || hasRequiredJunctions)) {
|
|
8705
8708
|
_context.next = 17;
|
|
8706
8709
|
break;
|
|
8707
8710
|
}
|
|
8708
|
-
return _context.abrupt("return", api.
|
|
8711
|
+
return _context.abrupt("return", api.getBalanceAssetsPallet(address, Number(asset.assetId)));
|
|
8709
8712
|
case 17:
|
|
8710
|
-
return _context.abrupt("return", api.
|
|
8713
|
+
return _context.abrupt("return", api.getBalanceForeignAssetsPallet(address, asset.multiLocation));
|
|
8711
8714
|
case 18:
|
|
8712
8715
|
return _context.abrupt("return", api.getBalanceForeignPolkadotXcm(address, asset.assetId));
|
|
8713
8716
|
case 19:
|
|
@@ -8736,7 +8739,7 @@ var getBalanceForeignXTokens = /*#__PURE__*/function () {
|
|
|
8736
8739
|
}
|
|
8737
8740
|
throw new assets.InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
8738
8741
|
case 3:
|
|
8739
|
-
return _context.abrupt("return", api.
|
|
8742
|
+
return _context.abrupt("return", api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
|
|
8740
8743
|
case 4:
|
|
8741
8744
|
if (!(node === 'BifrostPolkadot' || node === 'BifrostKusama')) {
|
|
8742
8745
|
_context.next = 6;
|
package/dist/index.d.ts
CHANGED
|
@@ -740,11 +740,11 @@ interface IPolkadotApi<TApi, TRes> {
|
|
|
740
740
|
getBalanceNativeAcala(address: string, symbol: string): Promise<bigint>;
|
|
741
741
|
getBalanceForeignPolkadotXcm(address: string, id?: string): Promise<bigint>;
|
|
742
742
|
getMythosForeignBalance(address: string): Promise<bigint>;
|
|
743
|
-
|
|
743
|
+
getBalanceForeignAssetsPallet(address: string, multiLocation: TMultiLocation): Promise<bigint>;
|
|
744
744
|
getForeignAssetsByIdBalance(address: string, assetId: string): Promise<bigint>;
|
|
745
745
|
getBalanceForeignXTokens(node: TNodePolkadotKusama, address: string, asset: TAsset): Promise<bigint>;
|
|
746
746
|
getBalanceForeignBifrost(address: string, asset: TAsset): Promise<bigint>;
|
|
747
|
-
|
|
747
|
+
getBalanceAssetsPallet(address: string, assetId: bigint | number): Promise<bigint>;
|
|
748
748
|
getFromRpc(module: string, method: string, key: string): Promise<string>;
|
|
749
749
|
blake2AsHex(data: Uint8Array): string;
|
|
750
750
|
clone(): IPolkadotApi<TApi, TRes>;
|
package/dist/index.mjs
CHANGED
|
@@ -8659,6 +8659,7 @@ var Builder = function Builder(api) {
|
|
|
8659
8659
|
|
|
8660
8660
|
var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
8661
8661
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(api, node, address, asset) {
|
|
8662
|
+
var ASSETS_PALLET_ID, hasRequiredJunctions;
|
|
8662
8663
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8663
8664
|
while (1) switch (_context.prev = _context.next) {
|
|
8664
8665
|
case 0:
|
|
@@ -8672,7 +8673,7 @@ var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
|
8672
8673
|
}
|
|
8673
8674
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
8674
8675
|
case 3:
|
|
8675
|
-
return _context.abrupt("return", api.
|
|
8676
|
+
return _context.abrupt("return", api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
|
|
8676
8677
|
case 4:
|
|
8677
8678
|
if (!(node === 'Mythos')) {
|
|
8678
8679
|
_context.next = 6;
|
|
@@ -8696,19 +8697,21 @@ var getBalanceForeignPolkadotXcm = /*#__PURE__*/function () {
|
|
|
8696
8697
|
}
|
|
8697
8698
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no multi-location"));
|
|
8698
8699
|
case 11:
|
|
8699
|
-
return _context.abrupt("return", api.
|
|
8700
|
+
return _context.abrupt("return", api.getBalanceForeignAssetsPallet(address, asset.multiLocation));
|
|
8700
8701
|
case 12:
|
|
8701
8702
|
if (!(node === 'AssetHubPolkadot')) {
|
|
8702
8703
|
_context.next = 18;
|
|
8703
8704
|
break;
|
|
8704
8705
|
}
|
|
8705
|
-
|
|
8706
|
+
ASSETS_PALLET_ID = 50;
|
|
8707
|
+
hasRequiredJunctions = asset.multiLocation && hasJunction(asset.multiLocation, 'PalletInstance', ASSETS_PALLET_ID) && hasJunction(asset.multiLocation, 'GeneralIndex');
|
|
8708
|
+
if (!(!asset.multiLocation || hasRequiredJunctions)) {
|
|
8706
8709
|
_context.next = 17;
|
|
8707
8710
|
break;
|
|
8708
8711
|
}
|
|
8709
|
-
return _context.abrupt("return", api.
|
|
8712
|
+
return _context.abrupt("return", api.getBalanceAssetsPallet(address, Number(asset.assetId)));
|
|
8710
8713
|
case 17:
|
|
8711
|
-
return _context.abrupt("return", api.
|
|
8714
|
+
return _context.abrupt("return", api.getBalanceForeignAssetsPallet(address, asset.multiLocation));
|
|
8712
8715
|
case 18:
|
|
8713
8716
|
return _context.abrupt("return", api.getBalanceForeignPolkadotXcm(address, asset.assetId));
|
|
8714
8717
|
case 19:
|
|
@@ -8737,7 +8740,7 @@ var getBalanceForeignXTokens = /*#__PURE__*/function () {
|
|
|
8737
8740
|
}
|
|
8738
8741
|
throw new InvalidCurrencyError("Asset ".concat(JSON.stringify(asset), " has no assetId"));
|
|
8739
8742
|
case 3:
|
|
8740
|
-
return _context.abrupt("return", api.
|
|
8743
|
+
return _context.abrupt("return", api.getBalanceAssetsPallet(address, BigInt(asset.assetId)));
|
|
8741
8744
|
case 4:
|
|
8742
8745
|
if (!(node === 'BifrostPolkadot' || node === 'BifrostKusama')) {
|
|
8743
8746
|
_context.next = 6;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paraspell/sdk-core",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.1",
|
|
4
4
|
"description": "SDK core for ParaSpell XCM/XCMP tool for developers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"ethers": "^6.13.7",
|
|
27
27
|
"viem": "^2.28.1",
|
|
28
|
-
"@paraspell/assets": "8.13.
|
|
29
|
-
"@paraspell/sdk-common": "8.13.
|
|
30
|
-
"@paraspell/pallets": "8.13.
|
|
28
|
+
"@paraspell/assets": "8.13.1",
|
|
29
|
+
"@paraspell/sdk-common": "8.13.1",
|
|
30
|
+
"@paraspell/pallets": "8.13.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/plugin-syntax-import-attributes": "^7.27.1",
|