# Wallet CLI - Multi-Blockchain Wallet Management Tool

Wallet CLI is a powerful command-line tool for managing multi-blockchain wallets. It allows you to generate public keys, manage balances, transfer funds, and estimate transaction fees with ease. The tool supports a wide range of blockchains and tokens, making it an essential utility for developers and blockchain enthusiasts.

---

## Installation

Install the `@codegame.dev/wallet-cli` globally using npm:

```bash
npm install -g @codegame.dev/wallet-cli
```

This makes the `wallet-cli` command accessible from anywhere on your system.

---

## Features

- Generate public keys for multiple blockchains from an existing or new mnemonic.
- View wallet balances in real-time.
- Perform secure and efficient transfers.
- Estimate transaction fees for supported networks.
- Wallet creation is supported for most major blockchains, but other features are currently supported for these blockchains: Ethereum, Binance Smart Chain, Polygon, Tron, Ton. In the future, other chains will be added.

---

## Commands Overview

### General Options

- **`-V, --version`**: Display the version number.
- **`-h, --help`**: Show help for any command.

### Commands

#### `coin-list`

Display a list of all supported coins.

Options:

- **`-s <text>`**: Search for a specific coin.
- **`--json`**: Output results in JSON format.

Example:

```bash
wallet-cli coin-list -s bitcoin
```

#### `get-address`

Retrieve the public address for a specific coin.

Options:

- **`--mnemonic <mnemonic>`**: Specify an existing mnemonic.
- **`--coin <coin>`**: Name of the coin (based on Trust Wallet Core).
- **`--coingecko-platform <platform>`**: Platform name (based on CoinGecko API).
- **`--json`**: Output results in JSON format.

Example:

```bash
wallet-cli get-address --mnemonic "your mnemonic" --coin ethereum
```

#### `create-wallet`

Generate a new mnemonic and wallet.

Options:

- **`--coin <coin>`**: Name of the coin (based on Trust Wallet Core).
- **`--coingecko-platform <platform>`**: Platform name (based on CoinGecko API).
- **`--json`**: Output results in JSON format.

Example:

```bash
wallet-cli create-wallet --coin bitcoin
```

#### `get-balance`

Check the balance of a wallet for a coin or token.

Options:

- **`--coin <coin>`**: Name of the coin (based on Trust Wallet Core).
- **`--coingecko-platform <platform>`**: Platform name (based on CoinGecko API).
- **`--address <address>`**: Wallet address.
- **`--token-address <token-address>`**: Contract address of the token.
- **`--json-rpc-provider <url>`**: URL of the JSON-RPC provider.
- **`--http-provider <url>`**: URL of the HTTP provider.
- **`--json`**: Output results in JSON format.
- **`--testnet`**: Use the testnet provider.

Example:

```bash
wallet-cli get-balance --coin ethereum --address 0xYourAddress
```

#### `transfer`

Send coins or tokens to another wallet.

Options:

- **`--mnemonic <mnemonic>`**: Specify an existing mnemonic.
- **`--coin <coin>`**: Name of the coin (based on Trust Wallet Core).
- **`--coingecko-platform <platform>`**: Platform name (based on CoinGecko API).
- **`--address <address>`**: Recipient wallet address.
- **`--amount <amount>`**: Amount to transfer.
- **`--token-address <token-address>`**: Contract address of the token.
- **`--json-rpc-provider <url>`**: URL of the JSON-RPC provider.
- **`--json`**: Output results in JSON format.
- **`--testnet`**: Use the testnet provider.

Example:

```bash
wallet-cli transfer --mnemonic "your mnemonic" --coin ethereum --address 0xReceiverAddress --amount 0.1
```

#### `estimate-fee`

Estimate the fees for a coin or token transfer.

Options:

- **`--mnemonic <mnemonic>`**: Specify an existing mnemonic.
- **`--coin <coin>`**: Name of the coin (based on Trust Wallet Core).
- **`--coingecko-platform <platform>`**: Platform name (based on CoinGecko API).
- **`--address <address>`**: Recipient wallet address.
- **`--amount <amount>`**: Amount to transfer.
- **`--token-address <token-address>`**: Contract address of the token.
- **`--json-rpc-provider <url>`**: URL of the JSON-RPC provider.
- **`--json`**: Output results in JSON format.
- **`--testnet`**: Use the testnet provider.

Example:

```bash
wallet-cli estimate-fee --mnemonic "your mnemonic" --coin ethereum --address 0xReceiverAddress --amount 0.1
```

---

## Supported Networks

The following networks are supported for `get-balance`, `transfer`, and `estimate-fee` commands:

- Ethereum (ETH)
- Binance Smart Chain (BSC)
- Polygon POS (POL)
- Tron (TRX)
- Ton (TON) - static estimate-fee

---

## Acknowledgements

Wallet CLI leverages the following libraries:

- [@trustwallet/wallet-core](https://github.com/trustwallet/wallet-core) for blockchain wallet operations.
- [ethers.js](https://github.com/ethers-io/ethers.js) for Ethereum-related operations.
- [tronweb](https://github.com/tronprotocol/tronweb) for interacting with the Tron network.

Special thanks to these projects for their contributions to the blockchain ecosystem.

---

## License

This project is licensed under the MIT License. See the [LICENSE](https://gitlab.com/dev.codegames/wallet-cli/-/blob/master/LICENSE) file for details.