@xchainjs/xchain-aggregator 2.2.1 → 2.2.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/lib/index.esm.js CHANGED
@@ -10445,6 +10445,8 @@ class MidgardQuery {
10445
10445
  'TRON.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7': 6,
10446
10446
  // XRP
10447
10447
  'XRP.XRP': 6,
10448
+ // Solana
10449
+ 'SOL.SOL': 9,
10448
10450
  };
10449
10451
  // Return specific fallback or use chain-based defaults
10450
10452
  if (fallbackDecimalMap[assetString]) {
@@ -10464,6 +10466,7 @@ class MidgardQuery {
10464
10466
  BASE: 18,
10465
10467
  TRON: 6,
10466
10468
  XRP: 6,
10469
+ SOL: 9,
10467
10470
  THOR: DEFAULT_THORCHAIN_DECIMALS,
10468
10471
  };
10469
10472
  const chainDefault = chainDefaults[asset.chain];
@@ -10531,7 +10534,12 @@ class MidgardQuery {
10531
10534
  return DEFAULT_THORCHAIN_DECIMALS;
10532
10535
  try {
10533
10536
  const pool = yield this.getPool(assetToString(asset));
10534
- return Number(pool.nativeDecimal);
10537
+ const decimals = Number(pool.nativeDecimal);
10538
+ if (decimals >= 0)
10539
+ return decimals;
10540
+ // Midgard returns -1 for chains where decimals are not yet configured
10541
+ console.warn(`Midgard returned -1 decimals for ${assetToString(asset)}, using fallback`);
10542
+ return this.getFallbackDecimals(asset);
10535
10543
  }
10536
10544
  catch (error) {
10537
10545
  // Fallback: if Midgard is down, use standard decimal values for common assets
package/lib/index.js CHANGED
@@ -10447,6 +10447,8 @@ class MidgardQuery {
10447
10447
  'TRON.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7': 6,
10448
10448
  // XRP
10449
10449
  'XRP.XRP': 6,
10450
+ // Solana
10451
+ 'SOL.SOL': 9,
10450
10452
  };
10451
10453
  // Return specific fallback or use chain-based defaults
10452
10454
  if (fallbackDecimalMap[assetString]) {
@@ -10466,6 +10468,7 @@ class MidgardQuery {
10466
10468
  BASE: 18,
10467
10469
  TRON: 6,
10468
10470
  XRP: 6,
10471
+ SOL: 9,
10469
10472
  THOR: DEFAULT_THORCHAIN_DECIMALS,
10470
10473
  };
10471
10474
  const chainDefault = chainDefaults[asset.chain];
@@ -10533,7 +10536,12 @@ class MidgardQuery {
10533
10536
  return DEFAULT_THORCHAIN_DECIMALS;
10534
10537
  try {
10535
10538
  const pool = yield this.getPool(xchainUtil.assetToString(asset));
10536
- return Number(pool.nativeDecimal);
10539
+ const decimals = Number(pool.nativeDecimal);
10540
+ if (decimals >= 0)
10541
+ return decimals;
10542
+ // Midgard returns -1 for chains where decimals are not yet configured
10543
+ console.warn(`Midgard returned -1 decimals for ${xchainUtil.assetToString(asset)}, using fallback`);
10544
+ return this.getFallbackDecimals(asset);
10537
10545
  }
10538
10546
  catch (error) {
10539
10547
  // Fallback: if Midgard is down, use standard decimal values for common assets
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-aggregator",
3
3
  "description": "Protocol aggregator to make actions in different protocols",
4
- "version": "2.2.1",
4
+ "version": "2.2.2",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
7
7
  "module": "lib/index.esm.js",
@@ -32,11 +32,11 @@
32
32
  "@chainflip/sdk": "2.0.3",
33
33
  "@xchainjs/xchain-client": "2.0.10",
34
34
  "@xchainjs/xchain-mayachain": "4.1.1",
35
- "@xchainjs/xchain-mayachain-amm": "4.1.12",
35
+ "@xchainjs/xchain-mayachain-amm": "4.1.13",
36
36
  "@xchainjs/xchain-mayachain-query": "2.1.7",
37
37
  "@xchainjs/xchain-thorchain": "3.0.14",
38
- "@xchainjs/xchain-thorchain-amm": "3.0.30",
39
- "@xchainjs/xchain-thorchain-query": "3.0.0",
38
+ "@xchainjs/xchain-thorchain-amm": "3.0.31",
39
+ "@xchainjs/xchain-thorchain-query": "3.0.1",
40
40
  "@xchainjs/xchain-util": "2.0.5",
41
41
  "@xchainjs/xchain-wallet": "2.0.23"
42
42
  },