Skip to content

Commit 64a9fc7

Browse files
committed
feat: a bunch of fixes and merge conflicts resolution
1 parent 058cbfc commit 64a9fc7

File tree

8 files changed

+14
-53
lines changed

8 files changed

+14
-53
lines changed

local-tests/tests/testPkpEthersWithEoaSessionSigsToSignWithAuthContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const testPkpEthersWithEoaSessionSigsToSignWithAuthContext = async (
2424
pkpPubKey: alice.pkp.publicKey,
2525
litNodeClient: devEnv.litNodeClient,
2626
authContext: {
27-
client: devEnv.litNodeClient,
2827
getSessionSigsProps: {
2928
authNeededCallback: async function (
3029
params: AuthCallbackParams

packages/pkp-base/src/lib/pkp-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ export class PKPBase<T = PKPBaseDefaultParams> {
417417

418418
try {
419419
const sig = await this.litNodeClient.pkpSign({
420-
toSign: Array.from(toSign),
420+
toSign,
421421
pubKey: this.uncompressedPubKey,
422422
sessionSigs: controllerSessionSigs,
423423
});

packages/pkp-walletconnect/src/lib/pkp-walletconnect.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('PKPWalletConnect', () => {
4444
const toSign = await createSiweMessageWithRecaps({
4545
uri: params.uri!,
4646
expiration: params.expiration!,
47-
resources: [params.resourceAbilityRequests!],
47+
resources: params.resourceAbilityRequests!,
4848
walletAddress: wallet.address,
4949
nonce: await litNodeClient.getLatestBlockhash(),
5050
litNodeClient,

packages/schemas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"tags": [
2121
"universal"
2222
],
23-
"version": "6.7.0",
23+
"version": "7.0.0-alpha.8",
2424
"main": "./dist/src/index.js",
2525
"typings": "./dist/src/index.d.ts"
2626
}

packages/schemas/src/lib/ILitNodeClient.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
EncryptSdkParamsSchema,
1515
ExecuteJsResponseSchema,
1616
FormattedMultipleAccsSchema,
17-
GetSignedTokenRequestSchema,
1817
HandshakeWithNodeSchema,
1918
JsonExecutionSdkParamsSchema,
2019
JsonHandshakeResponseSchema,
@@ -205,19 +204,6 @@ export const ILitNodeClientSchema = z.object({
205204
.function()
206205
.args(JsonExecutionSdkParamsSchema)
207206
.returns(z.promise(z.union([ExecuteJsResponseSchema, z.undefined()]))),
208-
/**
209-
*
210-
* Request a signed JWT from the LIT network. Before calling this function, you must know the access control conditions for the item you wish to gain authorization for.
211-
*
212-
* @param { GetSignedTokenRequest } params
213-
*
214-
* @returns { Promise<string> } final JWT
215-
*
216-
*/
217-
getSignedToken: z
218-
.function()
219-
.args(GetSignedTokenRequestSchema)
220-
.returns(z.promise(z.union([z.string(), z.undefined()]))),
221207
/**
222208
* Encrypt data with Lit identity-based Timelock Encryption.
223209
*

packages/schemas/src/lib/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const AuthCallbackParamsSchema = LitActionSdkParamsSchema.extend({
8888
* Optional project ID for WalletConnect V2. Only required if one is using checkAndSignAuthMessage and wants to display WalletConnect as an option.
8989
*/
9090
walletConnectProjectId: z.string().optional(),
91-
resourceAbilityRequests: LitResourceAbilityRequestSchema.optional(),
91+
resourceAbilityRequests: z.array(LitResourceAbilityRequestSchema).optional(),
9292
});
9393

9494
export const LitNodeClientConfigSchema = z.object({

packages/schemas/src/lib/schemas.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ export const IProviderSchema = z.object({
2222

2323
export const ChainSchema = z.string();
2424

25-
export const VerifyJWTPropsSchema = z.object({
26-
publicKey: z.string(),
27-
// A JWT signed by the LIT network using the BLS12-381 algorithm
28-
jwt: z.string(),
29-
});
30-
31-
export const JWTHeaderSchema = z.object({
32-
alg: z.string(),
33-
typ: z.string(),
34-
});
35-
3625
export const SignatureSchema = z.object({
3726
r: z.string(),
3827
s: z.string(),
@@ -265,7 +254,7 @@ export const CreateCustomAuthMethodRequestSchema = z.object({
265254

266255
export const BaseJsonPkpSignRequestSchema = z.object({
267256
authMethods: z.array(AuthMethodSchema).optional(),
268-
toSign: z.array(z.number()),
257+
toSign: z.instanceof(Uint8Array),
269258
});
270259

271260
/**
@@ -281,6 +270,9 @@ export const JsonPkpSignSdkParamsSchema = BaseJsonPkpSignRequestSchema.extend({
281270
* The actual payload structure sent to the node /pkp/sign endpoint.
282271
*/
283272
export const JsonPkpSignRequestSchema = BaseJsonPkpSignRequestSchema.extend({
273+
// Nodes can sign number[], not Uint8Array. Must use normalizeArray function
274+
toSign: z.array(z.number()),
275+
284276
authSig: AuthSigSchema,
285277

286278
/**
@@ -768,11 +760,6 @@ export const SigningAccessControlConditionRequestSchema =
768760
exp: z.number().optional(),
769761
});
770762

771-
export const GetSignedTokenRequestSchema =
772-
SigningAccessControlConditionRequestSchema.extend({
773-
sessionSigs: SessionSigsMapSchema,
774-
});
775-
776763
export const EncryptSdkParamsSchema =
777764
MultipleAccessControlConditionsSchema.extend({
778765
dataToEncrypt: z.instanceof(Uint8Array),

packages/types/src/lib/interfaces.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Provider } from '@ethersproject/abstract-provider';
21
import depd from 'depd';
32
import { z } from 'zod';
43

@@ -26,7 +25,6 @@ import {
2625
SigResponseSchema,
2726
ExecuteJsResponseBaseSchema,
2827
ExecuteJsResponseSchema,
29-
GetSignedTokenRequestSchema,
3028
MultipleAccessControlConditionsSchema,
3129
EncryptSdkParamsSchema,
3230
DecryptResponseSchema,
@@ -58,8 +56,6 @@ import {
5856
SolanaAuthSigSchema,
5957
CosmosAuthSigSchema,
6058
IProviderSchema,
61-
VerifyJWTPropsSchema,
62-
JWTHeaderSchema,
6359
ClaimKeyResponseSchema,
6460
SignatureSchema,
6561
BaseJsonPkpSignRequestSchema,
@@ -163,17 +159,6 @@ export interface DecryptFileProps {
163159
symmetricKey: SymmetricKey;
164160
}
165161

166-
export type VerifyJWTProps = z.infer<typeof VerifyJWTPropsSchema>;
167-
168-
export interface IJWT<T> {
169-
verified: boolean;
170-
header: JWTHeader;
171-
payload: T;
172-
signature: Uint8Array;
173-
}
174-
175-
export type JWTHeader = z.infer<typeof JWTHeaderSchema>;
176-
177162
export type SigningAccessControlConditionJWTPayload = z.infer<
178163
typeof SigningAccessControlConditionJWTPayloadSchema
179164
>;
@@ -238,14 +223,18 @@ export type MultipleAccessControlConditions = z.infer<
238223
typeof MultipleAccessControlConditionsSchema
239224
>;
240225

226+
/**
227+
* @deprecated
228+
*/
241229
export type JsonAccsRequest = z.infer<typeof JsonAccsRequestSchema>;
242230

243231
export type JsonSigningRetrieveRequest = z.infer<
244232
typeof JsonSigningRetrieveRequestSchema
245233
>;
246234

247-
export type GetSignedTokenRequest = z.infer<typeof GetSignedTokenRequestSchema>;
248-
235+
/**
236+
* @deprecated
237+
*/
249238
export type JsonSigningStoreRequest = z.infer<
250239
typeof JsonSigningStoreRequestSchema
251240
>;

0 commit comments

Comments
 (0)