Getting Started
Installation
Prerequesites
- Node.js (version 12 or higher)
npm
or preferablyyarn
.yarn
will be used for the rest of the documentation and is also used for the SDK development
SDK package installation:
yarn add @bel2labs/sdk
Configuration
Setting Up EVM Provider:
This library abstracts various versions of popular EVM providers for convenience.
- ethers v6:
- ethers v5
- Install ether.js
- v6:
yarn add ethers@6
- v5:
yarn add ethers@5
- Import and configure ethers in your project:
The following samples are for react projects
- v6:
import { ethers } from "ethers";
const provider = new ethers.BrowserProvider(window.ethereum);
- v5:
import { Web3Provider } from "@ethersproject/providers";
const provider = new Web3Provider(window.ethereum);