@levrbet/shared 0.1.80 → 0.1.82

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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,yCAAsB;AAEtB,wEAAwE;AACxE,+CAA+C;AAC/C,8CAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,yCAAsB;AAEtB,wEAAwE;AAExE,+CAA+C;AAC/C,8CAA8C"}
@@ -1,4 +1,4 @@
1
- import { PrivyInterface } from "@privy-io/react-auth";
1
+ import { Address } from "viem";
2
2
  /**
3
3
  * A React Query hook that provides authentication headers for API requests.
4
4
  *
@@ -14,15 +14,14 @@ import { PrivyInterface } from "@privy-io/react-auth";
14
14
  * const {data: authHeaders = {}} = useAuthHeaders()
15
15
  * ```
16
16
  */
17
- export declare const useAuthHeaders: (params?: {
18
- address?: string;
19
- privy: PrivyInterface;
17
+ export declare const useAuthHeaders: ({ address }: {
18
+ address: Address;
20
19
  }) => import("@tanstack/react-query").UseQueryResult<{
21
20
  "x-eth-address"?: undefined;
22
21
  "privy-access-token"?: undefined;
23
22
  "privy-id-token"?: undefined;
24
23
  } | {
25
- "x-eth-address": string | undefined;
24
+ "x-eth-address": `0x${string}`;
26
25
  "privy-access-token": string | null;
27
26
  "privy-id-token": string | null;
28
27
  }, Error>;
@@ -25,11 +25,14 @@ const queryClient_1 = require("../../queryClient");
25
25
  * const {data: authHeaders = {}} = useAuthHeaders()
26
26
  * ```
27
27
  */
28
- const useAuthHeaders = (params) => {
29
- const { address, privy } = params ?? {};
30
- const { user, getAccessToken } = privy ?? (0, react_auth_1.usePrivy)();
28
+ const useAuthHeaders = ({ address }) => {
29
+ const { getAccessToken, user } = (0, react_auth_1.usePrivy)();
31
30
  const { identityToken } = (0, react_auth_1.useIdentityToken)();
32
31
  const { refreshUser } = (0, react_auth_1.useUser)();
32
+ // Debug logging
33
+ console.log('[useAuthHeaders] user:', user);
34
+ console.log('[useAuthHeaders] user?.id:', user?.id);
35
+ console.log('[useAuthHeaders] identityToken:', identityToken);
33
36
  return (0, react_query_1.useQuery)({
34
37
  queryKey: ["authHeaders", user?.id, address].filter((k) => !lodash_1.default.isNil(k)),
35
38
  queryFn: async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthHeaders.js","sourceRoot":"","sources":["../../../../src/react/hooks/auth/useAuthHeaders.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA0F;AAC1F,uDAAgD;AAChD,oDAAsB;AACtB,4CAAmB;AACnB,6DAAoH;AACpH,mDAA+C;AAE/C;;;;;;;;;;;;;;GAcG;AACI,MAAM,cAAc,GAAG,CAAC,MAAoD,EAAE,EAAE;IACnF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAA;IACvC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,KAAK,IAAI,IAAA,qBAAQ,GAAE,CAAA;IACpD,MAAM,EAAE,aAAa,EAAE,GAAG,IAAA,6BAAgB,GAAE,CAAA;IAC5C,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,oBAAO,GAAE,CAAA;IAEjC,OAAO,IAAA,sBAAQ,EACX;QACI,QAAQ,EAAE,CAAC,aAAa,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,OAAO,EAAE,KAAK,IAAI,EAAE;YAChB,IAAI,CAAC,IAAI;gBAAE,OAAO,EAAE,CAAA;YACpB,MAAM,WAAW,EAAE,CAAA;YAEnB,OAAO;gBACH,CAAC,8BAAkB,C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CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,OAAO,EAAE,KAAK,IAAI,EAAE;YAChB,IAAI,CAAC,IAAI;gBAAE,OAAO,EAAE,CAAA;YACpB,MAAM,WAAW,EAAE,CAAA;YAEnB,OAAO;gBACH,CAAC,8BAAkB,CAAC,EAAE,OAAO;gBAC7B,CAAC,qCAAyB,CAAC,EAAE,MAAM,cAAc,EAAE;gBACnD,CAAC,iCAAqB,CAAC,EAAE,aAAa;aACzC,CAAA;QACL,CAAC;QACD,OAAO,EAAE,CAAC,gBAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,eAAe,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;QAC1B,SAAS,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;QACpB,MAAM,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;QACjB,YAAY,EAAE,IAAI;KACrB,EACD,yBAAW,CACd,CAAA;AACL,CAAC,CAAA;AA/BY,QAAA,cAAc,kBA+B1B"}
package/package.json CHANGED
@@ -1,28 +1,24 @@
1
1
  {
2
2
  "name": "@levrbet/shared",
3
- "version": "0.1.80",
3
+ "version": "0.1.82",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
7
7
  ".": {
8
- "require": "./dist/index.js",
9
- "import": "./dist/index.js",
10
- "types": "./dist/index.d.ts"
8
+ "types": "./dist/index.d.ts",
9
+ "require": "./dist/index.js"
11
10
  },
12
11
  "./core": {
13
- "require": "./dist/core/index.js",
14
- "import": "./dist/core/index.js",
15
- "types": "./dist/core/index.d.ts"
12
+ "types": "./dist/core/index.d.ts",
13
+ "require": "./dist/core/index.js"
16
14
  },
17
15
  "./server": {
18
- "require": "./dist/server/index.js",
19
- "import": "./dist/server/index.js",
20
- "types": "./dist/server/index.d.ts"
16
+ "types": "./dist/server/index.d.ts",
17
+ "require": "./dist/server/index.js"
21
18
  },
22
19
  "./react": {
23
- "require": "./dist/react/index.js",
24
- "import": "./dist/react/index.js",
25
- "types": "./dist/react/index.d.ts"
20
+ "types": "./dist/react/index.d.ts",
21
+ "require": "./dist/react/index.js"
26
22
  }
27
23
  },
28
24
  "files": [
@@ -31,22 +27,26 @@
31
27
  "sideEffects": false,
32
28
  "scripts": {
33
29
  "build": "npm run clean && npx prisma generate && npx tsc && npm run copy-assets",
34
- "build:tsc": "npx tsc",
30
+ "build:tsc": "npx tsc --noEmit",
35
31
  "watch": "npx tsc --watch",
36
- "dev": "npm link @levrbet/shared && npm run build && npm run watch",
32
+ "dev": "npm run build && npm run pack",
37
33
  "copy-assets": "mkdir -p dist/core/prisma/generated && cp -r src/core/prisma/generated/* dist/core/prisma/generated/ 2>/dev/null || true",
38
34
  "clean": "rm -rf dist",
39
35
  "prepublishOnly": "npm run build"
40
36
  },
41
37
  "peerDependencies": {
42
- "@privy-io/react-auth": ">=3",
43
- "@tanstack/react-query": ">=5",
44
- "react": ">=18"
38
+ "@privy-io/react-auth": ">=3.0.0",
39
+ "@tanstack/react-query": ">=5.0.0",
40
+ "@types/react": ">=18.0.0",
41
+ "react": ">=18.0.0"
45
42
  },
46
43
  "peerDependenciesMeta": {
47
44
  "react": {
48
45
  "optional": true
49
46
  },
47
+ "@types/react": {
48
+ "optional": true
49
+ },
50
50
  "@tanstack/react-query": {
51
51
  "optional": true
52
52
  },
@@ -54,6 +54,20 @@
54
54
  "optional": true
55
55
  }
56
56
  },
57
+ "devDependencies": {
58
+ "@privy-io/react-auth": ">=3.0.0",
59
+ "@tanstack/react-query": ">=5.0.0",
60
+ "@types/react": ">=18.0.0",
61
+ "react": ">=18.0.0",
62
+ "@types/express": "^5.0.3",
63
+ "@types/lodash": "^4.17.20",
64
+ "@types/ms": "^2.1.0",
65
+ "@types/node": "24.9.1",
66
+ "@types/object-hash": "^3.0.6",
67
+ "cross-fetch": "^4.1.0",
68
+ "prisma": "^6.17.1",
69
+ "typescript": "^5.9.3"
70
+ },
57
71
  "dependencies": {
58
72
  "@aws-sdk/client-kms": "^3.913.0",
59
73
  "@aws-sdk/client-sts": "^3.913.0",
@@ -89,20 +103,6 @@
89
103
  "winston": "3.18.3",
90
104
  "zod": "^4.1.12"
91
105
  },
92
- "devDependencies": {
93
- "@privy-io/react-auth": "^3.3.0",
94
- "@tanstack/react-query": "^5.90.5",
95
- "@types/express": "^5.0.3",
96
- "@types/lodash": "^4.17.20",
97
- "@types/ms": "^2.1.0",
98
- "@types/node": "24.9.1",
99
- "@types/object-hash": "^3.0.6",
100
- "@types/react": "19.2.2",
101
- "cross-fetch": "^4.1.0",
102
- "prisma": "^6.17.1",
103
- "react": "^19.2.0",
104
- "typescript": "^5.9.3"
105
- },
106
106
  "publishConfig": {
107
107
  "access": "public"
108
108
  }