Nodejs
Installation
npm install @xend-finance/web-sdkyarn add @xend-finance/web-sdkExample
require('dotenv').config(); // this helps you read from your env file
import XF from '@xend-finance/web-sdk'; // using the import format
//// OR ////
const { default: XF } = require('@xend-finance/web-sdk'); // using the require module
const chainId = 56; // Binance Smart Chain Mainnet
const privateKey = process.env.PRIVATE_KEY; // saved in your env file
const setup = async () => {
const instance = await XF(chainId, privateKey, { env:"mainnet" });
return instance;
}
const makeDeposit = async () => {
const { Personal } = await setup();
const depositAmount = "100";
const response = await Personal.flexibleDeposit(depositAmount);
return response;
}What you need to setup SDK
1. Chain ID
2. Private Key


3. Options
Scenario
Protocol Type
Setting up a development environment
Step 1


Step 2
Step 3



Transfer Funds & Make Your First Deposit and Withdrawal
Some available functions
General
Personal Savings
Esusu
Cooperative Savings
Last updated