<p align="center"> <a href="https://beedu.io/"> <img width="132" height="101" src="https://app.bework.vn/favicon.ico" class="attachment-full size-full" alt="Moralis Build Serverless web3 apps" loading="lazy" /></a> </p>
npm install beedu-web3
`
$3
create file config.js in struct or use default file config
`
{
"NETWORK": {
"TESTNET": {
"base": {
"ETH": {
"chainId": "0x3",
"decimal": 18,
"link": "https://api-ropsten.etherscan.io/api"
},
"BNB": {
"chainId": "0x61",
"decimal": 18,
"link": "https://api-testnet.bscscan.com/api"
}
},
"token": {
"HUB": {
"decimal": 8,
"base": "BNB",
"contract-address": "0x173c87073c762d4a99343c7e54e619d7c55f85fb"
}
}
},
"MAINNET": {
"base": {
"ETH": {
"chainId": "0x1",
"decimal": 18,
"link": "https://api.etherscan.io/api"
},
"BNB": {
"chainId": "0x38",
"decimal": 18,
"link": "https://api.bscscan.com/api"
}
},
"token": {
"HUB": {
"decimal": 8,
"base": "BNB",
"contract-address": "0x46bCBBB0D888dF90Eda86c9CA159C7727a8731D5"
}
}
}
},
"FUNCTION": {
"getBalance": {
"base": "eth_getBalance",
"token": "balanceOf"
}
}
}
`
NETWORK has 2 type: MAINNET AND TESTNET
Each network has 2 type: base and token
Config FUNCTION custom in library
How to use?
Very simple
`
import BeeduWeb3 from 'beedu-web3'
BeeduWeb3.login('METAMASK')
`
Provide facilities
`angular2html
- transferToken
- approveToken
- switchNetwork
- ....
SPECIAL
- handle(currency, nameMethod, params: any[] = [])
`
`
NOTE (IMPORTANT): You must login using the BeeduWeb3.login() function for the library to work
``