Skip to content

Commit de77460

Browse files
committed
chore(utils): add zkAppAccount to presentation request
1 parent dd75fec commit de77460

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/providers/src/validation.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
TransactionReceiptSchema,
1515
TypedSendableSchema,
1616
ZkAppCommandPayload,
17+
zkAppAccountSchema,
1718
} from "@mina-js/utils";
1819
import { z } from "zod";
1920

@@ -100,7 +101,12 @@ export const StorePrivateCredentialRequestParamsSchema =
100101
}).strict();
101102
export const PresentationRequestParamsSchema = RequestWithContext.extend({
102103
method: z.literal("mina_requestPresentation"),
103-
params: z.array(PresentationRequestSchema),
104+
params: z.array(
105+
z.object({
106+
presentationRequest: PresentationRequestSchema,
107+
zkAppAccount: zkAppAccountSchema.optional(),
108+
}).strict(),
109+
),
104110
}).strict();
105111

106112
// Returns

packages/utils/src/validation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export const NetworkId = z.string().regex(networkPattern);
3333

3434
export const KlesiaNetwork = z.enum(["devnet", "mainnet", "zeko_devnet"]);
3535

36+
export const MinaScanNetwork = z.enum(["devnet", "mainnet"]);
37+
3638
export const FeePayerSchema = z
3739
.object({
3840
feePayer: PublicKeySchema,
@@ -742,6 +744,12 @@ export const PresentationRequestSchema = z
742744
})
743745
.strict();
744746

747+
export const zkAppAccountSchema = z.object({
748+
address: PublicKeySchema,
749+
tokenId: z.string(),
750+
network: MinaScanNetwork,
751+
});
752+
745753
// Private Credentials: Witness Schemas
746754

747755
const SimpleWitnessSchema = z

0 commit comments

Comments
 (0)