Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 647 Bytes

README.md

File metadata and controls

34 lines (27 loc) · 647 Bytes

Linkdrop Widget Provider

Install

yarn add ssh://[email protected]:LinkdropHQ/linkdrop-widget-provider.git

Usage

import LinkdropWidget from 'linkdrop-widget-provider'
import Web3 from 'web3' // v1.2.1

// init provider
let widget
const initProvider = async () => { 
  widget = new LinkdropWidget({
   network: 'rinkeby'
  })
  
  // will resolve after user registers or logs in
  await widget.provider.enable()
  
  // use web3
  const web3 = new Web3(widget.provider)
  const accounts = await web3.eth.getAccounts()
  console.log({ accounts })
}

// show widget
widget.showWidget()

// hide widget
widget.hideWidget()