timelock-sdk 0.0.29 → 0.0.30

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/client.cjs CHANGED
@@ -151,16 +151,21 @@ const TimelockMarketProvider = ({ children, marketData, envioGraphqlUrl }) => {
151
151
  const chainId = (0, wagmi.useChainId)();
152
152
  const lensAddr = require_numberUtils.timelockLenses[chainId];
153
153
  const uniswapMathLensAddr = require_numberUtils.uniswapMathLenses[chainId];
154
+ const graphqlClient = (0, react.useMemo)(() => {
155
+ if (envioGraphqlUrl) return getSdk(new graphql_request.GraphQLClient(envioGraphqlUrl));
156
+ }, [envioGraphqlUrl]);
154
157
  const contextValue = (0, react.useMemo)(() => ({
155
158
  marketData: marketData || {},
156
159
  lensAddr,
157
160
  uniswapMathLensAddr,
158
- envioGraphqlUrl
161
+ envioGraphqlUrl,
162
+ graphqlClient
159
163
  }), [
160
164
  marketData,
161
165
  lensAddr,
162
166
  uniswapMathLensAddr,
163
- envioGraphqlUrl
167
+ envioGraphqlUrl,
168
+ graphqlClient
164
169
  ]);
165
170
  return /* @__PURE__ */ react.default.createElement(TimelockMarketContext.Provider, { value: contextValue }, children);
166
171
  };
@@ -172,15 +177,7 @@ const useCurrentMarket = () => {
172
177
  const useTimelockConfig = () => {
173
178
  const context = (0, react.useContext)(TimelockMarketContext);
174
179
  if (context === void 0) throw new Error("useConfig must be used within a TimelockMarketProvider");
175
- const graphqlClient = (0, react.useMemo)(() => {
176
- if (context.envioGraphqlUrl) return getSdk(new graphql_request.GraphQLClient(context.envioGraphqlUrl));
177
- }, [context.envioGraphqlUrl]);
178
- return {
179
- lensAddr: context.lensAddr,
180
- uniswapMathLensAddr: context.uniswapMathLensAddr,
181
- envioGraphqlUrl: context.envioGraphqlUrl,
182
- graphqlClient
183
- };
180
+ return context;
184
181
  };
185
182
 
186
183
  //#endregion