1.0.20 • Published 5 years ago

react.js-web3 v1.0.20

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

react.js-web3

demo

  • By detecting login and logout of MetaMask, you can develop high DApps of UX.
  • Supports import of contracts

Installation

npm install --save react.js-web3

Usage

Web3Container

import { Web3Container } from 'react.js-web3'
import Examples from '@conponents/Example'

// ...

class Index extends React.Component {

  // ...

  render () {
    return (
      <Web3Container
        renderLoading={() => <div>Loading Accounts Page...</div>}
        render={({ accounts }) => <Examples accounts={accounts} />}
      />
    )
  }
}
  • renderLoading You can specify the View that is displayed when web3.js can not acquire account.
  • render You can pass the account as props to the React Component.

getContract

import { getWeb3, getContract } from "react.js-web3";
import contractDefinition from '@contracts/SimpleStorage.json'

// ...

const web3 = await getWeb3();
const contract = await getContract(web3, contractDefinition)
1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago