1.1.14 ā€¢ Published 9 months ago

@viaprotocol/web3-wallets v1.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Web3 wallets

Universal adapter to Ethereum and Solana

NPM Version Downloads Stats Discord Gitmoji support

Features

  • šŸš€ Built-in functions for working with signatures, connecting wallets, tracking the status of transactions, ENS names, and more.
  • šŸ’¼ Built-in wallet connectors for MetaMask, WalletConnect, Coinbase Wallet, Keplr, xDefi, Phantom (Solana) and Injected wallets.
  • šŸŒ€ Auto-refresh data on wallet, block, and network changes
  • šŸ¦„ TypeScript ready
  • šŸŒ All supported networks are in networks.ts

Supported wallets

  • MetaMask
  • WalletConnect (all WalletConnect-compatible wallets are supported, >100 wallets!)
  • Coinbase Wallet
  • Phantom (Solana)
  • Keplr (Cosmos, Osmosis, Astar)
  • xDeFi (EVM networks, Bitcoin, Bitcoin Cash, Litecoin)
  • Safe (aka Gnosis Safe Multisig Wallet)

Installation

yarn add @viaprotocol/web3-wallets

Quick start

import { useContext } from 'react'
import { WalletContext, WalletProvider } from '@viaprotocol/web3-wallets'

function App() {
  return (
    <WalletProvider>
      <NestedComponent />
    </WalletProvider>
  )
}

function NestedComponent() {
  const { connect, isConnected, address } = useContext(WalletContext)

  if (!isConnected) {
    return (
      // Select MetaMask and connect to ETH Mainnet
      <button
        type="button"
        onClick={() => connect({ name: 'MetaMask', chainId: 1 })}
      >Connect wallet</button>
    )
  }

  return (
    <p>{address}</p>
  )
}

Local development

Unfortunately, there is no playground in the library at the moment, so local development is done with yalc.

  1. First, install the library:
yarn global add yalc
  1. Make changes to the web3-wallets code

  2. Run the following command to build the library:

yarn publish:yalc
  1. In the project you are going to test your functionality, initialize the package fetch from yalc
yalc add @viaprotocol/web3-wallets
  1. Install yalc version of web3-wallets
yarn add @viaprotocol/web3-wallets
  1. After the library is installed, you can use it in your project.

(if you are using vite, you need to run it with --force param)

  1. Run the following command to remove the library, after you are done with testing:
yalc remove @viaprotocol/web3-wallets && yarn

Contributing

We use Conventional Commits in our project to name commits. And we would be very grateful if you would also follow this convention.

Scope is optional.

āœŒšŸ» Additionally, it would be cool to put emoji according to Gitmoji's guide (VSCode plugin, WebStorm plugin)

  1. Fork it (https://github.com/viaprotocol/web3-wallets/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'āœØ feat: add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Any questions?

You can write us in Discord with any questions about usage, integrations, adding new wallets, etc.

1.1.14-rc.1

9 months ago

1.1.14

9 months ago

1.1.12-rc.7

10 months ago

1.1.12-rc.6

10 months ago

1.1.12-rc.5

10 months ago

1.1.11

11 months ago

1.1.10-rc.5

11 months ago

1.1.10-rc.4

11 months ago

1.1.8

1 year ago

1.1.8-rc.2

1 year ago

1.1.8-rc.3

1 year ago

1.1.8-rc.0

1 year ago

1.1.8-rc.1

1 year ago

1.1.9-rc.0

1 year ago

1.1.9-rc.1

1 year ago

1.1.9-rc.3

1 year ago

1.1.9-rc.6

1 year ago

1.1.10-rc.0

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.7-rc.4

1 year ago

1.1.7-rc.3

1 year ago

1.1.7-rc.2

1 year ago

1.1.7-rc.1

1 year ago

1.1.7-rc.7

1 year ago

1.1.7-rc.6

1 year ago

1.1.7-rc.5

1 year ago

1.1.5-rc.12

1 year ago

1.1.5-rc.11

1 year ago

1.1.5-rc.10

1 year ago

1.1.1-rc.1

2 years ago

1.1.1-rc.2

2 years ago

1.1.1

2 years ago

1.1.5-rc.9

1 year ago

1.1.2-rc.1

2 years ago

1.1.2-rc.0

2 years ago

1.1.5-rc.3

1 year ago

1.1.5-rc.4

1 year ago

1.1.5-rc.6

1 year ago

1.1.5-rc.0

1 year ago

1.1.5-rc.1

1 year ago

1.1.5-rc.2

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.4-rc.1

1 year ago

1.1.4-rc.0

1 year ago

1.1.4-rc.3

1 year ago

1.1.4-rc.2

1 year ago

1.1.4-rc.5

1 year ago

1.1.4-rc.4

1 year ago

1.1.4-rc.6

1 year ago

1.1.3-rc.0

1 year ago

1.1.3-rc.3

1 year ago

1.1.3-rc.4

1 year ago

1.1.3-rc.1

1 year ago

1.1.1-rc.0

2 years ago

1.1.0

2 years ago

1.0.31-rc.12

2 years ago

1.0.19

2 years ago

1.0.31-rc.9

2 years ago

1.0.18

2 years ago

1.0.31-rc.10

2 years ago

1.0.17

2 years ago

1.0.31-rc.11

2 years ago

1.0.16

2 years ago

1.0.23-rc.2

2 years ago

1.0.23-rc.3

2 years ago

1.0.26-rc.4

2 years ago

1.0.23-rc.0

2 years ago

1.0.26-rc.3

2 years ago

1.0.23-rc.1

2 years ago

1.0.26-rc.2

2 years ago

1.0.18-rc.2

2 years ago

1.0.26-rc.1

2 years ago

1.0.18-rc.3

2 years ago

1.0.26-rc.0

2 years ago

1.0.31-rc.2

2 years ago

1.0.22

2 years ago

1.0.31-rc.1

2 years ago

1.0.21

2 years ago

1.0.31-rc.4

2 years ago

1.0.20

2 years ago

1.0.31-rc.3

2 years ago

1.0.31-rc.6

2 years ago

1.0.26

2 years ago

1.0.31-rc.5

2 years ago

1.0.25

2 years ago

1.0.31-rc.8

2 years ago

1.0.24

2 years ago

1.0.31-rc.7

2 years ago

1.0.23

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.18-rc.0

2 years ago

1.0.18-rc.1

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.19-rc.1

2 years ago

1.0.19-rc.0

2 years ago

1.0.29-rc.0

2 years ago

1.0.11

2 years ago

1.0.24-rc.0

2 years ago

1.0.24-rc.2

2 years ago

1.0.15

2 years ago

1.0.24-rc.1

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.10

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago