Coder Social home page Coder Social logo

samkenxstream / turnkey-triumph-326606_gold-fiber-346123_samkencoin-web5-onboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blocknative/web3-onboard

0.0 1.0 0.0 14.69 MB

Client library to onboard users to web5 apps

Home Page: https://samkencoincore.com/onboard

License: MIT License

JavaScript 1.25% TypeScript 79.11% CSS 0.09% HTML 0.05% Svelte 19.50%

turnkey-triumph-326606_gold-fiber-346123_samkencoin-web5-onboard's Introduction

Web3-Onboard

easy way to connect users to dapps

Features

  • Minimal Dependencies: All wallet dependencies are included in separate packages, so you only include the ones you want to use in your app.
  • Multiple Wallets and Accounts Connection: Allow your users to connect multiple wallets and multiple accounts within each wallet at the same time to your app.
  • Multiple Chain Support: Allow users to switch between chains/networks with ease.
  • Account Center: A persistent interface to manage wallet connections and networks, with a minimal version for mobile
  • Notify: Real-time transaction notifications for the connected wallet addresses for all transaction states
  • Wallet Provider Standardization: All wallet modules expose a provider that is patched to be compliant with the EIP-1193, EIP-1102, EIP-3085 and EIP-3326 specifications.
  • Dynamic Imports: Supporting multiple wallets in your app requires a lot of dependencies. Onboard dynamically imports a wallet and its dependencies only when the user selects it, so that minimal bandwidth is used.

Quickstart

Install the core Onboard library, the injected wallets module and optionally ethers js to support browser extension and mobile wallets:

NPM npm i @web3-onboard/core @web3-onboard/injected-wallets ethers

Yarn yarn add @web3-onboard/core @web3-onboard/injected-wallets ethers

Then initialize in your app:

import Onboard from '@web3-onboard/core'
import injectedModule from '@web3-onboard/injected-wallets'
import { ethers } from 'ethers'

const MAINNET_RPC_URL = 'https://mainnet.infura.io/v3/<INFURA_KEY>'

const injected = injectedModule()

const onboard = Onboard({
  wallets: [injected],
  chains: [
    {
      id: '0x1',
      token: 'ETH',
      label: 'Ethereum Mainnet',
      rpcUrl: MAINNET_RPC_URL
    }
  ]
})

const wallets = await onboard.connectWallet()

console.log(wallets)

if (wallets[0]) {
  // create an ethers provider with the last connected wallet provider
  const ethersProvider = new ethers.providers.Web3Provider(
    wallets[0].provider,
    'any'
  )

  const signer = ethersProvider.getSigner()

  // send a transaction with the ethers provider
  const txn = await signer.sendTransaction({
    to: '0x',
    value: 100000000000000
  })

  const receipt = await txn.wait()
  console.log(receipt)
}

Onboard v1 migration guide

If you're coming from v1, we've created a migration guide for you.

Documentation

For full documentation, check out the README.md for each package or the docs page here:

Core Repo

Injected Wallets

SDK Wallets

Hardware Wallets

Frameworks

Test out the demo app

If you would like to test out the current functionality of V2 in a small browser demo, then:

  • Clone the repo: git clone [email protected]:blocknative/onboard.git
  • Change in to the onboard directory: cd onboard
  • Checkout the V2 feature branch: git checkout main
  • Install the dependencies: yarn (if running a M1 mac - yarn install-m1-mac)
  • Run all packages in dev mode: yarn dev
  • To view the demo app in the browser after running the above steps navigate to http://localhost:8080

turnkey-triumph-326606_gold-fiber-346123_samkencoin-web5-onboard's People

Contributors

aaronbarnardsound avatar adamj1232 avatar taylorjdawson avatar gesquinca avatar dependabot[bot] avatar dmarzzz avatar techgangboss avatar mahmud-bn avatar cmeisl avatar laurencedelisle avatar macomni avatar tomafrench avatar chaitanyapotti avatar samkenxstream avatar alex-miller-0 avatar matthaltom avatar samuelea avatar yomarion avatar brendanww avatar v-shadbolt avatar chendatony31 avatar soralit avatar kyungeunkim avatar monokh avatar mhchaudhry3 avatar katspaugh avatar erin-at-work avatar davidp94 avatar applicature-dlitvinov avatar skylarbarrera avatar

Watchers

 avatar

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.