@pear-protocol/symmio-client 0.3.27-alpha.1 → 0.3.28

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.
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { createContext, useContext, useMemo, useCallback, useState, useEffect, useRef } from 'react';
3
- import { createSymmSDK, TpslStatus, isAuthExpiredError, isNetworkError, isInsufficientMarginError, isRateLimitedError, isTimeoutError } from '@pear-protocol/symm-core';
3
+ import { createSymmSDK, TpslStatus, HedgerClient, isAuthExpiredError, isNetworkError, isInsufficientMarginError, isRateLimitedError, isTimeoutError } from '@pear-protocol/symm-core';
4
4
  import { create } from 'zustand';
5
5
  import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -27621,18 +27621,14 @@ function useSymmHedgerMarketBySymbol(params) {
27621
27621
  });
27622
27622
  }
27623
27623
  function useSymmLockedParams(params) {
27624
- const { symmCoreClient, chainId: ctxChainId } = useSymmContext();
27624
+ const { chainId: ctxChainId } = useSymmContext();
27625
27625
  const { marketName, leverage } = params;
27626
27626
  const chainId = params.chainId ?? ctxChainId;
27627
- const internalEnabled = !!symmCoreClient && !!marketName && leverage != null;
27627
+ const internalEnabled = !!marketName && leverage != null && typeof chainId === "number";
27628
27628
  return useQuery({
27629
27629
  ...params.query,
27630
27630
  queryKey: symmKeys.lockedParams(marketName, leverage, chainId),
27631
- queryFn: () => symmCoreClient.markets.getLockedParams({
27632
- marketName,
27633
- leverage,
27634
- chainId
27635
- }),
27631
+ queryFn: () => HedgerClient.getLockedParams(chainId, marketName, leverage),
27636
27632
  enabled: internalEnabled && (params.query?.enabled ?? true)
27637
27633
  });
27638
27634
  }