From bf3bf7db8dc32105167ca6c9ccfad533aca65c2a Mon Sep 17 00:00:00 2001 From: Alex Stelea Date: Thu, 2 Nov 2023 09:50:10 +0100 Subject: [PATCH] feat: add WalletInteractionWithOrigin --- src/radix-connect-schemas.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/radix-connect-schemas.ts b/src/radix-connect-schemas.ts index 36de7e9..69c14c6 100644 --- a/src/radix-connect-schemas.ts +++ b/src/radix-connect-schemas.ts @@ -215,6 +215,9 @@ export const Metadata = object({ dAppDefinitionAddress: string(), }) +export type MetadataWithOrigin = z.infer +export const MetadataWithOrigin = Metadata.and(object({ origin: string() })) + export type WalletInteraction = z.infer export const WalletInteraction = object({ interactionId: string(), @@ -222,6 +225,14 @@ export const WalletInteraction = object({ items: WalletInteractionItems, }) +export type WalletInteractionWithOrigin = z.infer< + typeof WalletInteractionWithOrigin +> + +export const WalletInteractionWithOrigin = WalletInteraction.and( + object({ metadata: MetadataWithOrigin }), +) + export type WalletUnauthorizedRequestResponseItems = z.infer< typeof WalletUnauthorizedRequestResponseItems >