@levrbet/shared 0.1.124 → 0.1.125

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.
@@ -8,18 +8,16 @@ const lodash_1 = __importDefault(require("lodash"));
8
8
  const core_1 = require("../../../core");
9
9
  const injectedDependencies_1 = require("../../injectedDependencies");
10
10
  const useContracts = (params) => {
11
- const { useQuery, useAccount, useChainId, useWalletClient, levrEnv } = (0, injectedDependencies_1.getDependencies)();
11
+ const { useQuery, useAccount, useChainId, useConnectorClient, levrEnv } = (0, injectedDependencies_1.getDependencies)();
12
12
  const { chainId: _chainId } = params ?? {};
13
13
  const { address } = useAccount?.() ?? { address: null };
14
14
  const chainId = useChainId?.() ?? _chainId;
15
- const { data: walletClient } = useWalletClient?.() ?? { data: undefined };
15
+ const { data: walletClient } = useConnectorClient?.() ?? { data: undefined };
16
16
  return useQuery({
17
17
  queryKey: ["contracts", address, chainId, walletClient?.account?.address],
18
18
  queryFn: async () => {
19
19
  if (!chainId)
20
20
  throw new Error("No chainId");
21
- if (walletClient?.account?.address !== address)
22
- throw new Error("Wallet client address does not match account address");
23
21
  const contractArgs = [chainId, levrEnv, { walletClient }];
24
22
  return {
25
23
  levrManager: (0, core_1.getLevrContract)("levrManager", ...contractArgs),
@@ -1 +1 @@
1
- {"version":3,"file":"useContracts.js","sourceRoot":"","sources":["../../../../src/react/hooks/contracts/useContracts.ts"],"names":[],"mappings":";;;;;;AACA,oDAAsB;AACtB,wCAA+C;AAC/C,qEAA4D;AAWrD,MAAM,YAAY,GAAG,CAAC,MAA0B,EAA6C,EAAE;IAClG,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,IAAA,sCAAe,GAAE,CAAA;IACxF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,EAAE,CAAA;IAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,EA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,sBAAe,EAAC,eAAe,EAAE,GAAG,YAAY,CAAC;gBAChE,eAAe,EAAE,IAAA,sBAAe,EAAC,iBAAiB,EAAE,GAAG,YAAY,CAAC;aACvE,CAAA;QACL,CAAC;QACD,OAAO,EAAE,CAAC,gBAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QAC1B,SAAS,EAAE,QAAQ;QACnB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,IAAI;KACrB,CAAC,CAAA;AACN,CAAC,CAAA;AA5BY,QAAA,YAAY,gBA4BxB"}
@@ -20,7 +20,7 @@
20
20
  */
21
21
  import { useIdentityToken, usePrivy, useUser } from "@privy-io/react-auth";
22
22
  import type { useQuery } from "@tanstack/react-query";
23
- import { WalletClient } from "viem";
23
+ import type { WalletClient } from "viem";
24
24
  import { LevrChain, LevrEnv } from "../core";
25
25
  export interface InjectedDependencies {
26
26
  usePrivy: typeof usePrivy;
@@ -31,7 +31,7 @@ export interface InjectedDependencies {
31
31
  address?: string | null;
32
32
  };
33
33
  useChainId?: () => LevrChain | undefined;
34
- useWalletClient?: () => {
34
+ useConnectorClient?: () => {
35
35
  data?: WalletClient;
36
36
  };
37
37
  levrEnv: LevrEnv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levrbet/shared",
3
- "version": "0.1.124",
3
+ "version": "0.1.125",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {