Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.
/ refund-bot Public archive

Automated service for processing BEP3 refunds on Kava and Binance Chain

Notifications You must be signed in to change notification settings

Kava-Labs/refund-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Refund Bot

Automated service for processing BEP3 refunds on Kava and Binance Chain.

Set up

Clone the example env file

cp ./refund/example-env ./refund/.env

Running

Running the refund bot is straightforward. Simply declare a new RefundBot, initialize its Kava client and Binance Chain client, then refund swaps on a cron job. Here's a working example:

var main = async () => {
  // Load environment variables
  const cronTimer = process.env.CRONTAB;
  const kavaLcdURL = process.env.KAVA_LCD_URL;
  const kavaMnemonic = process.env.KAVA_MNEMONIC;
  const bnbChainLcdURL = process.env.BINANCE_CHAIN_LCD_URL;
  const bnbChainMnemonic = process.env.BINANCE_CHAIN_MNEMONIC;
  const bnbChainDeputy = process.env.BINANCE_CHAIN_DEPUTY_ADDRESS;

  // Initiate refund bot
  refundBot = new RefundBot(bnbChainDeputy);
  await refundBot.initKavaClient(kavaLcdURL, kavaMnemonic);
  await refundBot.initBnbChainClient(
    bnbChainLcdURL,
    bnbChainMnemonic,
    "mainnet"
  );

  // Start cron job
  cron.schedule(cronTimer, () => {
    refundBot.refundSwaps();
  });

  // Optional: print Binance Chain offsets hourly for debugging
  cron.schedule("* 1 * * *", () => {
    refundBot.printOffsets();
  });
};

About

Automated service for processing BEP3 refunds on Kava and Binance Chain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published