# new Web3Connection(options)
Web3Connection Object
Parameters:
Name | Type | Description |
---|---|---|
options |
Web3Connection~Options
|
Methods
# async getAccounts() → {Promise.<Array.<string>>}
Get accounts connected via login()
Addresses array available
Promise.<Array.<string>>
# getCurrentAccount() → {Promise.<string>}
Get current/selected account in use if available, or selected signer wallet/address otherwise.
Account/Wallet in use
Promise.<string>
# async getETHBalance() → {Promise.<string>}
Get ETH Balance of Address connected
ETH Balance
Promise.<string>
# async getETHNetwork() → {Promise.<string>}
Get ETH Network
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
Web3
Web3
# async login() → {Promise.<boolean>}
Login with Metamask/Web3 Wallet - substitutes start()
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 |
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() |