The Somnia Auto-Bot is a Node.js-based automation tool designed to perform token swaps and automatic transactions on the Somnia network. It allows users to generate additional wallets, store their private keys securely, and perform circular transactions between the main wallet and generated wallets. The bot supports swapping tokens ($PING
and $PONG
) and sending native tokens (STT
) automatically.
-
Token Swapping:
- Swap
$PING
and$PONG
tokens using a predefined swap contract. - Supports multiple swap sequences.
- Swap
-
Automatic Wallet Generation:
- Generate additional wallets based on user input.
- Store wallet details (address and private key) securely in a
privatekey.json
file.
-
Automatic Transactions:
- Send
STT
(native token) between wallets in a circular manner. - Optionally send
$PING
or$PONG
tokens between wallets.
- Send
-
User-Friendly Interface:
- ASCII art interface with menu options.
- Interactive prompts for user input.
-
Configuration via
.env
:- Customize RPC URL, private keys, contract addresses, and other parameters.
Before using the Somnia Auto-Bot, ensure you have the following installed:
- Node.js (v16 or higher)
- npm (Node Package Manager)
- Git (optional, for cloning the repository)
-
Clone the Repository:
git clone https://github.com/zidanaetrna/somnia-auto.git cd somnia-auto-bot
-
Install Dependencies:
npm install
-
Set Up
.env
File: Open a.env
file in the src directory and add your privatekey:cd src && nano .env
It will be looked like this:
# Network and Wallet Info RPC_URL=https://dream-rpc.somnia.network MAIN_PRIVATE_KEY=your_main_private_key_here CHAIN_ID=50312 # Contract Addresses SWAP_ADDRESS=0x6aac14f090a35eea150705f72d90e4cdc4a49b2c PING_TOKEN=0x33e7fab0a8a5da1a923180989bd617c9c2d1c493 PONG_TOKEN=0x9beaa0016c22b646ac311ab171270b0ecf23098f # Swap Parameters FEE_TIER=500 MIN_GAS_BALANCE=0.01 # Display Symbols NATIVE_TOKEN_SYMBOL=STT TOKEN_A_SYMBOL=$PING TOKEN_B_SYMBOL=$PONG PROJECT_NAME=Somnia CREATOR_NAME=aetrna
Replace
your_main_private_key_here
with your main wallet's private key.
-
Start the Bot:
node main.js
-
Choose an Option: The bot will display a menu with the following options:
[1] Automatic swap [2] Automatic send [3] Both
- Option 1: Perform token swaps only.
- Option 2: Generate wallets and perform automatic
STT
transactions. - Option 3: Perform both token swaps and automatic transactions.
-
Follow the Prompts:
- For Option 1, enter the amount of tokens to swap and the number of swap sequences.
- For Option 2 or Option 3, enter the number of wallets to generate.
Select an option (1-3): 1
Enter the amount of tokens to swap (e.g., 0.1): 0.1
Enter the number of times to swap (e.g., 2): 2
Select an option (1-3): 2
Enter the number of wallets to generate (e.g., 2): 2
Select an option (1-3): 3
Enter the number of wallets to generate (e.g., 2): 2
Enter the amount of tokens to swap (e.g., 0.1): 0.1
Enter the number of times to swap (e.g., 2): 2
Select an option (1-4): 4
Available tokens: STT, WSTT, USDC, WETH
Enter the token to swap from (e.g., STT): stt
Enter the token to swap to (e.g., WSTT): usdc
Enter the amount of tokens to swap (e.g., 0.1): 0.1
swap.js
: Handles token swap logic.auto.js
: Manages wallet generation, storage, and automatic transactions.main.js
: Provides the user interface and orchestrates the bot..env
: Stores configuration variables.privatekey.json
: Stores generated wallet details.
-
Wallet Funding:
- Please fund your main wallet with STT, Ping and Pong in order to make the bot running perfectly.
-
Security:
- Never share your
.env
file orprivatekey.json
file. These contain sensitive information.
- Never share your
-
Transaction Fees:
- Ensure the main wallet has sufficient
STT
for gas fees.
- Ensure the main wallet has sufficient
-
Customization:
- Modify the
.env
file to use different RPC URLs, contract addresses, or tokens.
- Modify the
ethers
: For interacting with the Ethereum blockchain.web3
: For additional blockchain functionality.dotenv
: For loading environment variables from.env
.
Install dependencies using:
npm install ethers web3 dotenv
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or issues, please open an issue on the GitHub repository.
Enjoy using the Somnia Auto-Bot! 🚀