const {ethers}=require("ethers");
const fs=require("fs");
const w=JSON.parse(fs.readFileSync(".selfclaw-wallet.json"));
const p=new ethers.JsonRpcProvider("https://forno.celo.org");
const wallet=new ethers.Wallet(w.privateKey,p);

(async()=>{
  console.log("Sending 3 small self-transactions for on-chain activity...");
  for(let i=0;i<3;i++){
    const tx=await wallet.sendTransaction({to:wallet.address,value:ethers.parseEther("0.001")});
    await tx.wait();
    console.log("✅ TX "+(i+1)+"/3:", tx.hash.substring(0,20)+"...");
  }
  console.log("Done! CELO left:", ethers.formatEther(await p.getBalance(wallet.address)));
})();
