Git Product home page Git Product logo

web3-wallets's Introduction

Via Protocol is the most advanced cross-chain aggregation protocol

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.

web3-wallets's People

Contributors

disapadla avatar dzhanavapp avatar insulineru avatar iower avatar nrjshka avatar romanrakhlin avatar samisbakedham avatar serafimcloud avatar shamaevnn avatar webistomin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web3-wallets's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.