Telegram Earning mini app Script

Telegram mini app script for earning through joining channels, group and Tasks

About this script

1. How the mini app works

✓ Login: users open it from your bot and are signed in with their Telegram account. There are no passwords.
✓ Two balances:
• Earning balance is everything users earn, and it can be withdrawn.
• Advertise balance comes from deposits and pays for ads only. It can't be withdrawn.
• Users can transfer from Earning to Advertise, but not back.
• Both show in a sticky header on every page except Advertise.
✓ Home: the sponsored banner, an announcement, the daily bonus, Adsgram Watch & Earn, and a prompt to set a Security PIN.
✓ Earn: tasks are grouped by platform (All, Telegram, YouTube, TikTok, X, Instagram, Facebook, Websites). Below the tasks are the bonus ads (Monetag, OnClickA), with countdowns to the next ad.
✓ Telegram channel and group joins are verified automatically by the bot.
Other platforms use proof review: the user submits a username and a screenshot, and the advertiser approves it. Unreviewed proofs are auto-approved after the hours you set, and rejections can be disputed.
✓Advertise: advertisers pick a platform, set a cost per action and a budget, and the ad goes live instantly. They review proofs in the Reviews tab, and they can buy a sponsored banner for 12 hours, 24 hours, a week or a month.
✓ Contests: the Invite page (referral link, your top 6 friends and their earnings), the weekly or monthly leaderboard, and any contests you run.
✓ Wallet: Deposit (FaucetPay, TON, or Transfer), Withdraw (FaucetPay or TON, with live payout-wallet level), History with Load more, and the Security PIN.

2. Admin panel (/admin/)

✓ Dashboard: users, deposits, running ads, total earned by users, and your revenue (ad fees, banner sales, withdrawal fees, net) for today, 7 days, 30 days and all time.
✓ Users: search, adjust either balance, ban, flag duplicate accounts, CSV export.
✓ Ads & Tasks: add your own tasks, and pause or stop any campaign.
✓ Contests: referral and task contests (daily, weekly, monthly, or one-off).
✓ Deposits and Withdrawals: history, retry, mark paid, or reject and refund.
✓ Payments: which FaucetPay coins are on, plus minimum, fee and "100% level" per method, with live wallet balances.
✓ Proofs: disputed and pending social proofs.
✓ Banners: your own banners, removing abusive ones, and the default banner.
✓ Broadcast: send a message to all users.
✓ Security: 2FA, recovery codes, password change, IP allowlist, Telegram alerts, and the audit log.
✓ Settings:
• the bot token and Connect bot
• FaucetPay and TON credentials, stored encrypted
• ad fee, referral and bonus rules
• Adsgram, Monetag and OnClickA
• the leaderboard
• banner prices
• user security rules

View the Demo: https://t.me/instantpaid_bot/app?startapp=r7273671692

Installation guide

3. Installation
✓ Requirements:
• Hosting with PHP 8.1 or newer, and the cURL, OpenSSL, mbstring and PDO MySQL extensions. GD is optional and is used to clean uploaded images.
• MySQL or MariaDB.
• A domain with HTTPS, which Telegram requires.
• A Telegram bot from @BotFather.
• A FaucetPay merchant account with an API key.
• A TON wallet, plus a free TonCenter API key.
• Node.js 18 or newer for TON withdrawals. • Run npm install once inside the ton/ folder.
• Cron access.
• The security rules are written for Apache. • On Nginx you need equivalent deny rules for includes, cache and ton.

4. Steps:
✓ Upload the files to your domain root and create an empty database.
✓ Open /install.php, fill the form, then delete install.php.
✓ Log in at /admin/. It forces you to set up 2FA first. Scan the QR code and save the recovery codes.
✓ Go to Settings and enter the bot token, then save and press Connect bot.
✓ In @BotFather, run /newapp with the URL https://yourdomain.com/app/ and the short name app. Use assets/logo.png as the bot photo.
✓ Fill in the FaucetPay and TON details, then open Payments to enable coins and set minimums, fees and wallet levels.
✓ Add the cron job shown on the dashboard, every minute.
✓ Add your Adsgram, Monetag and OnClickA codes when you have them.
✓ Test a small deposit and a small withdrawal for both FaucetPay and TON.
=> The README inside the zip repeats this, and it also explains how to reset 2FA if you lose both your phone and your recovery codes.

For Installation costs if you like: $10