Class

Web3Connection

Web3Connection(options)

Constructor

# new Web3Connection(options)

Web3Connection Object

Parameters:
Name Type Description
options Web3Connection~Options

View Source Web3Connection.js, line 34

Methods

# async getAccounts() → {Promise.<Array.<string>>}

Get accounts connected via login()

View Source Web3Connection.js, line 186

Addresses array available

Promise.<Array.<string>>

# async getAddress() → {Promise.<string>}

Get Address connected

View Source Web3Connection.js, line 172

Address in Use

Promise.<string>

# getCurrentAccount() → {Promise.<string>}

Get current/selected account in use if available, or selected signer wallet/address otherwise.

View Source Web3Connection.js, line 159

Account/Wallet in use

Promise.<string>

# async getETHBalance() → {Promise.<string>}

Get ETH Balance of Address connected

View Source Web3Connection.js, line 197

ETH Balance

Promise.<string>

# async getETHNetwork() → {Promise.<string>}

Get ETH Network

View Source Web3Connection.js, line 144

Network Name (Ex : Kovan)

Promise.<string>

# getWeb3() → {Web3}

Get Web3 to access functions as https://ethereum.stackexchange.com/questions/66454/how-to-get-events-emitted-by-a-transaction-with-web3-js

View Source Web3Connection.js, line 208

Web3

Web3

# async login() → {Promise.<boolean>}

Login with Metamask/Web3 Wallet - substitutes start()

View Source Web3Connection.js, line 122

Promise.<boolean>

Type Definitions

Object

# Optional

Properties:
Name Type Description
web3Connection string

Web3 Connection String (Ex : https://data-seed-prebsc-1-s1.binance.org:8545)

privateKey string

Private key (0x....) used for server side use

View Source Web3Connection.js, line 20

Object

# Options

Properties:
Name Type Attributes Default Description
test boolean <optional>
false

Automated Tests

localtest boolean <optional>
false

Ganache Local Blockchain

opt web3Connection~Optional <optional>

Optional Chain Connection Object (Default ETH)

opt provider~Optional <optional>

Directly supply any web3 provider, automatically calls start()

View Source Web3Connection.js, line 26