@levrbet/shared 0.1.80 → 0.1.81
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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: (
|
|
18
|
-
address
|
|
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
|
|
24
|
+
"x-eth-address": `0x${string}`;
|
|
26
25
|
"privy-access-token": string | null;
|
|
27
26
|
"privy-id-token": string | null;
|
|
28
27
|
}, Error>;
|
|
@@ -25,9 +25,8 @@ const queryClient_1 = require("../../queryClient");
|
|
|
25
25
|
* const {data: authHeaders = {}} = useAuthHeaders()
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
const useAuthHeaders = (
|
|
29
|
-
const {
|
|
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)();
|
|
33
32
|
return (0, react_query_1.useQuery)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuthHeaders.js","sourceRoot":"","sources":["../../../../src/react/hooks/auth/useAuthHeaders.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"useAuthHeaders.js","sourceRoot":"","sources":["../../../../src/react/hooks/auth/useAuthHeaders.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA0E;AAC1E,uDAAgD;AAChD,oDAAsB;AACtB,4CAAmB;AAEnB,6DAAoH;AACpH,mDAA+C;AAE/C;;;;;;;;;;;;;;GAcG;AACI,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAwB,EAAE,EAAE;IAChE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,IAAA,qBAAQ,GAAE,CAAA;IAC3C,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,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;AA1BY,QAAA,cAAc,kBA0B1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levrbet/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.81",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build": "npm run clean && npx prisma generate && npx tsc && npm run copy-assets",
|
|
34
34
|
"build:tsc": "npx tsc",
|
|
35
35
|
"watch": "npx tsc --watch",
|
|
36
|
-
"dev": "npm
|
|
36
|
+
"dev": "npm run build && npm run pack",
|
|
37
37
|
"copy-assets": "mkdir -p dist/core/prisma/generated && cp -r src/core/prisma/generated/* dist/core/prisma/generated/ 2>/dev/null || true",
|
|
38
38
|
"clean": "rm -rf dist",
|
|
39
39
|
"prepublishOnly": "npm run build"
|
|
@@ -54,6 +54,17 @@
|
|
|
54
54
|
"optional": true
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/express": "^5.0.3",
|
|
59
|
+
"@types/lodash": "^4.17.20",
|
|
60
|
+
"@types/ms": "^2.1.0",
|
|
61
|
+
"@types/node": "24.9.1",
|
|
62
|
+
"@types/object-hash": "^3.0.6",
|
|
63
|
+
"@types/react": "19.2.2",
|
|
64
|
+
"cross-fetch": "^4.1.0",
|
|
65
|
+
"prisma": "^6.17.1",
|
|
66
|
+
"typescript": "^5.9.3"
|
|
67
|
+
},
|
|
57
68
|
"dependencies": {
|
|
58
69
|
"@aws-sdk/client-kms": "^3.913.0",
|
|
59
70
|
"@aws-sdk/client-sts": "^3.913.0",
|
|
@@ -89,20 +100,6 @@
|
|
|
89
100
|
"winston": "3.18.3",
|
|
90
101
|
"zod": "^4.1.12"
|
|
91
102
|
},
|
|
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
103
|
"publishConfig": {
|
|
107
104
|
"access": "public"
|
|
108
105
|
}
|