Page cover

Integration Guide

How to integrate Dollar Infinite into your dApp, bot, script, or tool.

Prerequisites

  • Node.js or web environment with ethers.js / web3.js

  • BSC RPC: https://bsc-dataseed.binance.org/arrow-up-right (or Infura/Alchemy BSC)

  • Contract addresses and ABIs (get from BSCScan or official site)

  • Wallet with BNB for tests (use test values)

Step 1: Configure Provider and Signer

Example with ethers.js (recommended):

javascript

const ethers = require('ethers');

// Provider (read-only)
const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org/');

// Signer (for transactions - NEVER expose private key in frontend!)
const privateKey = process.env.PRIVATE_KEY; // use .env or hardware
const wallet = new ethers.Wallet(privateKey, provider);

Step 2: Load Vault Contract

javascript

Step 3: Common Integration Examples

3.1 Approve USDT for Vault

javascript

3.2 Make Deposit

javascript

3.3 Check User Positions

javascript

3.4 Calculate Pending Rewards

javascript

3.5 Withdraw

javascript

Step 4: Affiliate Integration

Check pending commissions:

javascript

Integration Best Practices

  • Use Multicall to reduce RPC calls (e.g., multicall.bscscan.com)

  • Error Handling β€” Capture revert reasons (e.g., "Lock not matured")

  • Event Listening β€” Use provider.on() for Deposited/Withdrawn

  • Frontend β€” Use wagmi or rainbowkit for wallet connection

  • Security β€” Never expose private keys on client-side

  • Testing β€” Start with small amounts ($10-50)

  • Monitoring β€” Use The Graph or custom indexer for historical data

Warning: Always verify addresses and ABIs on official site or BSCScan. Never use untrusted sources.

β†’ Next: Code Examples

Last updated