@exodus/web3-ethereum
TypeScript icon, indicating that this package has built-in type declarations

13.1.2 • Public • Published

@exodus/web3-ethereum

Apps connectivity library for Ethereum and EVM-compatible chains.

Usage

const EventEmitter = require('events')

// Separate entry points are supported
const { EthereumProvider } = require('@exodus/web3-ethereum/provider')
const { registerRPCHandlers } = require('@exodus/web3-ethereum/rpc')

// Create transport.
const transport = new EventEmitter()
transport.write = (data) => {
  setTimeout(() => {
    transport.emit('data', data)
  })
}

// Create Exodus global API.
const accountsObservable = new Observable()
const storage = new Storage()
const supportedChainIDs = ['0x1']
const exodus = {
  ethereum: new EthereumProvider({
    accountsObservable,
    storage,
    supportedChainIDs,
    transport,
  }),
}

// Inject the Exodus object into the app.
window.exodus = exodus

// Register RPC handlers for requests the Provider can call.
registerRPCHandlers({
  transport,
  deps: {}, // required deps
})

Readme

Keywords

none

Package Sidebar

Install

npm i @exodus/web3-ethereum

Weekly Downloads

1,442

Version

13.1.2

License

MIT

Unpacked Size

176 kB

Total Files

35

Last publish

Collaborators

  • juraex
  • kevva
  • doguhan
  • ps.mcnally
  • janwe
  • yevhenii_molodyk
  • javiexodus
  • ismamz
  • exojo
  • feri42
  • jprichardson
  • farisissa
  • ryanzim
  • headfire
  • gutenye
  • mosesbot
  • roccomuso
  • dcastagnoli
  • sonaye
  • ves
  • tenaciousmv
  • asyakost
  • bulgakovk
  • chalker
  • andrejb
  • jaydp17
  • olistic
  • joepie91
  • merlz
  • vbonini
  • mol0d
  • devopsrobot
  • jenish-sojitra
  • markoexodus
  • nachoalvarez
  • giovannirco
  • filipexodus
  • cryptosgr
  • andrescarreon
  • diegomura
  • lanre-mark
  • sunilagrawal
  • guillecura
  • mariosvlad
  • federico-po
  • akinncar
  • fboucquez
  • lanahizzle
  • kwwood
  • umito
  • mzndako
  • joshuabot
  • iaacek
  • meniem
  • skapala
  • awilson-rs
  • ezenwankwogabriel
  • ggabarrin-rs
  • ralph.ba
  • danh.t.vo
  • voltagebots
  • ryansquared-npm
  • alexandrbbm
  • sergii_bo
  • florianmathieu
  • angelloz
  • exodus-justin.za
  • alex.alexandrius
  • rec
  • rg911
  • jamiemaw
  • james-gre
  • shehryar6
  • geoffreyrousset
  • clarkexo
  • tunguyennnnn
  • jschopen
  • cawfree
  • marcos.kichel
  • andrewtoth-exodus
  • cdotta-exodus
  • exorich
  • mmehta-10
  • kryptkeep
  • 633kh4ck
  • mbaraniak-exodus
  • jeehahn
  • hasakura
  • awesomeniko
  • davidexodus
  • r4vn
  • nantoaqui
  • exoleo
  • ale-exo
  • frankliexodus
  • bekatd
  • ronaldcrb
  • muratso
  • metasal