otmoic-cli has functions such as generating account reports, querying quotes, and making exchanges.
$ npm install -g otmoiccli
$ otmoiccli COMMAND
running command...
$ otmoiccli (--version)
otmoiccli/0.0.7 darwin-arm64 node-v20.11.1
$ otmoiccli --help [COMMAND]
USAGE
$ otmoiccli COMMAND
...The otmoiccli ask command is used to request a relay quote for a specified bridge and amount. This command interacts with the relay service to fetch the best available quote based on the provided parameters.
otmoiccli ask [OPTIONS]-r, --relay: Relay URL.-n, --network: Network (mainnet/testnet).-c, --chainRpc: RPC config JSON (e.g.,{ bsc: "<RPC_BSC>" }).-b, --bridge: Bridge name (e.g.,BSC=0x55d398326f99059ff775485246999027b3197955(USDT)-->OPT-0x94b00aa00579c1307b0ef2c499ad98a8ce58e58(USDT)).-a, --amount: Amount to exchange.
# Request a relay quote with specified parameters
otmoiccli ask --relay https://relay.example.com --network mainnet --chainRpc '{"bsc": "https://bsc.rpc.url"}' --bridge BSC=0x55d398326f99059ff775485246999027b3197955(USDT)-->OPT-0x94b00aa00579c1307b0ef2c499ad98a8ce58e58(USDT) --amount 100The implementation of this command can be found in src/commands/ask.ts.
The otmoiccli help [COMMAND] command provides detailed information about a specific command, including its usage and options.
otmoiccli help [COMMAND] [OPTIONS]COMMAND: The command to get help for.-n, --nested-commands: Include all nested commands in the output.
# Get help for the ask command
otmoiccli help ask
# Get help for the monkey command
otmoiccli help monkeySee code: @oclif/plugin-help
The otmoiccli reportforms command is used to generate report forms by syncing data and creating reports based on the provided parameters.
otmoiccli reportforms [OPTIONS]-f, --force: Force the operation.-n, --name: Name to print.
# Run the reportforms command
otmoiccli reportforms
# Run the reportforms command with a specific name
otmoiccli reportforms --name oclif- Prompt for Modes: The command will prompt you to select the modes you want to run (Sync Data, Create Report Forms).
- Prompt for DB Path: You will be asked to enter the database path.
- Prompt for Wallets: You will be asked to enter your wallets.
- Prompt for Chains: You will be asked to select the chains you want to include (BSC, OPT).
The implementation of this command can be found in src/commands/reportforms.ts.
The otmoiccli swap command is used to exchange tokens across different blockchains. This command interacts with various blockchain networks to facilitate token swaps.
otmoiccli swap [OPTIONS]-r, --relay: Relay URL.-n, --network: Network (mainnet/testnet).-c, --chainRpc: RPC config JSON (e.g.,{ bsc: "<RPC_BSC>" }).-b, --bridge: Bridge name (e.g.,BSC-0x55d398326f99059fF775485246999027b3197955(USDT)-->OPT-0x94b08aa00579c1307b0ef2c499ad98a8ce58e58(USDT)).-a, --amount: Amount to exchange.-p, --privateKeyForSign: Your wallet private key for signing the deal.-s, --privateKeyForSend: Your wallet private key for sending the source token.-t, --to: Your wallet address for receiving the token.
# Run the swap command with specified parameters
otmoiccli swap --relay https://relay.example.com --network mainnet --chainRpc '{"bsc": "https://bsc.rpc.url"}' --bridge BSC-0x55d398326f99059ff775485246999027b3197955(USDT)-->OPT-0x94b008aa00579c1307b0ef2c499ad98a8ce58e58(USDT) --amount 100 --privateKeyForSign <PRIVATE_KEY> --privateKeyForSend <PRIVATE_KEY> --to <RECEIVING_ADDRESS>- Initialize SwapActuator: The command initializes a
SwapActuatorwith the provided parameters. - Fetch Quote: The actuator fetches a quote for the specified bridge and amount.
- Sign and Send Transaction: The actuator signs and sends the transaction using the provided private keys.
- Receive Tokens: The tokens are received at the specified receiving address.
The implementation of this command can be found in src/commands/swap.ts.
The otmoiccli monkey command is used to perform automated periodic swap tasks on the blockchain network, often in conjunction with shell scripts such as monkey_mainnet.sh.
otmoiccli monkey [OPTIONS]-i, --interval: Interval range for task execution, in the format of [min]-[max] (e.g., 3600-7200).-r, --relay: Relay URL.-a, --amount: Per mille of srctokens exchanged (base of balance) in each test, random within a specific range, in the format of [min]-[max] (e.g., 1000-1000).-p, --privateKey: Your Evm wallet private key for signing the deal.-s, --solanaPrivateKey: Your Solana wallet private key.-t, --task: Task type (e.g., succeed, refund, cheat amount, cheat address, cheat txin).-C, --complaint: Complaint flag (true/false).-n, --network: Network (mainnet/testnet).-T, --to: Your Evm address for receiving token.-S, --solanaTo: Your Solana address for receiving token.-w, --webhook: Webhook URL.-b, --bridge: Bridges to be tested are separated by commas. If it is empty, there is no limit.-c, --chainRpc: RPC config JSON (e.g.,{"opt": "https://sepolia.optimism.io"}).-l, --lp: Lp name to be tested. no restriction if empty.-d, --debug: Debug flag for output detailed lp (true/false).
# Run the monkey command with specified parameters
otmoiccli monkey -i 300-450 -r https://relay.example.com -a 1000-1000 -p <PRIVATE_KEY> -s <SOLANA_PRIVATE_KEY>
# Run the monkey command with specified parameters
otmoiccli monkey -i 300-450 -r https://relay.example.com -a 1000-1000 -p <PRIVATE_KEY> -s <SOLANA_PRIVATE_KEY> -t "succeed" -C true -n testnet -T 0x945e9704D2735b420363071bB935ACf2B9C4b814 -S 0xfee69ce6840ffcc48af425d5827e8dbcb1a9afd688ef206ee3da5c9ef23503dc -w http://xxx -b "" -c '{"opt": "https://sepolia.optimism.io"}' -l "" -d true- Initialize Log Directory: The script checks if the log directory exists and creates it if it doesn't.
- Get Current Date and Time: The script fetches the current date and time.
- Set Break Times: The script sets the break start and end times for the day.
- Check Break Window: The script checks if the current time is within the break window. If it is, it sleeps until the break ends.
- Execute Task: If not in the break window, the script logs the start of the task and executes the
monkeycommand with the specified parameters. - Log Output: The script logs the output of the task execution.
- Restart on Exit: If the task exits, the script logs the exit code and restarts the task after a short delay.
The implementation of this command can be found in src/commands/monkey.ts and monkey_mainnet.sh.
We welcome contributions to this project! If you are interested in contributing, please follow these steps:
-
Fork the repository: Click the "Fork" button at the top right of this page to create a copy of this repository in your GitHub account.
-
Clone your fork: Use the following command to clone your forked repository to your local machine:
git clone https://github.com/your-username/Command-Line-Interface.git
-
Create a new branch: Create a new branch for your feature or bugfix:
git checkout -b my-feature-branch
-
Install dependencies: Navigate to the project directory and install the dependencies:
cd Command-Line-Interface npm install -
Make your changes: Implement your feature or bugfix.
-
Commit your changes: Commit your changes with a descriptive commit message:
git commit -am 'Add new feature' -
Push to your fork: Push your changes to your forked repository:
git push origin my-feature-branch
-
Create a pull request: Open a pull request from your forked repository to the main repository.
Thank you for contributing!
This project is licensed under the terms of the LICENSE.txt file.