Api Reference
useBalance
const { balance } = useBalance();
interface UserBalance {
balance: Ref<number>;
}
useBlock
const { blockNumber } = useBlockNumber();
interface Block {
blockNumber: Ref<number>;
}
useConfig
const { config } = useConfig();
interface IConfig {
rpc: string;
chainId: ChainId;
multicall: string;
pollingInterval: number;
autoConnect: boolean;
}
useContractCall
Coming Soon...
useENS
Coming Soon...
useGasPrice
Coming Soon...
useEthereum
TODO: Documentation
useEthers
Fetches common network & user data to connect with ethers.
const { account, ens, active, connect, disconnect, network } = useEthers();
- account - User address for the currently connected account to MetaMask
- ens - Resolved ENS (if available)
- active - Is the user currently connected Via MetaMask
- connect - Callback function which requests the current user to connect.
- disconnect - Callback function which disconnects the current user.
- network - Current connected network details.
useNFT
TODO: Documentation
usePolling
TODO: Documentation
useProvider
TODO: Documentation
useToken
const spirit = useToken('0x5cc61a78f164885776aa610fb0fe1257df78e59b')
const balance = spirit.balanceOf(userAddress)
interface ERC20Token {
name: Ref<string>;
symbol: Ref<string>;
decimals: Ref<number>;
totalSupply: Ref<number>;
balanceOf: (address: Ref<string> | string) => Ref<number>;
}