@paraspell/sdk 10.11.0 → 10.11.2

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 CHANGED
@@ -1200,7 +1200,7 @@ var PapiApi = /*#__PURE__*/function () {
1200
1200
  key: "getBalanceForeignXTokens",
1201
1201
  value: function () {
1202
1202
  var _getBalanceForeignXTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(node, address, asset) {
1203
- var pallet, response, entry;
1203
+ var pallet, currencyId, _response, response, entry;
1204
1204
  return _regenerator().w(function (_context14) {
1205
1205
  while (1) switch (_context14.n) {
1206
1206
  case 0:
@@ -1208,9 +1208,20 @@ var PapiApi = /*#__PURE__*/function () {
1208
1208
  if (node === 'Centrifuge' || node === 'Altair') {
1209
1209
  pallet = 'OrmlTokens';
1210
1210
  }
1211
+ if (!(node === 'Hydration' && (asset.symbol === 'aUSDT' || asset.symbol === 'aUSDC' || asset.symbol === 'aDOT' || asset.symbol === 'atBTC' || asset.symbol === 'avDOT' || asset.symbol === 'aETH' || asset.symbol === 'aWBTC'))) {
1212
+ _context14.n = 2;
1213
+ break;
1214
+ }
1215
+ currencyId = asset.symbol === 'aUSDT' ? 1002 : asset.symbol === 'aUSDC' ? 1003 : asset.symbol === 'aDOT' ? 1001 : asset.symbol === 'atBTC' ? 1006 : asset.symbol === 'avDOT' ? 1005 : asset.symbol === 'aETH' ? 1007 : 1004;
1211
1216
  _context14.n = 1;
1212
- return this.api.getUnsafeApi().query[pallet].Accounts.getEntries(address);
1217
+ return this.api.getUnsafeApi().apis.CurrenciesApi.account(currencyId, address);
1213
1218
  case 1:
1219
+ _response = _context14.v;
1220
+ return _context14.a(2, _response ? BigInt(_response.free.toString()) : 0n);
1221
+ case 2:
1222
+ _context14.n = 3;
1223
+ return this.api.getUnsafeApi().query[pallet].Accounts.getEntries(address);
1224
+ case 3:
1214
1225
  response = _context14.v;
1215
1226
  entry = response.find(function (_ref5) {
1216
1227
  var _asset$symbol, _asset$assetId, _asset$symbol2, _asset$assetId2;
package/dist/index.mjs CHANGED
@@ -1199,7 +1199,7 @@ var PapiApi = /*#__PURE__*/function () {
1199
1199
  key: "getBalanceForeignXTokens",
1200
1200
  value: function () {
1201
1201
  var _getBalanceForeignXTokens = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(node, address, asset) {
1202
- var pallet, response, entry;
1202
+ var pallet, currencyId, _response, response, entry;
1203
1203
  return _regenerator().w(function (_context14) {
1204
1204
  while (1) switch (_context14.n) {
1205
1205
  case 0:
@@ -1207,9 +1207,20 @@ var PapiApi = /*#__PURE__*/function () {
1207
1207
  if (node === 'Centrifuge' || node === 'Altair') {
1208
1208
  pallet = 'OrmlTokens';
1209
1209
  }
1210
+ if (!(node === 'Hydration' && (asset.symbol === 'aUSDT' || asset.symbol === 'aUSDC' || asset.symbol === 'aDOT' || asset.symbol === 'atBTC' || asset.symbol === 'avDOT' || asset.symbol === 'aETH' || asset.symbol === 'aWBTC'))) {
1211
+ _context14.n = 2;
1212
+ break;
1213
+ }
1214
+ currencyId = asset.symbol === 'aUSDT' ? 1002 : asset.symbol === 'aUSDC' ? 1003 : asset.symbol === 'aDOT' ? 1001 : asset.symbol === 'atBTC' ? 1006 : asset.symbol === 'avDOT' ? 1005 : asset.symbol === 'aETH' ? 1007 : 1004;
1210
1215
  _context14.n = 1;
1211
- return this.api.getUnsafeApi().query[pallet].Accounts.getEntries(address);
1216
+ return this.api.getUnsafeApi().apis.CurrenciesApi.account(currencyId, address);
1212
1217
  case 1:
1218
+ _response = _context14.v;
1219
+ return _context14.a(2, _response ? BigInt(_response.free.toString()) : 0n);
1220
+ case 2:
1221
+ _context14.n = 3;
1222
+ return this.api.getUnsafeApi().query[pallet].Accounts.getEntries(address);
1223
+ case 3:
1213
1224
  response = _context14.v;
1214
1225
  entry = response.find(function (_ref5) {
1215
1226
  var _asset$symbol, _asset$assetId, _asset$symbol2, _asset$assetId2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraspell/sdk",
3
- "version": "10.11.0",
3
+ "version": "10.11.2",
4
4
  "description": "SDK for ParaSpell XCM/XCMP tool for developers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@noble/hashes": "^1.8.0",
27
27
  "viem": "^2.33.2",
28
- "@paraspell/sdk-core": "10.11.0"
28
+ "@paraspell/sdk-core": "10.11.2"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "polkadot-api": ">= 1.14.1 < 2"