Skip to main content

useSignerAddress

Call external functions.

Returns undefined or the address of the signer.

How to import

import { useSignerAddress } from 'eth-hooks';

How to use

const [myAddress] = useSignerAddress(ethersContext.signer);

Use with the useContractReader hook to read your DAI balance from the blockchain:

const [myAddress] = useSignerAddress(ethersContext.signer);
const myMainnetDAIBalance = useContractReader(mainnetDai, mainnetDai?.balanceOf, [myAddress ?? '']);

To learn more

Go here for this hooks full API documentation.