beedu-web3
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

Moralis Build Serverless web3 apps

BEEDU WEB 3 SDK for JavaScript

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-web3

configuring

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

    - transferToken
    - approveToken
    - switchNetwork
    - ....

    SPECIAL
    
    - handle(currency, nameMethod, params: any[] = [])

    
NOTE (IMPORTANT): You must login using the BeeduWeb3.login() function for the library to work

Package Sidebar

Install

npm i beedu-web3

Homepage

beedu.io/

Weekly Downloads

3

Version

1.1.6

License

BEEDU

Unpacked Size

33.3 kB

Total Files

27

Last publish

Collaborators

  • hunglt2604