@lit-protocol/vincent-app-sdk 2.0.1-mma → 2.0.2-mma
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/CHANGELOG.md +15 -0
- package/dist/CHANGELOG.md +15 -0
- package/dist/package.json +1 -1
- package/dist/src/react/jwtProvider.d.ts +29 -0
- package/dist/src/react/jwtProvider.d.ts.map +1 -1
- package/dist/src/react/jwtProvider.js +30 -1
- package/dist/src/react/jwtProvider.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 2.1.0 (2025-09-11)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Refactor the Uniswap Swap Ability to utilize a prepare step which uses a Lit Action to generate and sign a Uniswap route generated by the V3 Alpha Router. The Swap Ability now intakes the signed route, validates it was signed by the expected PKP (which can only be used to sign the generated Uniswap routes within the prepare Lit Action), then uses the provided route to create and sign the Uniswap Swap transaction with the Agent Wallet PKP. The Uniswap Swap Ability was also updated to no longer support the Spending Limit Policy, and currently doesn't support any Policies. ([8bbb1c07](https://github.com/LIT-Protocol/Vincent/commit/8bbb1c07))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated ability-sdk to 2.1.0
|
|
10
|
+
- Updated contracts-sdk to 1.2.0
|
|
11
|
+
|
|
12
|
+
### ❤️ Thank You
|
|
13
|
+
|
|
14
|
+
- Wyatt Barnes @spacesailor24
|
|
15
|
+
|
|
1
16
|
## 2.0.1 (2025-09-03)
|
|
2
17
|
|
|
3
18
|
### 🧱 Updated Dependencies
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 2.1.0 (2025-09-11)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Refactor the Uniswap Swap Ability to utilize a prepare step which uses a Lit Action to generate and sign a Uniswap route generated by the V3 Alpha Router. The Swap Ability now intakes the signed route, validates it was signed by the expected PKP (which can only be used to sign the generated Uniswap routes within the prepare Lit Action), then uses the provided route to create and sign the Uniswap Swap transaction with the Agent Wallet PKP. The Uniswap Swap Ability was also updated to no longer support the Spending Limit Policy, and currently doesn't support any Policies. ([8bbb1c07](https://github.com/LIT-Protocol/Vincent/commit/8bbb1c07))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated ability-sdk to 2.1.0
|
|
10
|
+
- Updated contracts-sdk to 1.2.0
|
|
11
|
+
|
|
12
|
+
### ❤️ Thank You
|
|
13
|
+
|
|
14
|
+
- Wyatt Barnes @spacesailor24
|
|
15
|
+
|
|
1
16
|
## 2.0.1 (2025-09-03)
|
|
2
17
|
|
|
3
18
|
### 🧱 Updated Dependencies
|
package/dist/package.json
CHANGED
|
@@ -21,6 +21,29 @@ interface JwtContextType {
|
|
|
21
21
|
loginWithJwt: () => void;
|
|
22
22
|
logOut: () => void;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* React Context that exposes JWT authentication state and actions for Vincent apps.
|
|
26
|
+
*
|
|
27
|
+
* This context carries a value of type `JwtContextType` with:
|
|
28
|
+
* - `authInfo`: `AuthInfo | null` — Authenticated user/application information or `null` when not authenticated.
|
|
29
|
+
* - `loading`: `boolean` — Indicates whether an authentication operation (login/logout/validation) is in progress.
|
|
30
|
+
* - `connect(redirectUri: string)`: Redirects the user to the Vincent consent page to initiate authentication.
|
|
31
|
+
* - `loginWithJwt()`: Attempts to retrieve and validate a JWT from Vincent dashboard.
|
|
32
|
+
* - `logOut()`: Removes the stored JWT and resets the authentication state.
|
|
33
|
+
*
|
|
34
|
+
* The provider component `JwtProvider` must wrap your component tree for this context to be available and for
|
|
35
|
+
* `useJwtContext` to work in your components.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <JwtProvider appId={123}>
|
|
40
|
+
* <App />
|
|
41
|
+
* </JwtProvider>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see JwtProvider
|
|
45
|
+
* @see useJwtContext
|
|
46
|
+
*/
|
|
24
47
|
export declare const JwtContext: React.Context<JwtContextType>;
|
|
25
48
|
/**
|
|
26
49
|
* React hook to access the JWT authentication context.
|
|
@@ -58,6 +81,9 @@ export declare const JwtContext: React.Context<JwtContextType>;
|
|
|
58
81
|
* ```
|
|
59
82
|
*
|
|
60
83
|
* @returns The JWT context containing authentication state and methods
|
|
84
|
+
*
|
|
85
|
+
* @see JwtContext
|
|
86
|
+
* @see JwtProvider
|
|
61
87
|
*/
|
|
62
88
|
export declare function useJwtContext(): JwtContextType;
|
|
63
89
|
/**
|
|
@@ -131,6 +157,9 @@ interface JwtProviderProps {
|
|
|
131
157
|
* @param props.appId - Your Vincent App Id
|
|
132
158
|
* @param props.storage - Optional custom storage implementation (defaults to localStorage)
|
|
133
159
|
* @param props.storageKeyBuilder - Optional function to customize the storage key for JWT tokens
|
|
160
|
+
*
|
|
161
|
+
* @see JwtContext
|
|
162
|
+
* @see useJwtContext
|
|
134
163
|
*/
|
|
135
164
|
export declare const JwtProvider: ({ children, appId, storage, storageKeyBuilder, }: JwtProviderProps) => JSX.Element;
|
|
136
165
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwtProvider.d.ts","sourceRoot":"","sources":["../../../src/react/jwtProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAA+E,MAAM,OAAO,CAAC;AAEpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAKrE;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,GA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;;;;;;;;;;GAuCG;AACH,wBAAgB,aAAa,IAAI,cAAc,CAE9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IACjE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACnD;AAED,UAAU,gBAAgB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,WAAW,GAAI,kDAKzB,gBAAgB,KAAG,GAAG,CAAC,OAoGzB,CAAC"}
|
|
@@ -9,6 +9,29 @@ const useVincentWebAuthClient_1 = require("./useVincentWebAuthClient");
|
|
|
9
9
|
function jwtContextNotInitialized() {
|
|
10
10
|
throw new Error('JwtContext must be used within an JwtProvider');
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* React Context that exposes JWT authentication state and actions for Vincent apps.
|
|
14
|
+
*
|
|
15
|
+
* This context carries a value of type `JwtContextType` with:
|
|
16
|
+
* - `authInfo`: `AuthInfo | null` — Authenticated user/application information or `null` when not authenticated.
|
|
17
|
+
* - `loading`: `boolean` — Indicates whether an authentication operation (login/logout/validation) is in progress.
|
|
18
|
+
* - `connect(redirectUri: string)`: Redirects the user to the Vincent consent page to initiate authentication.
|
|
19
|
+
* - `loginWithJwt()`: Attempts to retrieve and validate a JWT from Vincent dashboard.
|
|
20
|
+
* - `logOut()`: Removes the stored JWT and resets the authentication state.
|
|
21
|
+
*
|
|
22
|
+
* The provider component `JwtProvider` must wrap your component tree for this context to be available and for
|
|
23
|
+
* `useJwtContext` to work in your components.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <JwtProvider appId={123}>
|
|
28
|
+
* <App />
|
|
29
|
+
* </JwtProvider>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see JwtProvider
|
|
33
|
+
* @see useJwtContext
|
|
34
|
+
*/
|
|
12
35
|
exports.JwtContext = (0, react_1.createContext)({
|
|
13
36
|
authInfo: null,
|
|
14
37
|
loading: false,
|
|
@@ -52,6 +75,9 @@ exports.JwtContext = (0, react_1.createContext)({
|
|
|
52
75
|
* ```
|
|
53
76
|
*
|
|
54
77
|
* @returns The JWT context containing authentication state and methods
|
|
78
|
+
*
|
|
79
|
+
* @see JwtContext
|
|
80
|
+
* @see JwtProvider
|
|
55
81
|
*/
|
|
56
82
|
function useJwtContext() {
|
|
57
83
|
return (0, react_1.useContext)(exports.JwtContext);
|
|
@@ -110,6 +136,9 @@ function useJwtContext() {
|
|
|
110
136
|
* @param props.appId - Your Vincent App Id
|
|
111
137
|
* @param props.storage - Optional custom storage implementation (defaults to localStorage)
|
|
112
138
|
* @param props.storageKeyBuilder - Optional function to customize the storage key for JWT tokens
|
|
139
|
+
*
|
|
140
|
+
* @see JwtContext
|
|
141
|
+
* @see useJwtContext
|
|
113
142
|
*/
|
|
114
143
|
const JwtProvider = ({ children, appId, storage = localStorage, storageKeyBuilder = (appId) => `vincent-${appId}-jwt`, }) => {
|
|
115
144
|
const appJwtKey = storageKeyBuilder(appId);
|
|
@@ -170,7 +199,7 @@ const JwtProvider = ({ children, appId, storage = localStorage, storageKeyBuilde
|
|
|
170
199
|
app: decodedJWT.payload.app,
|
|
171
200
|
authentication: decodedJWT.payload.authentication,
|
|
172
201
|
jwt: jwtStr,
|
|
173
|
-
pkp: decodedJWT.payload.
|
|
202
|
+
pkp: decodedJWT.payload.pkpInfo,
|
|
174
203
|
});
|
|
175
204
|
}
|
|
176
205
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwtProvider.js","sourceRoot":"","sources":["../../../src/react/jwtProvider.tsx"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"jwtProvider.js","sourceRoot":"","sources":["../../../src/react/jwtProvider.tsx"],"names":[],"mappings":";;;AA2GA,sCAEC;;AA3GD,uDAAoG;AAMpG,gCAAiD;AACjD,uEAAoE;AAuBpE,SAAS,wBAAwB;IAC/B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,UAAU,GAAG,IAAA,qBAAa,EAAiB;IACtD,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,wBAAwB;IACjC,YAAY,EAAE,wBAAwB;IACtC,MAAM,EAAE,wBAAwB;CACjC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAgB,aAAa;IAC3B,OAAO,IAAA,kBAAU,EAAC,kBAAU,CAAC,CAAC;AAChC,CAAC;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACI,MAAM,WAAW,GAAG,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,OAAO,GAAG,YAAY,EACtB,iBAAiB,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,KAAK,MAAM,GACpC,EAAe,EAAE;IAClC,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,mBAAmB,GAAG,IAAA,iDAAuB,EAAC,KAAK,CAA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MAAM,MAAM,EAAE,CAAC;QACjB,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAErB,MAAM,KAAK,GAAG,IAAA,eAAO,EACnB,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ;QACR,OAAO;QACP,OAAO;QACP,YAAY;QACZ,MAAM;KACP,CAAC,EACF,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,CACnD,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,KAAK,YAAY,EAAE,CAAC;IACtB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,8BAAC,kBAAU,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAuB,CAAC;AAC7E,CAAC,CAAC;AAzGW,QAAA,WAAW,eAyGtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-protocol/vincent-app-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2-mma",
|
|
4
4
|
"description": "Vincent SDK for browser and backend",
|
|
5
5
|
"author": "Lit Protocol",
|
|
6
6
|
"license": "ISC",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"ethers": "5.8.0",
|
|
59
59
|
"tslib": "^2.8.1",
|
|
60
60
|
"zod": "3.25.64",
|
|
61
|
-
"@lit-protocol/vincent-ability-sdk": "2.0
|
|
62
|
-
"@lit-protocol/vincent-contracts-sdk": "1.
|
|
61
|
+
"@lit-protocol/vincent-ability-sdk": "2.1.0",
|
|
62
|
+
"@lit-protocol/vincent-contracts-sdk": "1.2.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"react": "^19.0.0"
|