useMetamask<>
Name | Type | Returns |
---|---|---|
useMetamask<>(CallBack | undefined ) |
function |
UseMatamaskAPI |
CallBack<>( When calling | function |
HookCleaner |
Metamask |
Metamask | |
React like Cleaner function in where you can as an example destroy listeners attached to metamask. | function |
void | function |
useTokenPrice<>
Name | Type | Returns |
---|---|---|
useTokenPrice<>(string ) |
function |
[number, ReFetchFn] |
ReFetchFn<> Hook resolves with an Array of 2 elements. | function |
void |
Parse
Parse
is a nano-module that includes a set of small functions to format/manipulate Ether.
interface Parse { toHex: (n: number) => string hexToInt: (s: string) => number toWei: (s: number | string) => string toTxWei: (n: number | string) => string weiToEth: (n: number | string) => number txWeiToEth: (s: string) => number}
Name | Type | Returns |
---|---|---|
toHex<>( Parses a number to a it's HEX base value. | function |
string |
hexToInt<>( Parses a HEX base number to it's decimal value. | function |
number |
toWei<>( Returns the wei value of a decimal string number. | function |
string |
toTxWei<>( Returns the HEX base value of a decimal number. | function |
string |
weiToEth<>( Returns the value in | function |
number |
txWeiToEth<>( Returns the decimal value for a HEX base | function |
number |
@Type Metamask
export interface Metamask extends OnEvent, OnRequest { isConnected(): boolean isUserUnlocked(): Promise<boolean> isMetaMask: boolean chainId: string removeListener: (e: string, f: any) => void selectedAddress: string | null}
@Type UseMatamaskAPI
export interface UseMatamaskAPI { connect: () => void disconnect: (props?: { reload?: boolean }) => void send: (props: Omit<SendMethodProps, "from">) => Promise<string> resetError: () => void account: string accounts: string[] balance: number formattedBalance: string chainId: string chainIdDecimal: number error?: ErrorState metamask: Metamask isConnected: boolean}