Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
feat: add extension interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Nov 1, 2023
1 parent e88ea6d commit 96562eb
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/radix-connect-schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,34 @@ export const WalletInteractionResponse = union([
WalletInteractionFailureResponse,
])

export const ExtensionInteraction = object({
export const extensionInteractionDiscriminator = {
extensionStatus: 'extensionStatus',
openPopup: 'openPopup',
} as const

export const StatusExtensionInteraction = object({
interactionId: string(),
discriminator: literal(extensionInteractionDiscriminator.extensionStatus),
})

export type StatusExtensionInteraction = z.infer<
typeof StatusExtensionInteraction
>

export const OpenPopupExtensionInteraction = object({
interactionId: string(),
discriminator: literal('extensionStatus'),
discriminator: literal(extensionInteractionDiscriminator.openPopup),
})

export type OpenPopupExtensionInteraction = z.infer<
typeof OpenPopupExtensionInteraction
>

export const ExtensionInteraction = union([
StatusExtensionInteraction,
OpenPopupExtensionInteraction,
])

export type ExtensionInteraction = z.infer<typeof ExtensionInteraction>

export const messageLifeCycleEventType = {
Expand Down

0 comments on commit 96562eb

Please sign in to comment.