2017 © Pedro Peláez
 

yii2-extension yii2-web3js-asset

Web3.js libgrary asset bundle for Yii 2.0 Framework

image

biozahard/yii2-web3js-asset

Web3.js libgrary asset bundle for Yii 2.0 Framework

  • Saturday, December 30, 2017
  • by biozahard
  • Repository
  • 0 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii2 asset bundle for library web3.js v0.20.2

This package provide AssetBundle for web3js library, (*1)

To install Yii2 Web3js Asset run:, (*2)

composer require dmstr/yii2-adminlte-asset "0.20.2"

For adding web3.js on your page just add line:

    biozahard\web3js\Web3jsAssets::register($this);

Usage of web3.js

Use the web3 object directly from global namespace:, (*3)

console.log(web3); // {eth: .., shh: ...} // it's here!

Set a provider (HttpProvider), (*4)

if (typeof web3 !== 'undefined') {
  web3 = new Web3(web3.currentProvider);
} else {
  // set the provider you want from Web3.providers
  web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}

Set a provider (HttpProvider using HTTP Basic Authentication), (*5)

web3.setProvider(new web3.providers.HttpProvider('http://host.url', 0, BasicAuthUsername, BasicAuthPassword));

There you go, now you can use it:, (*6)

var coinbase = web3.eth.coinbase;
var balance = web3.eth.getBalance(coinbase);

You can find more examples in example directory., (*7)

Caution!

Web3.js library in development, a lot of bugs and unpredictable behaviors expects you =), (*8)

The Versions

30/12 2017

dev-master

9999999-dev

Web3.js libgrary asset bundle for Yii 2.0 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar biozahard

extension yii2 asset js ethereum solidity biozahard web3js dapp

30/12 2017

0.20.2

0.20.2.0

Web3.js libgrary asset bundle for Yii 2.0 Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar biozahard

extension yii2 asset js ethereum solidity biozahard web3js dapp