From 97820b77b71d11e05292846879a53cbed60a46bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Mon, 9 Sep 2024 15:41:19 +0200 Subject: [PATCH] Add disconnect event --- src/provider/types.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/provider/types.ts b/src/provider/types.ts index 20aa457..cfcf3ef 100644 --- a/src/provider/types.ts +++ b/src/provider/types.ts @@ -32,7 +32,19 @@ export const networkChangeSchema = v.object({ }); export type NetworkChangeEvent = v.InferOutput; -export const walletEventSchema = v.variant('type', [accountChangeSchema, networkChangeSchema]); +// disconnect +export const disconnectEventName = 'disconnect'; +export const disconnectSchema = v.object({ + type: v.literal(disconnectEventName), +}); +export type DisconnectEvent = v.InferOutput; + +export const walletEventSchema = v.variant('type', [ + accountChangeSchema, + networkChangeSchema, + disconnectSchema, +]); + export type WalletEvent = v.InferOutput; export type AddListener = (