Create a Web3Connection
Create a Simple Web3 Connection
A very simple way to connect your app to the web3 Environment
The use for other objects as StakingContract of ERC20Contract are similar to options structure A & B, either if you want to connect to a backend system and provide all variables (Option A) connect directly to an injected wallet (Option B)
1
const { Web3Connection } = require("bepro-js");
2
3
/* Options */
4
5
/* a) Create Instance without Injected Web3 (without Metamask) */
6
let web3 = new Web3Connection({
7
opt : { web3Connection : 'https://kovan.infura.io/v3' } });
8
9
await web3.start();
10
11
/* b) Create Instance with Injected Web3 (Metamask For Example) */
12
let web3 = new Web3Connection({});
13
14
await web3.login();
15
16
/* After A) or B) access methods easily */
17
let transactionData = await web3.getWeb3().eth.getTransactionReceipt(tx);
Copied!
Looking for more functions?
See all available functions here
Last modified 3d ago
Copy link