├── .gitignore ├── src ├── config.js ├── utils.js ├── checkIn.js └── userData.js ├── package.json ├── LICENSE ├── index.js └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | package-lock.json 4 | bearers.json 5 | 6 | ori.js -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const BASE_URL = 'https://us-central1-openoracle-de73b.cloudfunctions.net'; 4 | const BEARERS = JSON.parse(fs.readFileSync('bearers.json', 'utf-8')); 5 | 6 | module.exports = { 7 | BASE_URL, 8 | BEARERS, 9 | }; 10 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | function displayHeader() { 2 | process.stdout.write('\x1Bc'); 3 | console.log('========================================'.cyan); 4 | console.log('= 🚀 OpenLayer Airdrop Bot 🚀 ='.cyan); 5 | console.log('= Created by HappyCuanAirdrop ='.cyan); 6 | console.log('= https://t.me/HappyCuanAirdrop ='.cyan); 7 | console.log('========================================'.cyan); 8 | console.log(); 9 | } 10 | 11 | const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); 12 | 13 | module.exports = { 14 | displayHeader, 15 | delay, 16 | }; 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openlayer-airdrop-bot", 3 | "version": "1.0.0", 4 | "description": "A bot that automates daily check-ins for the OpenLayer airdrop, supporting multiple accounts and scheduled tasks.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node index.js" 9 | }, 10 | "keywords": [ 11 | "airdrop", 12 | "bot", 13 | "automation", 14 | "openlayer", 15 | "crypto", 16 | "check-in", 17 | "airdrops", 18 | "cron-job", 19 | "nodejs" 20 | ], 21 | "author": "dante4rt", 22 | "license": "MIT", 23 | "dependencies": { 24 | "axios": "^1.7.7", 25 | "colors": "^1.4.0", 26 | "cron": "^3.1.7", 27 | "moment": "^2.30.1", 28 | "readline-sync": "^1.4.10" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2024 Dante4rt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/checkIn.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const moment = require('moment'); 3 | 4 | const { BEARERS, BASE_URL } = require('./config'); 5 | 6 | async function login(token) { 7 | const { data } = await axios({ 8 | url: BASE_URL + '/backend_apis/api/service/checkIn', 9 | method: 'POST', 10 | headers: { 11 | Authorization: `Bearer ${token}`, 12 | }, 13 | data: {}, 14 | }); 15 | return data; 16 | } 17 | 18 | async function performCheckIn() { 19 | try { 20 | for (let i = 0; i < BEARERS.length; i++) { 21 | const response = await login(BEARERS[i]); 22 | 23 | console.log(`[ # Account ${i + 1} ]`.bold.green); 24 | 25 | if (response.msg.includes('already checked in')) { 26 | console.log( 27 | `[ ${moment().format( 28 | 'HH:mm:ss' 29 | )} ] Check-in failed: You've already checked in today! Try again tomorrow.` 30 | .red 31 | ); 32 | } else { 33 | console.log( 34 | `[ ${moment().format('HH:mm:ss')} ] Check-in successful! Congrats 🎉` 35 | .green 36 | ); 37 | } 38 | 39 | console.log(); 40 | } 41 | } catch (error) { 42 | console.log( 43 | `[ ${moment().format('HH:mm:ss')} ] Error: ${error.message}`.red 44 | ); 45 | } 46 | } 47 | 48 | module.exports = { 49 | performCheckIn, 50 | }; 51 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('colors'); 2 | const cron = require('cron'); 3 | const readline = require('readline-sync'); 4 | const { displayHeader, delay } = require('./src/utils'); 5 | const { performCheckIn } = require('./src/checkIn'); 6 | const { displayUserData } = require('./src/userData'); 7 | 8 | (async () => { 9 | displayHeader(); 10 | 11 | console.log(`Please wait...\n`.yellow); 12 | await delay(1000); 13 | 14 | await displayUserData(); 15 | 16 | console.log('What would you like to do?'); 17 | console.log('1. Auto daily check-in'); 18 | console.log('0. Exit'); 19 | 20 | const choice = readline.questionInt('\nEnter your choice: '); 21 | 22 | if (choice === 1) { 23 | console.log('Running your first check-in...'.yellow); 24 | await performCheckIn(); 25 | 26 | const job = new cron.CronJob('0 */12 * * *', () => { 27 | console.log( 28 | `\nPerforming automatic check-in at ${new Date().toLocaleString()}\n` 29 | .green 30 | ); 31 | performCheckIn(); 32 | }); 33 | 34 | job.start(); 35 | console.log('Cron job set to run every 12 hours.'.green); 36 | } else if (choice === 0) { 37 | console.log('👋 Exiting the bot. See you next time!'.cyan); 38 | console.log('Subscribe: https://t.me/HappyCuanAirdrop.'.green); 39 | process.exit(0); 40 | } else { 41 | console.log('Invalid choice. Exiting...'.red); 42 | console.log('Subscribe: https://t.me/HappyCuanAirdrop.'.green); 43 | process.exit(0); 44 | } 45 | })(); 46 | -------------------------------------------------------------------------------- /src/userData.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { BEARERS, BASE_URL } = require('./config'); 3 | 4 | async function getData(token) { 5 | const { data } = await axios({ 6 | url: BASE_URL + '/backend_apis/api/service/userInfo', 7 | method: 'GET', 8 | headers: { 9 | Authorization: `Bearer ${token}`, 10 | }, 11 | }); 12 | return data.data; 13 | } 14 | 15 | async function displayUserData() { 16 | try { 17 | for (let i = 0; i < BEARERS.length; i++) { 18 | const userData = await getData(BEARERS[i]); 19 | 20 | console.log(`[ ### Account ${i + 1} ### ]\n`.bold.green); 21 | console.log(`Name: ${userData.xName}`.bold.yellow); 22 | console.log(`X Username: ${userData.xUsername}`.bold.yellow); 23 | console.log(`Address: ${userData.point.address}`.bold.yellow); 24 | console.log(`Current Points: ${userData.point.currentPoints}`.bold.green); 25 | console.log(`Multiplier: ${userData.point.multiplier}x`.bold.cyan); 26 | console.log( 27 | `Consecutive Check-in Count: ${userData.point.consecutiveCheckinCount}` 28 | .bold.magenta 29 | ); 30 | console.log( 31 | `Pet Details: [ Name: ${userData.eggInfo.eggInfo.name} | Type: ${userData.eggInfo.eggInfo.type} | Info: ${userData.eggInfo.eggInfo.info} ]` 32 | .bold.blue 33 | ); 34 | console.log('\n==================================\n'); 35 | } 36 | } catch (error) { 37 | console.log(`Error: ${error.message}`.red); 38 | } 39 | } 40 | 41 | module.exports = { 42 | displayUserData, 43 | }; 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🚀 OpenLayer Airdrop Bot 2 | 3 | **Created by [HappyCuanAirdrop](https://t.me/HappyCuanAirdrop)** 4 | 5 | This bot automatically checks in to OpenLayer to claim daily rewards on your behalf. It uses bearer tokens to authenticate, which you will need to retrieve from your browser. 6 | 7 | ## Features 8 | 9 | - **Auto daily check-in:** Automatically claims your rewards every 12 hours using a cron job. 10 | - **Display user info:** View account details like points, username, address, consecutive check-ins, and pet details. 11 | - **Multiple accounts support:** Easily manage multiple accounts using a single script. 12 | 13 | ## How to Use 14 | 15 | ### 1. Clone the Repository 16 | 17 | First, clone the repository to your local machine: 18 | 19 | ```bash 20 | git clone https://github.com/dante4rt/openlayer-airdrop-bot.git 21 | cd openlayer-airdrop-bot 22 | ``` 23 | 24 | ### 2. Install Dependencies 25 | 26 | Run the following command to install the required Node.js packages: 27 | 28 | ```bash 29 | npm install 30 | ``` 31 | 32 | ### 3. Create `bearers.json` 33 | 34 | You need to create a file named `bearers.json` in the root folder to store your authentication tokens (Bearer tokens). These tokens authenticate the bot to perform actions on your OpenLayer accounts. 35 | 36 | The `bearers.json` file should have the following format: 37 | 38 | ```json 39 | [ 40 | "eyJhbGciOiJ...YourFirstBearerToken", 41 | "eyJhbGciOiJ...YourSecondBearerToken" 42 | ] 43 | ``` 44 | 45 | #### How to Get the Bearer Token? 46 | 47 | 1. Open the OpenLayer extension and log in to your account. 48 | 2. Right-click on the extension page and select **Inspect**. 49 | 3. Go to the **Console** tab. 50 | 4. Paste the following command into the console and press `Enter`: 51 | 52 | ```javascript 53 | console.log(localStorage.getItem('_open_layer_token_')) 54 | ``` 55 | 56 | 5. Copy the value that appears. This is your Bearer token. 57 | 6. Add this token to your `bearers.json` file. 58 | 59 | ### 4. Run the Bot 60 | 61 | You can now run the bot with the following command: 62 | 63 | ```bash 64 | npm start 65 | ``` 66 | 67 | - The bot will display your account information. 68 | - You'll be prompted to choose between an automatic daily check-in or exiting. 69 | 70 | ### 5. Automate Daily Check-ins 71 | 72 | When you choose the auto daily check-in option, the bot will: 73 | 74 | - Perform the first check-in immediately. 75 | - Set up a cron job to perform automatic check-ins every 12 hours. 76 | 77 | ## Donations 78 | 79 | If you found this bot helpful, consider supporting the project: 80 | 81 | - **Solana**: `GLQMG8j23ookY8Af1uLUg4CQzuQYhXcx56rkpZkyiJvP` 82 | - **EVM**: `0x960EDa0D16f4D70df60629117ad6e5F1E13B8F44` 83 | - **BTC**: `bc1p9za9ctgwwvc7amdng8gvrjpwhnhnwaxzj3nfv07szqwrsrudfh6qvvxrj8` 84 | 85 | ## License 86 | 87 | This project is licensed under the [MIT License](LICENSE). Feel free to use and modify it for your own purposes. 88 | 89 | ## Follow Us 90 | 91 | Stay updated with more bots and crypto airdrop news by joining [HappyCuanAirdrop](https://t.me/HappyCuanAirdrop)! 92 | --------------------------------------------------------------------------------