m-react-web3
v1.0.4
Published
hook web3
Downloads
16
Readme
REACT WBE3
hook web3
install
yarn add m-react-web3
import Web3Provider from 'm-react-web3'
function Web3({children}) {
return (
<Web3Provider>
{children}
</Web3Provider>
)
}
import {useWeb3} from 'm-react-web3'
function Index( ) {
const {account, getBlockNumber} = useWeb3()
return (
<div>
{getBlockNumber()}
</div>
)
}
API
const {
chainName,
account,
connect,
connected,
unlock,
chainId,
connectWalletConnect
} = useWeb3()
import {
decimalHex,
shortAddress,
setDefaultProvider,
setProvider,
initWeb3,
reInitWeb3,
PROXY_ZERO_ADDRESS,
DEFAULT_PRC,
DEFAULT_CHAIN_ID,
ZERO_ADDRESS,
ERC20,
multiCallArr,
multiCalls,
BN,
wFormatInt,
MAX_UINT
} from 'm-react-web3'