Skip to content

Releases: aragon/use-wallet

useWallet() v0.8.0

28 Jul 21:42
Compare
Choose a tag to compare

This version brings an API overhaul, making use-wallet easier to use across the board! Please note that this is a breaking change.

New API

With the new API exposed by use-wallet, boilerplate code is reduced to a minimum; all relevant state lives within the library itself you do not need to infer it for updating UI. The new spec is documented on the latest README.md. Here's the list of properties that we've deprecated:

  • activate() and deactivate(): Replaced by connect() and reset(). This improves consistency with the ecosystem's conventions and also aligns with our latest naming decisions across our apps.

  • activating and connected: Replaced by status, which contains the current status of the wallet connection in a string.

  • isContract: Replaced by type, which will indicate if the account is a contract or not, in a string.

Apart from this, we've added some things which make using use-wallet a breeze, so, make sure to check the new spec out! If you'd like a pointer on how to use it, we have examples that will set you right on track.

Related issue: #28. Thanks @bpierre for the super 馃敟 new API spec!

useWallet() v0.7.1

04 Jul 22:36
Compare
Choose a tag to compare

This version is a small improvement over our recent 0.7.0 release, which brings a few things:

New chains

We've added new chains to the list so use-wallet can detect them. These are:

  • xDai (100)
  • Goerli (5)
  • Local (1337, added by convention)

useWallet() v0.7.0

03 Jul 23:55
Compare
Choose a tag to compare

This version adds the new ProvidedConnector, which you can use when you want to provide your own EIP-1193 compatible provider object

Pull request

  • API: Add ProvidedConnector and its configuration options (#39)

ProvidedConnector

The ProvidedConnector is a special kind of connector: it acts just like the normal InjectedConnector from web3-react (use-wallet's default connector), but with the ability to configure it to use any other EIP-1193 compatible provider object through the provided key. This enables a lot of possibilities, such as developing a system to manage multiple providers in the future.

Here's an example:

import { useWallet, UseWalletProvider } from 'use-wallet'

function App() {
  const { activate } = useWallet()
  return (
    <button
      onClick={() => activate('provided')}
    >
      connect
    </button>
  )
}

export default () => (
  <UseWalletProvider
    connectors={{
      // You can use window.ethereum, or any other compatible provider object
      provided: { provider: window.ethereum },
    }}
  >
    <App />
  </UseWalletProvider>
)

useWallet() 0.6.0

29 Jun 17:34
v0.6.0
bf71736
Compare
Choose a tag to compare

This version enables two new connectors by default, and includes TypeScript definitions!

Contributors for this release: @bpierre, @JamesLefrere, @sohkai 馃檹

TypeScript Definitions

If you are a TypeScript user, you can now benefit from type definitions.

Pull request

  • Enable WalletConnect + add TypeScript definitions (#37)

WalletConnect

WalletConnect has been enabled again, and can be used with the walletconnect identifier.

Its configurations requires the rpcUrl parameter to be set. Example:

import { useWallet, UseWalletProvider } from 'use-wallet'

function App() {
  const { activate } = useWallet()
  return (
    <button
      onClick={() => activate('walletconnect')}
    >
      connect
    </button>
  )
}

export default () => (
  <UseWalletProvider
    connectors={{
      walletconnect: { rpcUrl: 'https://<Ethereum JSON RPC endpoint>' },
    }}
  >
    <App />
  </UseWalletProvider>
)

Pull request

  • Enable WalletConnect + add TypeScript definitions (#37)

Torus

A connector for the Torus wallet can now be used.

You can use it via the torus identifier:

import { useWallet, UseWalletProvider } from 'use-wallet'

function App() {
  const { activate } = useWallet()
  return (
    <button
      onClick={() => activate('torus')}
    >
      connect
    </button>
  )
}

export default () => (
  <UseWalletProvider>
    <App />
  </UseWalletProvider>
)

Pull request

  • Re-enable the Torus connector (#35)

Other changes

  • README: add section for current users (#36)
  • WalletLink: only accept HTTP聽endpoints (#37)
  • Update web3-react modules (#37)

0.5.0

25 Jun 18:58
8c6aa16
Compare
Choose a tag to compare
v0.5.0

v0.5.0