Browser

Initialization

import Browseth from '@browseth/browser';

const beth = new Browseth();

Contract

prototype . contract ( contractAbi [, options] )

returns Contracts instance.

Options may have the properties:

  • bin — contract binary (required for contract deployment)
  • address — address of already deployed contract - .send() and .call() will default to this for the {to: address} option

Units

prototype . convert ( fromUnit, value, toUnit )
convert unit of value to unit
prototype . etherToWei ( value )
convert value in ether to wei
prototype . gweiToWei ( value )
convert value in gwei to wei
prototype . weiToEther ( value )
convert value in wei to ether
prototype . toWei ( fromUnit, value )
convert unit of value to wei
prototype . toEther ( fromUnit, value )
convert unit of value to ether
prototype . unitToPow ( unit )
returns the power of the unit relative to wei

Accounts

prototype . useAccount ( account )
switch to account
prototype . useOnlineAccount ( onlineAccount )
switch to online account
prototype . useSignerAccount ( signerAccount )
switch to signer account
prototype . addOnlineAccount ( onlineAccount )
adds online account to list of accounts
prototype . addSignerAccount ( )
adds signer account to list of accounts

Utils

Addresses

prototype . checksum ( value )
Returns an address from bytes
prototype . isValidAddress ( value )
Checks if the given value is a valid address

Crypto

prototype . keccak256 ( value )
returns the keccak256 of a string
prototype . namehash ( name )
returns the node of a ‘.eth’ domain string

Transaction Listener

prototype . tx
Transaction Listener instance

Block Tracker

prototype . block
Block Tracker instance