Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

The Hook useScaffoldEventHistory Requires Path not Name #99

@barretodavid

Description

@barretodavid

The docs for this hook shows the following code example:

const { data, isLoading, error } = useScaffoldEventHistory({
  contractName: "YourContract",
  eventName: "YourEvent",
  fromBlock: BigInt(0),
  filters: { parameterName: value },
  blockData: true,
  transactionData: false,
  receiptData: false,
  watch: true,
  enabled: true,
});

This doesn't work anymore as the function now expects the full path of the event struct like this:

const { data: events } = useScaffoldEventHistory({
    contractName: "CounterContract",
    eventName: "contracts::YourContract::YourContract::YourEvent",
    fromBlock: BigInt(0),
    blockData: true,
    transactionData: false,
    receiptData: false,
    watch: true,
    enabled: true,
  });

This is however inconsistent with other hooks like useScaffoldReadContract where the name is actually what's expected, not the full path.

const { data: totalCounter } = useScaffoldReadContract({
  contractName: "YourContract",
  functionName: "userGreetingCounter",
  args: ["0xd8da6bf26964af9d7eed9e03e53415d37aa96045"],
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions