Skip to content

useEvent

Usage

connect() must be called and WalletConnect session must be initiated before account information will be returned.

The useEvent hook is a React Hook wrapper around the getEvent function. If an address is provided, the wallet will return that an event for a given address if that address is in the wallet. Otherwise, it will use the currently selected account’s address. If the multisig flag is true, the sdk will not fetch until an address is present

import { useEvent } from '@puzzlehq/sdk';
const { fetchEvent, event, loading, error } = useEvent({
id: "6569ee9d75d4cff690f8931b",
address: 'aleo19uypgpau7extvc80h5r3kz07jg2puynt8rdeyarg0608l4lhr58qu33kc6'
multisig: true
});

Return Value

{
fetchEvent: () => void,
event?: Event[],
error?: string,
loading: boolean
};

Additional related types can be found on the events page.