Skip to content

Commit

Permalink
Add disconnect event
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Sep 9, 2024
1 parent 1907a34 commit 97820b7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/provider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ export const networkChangeSchema = v.object({
});
export type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;

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<typeof disconnectSchema>;

export const walletEventSchema = v.variant('type', [
accountChangeSchema,
networkChangeSchema,
disconnectSchema,
]);

export type WalletEvent = v.InferOutput<typeof walletEventSchema>;

export type AddListener = <const WalletEventName extends WalletEvent['type']>(
Expand Down

0 comments on commit 97820b7

Please sign in to comment.