1.1.6 • Published 3 years ago
beedu-web3 v1.1.6
Just need 1 correct config file, we will help you with all the rest, very simple:
- A syntax for 1 function even with multiple wallets
- Optimization of performance and speed of deployment
- Simple Simplified syntax, regardless of token or base currency
- In addition, we provide specialized helper functions for web3 related jobs
Getting Started
    npm install beedu-web3configuring
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"
    }
  }
}import BeeduWeb3 from 'beedu-web3'
BeeduWeb3.login('METAMASK')    - transferToken
    - approveToken
    - switchNetwork
    - ....
    SPECIAL
    
    - handle(currency, nameMethod, params: any[] = [])
    NOTE (IMPORTANT): You must login using the BeeduWeb3.login() function for the library to work