whale-market-cli 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +719 -176
- package/dist/api.d.ts +45 -4
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +67 -11
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts +4 -4
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +38 -48
- package/dist/auth.js.map +1 -1
- package/dist/blockchain/aptos/constants.d.ts +13 -0
- package/dist/blockchain/aptos/constants.d.ts.map +1 -0
- package/dist/blockchain/aptos/constants.js +18 -0
- package/dist/blockchain/aptos/constants.js.map +1 -0
- package/dist/blockchain/aptos/contracts/OtcPreMarket.d.ts +7 -0
- package/dist/blockchain/aptos/contracts/OtcPreMarket.d.ts.map +1 -0
- package/dist/blockchain/aptos/contracts/OtcPreMarket.js +19 -0
- package/dist/blockchain/aptos/contracts/OtcPreMarket.js.map +1 -0
- package/dist/blockchain/aptos/contracts/PreMarket.d.ts +40 -0
- package/dist/blockchain/aptos/contracts/PreMarket.d.ts.map +1 -0
- package/dist/blockchain/aptos/contracts/PreMarket.js +226 -0
- package/dist/blockchain/aptos/contracts/PreMarket.js.map +1 -0
- package/dist/blockchain/aptos/index.d.ts +14 -0
- package/dist/blockchain/aptos/index.d.ts.map +1 -0
- package/dist/blockchain/aptos/index.js +49 -0
- package/dist/blockchain/aptos/index.js.map +1 -0
- package/dist/blockchain/aptos/signer.d.ts +4 -0
- package/dist/blockchain/aptos/signer.d.ts.map +1 -0
- package/dist/blockchain/aptos/signer.js +52 -0
- package/dist/blockchain/aptos/signer.js.map +1 -0
- package/dist/blockchain/aptos/utils.d.ts +6 -0
- package/dist/blockchain/aptos/utils.d.ts.map +1 -0
- package/dist/blockchain/aptos/utils.js +31 -0
- package/dist/blockchain/aptos/utils.js.map +1 -0
- package/dist/blockchain/evm/constants.d.ts +16 -0
- package/dist/blockchain/evm/constants.d.ts.map +1 -0
- package/dist/blockchain/evm/constants.js +334 -0
- package/dist/blockchain/evm/constants.js.map +1 -0
- package/dist/blockchain/evm/contracts/OtcPreMarket.d.ts +31 -0
- package/dist/blockchain/evm/contracts/OtcPreMarket.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/OtcPreMarket.js +164 -0
- package/dist/blockchain/evm/contracts/OtcPreMarket.js.map +1 -0
- package/dist/blockchain/evm/contracts/PreMarket.d.ts +52 -0
- package/dist/blockchain/evm/contracts/PreMarket.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/PreMarket.js +222 -0
- package/dist/blockchain/evm/contracts/PreMarket.js.map +1 -0
- package/dist/blockchain/evm/contracts/abis/ERC20.d.ts +62 -0
- package/dist/blockchain/evm/contracts/abis/ERC20.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/abis/ERC20.js +40 -0
- package/dist/blockchain/evm/contracts/abis/ERC20.js.map +1 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarket.d.ts +68 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarket.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarket.js +1112 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarket.js.map +1 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarketRef.d.ts +68 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarketRef.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarketRef.js +1148 -0
- package/dist/blockchain/evm/contracts/abis/OtcPreMarketRef.js.map +1 -0
- package/dist/blockchain/evm/contracts/abis/PreMarket.d.ts +81 -0
- package/dist/blockchain/evm/contracts/abis/PreMarket.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/abis/PreMarket.js +1871 -0
- package/dist/blockchain/evm/contracts/abis/PreMarket.js.map +1 -0
- package/dist/blockchain/evm/contracts/abis/PreMarketRef.d.ts +60 -0
- package/dist/blockchain/evm/contracts/abis/PreMarketRef.d.ts.map +1 -0
- package/dist/blockchain/evm/contracts/abis/PreMarketRef.js +1898 -0
- package/dist/blockchain/evm/contracts/abis/PreMarketRef.js.map +1 -0
- package/dist/blockchain/evm/ex-tokens.d.ts +16 -0
- package/dist/blockchain/evm/ex-tokens.d.ts.map +1 -0
- package/dist/blockchain/evm/ex-tokens.js +85 -0
- package/dist/blockchain/evm/ex-tokens.js.map +1 -0
- package/dist/blockchain/evm/index.d.ts +11 -0
- package/dist/blockchain/evm/index.d.ts.map +1 -0
- package/dist/blockchain/evm/index.js +35 -0
- package/dist/blockchain/evm/index.js.map +1 -0
- package/dist/blockchain/evm/signer.d.ts +2 -0
- package/dist/blockchain/evm/signer.d.ts.map +1 -0
- package/dist/blockchain/evm/signer.js +8 -0
- package/dist/blockchain/evm/signer.js.map +1 -0
- package/dist/blockchain/evm/utils.d.ts +8 -0
- package/dist/blockchain/evm/utils.d.ts.map +1 -0
- package/dist/blockchain/evm/utils.js +60 -0
- package/dist/blockchain/evm/utils.js.map +1 -0
- package/dist/blockchain/index.d.ts +9 -0
- package/dist/blockchain/index.d.ts.map +1 -0
- package/dist/blockchain/index.js +51 -0
- package/dist/blockchain/index.js.map +1 -0
- package/dist/blockchain/solana/constants.d.ts +28 -0
- package/dist/blockchain/solana/constants.d.ts.map +1 -0
- package/dist/blockchain/solana/constants.js +34 -0
- package/dist/blockchain/solana/constants.js.map +1 -0
- package/dist/blockchain/solana/index.d.ts +11 -0
- package/dist/blockchain/solana/index.d.ts.map +1 -0
- package/dist/blockchain/solana/index.js +38 -0
- package/dist/blockchain/solana/index.js.map +1 -0
- package/dist/blockchain/solana/programs/OtcPreMarket.d.ts +39 -0
- package/dist/blockchain/solana/programs/OtcPreMarket.d.ts.map +1 -0
- package/dist/blockchain/solana/programs/OtcPreMarket.js +238 -0
- package/dist/blockchain/solana/programs/OtcPreMarket.js.map +1 -0
- package/dist/blockchain/solana/programs/PreMarket.d.ts +50 -0
- package/dist/blockchain/solana/programs/PreMarket.d.ts.map +1 -0
- package/dist/blockchain/solana/programs/PreMarket.js +450 -0
- package/dist/blockchain/solana/programs/PreMarket.js.map +1 -0
- package/dist/blockchain/solana/programs/idl/otc_pre_market.d.ts +935 -0
- package/dist/blockchain/solana/programs/idl/otc_pre_market.d.ts.map +1 -0
- package/dist/blockchain/solana/programs/idl/otc_pre_market.js +937 -0
- package/dist/blockchain/solana/programs/idl/otc_pre_market.js.map +1 -0
- package/dist/blockchain/solana/programs/idl/pre_market.d.ts +2670 -0
- package/dist/blockchain/solana/programs/idl/pre_market.d.ts.map +1 -0
- package/dist/blockchain/solana/programs/idl/pre_market.js +2672 -0
- package/dist/blockchain/solana/programs/idl/pre_market.js.map +1 -0
- package/dist/blockchain/solana/signer.d.ts +2 -0
- package/dist/blockchain/solana/signer.d.ts.map +1 -0
- package/dist/blockchain/solana/signer.js +8 -0
- package/dist/blockchain/solana/signer.js.map +1 -0
- package/dist/blockchain/solana/utils.d.ts +6 -0
- package/dist/blockchain/solana/utils.d.ts.map +1 -0
- package/dist/blockchain/solana/utils.js +49 -0
- package/dist/blockchain/solana/utils.js.map +1 -0
- package/dist/blockchain/sui/constants.d.ts +20 -0
- package/dist/blockchain/sui/constants.d.ts.map +1 -0
- package/dist/blockchain/sui/constants.js +25 -0
- package/dist/blockchain/sui/constants.js.map +1 -0
- package/dist/blockchain/sui/contracts/OtcPreMarket.d.ts +7 -0
- package/dist/blockchain/sui/contracts/OtcPreMarket.d.ts.map +1 -0
- package/dist/blockchain/sui/contracts/OtcPreMarket.js +19 -0
- package/dist/blockchain/sui/contracts/OtcPreMarket.js.map +1 -0
- package/dist/blockchain/sui/contracts/PreMarket.d.ts +41 -0
- package/dist/blockchain/sui/contracts/PreMarket.d.ts.map +1 -0
- package/dist/blockchain/sui/contracts/PreMarket.js +243 -0
- package/dist/blockchain/sui/contracts/PreMarket.js.map +1 -0
- package/dist/blockchain/sui/index.d.ts +12 -0
- package/dist/blockchain/sui/index.d.ts.map +1 -0
- package/dist/blockchain/sui/index.js +29 -0
- package/dist/blockchain/sui/index.js.map +1 -0
- package/dist/blockchain/sui/signer.d.ts +4 -0
- package/dist/blockchain/sui/signer.d.ts.map +1 -0
- package/dist/blockchain/sui/signer.js +13 -0
- package/dist/blockchain/sui/signer.js.map +1 -0
- package/dist/blockchain/sui/utils.d.ts +5 -0
- package/dist/blockchain/sui/utils.d.ts.map +1 -0
- package/dist/blockchain/sui/utils.js +38 -0
- package/dist/blockchain/sui/utils.js.map +1 -0
- package/dist/blockchain/types.d.ts +70 -0
- package/dist/blockchain/types.d.ts.map +1 -0
- package/dist/blockchain/types.js +23 -0
- package/dist/blockchain/types.js.map +1 -0
- package/dist/commands/book.d.ts.map +1 -1
- package/dist/commands/book.js +17 -6
- package/dist/commands/book.js.map +1 -1
- package/dist/commands/completion.d.ts +3 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +112 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +239 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +11 -10
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/helpers/chain.d.ts +32 -0
- package/dist/commands/helpers/chain.d.ts.map +1 -0
- package/dist/commands/helpers/chain.js +174 -0
- package/dist/commands/helpers/chain.js.map +1 -0
- package/dist/commands/helpers/confirm.d.ts +4 -0
- package/dist/commands/helpers/confirm.d.ts.map +1 -0
- package/dist/commands/helpers/confirm.js +23 -0
- package/dist/commands/helpers/confirm.js.map +1 -0
- package/dist/commands/helpers/resolve.d.ts +32 -0
- package/dist/commands/helpers/resolve.d.ts.map +1 -0
- package/dist/commands/helpers/resolve.js +84 -0
- package/dist/commands/helpers/resolve.js.map +1 -0
- package/dist/commands/offers.d.ts.map +1 -1
- package/dist/commands/offers.js +71 -11
- package/dist/commands/offers.js.map +1 -1
- package/dist/commands/orders.js +22 -5
- package/dist/commands/orders.js.map +1 -1
- package/dist/commands/otc.d.ts +3 -0
- package/dist/commands/otc.d.ts.map +1 -0
- package/dist/commands/otc.js +249 -0
- package/dist/commands/otc.js.map +1 -0
- package/dist/commands/portfolio.d.ts.map +1 -1
- package/dist/commands/portfolio.js +55 -12
- package/dist/commands/portfolio.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +55 -67
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +6 -4
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tokens.d.ts.map +1 -1
- package/dist/commands/tokens.js +86 -12
- package/dist/commands/tokens.js.map +1 -1
- package/dist/commands/trade.d.ts +3 -0
- package/dist/commands/trade.d.ts.map +1 -0
- package/dist/commands/trade.js +645 -0
- package/dist/commands/trade.js.map +1 -0
- package/dist/commands/wallet.d.ts.map +1 -1
- package/dist/commands/wallet.js +146 -44
- package/dist/commands/wallet.js.map +1 -1
- package/dist/config.d.ts +19 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +57 -2
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/load-env.d.ts +2 -0
- package/dist/load-env.d.ts.map +1 -0
- package/dist/load-env.js +37 -0
- package/dist/load-env.js.map +1 -0
- package/dist/output/table.d.ts +10 -0
- package/dist/output/table.d.ts.map +1 -1
- package/dist/output/table.js +66 -18
- package/dist/output/table.js.map +1 -1
- package/dist/utils/wallet.d.ts +15 -8
- package/dist/utils/wallet.d.ts.map +1 -1
- package/dist/utils/wallet.js +42 -17
- package/dist/utils/wallet.js.map +1 -1
- package/package.json +19 -14
package/README.md
CHANGED
|
@@ -1,322 +1,865 @@
|
|
|
1
1
|
# Whale Market CLI
|
|
2
2
|
|
|
3
|
-
A command-line interface for the Whales Market trading platform,
|
|
4
|
-
|
|
5
|
-
**Repository:** [https://github.com/whalemarketdev/whale-market-cli](https://github.com/whalemarketdev/whale-market-cli)
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- 🐋 **Multi-chain Support**: Solana and EVM chains (Ethereum, BSC, Polygon, etc.)
|
|
10
|
-
- 💼 **Wallet Management**: Create, import, and manage wallets
|
|
11
|
-
- 📊 **Token Operations**: Browse, search, and view token details
|
|
12
|
-
- 💰 **Trading**: View and manage offers and orders
|
|
13
|
-
- 📈 **Portfolio Tracking**: Monitor your positions and portfolio
|
|
14
|
-
- 📚 **Order Book**: View order book per token (`whales book <symbol>`) + orderbook v2 operations
|
|
15
|
-
- 🎁 **Referral System**: Track campaigns and earnings
|
|
16
|
-
- 🎨 **Beautiful Output**: Table and JSON output formats
|
|
17
|
-
- ⚡ **Fast & Reliable**: Built with TypeScript for type safety
|
|
3
|
+
A command-line interface for the [Whales Market](https://whales.market) pre-market trading platform, supporting EVM chains, Solana, Sui, and Aptos.
|
|
18
4
|
|
|
19
5
|
## Installation
|
|
20
6
|
|
|
21
|
-
###
|
|
7
|
+
### npm (recommended)
|
|
22
8
|
|
|
23
9
|
```bash
|
|
24
10
|
npm install -g whale-market-cli
|
|
25
11
|
```
|
|
26
12
|
|
|
27
|
-
###
|
|
13
|
+
### Build from source
|
|
28
14
|
|
|
29
15
|
```bash
|
|
30
|
-
|
|
16
|
+
git clone https://github.com/whalemarketdev/whale-market-cli.git
|
|
17
|
+
cd whale-market-cli
|
|
18
|
+
npm install && npm run build && npm link
|
|
31
19
|
```
|
|
32
20
|
|
|
33
21
|
### Requirements
|
|
34
22
|
|
|
35
23
|
- Node.js 18.0.0 or higher
|
|
36
|
-
|
|
24
|
+
|
|
25
|
+
---
|
|
37
26
|
|
|
38
27
|
## Quick Start
|
|
39
28
|
|
|
40
|
-
|
|
29
|
+
```bash
|
|
30
|
+
# 1. Create or import a wallet
|
|
31
|
+
whales wallet create
|
|
32
|
+
whales wallet import "word1 word2 ... word12"
|
|
33
|
+
|
|
34
|
+
# 2. View tokens
|
|
35
|
+
whales tokens list
|
|
36
|
+
|
|
37
|
+
# 3. View order book
|
|
38
|
+
whales book MEGA
|
|
39
|
+
|
|
40
|
+
# 4. Place an offer (Solana mainnet, default chain)
|
|
41
|
+
whales trade create-offer --token 1 --side buy --price 0.5 --amount 100 --ex-token <USDC_mint>
|
|
42
|
+
|
|
43
|
+
# 5. Check your positions
|
|
44
|
+
whales orders my
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Shell Completion (Tab Autocomplete)
|
|
50
|
+
|
|
51
|
+
Enable tab completion for commands and subcommands:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Add to ~/.zshrc (zsh)
|
|
55
|
+
eval "$(whales completion)"
|
|
56
|
+
|
|
57
|
+
# Or for bash, add to ~/.bashrc
|
|
58
|
+
eval "$(whales completion --shell bash)"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then `source ~/.zshrc` (or `~/.bashrc`). After that, typing `whales ` + Tab suggests commands; `whales wallet ` + Tab suggests subcommands.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Global Options
|
|
66
|
+
|
|
67
|
+
All commands accept these flags:
|
|
68
|
+
|
|
69
|
+
| Flag | Description | Default |
|
|
70
|
+
|------|-------------|---------|
|
|
71
|
+
| `-f, --format <fmt>` | Output format: `table`, `json`, `plain` | `table` |
|
|
72
|
+
| `--chain-id <id>` | Override chain ID for this command | config value |
|
|
73
|
+
| `--api-url <url>` | Override API base URL for this command | config value |
|
|
74
|
+
| `-y, --yes` | Skip confirmation prompts | false |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Commands
|
|
41
79
|
|
|
42
|
-
|
|
80
|
+
### `whales setup`
|
|
81
|
+
|
|
82
|
+
Interactive first-time setup wizard. Guides you through wallet creation/import and API configuration.
|
|
43
83
|
|
|
44
84
|
```bash
|
|
45
85
|
whales setup
|
|
46
86
|
```
|
|
47
87
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- Saving your configuration
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `whales status`
|
|
52
91
|
|
|
53
|
-
|
|
92
|
+
Check API connectivity and display current wallet and config.
|
|
54
93
|
|
|
55
94
|
```bash
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
whales status
|
|
96
|
+
```
|
|
58
97
|
|
|
59
|
-
|
|
60
|
-
whales book MEGA
|
|
98
|
+
---
|
|
61
99
|
|
|
62
|
-
|
|
63
|
-
whales offers my
|
|
100
|
+
### `whales upgrade`
|
|
64
101
|
|
|
65
|
-
|
|
66
|
-
whales portfolio show
|
|
102
|
+
Self-update the CLI from the npm registry.
|
|
67
103
|
|
|
68
|
-
|
|
69
|
-
whales
|
|
104
|
+
```bash
|
|
105
|
+
whales upgrade
|
|
70
106
|
```
|
|
71
107
|
|
|
72
|
-
|
|
108
|
+
---
|
|
73
109
|
|
|
74
|
-
|
|
110
|
+
## Wallet Management
|
|
75
111
|
|
|
76
|
-
|
|
77
|
-
- `whales status` - Check API connectivity and wallet status
|
|
78
|
-
- `whales upgrade` - Self-update from npm registry
|
|
112
|
+
Wallets are stored locally as BIP-39 mnemonic phrases. A single mnemonic derives addresses for all chains (EVM, Solana, Sui, Aptos).
|
|
79
113
|
|
|
80
|
-
###
|
|
114
|
+
### `whales wallet create`
|
|
81
115
|
|
|
82
|
-
-
|
|
83
|
-
- `whales wallet import <private-key>` - Import existing wallet
|
|
84
|
-
- `whales wallet show` - Display wallet details
|
|
85
|
-
- `whales wallet address` - Show wallet address
|
|
86
|
-
- `whales wallet link <target-address>` - Link multiple wallets
|
|
116
|
+
Generate a new 12-word mnemonic wallet and save it to config.
|
|
87
117
|
|
|
88
|
-
|
|
118
|
+
```bash
|
|
119
|
+
whales wallet create
|
|
120
|
+
whales wallet create --name trading
|
|
121
|
+
```
|
|
89
122
|
|
|
90
|
-
|
|
91
|
-
- `whales tokens get <token-id>` - Get token details
|
|
92
|
-
- `whales tokens search <query> [--limit <n>]` - Search tokens
|
|
93
|
-
- `whales tokens highlight` - Get highlighted/trending tokens
|
|
94
|
-
- `whales tokens stats` - Get prediction stats
|
|
123
|
+
Output includes: mnemonic phrase, EVM address, Solana address. **Save the mnemonic securely.**
|
|
95
124
|
|
|
96
|
-
|
|
125
|
+
---
|
|
97
126
|
|
|
98
|
-
|
|
127
|
+
### `whales wallet import <mnemonic>`
|
|
99
128
|
|
|
100
|
-
|
|
129
|
+
Import an existing wallet using a 12 or 24-word BIP-39 seed phrase.
|
|
101
130
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
131
|
+
```bash
|
|
132
|
+
whales wallet import "word1 word2 word3 ... word12"
|
|
133
|
+
whales wallet import "word1 word2 ... word12" --name myWallet
|
|
134
|
+
```
|
|
106
135
|
|
|
107
|
-
|
|
136
|
+
---
|
|
108
137
|
|
|
109
|
-
|
|
110
|
-
- `whales orders my [--side buy|sell]` - List my orders
|
|
111
|
-
- `whales orders get <order-id>` - Get order details
|
|
112
|
-
- `whales orders by-offer <address>` - Orders for my offers
|
|
138
|
+
### `whales wallet list`
|
|
113
139
|
|
|
114
|
-
|
|
140
|
+
List all saved wallets.
|
|
115
141
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
```bash
|
|
143
|
+
whales wallet list
|
|
144
|
+
```
|
|
119
145
|
|
|
120
|
-
|
|
146
|
+
---
|
|
121
147
|
|
|
122
|
-
|
|
123
|
-
- `whales orderbook positions --telegram-id <id>` - Get positions
|
|
124
|
-
- `whales orderbook pairs --telegram-id <id>` - List trading pairs
|
|
125
|
-
- `whales orderbook filled <id>` - Get filled order details
|
|
148
|
+
### `whales wallet use <name>`
|
|
126
149
|
|
|
127
|
-
|
|
150
|
+
Switch the active wallet.
|
|
128
151
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- `whales referral transactions [--address <addr>]` - Get transactions
|
|
152
|
+
```bash
|
|
153
|
+
whales wallet use trading
|
|
154
|
+
```
|
|
133
155
|
|
|
134
|
-
|
|
156
|
+
---
|
|
135
157
|
|
|
136
|
-
|
|
137
|
-
- `whales shell` - Interactive REPL mode
|
|
158
|
+
### `whales wallet show`
|
|
138
159
|
|
|
139
|
-
|
|
160
|
+
Display addresses on all chains for the active wallet (or a named one).
|
|
140
161
|
|
|
141
|
-
|
|
162
|
+
```bash
|
|
163
|
+
whales wallet show
|
|
164
|
+
whales wallet show --name trading
|
|
165
|
+
whales wallet show --format json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### `whales wallet address`
|
|
171
|
+
|
|
172
|
+
Print only the wallet address for the currently configured chain.
|
|
142
173
|
|
|
143
174
|
```bash
|
|
144
|
-
whales
|
|
175
|
+
whales wallet address
|
|
145
176
|
```
|
|
146
177
|
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### `whales wallet remove <name>`
|
|
181
|
+
|
|
182
|
+
Remove a saved wallet from config. Does not affect the blockchain.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
whales wallet remove trading
|
|
147
186
|
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Configuration
|
|
191
|
+
|
|
192
|
+
### `whales config get [key]`
|
|
193
|
+
|
|
194
|
+
View current config. Omit `key` to print all values.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
whales config get
|
|
198
|
+
whales config get api-url
|
|
199
|
+
whales config get chain-id
|
|
153
200
|
```
|
|
154
201
|
|
|
155
|
-
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### `whales config set <key> <value>`
|
|
205
|
+
|
|
206
|
+
Set a config value. Supported keys: `api-url`, `chain-id`.
|
|
156
207
|
|
|
157
208
|
```bash
|
|
158
|
-
whales
|
|
209
|
+
whales config set api-url https://api.whales.market
|
|
210
|
+
whales config set chain-id 666666
|
|
159
211
|
```
|
|
160
212
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"chain_id": 56
|
|
170
|
-
}
|
|
171
|
-
]
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### `whales config path`
|
|
216
|
+
|
|
217
|
+
Show the path to the config file on disk.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
whales config path
|
|
172
221
|
```
|
|
173
222
|
|
|
174
|
-
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### Custom RPC per Chain
|
|
175
226
|
|
|
176
|
-
|
|
227
|
+
Override the default RPC URL for any chain. Useful for private nodes or faster endpoints.
|
|
177
228
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
229
|
+
```bash
|
|
230
|
+
# Set a custom RPC
|
|
231
|
+
whales config rpc set 666666 https://my-solana-rpc.example.com
|
|
181
232
|
|
|
182
|
-
|
|
233
|
+
# View resolved RPC for a chain (shows custom vs default)
|
|
234
|
+
whales config rpc get 666666
|
|
183
235
|
|
|
184
|
-
|
|
236
|
+
# Remove custom RPC (revert to default)
|
|
237
|
+
whales config rpc remove 666666
|
|
185
238
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
- `--api-url <url>` - API endpoint URL
|
|
189
|
-
- `--chain-id <id>` - Chain ID
|
|
239
|
+
# List all custom RPC overrides
|
|
240
|
+
whales config rpc list
|
|
190
241
|
|
|
191
|
-
|
|
242
|
+
# List all supported chains with IDs and default RPCs
|
|
243
|
+
whales config rpc chains
|
|
244
|
+
```
|
|
192
245
|
|
|
193
|
-
|
|
246
|
+
**Config is stored at:**
|
|
247
|
+
- macOS: `~/Library/Preferences/whales-market-cli/config.json`
|
|
248
|
+
- Linux: `~/.config/whales-market-cli/config.json`
|
|
249
|
+
- Windows: `%APPDATA%\whales-market-cli\config.json`
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Chain IDs
|
|
254
|
+
|
|
255
|
+
Use `--chain-id` to target a specific network. Common values:
|
|
256
|
+
|
|
257
|
+
| Chain | Chain ID |
|
|
258
|
+
|-------|----------|
|
|
259
|
+
| Solana Mainnet | `666666` (default) |
|
|
260
|
+
| Solana Devnet | `999999` |
|
|
261
|
+
| Ethereum | `1` |
|
|
262
|
+
| BNB Chain | `56` |
|
|
263
|
+
| Base | `8453` |
|
|
264
|
+
| Arbitrum | `42161` |
|
|
265
|
+
| Polygon | `137` |
|
|
266
|
+
| Sui Mainnet | `900000` |
|
|
267
|
+
| Aptos Mainnet | `900001` |
|
|
268
|
+
|
|
269
|
+
Run `whales config rpc chains` to see the full list.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Token Commands
|
|
274
|
+
|
|
275
|
+
### `whales tokens list`
|
|
276
|
+
|
|
277
|
+
List pre-market tokens with price, implied FDV, and volume.
|
|
194
278
|
|
|
195
279
|
```bash
|
|
196
|
-
|
|
197
|
-
whales tokens list --status active
|
|
280
|
+
whales tokens list
|
|
281
|
+
whales tokens list --status active
|
|
282
|
+
whales tokens list --status settling
|
|
283
|
+
whales tokens list --chain 56 --limit 20
|
|
284
|
+
whales tokens list --sort vol
|
|
285
|
+
whales tokens list --sort price
|
|
286
|
+
whales tokens list --sort created
|
|
287
|
+
whales tokens list --show-address # show token contract address
|
|
288
|
+
whales tokens list --no-fdv # hide Implied FDV column
|
|
289
|
+
whales tokens list --no-volume # hide 24h Vol column
|
|
290
|
+
whales tokens list --no-total-vol # hide Total Vol column
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Options:
|
|
294
|
+
- `--status <s>` — filter by status: `active`, `settling`, `ended`
|
|
295
|
+
- `--chain <id>` — filter by chain ID
|
|
296
|
+
- `--limit <n>` — max rows (default: 20)
|
|
297
|
+
- `--sort <by>` — sort by `vol`, `price`, or `created`
|
|
298
|
+
- `--show-address` — show token/contract addresses (hidden by default)
|
|
299
|
+
- `--no-fdv` — hide Implied FDV
|
|
300
|
+
- `--no-volume` — hide 24h Vol
|
|
301
|
+
- `--no-total-vol` — hide Total Vol
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### `whales tokens get <token-id>`
|
|
306
|
+
|
|
307
|
+
Get full details for a token by its ID or symbol.
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
whales tokens get MEGA
|
|
311
|
+
whales tokens get <uuid>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
### `whales tokens search <query>`
|
|
317
|
+
|
|
318
|
+
Search tokens by name or symbol.
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
whales tokens search MEGA
|
|
322
|
+
whales tokens search "Layer" --limit 5
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### `whales tokens highlight`
|
|
328
|
+
|
|
329
|
+
Show highlighted / trending tokens.
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
whales tokens highlight
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
### `whales tokens stats`
|
|
338
|
+
|
|
339
|
+
Show prediction stats across tokens.
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
whales tokens stats
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
198
346
|
|
|
199
|
-
|
|
200
|
-
whales tokens search "MEGA"
|
|
347
|
+
## Order Book
|
|
201
348
|
|
|
202
|
-
|
|
203
|
-
whales tokens get <token-id>
|
|
349
|
+
### `whales book <symbol>`
|
|
204
350
|
|
|
205
|
-
|
|
206
|
-
|
|
351
|
+
View the order book (buy/sell walls, spread, fill status) for a token.
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
whales book MEGA
|
|
355
|
+
whales book MEGA --depth 10
|
|
356
|
+
whales book MEGA --chain-id 56
|
|
357
|
+
whales book MEGA --format json
|
|
207
358
|
```
|
|
208
359
|
|
|
209
|
-
|
|
360
|
+
Options:
|
|
361
|
+
- `--depth <n>` — number of rows per side (default: 5)
|
|
362
|
+
- `--chain-id <id>` — chain to query
|
|
363
|
+
- `--format json|plain|table` — output format
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Offers
|
|
368
|
+
|
|
369
|
+
### `whales offers list`
|
|
370
|
+
|
|
371
|
+
List all open offers on the market.
|
|
210
372
|
|
|
211
373
|
```bash
|
|
212
|
-
|
|
374
|
+
whales offers list
|
|
213
375
|
whales offers list --type buy
|
|
376
|
+
whales offers list --type sell
|
|
377
|
+
whales offers list --token MEGA
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
### `whales offers my`
|
|
214
383
|
|
|
215
|
-
|
|
384
|
+
List offers created by your wallet address.
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
whales offers my
|
|
216
388
|
whales offers my --status open
|
|
389
|
+
whales offers my --status filled
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
217
393
|
|
|
218
|
-
|
|
394
|
+
### `whales offers get <offer-id>`
|
|
395
|
+
|
|
396
|
+
Get details for a specific offer.
|
|
397
|
+
|
|
398
|
+
```bash
|
|
219
399
|
whales offers get 456
|
|
400
|
+
whales offers get <uuid>
|
|
220
401
|
```
|
|
221
402
|
|
|
222
|
-
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
### `whales offers react <offer-id>`
|
|
406
|
+
|
|
407
|
+
React to an offer.
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
whales offers react 456
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Orders
|
|
416
|
+
|
|
417
|
+
### `whales orders list`
|
|
418
|
+
|
|
419
|
+
List all orders.
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
whales orders list
|
|
423
|
+
whales orders list --token MEGA
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
### `whales orders my`
|
|
429
|
+
|
|
430
|
+
List orders associated with your wallet.
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
whales orders my
|
|
434
|
+
whales orders my --side buy
|
|
435
|
+
whales orders my --side sell
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
### `whales orders get <order-id>`
|
|
441
|
+
|
|
442
|
+
Get details for a specific order.
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
whales orders get 123
|
|
446
|
+
whales orders get <uuid>
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
### `whales orders by-offer <offer-id>`
|
|
452
|
+
|
|
453
|
+
List orders created from a specific offer.
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
whales orders by-offer 456
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## Portfolio
|
|
462
|
+
|
|
463
|
+
### `whales portfolio show`
|
|
464
|
+
|
|
465
|
+
Show portfolio summary for your wallet (or any address).
|
|
223
466
|
|
|
224
467
|
```bash
|
|
225
|
-
# Show portfolio summary
|
|
226
468
|
whales portfolio show
|
|
469
|
+
whales portfolio show --address 0xAbcDef...
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
### `whales portfolio positions`
|
|
475
|
+
|
|
476
|
+
List positions (open or filled orders).
|
|
227
477
|
|
|
228
|
-
|
|
478
|
+
```bash
|
|
479
|
+
whales portfolio positions
|
|
229
480
|
whales portfolio positions --type open
|
|
481
|
+
whales portfolio positions --type filled
|
|
230
482
|
```
|
|
231
483
|
|
|
232
|
-
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
### `whales portfolio balance`
|
|
487
|
+
|
|
488
|
+
Show token balances.
|
|
233
489
|
|
|
234
490
|
```bash
|
|
235
|
-
|
|
236
|
-
whales
|
|
491
|
+
whales portfolio balance
|
|
492
|
+
whales portfolio balance --token MEGA
|
|
493
|
+
```
|
|
237
494
|
|
|
238
|
-
|
|
239
|
-
whales book MEGA --format json | jq '.sell_orders'
|
|
495
|
+
---
|
|
240
496
|
|
|
241
|
-
|
|
242
|
-
|
|
497
|
+
## Trading (On-chain)
|
|
498
|
+
|
|
499
|
+
These commands send transactions to the blockchain. A configured wallet is required.
|
|
500
|
+
|
|
501
|
+
### `whales trade create-offer`
|
|
502
|
+
|
|
503
|
+
Create a buy or sell pre-market offer on-chain.
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
whales trade create-offer \
|
|
507
|
+
--token <token-id> \
|
|
508
|
+
--side buy \
|
|
509
|
+
--price 0.5 \
|
|
510
|
+
--amount 100 \
|
|
511
|
+
--ex-token <exchange-token-address>
|
|
243
512
|
```
|
|
244
513
|
|
|
245
|
-
|
|
514
|
+
Options:
|
|
515
|
+
| Option | Required | Description |
|
|
516
|
+
|--------|----------|-------------|
|
|
517
|
+
| `--token <id>` | Yes | Token ID (numeric for EVM/Solana, config address for Sui/Aptos) |
|
|
518
|
+
| `--side <side>` | Yes | `buy` or `sell` |
|
|
519
|
+
| `--price <n>` | Yes | Price per token in USD (e.g. `0.5`) |
|
|
520
|
+
| `--amount <n>` | Yes | Token amount |
|
|
521
|
+
| `--ex-token <addr>` | Yes | Exchange token address (USDC, USDT, ETH, wSOL, etc.) |
|
|
522
|
+
| `--full-match` | No | Require full fill only (no partial fills) |
|
|
523
|
+
| `--ex-token-decimals <n>` | No | Decimals for exchange token (default: 6) |
|
|
524
|
+
| `--token-config <addr>` | Sui/Aptos | Token config object address |
|
|
525
|
+
| `--coin-type <type>` | Sui | Coin type (default: `0x2::sui::SUI`) |
|
|
526
|
+
|
|
527
|
+
**Chain-specific token ID format:**
|
|
528
|
+
- EVM: numeric (e.g. `1`) or bytes32 hex (e.g. `0x313638...`)
|
|
529
|
+
- Solana: numeric (e.g. `5`)
|
|
530
|
+
- Sui/Aptos: config object address (e.g. `0x1a2b...`)
|
|
531
|
+
|
|
532
|
+
**Examples:**
|
|
246
533
|
|
|
247
|
-
|
|
534
|
+
```bash
|
|
535
|
+
# Solana mainnet buy offer (default chain 666666)
|
|
536
|
+
whales trade create-offer \
|
|
537
|
+
--token 5 \
|
|
538
|
+
--side buy \
|
|
539
|
+
--price 0.25 \
|
|
540
|
+
--amount 500 \
|
|
541
|
+
--ex-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
|
|
542
|
+
|
|
543
|
+
# EVM (BSC, chain 56) sell offer with USDT
|
|
544
|
+
whales trade create-offer \
|
|
545
|
+
--chain-id 56 \
|
|
546
|
+
--token 10 \
|
|
547
|
+
--side sell \
|
|
548
|
+
--price 1.5 \
|
|
549
|
+
--amount 200 \
|
|
550
|
+
--ex-token 0x55d398326f99059fF775485246999027B3197955
|
|
551
|
+
|
|
552
|
+
# Full match only
|
|
553
|
+
whales trade create-offer --token 5 --side buy --price 0.5 --amount 100 \
|
|
554
|
+
--ex-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --full-match
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
### `whales trade fill-offer <offer-id>`
|
|
560
|
+
|
|
561
|
+
Fill an existing offer (become the counterparty).
|
|
248
562
|
|
|
249
563
|
```bash
|
|
250
|
-
#
|
|
251
|
-
|
|
252
|
-
cd whale-market-cli
|
|
564
|
+
# Fill fully (default)
|
|
565
|
+
whales trade fill-offer 123
|
|
253
566
|
|
|
254
|
-
#
|
|
255
|
-
|
|
567
|
+
# Fill partially
|
|
568
|
+
whales trade fill-offer 123 --amount 50
|
|
256
569
|
|
|
257
|
-
#
|
|
258
|
-
|
|
570
|
+
# Accept UUID from API
|
|
571
|
+
whales trade fill-offer <uuid>
|
|
572
|
+
```
|
|
259
573
|
|
|
260
|
-
|
|
261
|
-
|
|
574
|
+
Options:
|
|
575
|
+
- `--amount <n>` — partial fill amount (default: fill the remaining amount)
|
|
576
|
+
- `--ex-token <addr>` — exchange token address (EVM: auto-fetched from offer if omitted)
|
|
577
|
+
|
|
578
|
+
---
|
|
262
579
|
|
|
263
|
-
|
|
264
|
-
|
|
580
|
+
### `whales trade close-offer <offer-id>`
|
|
581
|
+
|
|
582
|
+
Close an offer you created. Reclaims your collateral for any unfilled portion.
|
|
583
|
+
|
|
584
|
+
```bash
|
|
585
|
+
whales trade close-offer 123
|
|
586
|
+
whales trade close-offer <uuid>
|
|
265
587
|
```
|
|
266
588
|
|
|
267
|
-
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
### `whales trade settle <order-id>`
|
|
592
|
+
|
|
593
|
+
Settle a filled order. The seller delivers the settlement token to finalize the trade.
|
|
268
594
|
|
|
269
595
|
```bash
|
|
270
|
-
|
|
596
|
+
# Solana / Sui / Aptos
|
|
597
|
+
whales trade settle 42
|
|
598
|
+
|
|
599
|
+
# EVM — requires token address and amount
|
|
600
|
+
whales trade settle 42 \
|
|
601
|
+
--token-address 0xTokenAddress \
|
|
602
|
+
--amount 100 \
|
|
603
|
+
--token-decimals 18
|
|
604
|
+
|
|
605
|
+
# With discount (referral fee reduction)
|
|
606
|
+
whales trade settle 42 \
|
|
607
|
+
--token-address 0xTokenAddress \
|
|
608
|
+
--amount 100 \
|
|
609
|
+
--with-discount \
|
|
610
|
+
--order-uuid <order-uuid-from-api>
|
|
271
611
|
```
|
|
272
612
|
|
|
273
|
-
|
|
613
|
+
Options:
|
|
614
|
+
- `--token-address <addr>` — settlement token address (EVM: required)
|
|
615
|
+
- `--amount <n>` — settlement token amount in human units (EVM: required)
|
|
616
|
+
- `--token-decimals <n>` — token decimals (default: 6)
|
|
617
|
+
- `--with-discount` — apply referral discount (requires `--order-uuid`)
|
|
618
|
+
- `--order-uuid <uuid>` — order UUID from the API
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
### `whales trade claim-collateral <order-id>`
|
|
623
|
+
|
|
624
|
+
Cancel an unfilled order and reclaim your collateral as a buyer.
|
|
274
625
|
|
|
275
626
|
```bash
|
|
276
|
-
|
|
277
|
-
|
|
627
|
+
whales trade claim-collateral 42
|
|
628
|
+
|
|
629
|
+
# With discount
|
|
630
|
+
whales trade claim-collateral 42 \
|
|
631
|
+
--with-discount \
|
|
632
|
+
--order-uuid <order-uuid-from-api>
|
|
278
633
|
```
|
|
279
634
|
|
|
280
|
-
|
|
635
|
+
Options:
|
|
636
|
+
- `--with-discount` — apply referral discount (requires `--order-uuid`)
|
|
637
|
+
- `--order-uuid <uuid>` — order UUID from the API
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
## OTC (Resell Positions)
|
|
642
|
+
|
|
643
|
+
OTC lets a buyer resell their order position to a new buyer before settlement. Supported on EVM and Solana.
|
|
281
644
|
|
|
282
|
-
###
|
|
645
|
+
### `whales otc create <order-id>`
|
|
283
646
|
|
|
284
|
-
|
|
647
|
+
Create an OTC offer to resell your order position.
|
|
285
648
|
|
|
286
649
|
```bash
|
|
287
|
-
whales
|
|
650
|
+
whales otc create 42 \
|
|
651
|
+
--price 1.2 \
|
|
652
|
+
--ex-token 0xUSDCAddress
|
|
653
|
+
|
|
654
|
+
# With custom deadline (unix timestamp)
|
|
655
|
+
whales otc create 42 \
|
|
656
|
+
--price 1.2 \
|
|
657
|
+
--ex-token 0xUSDCAddress \
|
|
658
|
+
--deadline 1800000000
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
Options:
|
|
662
|
+
| Option | Required | Description |
|
|
663
|
+
|--------|----------|-------------|
|
|
664
|
+
| `--price <n>` | Yes | Resell price per token (in exchange token units, e.g. 1.2 USDC) |
|
|
665
|
+
| `--ex-token <addr>` | Yes | Exchange token address |
|
|
666
|
+
| `--deadline <unix-ts>` | No | Offer expiry (default: 1 year from now) |
|
|
667
|
+
| `--ex-token-decimals <n>` | No | Exchange token decimals (default: 6) |
|
|
668
|
+
|
|
669
|
+
---
|
|
670
|
+
|
|
671
|
+
### `whales otc fill <otc-offer-id>`
|
|
672
|
+
|
|
673
|
+
Fill an OTC offer (buy someone else's order position).
|
|
674
|
+
|
|
675
|
+
```bash
|
|
676
|
+
# EVM (numeric offer ID)
|
|
677
|
+
whales otc fill 7
|
|
678
|
+
|
|
679
|
+
# Solana (on-chain PDA pubkey)
|
|
680
|
+
whales otc fill <base58PubkeyOfOtcOffer>
|
|
681
|
+
|
|
682
|
+
# With referral discount
|
|
683
|
+
whales otc fill 7 --with-discount --offer-uuid <uuid>
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Options:
|
|
687
|
+
- `--with-discount` — apply referral discount
|
|
688
|
+
- `--offer-uuid <uuid>` — OTC offer UUID from API (required for `--with-discount`)
|
|
689
|
+
|
|
690
|
+
---
|
|
691
|
+
|
|
692
|
+
### `whales otc cancel <otc-offer-id>`
|
|
693
|
+
|
|
694
|
+
Cancel an OTC offer you created and reclaim your order position.
|
|
695
|
+
|
|
696
|
+
```bash
|
|
697
|
+
# EVM
|
|
698
|
+
whales otc cancel 7
|
|
699
|
+
|
|
700
|
+
# Solana
|
|
701
|
+
whales otc cancel <base58Pubkey>
|
|
288
702
|
```
|
|
289
703
|
|
|
290
|
-
|
|
704
|
+
---
|
|
291
705
|
|
|
292
|
-
|
|
706
|
+
## Orderbook V2
|
|
707
|
+
|
|
708
|
+
Aggregated orderbook statistics and positions.
|
|
709
|
+
|
|
710
|
+
```bash
|
|
711
|
+
# Snapshot statistics
|
|
712
|
+
whales orderbook snapshot
|
|
713
|
+
|
|
714
|
+
# Positions for a Telegram user
|
|
715
|
+
whales orderbook positions --telegram-id <id>
|
|
716
|
+
|
|
717
|
+
# Trading pairs for a Telegram user
|
|
718
|
+
whales orderbook pairs --telegram-id <id>
|
|
719
|
+
|
|
720
|
+
# Filled order details
|
|
721
|
+
whales orderbook filled <id>
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
---
|
|
725
|
+
|
|
726
|
+
## Referral
|
|
727
|
+
|
|
728
|
+
```bash
|
|
729
|
+
# Campaign summary
|
|
730
|
+
whales referral summary
|
|
731
|
+
whales referral summary --address 0xYourAddress
|
|
732
|
+
|
|
733
|
+
# List campaigns
|
|
734
|
+
whales referral campaigns
|
|
735
|
+
whales referral campaigns --address 0xYourAddress
|
|
736
|
+
|
|
737
|
+
# Earnings
|
|
738
|
+
whales referral earnings
|
|
739
|
+
whales referral earnings --address 0xYourAddress
|
|
740
|
+
|
|
741
|
+
# Transaction history
|
|
742
|
+
whales referral transactions
|
|
743
|
+
whales referral transactions --address 0xYourAddress
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
---
|
|
747
|
+
|
|
748
|
+
## Utilities
|
|
749
|
+
|
|
750
|
+
```bash
|
|
751
|
+
# List all supported networks with chain IDs
|
|
752
|
+
whales networks list
|
|
753
|
+
|
|
754
|
+
# Interactive REPL shell (run commands without re-typing whales)
|
|
755
|
+
whales shell
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
## Output Formats
|
|
761
|
+
|
|
762
|
+
All commands support `--format table` (default), `--format json`, and `--format plain`.
|
|
763
|
+
|
|
764
|
+
```bash
|
|
765
|
+
# Table output (default)
|
|
766
|
+
whales tokens list
|
|
767
|
+
|
|
768
|
+
# JSON output — pipe into jq or scripts
|
|
769
|
+
whales tokens list --format json | jq '.[0].symbol'
|
|
770
|
+
|
|
771
|
+
# Check wallet address in scripts
|
|
772
|
+
whales wallet address --format json | jq -r '.address'
|
|
773
|
+
|
|
774
|
+
# Export order book as JSON
|
|
775
|
+
whales book MEGA --format json | jq '.sell_orders'
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
---
|
|
779
|
+
|
|
780
|
+
## Scripting & Automation
|
|
781
|
+
|
|
782
|
+
Use `--yes` / `-y` to skip confirmation prompts and `--format json` for machine-readable output:
|
|
783
|
+
|
|
784
|
+
```bash
|
|
785
|
+
# Non-interactive fill
|
|
786
|
+
whales trade fill-offer 123 --yes --format json
|
|
787
|
+
|
|
788
|
+
# Watch tokens and pipe to a file
|
|
789
|
+
whales tokens list --format json > tokens.json
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
---
|
|
793
|
+
|
|
794
|
+
## Troubleshooting
|
|
795
|
+
|
|
796
|
+
**"No wallet configured"**
|
|
797
|
+
|
|
798
|
+
```bash
|
|
799
|
+
whales wallet create
|
|
800
|
+
# or
|
|
801
|
+
whales wallet import "your twelve word mnemonic phrase here"
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
**"API connection failed"**
|
|
293
805
|
|
|
294
806
|
```bash
|
|
295
807
|
whales status
|
|
808
|
+
whales config set api-url https://api.whales.market
|
|
296
809
|
```
|
|
297
810
|
|
|
298
|
-
|
|
811
|
+
**"Unsupported chain ID"**
|
|
299
812
|
|
|
813
|
+
Check available chains:
|
|
300
814
|
```bash
|
|
301
|
-
whales
|
|
815
|
+
whales config rpc chains
|
|
302
816
|
```
|
|
303
817
|
|
|
304
|
-
|
|
818
|
+
Then set the correct chain:
|
|
819
|
+
```bash
|
|
820
|
+
whales config set chain-id 666666
|
|
821
|
+
# or pass per-command:
|
|
822
|
+
whales trade create-offer --chain-id 56 ...
|
|
823
|
+
```
|
|
305
824
|
|
|
306
|
-
|
|
307
|
-
- **Solana**: Base58 encoded private key
|
|
308
|
-
- **EVM**: Hex-encoded private key (with or without 0x prefix)
|
|
825
|
+
**"ex-token 0x... is EVM format"**
|
|
309
826
|
|
|
310
|
-
|
|
827
|
+
You passed an EVM address on a Solana command. Add `--chain-id` for your EVM chain:
|
|
828
|
+
```bash
|
|
829
|
+
whales otc create 42 --price 1.2 --ex-token 0xUSDC --chain-id 8453
|
|
830
|
+
```
|
|
311
831
|
|
|
312
|
-
|
|
832
|
+
**Build / TypeScript errors**
|
|
313
833
|
|
|
314
|
-
|
|
834
|
+
```bash
|
|
835
|
+
npm run build
|
|
836
|
+
npx tsc --noEmit # type-check only
|
|
837
|
+
```
|
|
315
838
|
|
|
316
|
-
|
|
839
|
+
---
|
|
840
|
+
|
|
841
|
+
## Development
|
|
842
|
+
|
|
843
|
+
```bash
|
|
844
|
+
# Type-check without building
|
|
845
|
+
npx tsc --noEmit
|
|
846
|
+
|
|
847
|
+
# Run without building (ts-node)
|
|
848
|
+
npm run dev -- tokens list
|
|
849
|
+
|
|
850
|
+
# Build and run
|
|
851
|
+
npm run build
|
|
852
|
+
node dist/index.js tokens list
|
|
853
|
+
|
|
854
|
+
# Link globally for testing
|
|
855
|
+
npm link
|
|
856
|
+
whales tokens list
|
|
857
|
+
```
|
|
317
858
|
|
|
318
|
-
|
|
859
|
+
See [docs/LOCAL_DEV.md](docs/LOCAL_DEV.md) for more detail.
|
|
319
860
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
861
|
+
---
|
|
862
|
+
|
|
863
|
+
## License
|
|
864
|
+
|
|
865
|
+
MIT
|