Skip to content

Commit

Permalink
fix: add a hack for the provider
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jun 5, 2024
1 parent d5b712f commit 13e7858
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions examples/sample-react-app/src/hooks/useCounter.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { useProvider } from '@vechain/dapp-kit-react';
import { useMemo } from 'react';
import { Counter__factory } from '@vechain/hardhat-example';

const counterAddress = '0x8384738c995d49c5b692560ae688fc8b51af1059';

export const useCounter = () => {
const provider = useProvider();
const signer = useMemo(() => {
return provider.getSignerSync();
}, [provider]);

return Counter__factory.connect(counterAddress, signer);
return Counter__factory.connect(
counterAddress,
// TODO: Fix this hack
// eslint-disable-next-line @typescript-eslint/no-explicit-any
provider.getSignerSync() as unknown as any,
);
};

0 comments on commit 13e7858

Please sign in to comment.