Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
akins-dev committed Jan 22, 2024
1 parent 33876df commit 4ee083e
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 13 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ ethers
supabase

## Contributors


## Little notes
```npx prisma db push``` to connect db

```npx prsma generate``` to start using prisma client

```npx prisma studio``` to view database locally

```npm run dev``` to run bot
3 changes: 1 addition & 2 deletions bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
conversations,
createConversation,
} from "@grammyjs/conversations";
import { callbackHandler, listenerComposer } from "./handlers";
import { callbackHandler, listenerComposer, callBackQueryComposer } from "./handlers";
import {
CreateTokenMenu,
initTaxMenu,
Expand All @@ -31,7 +31,6 @@ import {
import { accountMenu } from "./views";
import withdrawEthConversation from "./conversations/withdrawEth.conversations";
import { freeStorage } from "@grammyjs/storage-free";
import { callBackQueryComposer } from "./handlers";
import { distribute, run, sequentialize } from "@grammyjs/runner";
import validate from "./validations/config.validation";
import { I18n } from "@grammyjs/i18n";
Expand Down
2 changes: 1 addition & 1 deletion commands/help.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MyContext } from "../bot";
import { Conversation } from "@grammyjs/conversations";
export async function helpCommand(_ctx: CommandContext<MyContext>) {
await _ctx.reply(
`JOIN OUR TELEGRAM CHANNEL TO GET HELP \n ${process.env.BOT_NAME} `
`JOIN OUR TELEGRAM CHANNEL TO GET HELP \n ${process.env.CHANNEL_LINK} `
);
//await askQuestion(_ctx as MyContext, "What is your Name?");

Expand Down
10 changes: 6 additions & 4 deletions controllers/faq.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { boldenText } from "../utils";

export async function faqController(ctx: MyContext) {
await ctx.reply(
`ℹ️ FAQ \n${boldenText(
"Transaction Error Messages"
)} \n \n1. Insufficient Output Amount \n Your slippage tolerance is too low for this transaction. Either increase your slippage tolerance in the wallet settings or increase your gas price/delta to gain more priority on the blockchain.\n \n2. ${boldenText(
`ℹ️ \n${boldenText(
"FAQ"
)}(Transaction Error Messages) \n \n1. ${boldenText(
"Insufficient Output Amount"
)} \nYour slippage tolerance is too low for this transaction. Either increase your slippage tolerance in the wallet settings or increase your gas price/delta to gain more priority on the blockchain.\n \n2. ${boldenText(
"Excessive/Insufficient Input Amount"
)} \n This happens when the bot attempts to buy an exact number of number of tokens, but the token's volatility turns out to be too extreme, even with your slippage taken into consideration. For example, assume that you want to buy exactly 1 token, and the current price for that 1 token is 1 FTM. With 100% slippage, the bot will allow you to pay up to 2 FTM to get that token. If the token's volatility is too extreme that even 2 FTM isn't enough to purchase 1 token, the transaction will fail. For sells, it can happen when the bot is trying to sell 0 tokens.\n \n3. ${boldenText(
)} \nThis happens when the bot attempts to buy an exact number of number of tokens, but the token's volatility turns out to be too extreme, even with your slippage taken into consideration. For example, assume that you want to buy exactly 1 token, and the current price for that 1 token is 1 FTM. With 100% slippage, the bot will allow you to pay up to 2 FTM to get that token. If the token's volatility is too extreme that even 2 FTM isn't enough to purchase 1 token, the transaction will fail. For sells, it can happen when the bot is trying to sell 0 tokens.\n \n3. ${boldenText(
"Insufficient funds for gas x price + value"
)} \nYour wallet doesn't have enough funds to cover the transaction value and its gas fees. If you're using Ape Max, disable it and try again. If not, double check your gas settings and compare the potential gas fees to your wallet's FTM balance.
\n \n4. ${boldenText(
Expand Down
8 changes: 5 additions & 3 deletions handlers/leaderboard.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { rewardsMenu } from "../views";

export async function getLeaderboard(ctx: MyContext, msgId: number) {
let user = await getAllUsers();
let leaderboard = `${boldenText(
let leaderboard = `🏆${boldenText(
" Leaderboard "
)}🏆 \n📍Only top 10 trading activities will show on the Leaderboard\n \n${boldenText(
"Name"
)} | Points \nOnly top 10 trading activities will show on the Leaderboard `;
)} | Points \n `;
user.sort((a, b) => b.points - a.points);
user.forEach((el, id) => {
if (id <= 9) {
leaderboard += `\n${id + 1} ${el.userName} | ${el.points}`;
leaderboard += `\n${id + 1}. ${el.userName} | ${el.points}`;
}
});

Expand Down
6 changes: 5 additions & 1 deletion handlers/tasks.handler.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { MyContext } from "../bot";
import { rewardsMenu } from "../views";
import { boldenText } from "../utils";

export async function getTasks(ctx: MyContext, msgId: number) {
ctx.api.editMessageText(
ctx.chat.id,
msgId,
` Task List \n 1. Refer to earn - 80 points per referral \n 2. Execute snipe - 150 points per snipe \n3. 10000 FTM in volume - 500 points \n4. Execute swaps - 50 points \n5. Copy trade - 70 points `,
`🎯${boldenText(
" TASK LIST"
)} \n \n1. Refer to earn - 80 points per referral \n2. Execute snipe - 150 points per snipe \n3. 10000 FTM in volume - 500 points \n4. Execute swaps - 50 points \n5. Copy trade - 70 points
`,
{
reply_markup: rewardsMenu(),
parse_mode: "HTML",
Expand Down
10 changes: 10 additions & 0 deletions validations/config.validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ async function validate() {
!deployerContract ||
!botUserName
) {
console.log(monogo);
console.log(botToken);
console.log(rpc);
console.log(botName);
console.log(channelId);
console.log(etherScanAPiKEy);
console.log(scanurl);
console.log(graphClient);
console.log(deployerContract);
console.log(botUserName);
throw error("Configurations are missing");
} else {
console.info("Configurations Files are Saved");
Expand Down
10 changes: 8 additions & 2 deletions views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ export async function viewWalletDetailsView(
ctx.reply(
`🔒${boldenText(
" New Encrypted Fantom Wallet Created"
)}.🔒\n \n 💳 Wallet Address:\n ${makeCopiable(
)}! 🎉\n \n${boldenText(
"🚨KEEP THE DETAILS BELOW SAFE! 🚨"
)}\n \n 💳 Wallet Address:\n ${makeCopiable(
publicKey
)}\n \n 🔑 Private Key:\n${makeCopiable(
privateKey
)}\n \n🔍Mnemonic Phrase:\n${makeCopiable(
mnemonic
)} \n \n \n \n It is important to retain these details if you wish to access your wallet from outside this telegram account in the future, however, if these details are compromised it will grant full access to your wallet and funds. \n \n \n ---------------------------------------------\n**Store these details securely offline and then delete this message.**\n---------------------------------------------`,
)} \n \n \n \n⚠️${boldenText(
"It is important to retain these details if you wish to access your wallet from outside this telegram account in the future, however, if these details are compromised it will grant full access to your wallet and funds."
)}⚠️\n \n \n ---------------------------------------------\n 🚨${boldenText(
"STORE THESE DETAILS SECURELY OFFLINE AND THEN DELETE THIS MESSAGE."
)}🚨 \n---------------------------------------------`,
{ parse_mode: "HTML" }
);
}

0 comments on commit 4ee083e

Please sign in to comment.