Union Auto Bot is a cutting-edge Node.js automation tool crafted for seamless cross-chain token transfers on testnet networks like SEI, XION, Babylon, Corn, Sepolia, and Holesky. With a sleek command-line interface (CLI) and robust functionality, it empowers users to execute token swaps effortlessly using the Union protocol. Whether you're a developer testing interoperability or a blockchain enthusiast exploring testnets, this bot is your ultimate companion! ๐ ๏ธ
โ ๏ธ Important: This tool is for testnet use only. Ensure you have testnet tokens for gas and transfers. Use responsibly!
- Cross-Chain Magic ๐: Transfer tokens between SEI, XION, Babylon, and destinations like Corn, Sepolia, and Holesky.
- Interactive CLI ๐ฅ๏ธ: Navigate a vibrant menu with arrow keys and Enter to select options.
- Flexible Token Support ๐ฐ: Swap native tokens (SEI, XION, BBN) or stablecoins (USDC).
- Customizable Transfers โ๏ธ: Set transfer amounts, transaction counts, and delays with ease.
- Real-Time Feedback ๐: Enjoy a loading spinner, color-coded outputs, and transaction summaries.
- Error Resilience ๐ก๏ธ: Handles wallet misconfigurations, insufficient balances, and network hiccups gracefully.
- Transaction Insights ๐: View transaction hashes, packet hashes, and block explorer links for transparency.
- Wallet Integration ๐: Supports EVM (SEI) and Cosmos (XION, Babylon) wallets for secure operations.
| Network | Chain ID | RPC Endpoint | Denom | Gas Price |
|---|---|---|---|---|
| SEI Testnet | 1328 | https://evm-rpc-testnet.sei-apis.com |
SEI | Dynamic |
| XION Testnet | xion-testnet-2 |
https://rpc.xion-testnet-2.burnt.com/ |
uxion | 0.025uxion |
| Babylon Testnet | bbn-test-3 |
https://babylon-testnet-rpc.nodes.guru |
ubbn | 0.0025ubbn |
- Corn ๐ฟ: Channel ID 3, Token Address:
e53dcec07d16d88e386ae0710e86d9a400f83c31 - Sepolia ๐งช: Channel ID 1, Token Address:
bd030914ab8d7ab1bd626f09e47c7cc2881550a3 - Holesky ๐ณ๏ธ: Channel ID 2, Token Address:
77b99a27a5fed3bc8fb3e2f1063181f82ec48637
Before diving in, ensure you have:
- Node.js (v16+): Download here ๐ฆ
- npm: Comes with Node.js
- Testnet Wallets: Private keys for SEI, XION, and Babylon with testnet funds
- Testnet Tokens: Grab tokens from testnet faucets for gas and transfers ๐ง
- Git: For cloning the repository Install Git
-
Clone the Repository ๐:
git clone https://github.com/Kazuha787/Union-Auto-Bot.git cd Union-Auto-Bot -
Install Dependencies ๐:
npm install
Key dependencies include:
ethers: Ethereum-compatible transactions@cosmjs/proto-signing,@cosmjs/stargate: Cosmos SDK supportaxios: GraphQL queries for packet hashesviem: Hex conversionscrypto: Random salt generationreadline: CLI input handling
-
Configure Wallets ๐:
- Create a
wallet.jsonfile in the project root:{ "wallets": [ { "sei_privatekey": "0xYourSeiPrivateKey", "xion_privatekey": "0xYourXionPrivateKey", "babylon_privatekey": "0xYourBabylonPrivateKey", "babylon_address": "bbnYourBabylonAddress" } ] } - Pro Tip: Use testnet private keys only and ensure sufficient funds.
- Create a
-
Union Instruction Builder ๐งฉ:
- The bot requires
union-instruction-builder.jsfor token configs and messages. If missing, a placeholder is used. For custom logic, addunion-instruction-builder.jswith:getTokenConfig(type): Returns token details (e.g., USDC, XION)createSendMessage(params): Builds Cosmos transfer messages
- The bot requires
-
Launch the Bot:
node main.js
-
Navigate the Menu ๐ฎ:
- Use Up โฌ๏ธ and Down โฌ๏ธ arrow keys to highlight options.
- Press Enter โ to select.
- Menu options:
- ๐ SEI to XION SWAP
- ๐ฝ SEI to CORN SWAP
- ๐๏ธ XION to Babylon SWAP
- ๐ Babylon to Others SWAPS
- ๐ช Exit
-
Configure Transfers ๐ ๏ธ:
- SEI to XION/CORN:
- Amount: Enter SEI amount (default: 0.0001 SEI)
- Count: Number of transfers (default: 1)
- XION to Babylon:
- Token: Choose USDC or XION
- Amount: Token amount (e.g., 0.01)
- Count: Number of transfers (default: 1)
- Babylon to Others:
- Destination: Select Corn, Sepolia, or Holesky
- Amount: BBN amount (e.g., 0.001)
- Count: Number of transfers (default: 1)
- Delay: Seconds between transactions (default: 0)
- SEI to XION/CORN:
-
Track Progress ๐ก:
- Watch the CLI for:
- Transaction hashes with block explorer links (e.g., seitrace.com)
- Packet hashes (polled via GraphQL)
- Color-coded status: ๐ข Success, ๐ด Failure
- A detailed summary shows successful/failed transfers and hashes.
- Watch the CLI for:
-
Exit Gracefully:
- Select Exit or press Ctrl+C to stop the bot. ๐
Modify network configurations in the script if needed:
- XION Testnet:
const XION_TESTNET = { chainId: "xion-testnet-2", rpcEndpoint: "https://rpc.xion-testnet-2.burnt.com/", prefix: "xion", denom: "uxion", gasPrice: GasPrice.fromString("0.025uxion") };
- Babylon Testnet:
const BABYLON_TESTNET = { chainId: "bbn-test-3", rpcEndpoint: "https://babylon-testnet-rpc.nodes.guru", prefix: "bbn", denom: "ubbn", gasPrice: GasPrice.fromString("0.0025ubbn") };
- SEI Testnet:
const provider = new ethers.JsonRpcProvider("https://evm-rpc-testnet.sei-apis.com");
Update DESTINATIONS to add or modify transfer destinations:
const DESTINATIONS = {
corn: { name: "Corn", channelId: 3, tokenAddress: "e53dcec07d16d88e386ae0710e86d9a400f83c31" },
sepolia: { name: "Sepolia", channelId: 1, tokenAddress: "bd030914ab8d7ab1bd626f09e47c7cc2881550a3" },
holesky: { name: "Holesky", channelId: 2, tokenAddress: "77b99a27a5fed3bc8fb3e2f1063181f82ec48637" }
};- SEI: Dynamic gas pricing using
provider.getFeeData(). - XION: Fixed gas of 696861 and 697 uxion per transfer.
- Babylon: Fixed gas of 500000 and 1000 ubbn per transfer.
The bot is built to handle errors gracefully:
- Wallet Errors ๐ซ: Validates private keys and addresses in
wallet.json. - Balance Checks ๐ธ: Ensures sufficient tokens and gas before transfers.
- Network Failures ๐: Retries packet hash queries (50 attempts, 5s delay).
- User Input โจ๏ธ: Validates amounts, counts, and delays with clear error messages.
- Transaction Failures ๐ด: Logs detailed errors and continues with remaining transfers.
Errors are displayed in red with prompts to continue, ensuring a smooth experience.
We love contributions! Here's how to get started:
- Fork the Repo ๐ด: https://github.com/Kazuha787/Union-Auto-Bot
- Create a Branch ๐ฟ:
git checkout -b feature/your-awesome-feature
- Make Changes โ๏ธ: Add features, fix bugs, or improve docs.
- Commit ๐:
git commit -m "Add your awesome feature" - Push ๐:
git push origin feature/your-awesome-feature
- Submit a Pull Request ๐ฌ: Include a clear description of your changes.
Contribution Ideas:
- Add support for new testnet networks ๐
- Enhance the CLI with progress bars or ASCII art ๐จ
- Implement batch transaction optimization โก
- Improve error logging with file outputs ๐
Join our vibrant community for help and updates:
- Telegram ๐ฉ: t.me/Offical_Im_kazuha
- GitHub Issues ๐: Report bugs or suggest features here
- Discussions ๐ฌ: Share ideas in the GitHub Discussions
This project is licensed under the MIT License. See the LICENSE file for details. ๐
Union Auto Bot is for testnet environments only. Using it on mainnet may lead to loss of funds. The author is not liable for any misuse or unintended consequences. Always verify wallet configurations and test thoroughly. ๐
- Union Protocol: For enabling cross-chain interoperability
- Cosmos SDK & Ethers.js: For robust blockchain interactions
- Community: For feedback and support on Telegram
Built with ๐ by Kazuha
๐ GitHub | ๐ฉ Telegram
Let's conquer the testnet together! ๐
-
Visual Appeal:
- Added emojis (๐, ๐, ๐ ๏ธ, etc.) for engagement.
- Used modern Markdown formatting with tables, badges, and callouts.
- Color-coded CLI feedback mirrored in documentation (๐ข, ๐ด).
-
Advanced Sections:
- Added Supported Networks & Destinations with a table.
- Included Advanced Configuration for developers.
- Expanded Contributing with specific ideas.
- Added Acknowledgments for a professional touch.
-
User-Friendly:
- Clear installation steps with code blocks and links.
- Detailed usage instructions with menu navigation.
- Comprehensive error handling section.
-
Professional Tone:
- Maintained a balance between technical accuracy and accessibility.
- Included a disclaimer for legal clarity.
- Linked to community resources for support.
To use this README, create a README.md file in your repository and paste the content above. If you need a LICENSE file or further customization (e.g., badges for build status, npm version), let me know! ๐
