Skip to content

useRequestCreateEvent

Usage

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

The useRequestCreateEvent hook is a React Hook wrapper around the createEvent function

import { useRequestCreateEvent } from '@puzzlehq/sdk';
const { createEvent, eventId, loading, error } = useRequestCreateEvent({
type: EventType.Execute,
programId: 'program_name_here.aleo',
functionId: 'function_name_here',
fee: 1.23,
inputs: Object.values(inputs)
});

Return Value

{
createEvent: () => void,
eventId?: string,
loading: boolean,
error?: string,
};

Additional related types can be found on the events page.