npm package: @paratro/cli
Description: CLI for Paratro MPC Wallet Gateway
Author: Paratro
Latest version: 1.1.9

# @paratro/cli

[![npm](https://img.shields.io/npm/v/@paratro/cli)](https://www.npmjs.com/package/@paratro/cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Command-line interface for [Paratro](https://paratro.com) MPC Wallet Gateway — manage wallets, accounts, assets and transfers from your terminal.

## Features

- **Wallet Management** — Create, list and inspect MPC wallets
- **Multi-Chain Accounts** — Create accounts on Ethereum, Polygon, Avalanche, Solana and more
- **Transfer Funds** — Send USDC, USDT and other tokens with one command
- **Transaction History** — Query and filter transactions by wallet, chain or account
- **Config Management** — Store API credentials locally in `~/.paratro/config.json`
- **x402 Payments** — Track X402_SIGN and X402_SETTLE transaction types

## Installation

```bash
npm install -g @paratro/cli
```

Or run directly without installing:

```bash
npx @paratro/cli --help
```

## Setup

```bash
# Set API credentials
paratro config set --api-key <your-api-key> --api-secret <your-api-secret>

# Set environment
paratro config set --env sandbox        # sandbox (testnet)
paratro config set --env production     # production (mainnet)

# Or use a custom endpoint
paratro config set --base-url https://your-api.example.com

# View current configuration
paratro config get

# Show config file path
paratro config path
```

## Commands

### Wallet

```bash
# Create a new wallet
paratro wallet create --name "Treasury" --description "Main treasury wallet"

# Get wallet details
paratro wallet get <wallet_id>

# List all wallets
paratro wallet list
paratro wallet list --page 2 --page-size 5
```

### Account

```bash
# Create an account under a wallet
paratro account create --wallet <wallet_id> --chain ethereum --label "Hot Wallet"

# Supported chains: ethereum, bsc, polygon, avalanche, arbitrum, optimism, tron, bitcoin, solana

# Get account details
paratro account get <account_id>

# List accounts for a wallet
paratro account list --wallet <wallet_id>
```

### Transfer

```bash
# Send funds
paratro transfer send \
  --from 0xYourAddress... \
  --to 0xRecipient... \
  --chain ethereum \
  --token USDC \
  --amount 100.50 \
  --memo "Invoice #1234"

# Get transaction details
paratro transfer get <tx_id>

# List transactions
paratro transfer list --wallet <wallet_id>
paratro transfer list --chain ethereum --page 1 --page-size 20
```

### Other

```bash
# Show version
paratro version
paratro -v

# Show help
paratro help
paratro --help
```

## Example Workflow

```bash
# 1. Configure
paratro config set --api-key pk_test_xxx --api-secret sk_test_xxx --env sandbox

# 2. Create wallet
paratro wallet create --name "Agent Wallet"

# 3. Wait for wallet to be ready (status=ACTIVE, key_status=ACTIVE)
paratro wallet get <wallet_id>

# 4. Create Ethereum account
paratro account create --wallet <wallet_id> --chain ethereum --label "USDC Account"

# 5. Check address
paratro account get <account_id>

# 6. Send USDC
paratro transfer send --from <address> --to <recipient> --chain ethereum --token USDC --amount 10

# 7. Check transaction
paratro transfer get <tx_id>
```

## Configuration

Stored in `~/.paratro/config.json`:

```json
{
  "api_key": "pk_test_xxx",
  "api_secret": "sk_test_xxx",
  "env": "sandbox"
}
```

| Field | Description |
|-------|-------------|
| `api_key` | Your Paratro API key |
| `api_secret` | Your Paratro API secret |
| `env` | `sandbox` or `production` |
| `base_url` | Custom API endpoint (overrides `env`) |

## Supported Chains

| Chain | Value | Type |
|-------|-------|------|
| Ethereum | `ethereum` | EVM |
| BNB Smart Chain | `bsc` | EVM |
| Polygon | `polygon` | EVM |
| Avalanche | `avalanche` | EVM |
| Arbitrum | `arbitrum` | EVM |
| Optimism | `optimism` | EVM |
| Tron | `tron` | TVM |
| Bitcoin | `bitcoin` | UTXO |
| Solana | `solana` | SVM |

## Requirements

- Node.js >= 18

## Links

- [SDK Package](https://www.npmjs.com/package/@paratro/sdk)
- [Documentation](https://docs.paratro.com)
- [GitHub](https://github.com/paratro/paratro-packages)
- [Website](https://paratro.com)

## License

MIT