Skip to content

Commit

Permalink
brings back network (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewmeconry committed Apr 5, 2022
1 parent d09c8f1 commit 03c5795
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -142,6 +142,7 @@ It returns an object representing the connected account (“wallet”), containi
- `ethereum`: the connected [Ethereum provider](https://eips.ethereum.org/EIPS/eip-1193).
- `getBlockNumber()`: this function returns the current block number. This is a function because the block number updates often, which could trigger as many extra renders. Making an explicit call for the block number allows users of `useWallet()` to avoid extra renders when the block number is not needed.
- `isConnected()`: this function returns whether the wallet is connected.
- `networkName`: a human-readable name corresponding to the Chain ID.
- `reset()`: call this function to “disconnect” from the current provider. This will also clean the latest error value stored in `use-wallet`'s state.
- `status`: contains the current status of the wallet connection. The possible values are:
- "disconnected": no wallet connected (default state).
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Expand Up @@ -331,6 +331,7 @@ function UseWalletProvider({
error,
ethereum,
isConnected: () => status === 'connected',
networkName: chains.getChainInformation(chainId).type,
providerInfo: connector
? getProviderFromUseWalletId(connector)
: getProviderFromUseWalletId('unknown'),
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Expand Up @@ -49,6 +49,7 @@ export type Wallet = {
ethereum?: any
getBlockNumber?: () => number | null
isConnected: () => boolean
networkName: string | null
reset: () => void
status: Status
type: AccountType | null
Expand Down

0 comments on commit 03c5795

Please sign in to comment.