@antseed/cli 0.1.156 → 0.1.158

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.
Files changed (242) hide show
  1. package/README.md +135 -6
  2. package/dist/cli/commands/ants/addresses.d.ts +3 -0
  3. package/dist/cli/commands/ants/addresses.d.ts.map +1 -0
  4. package/dist/cli/commands/ants/addresses.js +20 -0
  5. package/dist/cli/commands/ants/addresses.js.map +1 -0
  6. package/dist/cli/commands/ants/addresses.test.d.ts +2 -0
  7. package/dist/cli/commands/ants/addresses.test.d.ts.map +1 -0
  8. package/dist/cli/commands/ants/addresses.test.js +12 -0
  9. package/dist/cli/commands/ants/addresses.test.js.map +1 -0
  10. package/dist/cli/commands/ants/arguments.test.d.ts +2 -0
  11. package/dist/cli/commands/ants/arguments.test.d.ts.map +1 -0
  12. package/dist/cli/commands/ants/arguments.test.js +51 -0
  13. package/dist/cli/commands/ants/arguments.test.js.map +1 -0
  14. package/dist/cli/commands/ants/dashboard.d.ts +4 -0
  15. package/dist/cli/commands/ants/dashboard.d.ts.map +1 -0
  16. package/dist/cli/commands/ants/dashboard.js +45 -0
  17. package/dist/cli/commands/ants/dashboard.js.map +1 -0
  18. package/dist/cli/commands/ants/dashboard.test.d.ts +2 -0
  19. package/dist/cli/commands/ants/dashboard.test.d.ts.map +1 -0
  20. package/dist/cli/commands/ants/dashboard.test.js +14 -0
  21. package/dist/cli/commands/ants/dashboard.test.js.map +1 -0
  22. package/dist/cli/commands/ants/emissions.d.ts +5 -0
  23. package/dist/cli/commands/ants/emissions.d.ts.map +1 -0
  24. package/dist/cli/commands/ants/emissions.js +44 -0
  25. package/dist/cli/commands/ants/emissions.js.map +1 -0
  26. package/dist/cli/commands/ants/emissions.test.d.ts +2 -0
  27. package/dist/cli/commands/ants/emissions.test.d.ts.map +1 -0
  28. package/dist/cli/commands/ants/emissions.test.js +17 -0
  29. package/dist/cli/commands/ants/emissions.test.js.map +1 -0
  30. package/dist/cli/commands/ants/extend.d.ts +3 -0
  31. package/dist/cli/commands/ants/extend.d.ts.map +1 -0
  32. package/dist/cli/commands/ants/extend.js +14 -0
  33. package/dist/cli/commands/ants/extend.js.map +1 -0
  34. package/dist/cli/commands/ants/extend.test.d.ts +2 -0
  35. package/dist/cli/commands/ants/extend.test.d.ts.map +1 -0
  36. package/dist/cli/commands/ants/extend.test.js +13 -0
  37. package/dist/cli/commands/ants/extend.test.js.map +1 -0
  38. package/dist/cli/commands/ants/index.d.ts +7 -0
  39. package/dist/cli/commands/ants/index.d.ts.map +1 -0
  40. package/dist/cli/commands/ants/index.js +46 -0
  41. package/dist/cli/commands/ants/index.js.map +1 -0
  42. package/dist/cli/commands/ants/index.test.d.ts +2 -0
  43. package/dist/cli/commands/ants/index.test.d.ts.map +1 -0
  44. package/dist/cli/commands/ants/index.test.js +24 -0
  45. package/dist/cli/commands/ants/index.test.js.map +1 -0
  46. package/dist/cli/commands/ants/max-lock.d.ts +3 -0
  47. package/dist/cli/commands/ants/max-lock.d.ts.map +1 -0
  48. package/dist/cli/commands/ants/max-lock.js +13 -0
  49. package/dist/cli/commands/ants/max-lock.js.map +1 -0
  50. package/dist/cli/commands/ants/max-lock.test.d.ts +2 -0
  51. package/dist/cli/commands/ants/max-lock.test.d.ts.map +1 -0
  52. package/dist/cli/commands/ants/max-lock.test.js +15 -0
  53. package/dist/cli/commands/ants/max-lock.test.js.map +1 -0
  54. package/dist/cli/commands/ants/merge.d.ts +3 -0
  55. package/dist/cli/commands/ants/merge.d.ts.map +1 -0
  56. package/dist/cli/commands/ants/merge.js +12 -0
  57. package/dist/cli/commands/ants/merge.js.map +1 -0
  58. package/dist/cli/commands/ants/merge.test.d.ts +2 -0
  59. package/dist/cli/commands/ants/merge.test.d.ts.map +1 -0
  60. package/dist/cli/commands/ants/merge.test.js +16 -0
  61. package/dist/cli/commands/ants/merge.test.js.map +1 -0
  62. package/dist/cli/commands/ants/move.d.ts +3 -0
  63. package/dist/cli/commands/ants/move.d.ts.map +1 -0
  64. package/dist/cli/commands/ants/move.js +14 -0
  65. package/dist/cli/commands/ants/move.js.map +1 -0
  66. package/dist/cli/commands/ants/move.test.d.ts +2 -0
  67. package/dist/cli/commands/ants/move.test.d.ts.map +1 -0
  68. package/dist/cli/commands/ants/move.test.js +16 -0
  69. package/dist/cli/commands/ants/move.test.js.map +1 -0
  70. package/dist/cli/commands/ants/pool.d.ts +3 -0
  71. package/dist/cli/commands/ants/pool.d.ts.map +1 -0
  72. package/dist/cli/commands/ants/pool.js +21 -0
  73. package/dist/cli/commands/ants/pool.js.map +1 -0
  74. package/dist/cli/commands/ants/pool.test.d.ts +2 -0
  75. package/dist/cli/commands/ants/pool.test.d.ts.map +1 -0
  76. package/dist/cli/commands/ants/pool.test.js +13 -0
  77. package/dist/cli/commands/ants/pool.test.js.map +1 -0
  78. package/dist/cli/commands/ants/pools.d.ts +6 -0
  79. package/dist/cli/commands/ants/pools.d.ts.map +1 -0
  80. package/dist/cli/commands/ants/pools.js +50 -0
  81. package/dist/cli/commands/ants/pools.js.map +1 -0
  82. package/dist/cli/commands/ants/pools.test.d.ts +2 -0
  83. package/dist/cli/commands/ants/pools.test.d.ts.map +1 -0
  84. package/dist/cli/commands/ants/pools.test.js +18 -0
  85. package/dist/cli/commands/ants/pools.test.js.map +1 -0
  86. package/dist/cli/commands/ants/positions.d.ts +6 -0
  87. package/dist/cli/commands/ants/positions.d.ts.map +1 -0
  88. package/dist/cli/commands/ants/positions.js +46 -0
  89. package/dist/cli/commands/ants/positions.js.map +1 -0
  90. package/dist/cli/commands/ants/positions.test.d.ts +2 -0
  91. package/dist/cli/commands/ants/positions.test.d.ts.map +1 -0
  92. package/dist/cli/commands/ants/positions.test.js +19 -0
  93. package/dist/cli/commands/ants/positions.test.js.map +1 -0
  94. package/dist/cli/commands/ants/rewards.d.ts +9 -0
  95. package/dist/cli/commands/ants/rewards.d.ts.map +1 -0
  96. package/dist/cli/commands/ants/rewards.js +93 -0
  97. package/dist/cli/commands/ants/rewards.js.map +1 -0
  98. package/dist/cli/commands/ants/rewards.test.d.ts +2 -0
  99. package/dist/cli/commands/ants/rewards.test.d.ts.map +1 -0
  100. package/dist/cli/commands/ants/rewards.test.js +46 -0
  101. package/dist/cli/commands/ants/rewards.test.js.map +1 -0
  102. package/dist/cli/commands/ants/seller.d.ts +3 -0
  103. package/dist/cli/commands/ants/seller.d.ts.map +1 -0
  104. package/dist/cli/commands/ants/seller.js +32 -0
  105. package/dist/cli/commands/ants/seller.js.map +1 -0
  106. package/dist/cli/commands/ants/seller.test.d.ts +2 -0
  107. package/dist/cli/commands/ants/seller.test.d.ts.map +1 -0
  108. package/dist/cli/commands/ants/seller.test.js +16 -0
  109. package/dist/cli/commands/ants/seller.test.js.map +1 -0
  110. package/dist/cli/commands/ants/shared.d.ts +26 -0
  111. package/dist/cli/commands/ants/shared.d.ts.map +1 -0
  112. package/dist/cli/commands/ants/shared.js +94 -0
  113. package/dist/cli/commands/ants/shared.js.map +1 -0
  114. package/dist/cli/commands/ants/shared.test.d.ts +2 -0
  115. package/dist/cli/commands/ants/shared.test.d.ts.map +1 -0
  116. package/dist/cli/commands/ants/shared.test.js +25 -0
  117. package/dist/cli/commands/ants/shared.test.js.map +1 -0
  118. package/dist/cli/commands/ants/split.d.ts +3 -0
  119. package/dist/cli/commands/ants/split.d.ts.map +1 -0
  120. package/dist/cli/commands/ants/split.js +12 -0
  121. package/dist/cli/commands/ants/split.js.map +1 -0
  122. package/dist/cli/commands/ants/split.test.d.ts +2 -0
  123. package/dist/cli/commands/ants/split.test.d.ts.map +1 -0
  124. package/dist/cli/commands/ants/split.test.js +13 -0
  125. package/dist/cli/commands/ants/split.test.js.map +1 -0
  126. package/dist/cli/commands/ants/stake.d.ts +3 -0
  127. package/dist/cli/commands/ants/stake.d.ts.map +1 -0
  128. package/dist/cli/commands/ants/stake.js +15 -0
  129. package/dist/cli/commands/ants/stake.js.map +1 -0
  130. package/dist/cli/commands/ants/stake.test.d.ts +2 -0
  131. package/dist/cli/commands/ants/stake.test.d.ts.map +1 -0
  132. package/dist/cli/commands/ants/stake.test.js +17 -0
  133. package/dist/cli/commands/ants/stake.test.js.map +1 -0
  134. package/dist/cli/commands/ants/status.d.ts +9 -0
  135. package/dist/cli/commands/ants/status.d.ts.map +1 -0
  136. package/dist/cli/commands/ants/status.js +43 -0
  137. package/dist/cli/commands/ants/status.js.map +1 -0
  138. package/dist/cli/commands/ants/status.test.d.ts +2 -0
  139. package/dist/cli/commands/ants/status.test.d.ts.map +1 -0
  140. package/dist/cli/commands/ants/status.test.js +23 -0
  141. package/dist/cli/commands/ants/status.test.js.map +1 -0
  142. package/dist/cli/commands/ants/usage.d.ts +4 -0
  143. package/dist/cli/commands/ants/usage.d.ts.map +1 -0
  144. package/dist/cli/commands/ants/usage.js +31 -0
  145. package/dist/cli/commands/ants/usage.js.map +1 -0
  146. package/dist/cli/commands/ants/usage.test.d.ts +2 -0
  147. package/dist/cli/commands/ants/usage.test.d.ts.map +1 -0
  148. package/dist/cli/commands/ants/usage.test.js +15 -0
  149. package/dist/cli/commands/ants/usage.test.js.map +1 -0
  150. package/dist/cli/commands/ants/verify.d.ts +3 -0
  151. package/dist/cli/commands/ants/verify.d.ts.map +1 -0
  152. package/dist/cli/commands/ants/verify.js +51 -0
  153. package/dist/cli/commands/ants/verify.js.map +1 -0
  154. package/dist/cli/commands/ants/verify.test.d.ts +2 -0
  155. package/dist/cli/commands/ants/verify.test.d.ts.map +1 -0
  156. package/dist/cli/commands/ants/verify.test.js +51 -0
  157. package/dist/cli/commands/ants/verify.test.js.map +1 -0
  158. package/dist/cli/commands/ants/withdraw.d.ts +16 -0
  159. package/dist/cli/commands/ants/withdraw.d.ts.map +1 -0
  160. package/dist/cli/commands/ants/withdraw.js +48 -0
  161. package/dist/cli/commands/ants/withdraw.js.map +1 -0
  162. package/dist/cli/commands/ants/withdraw.test.d.ts +2 -0
  163. package/dist/cli/commands/ants/withdraw.test.d.ts.map +1 -0
  164. package/dist/cli/commands/ants/withdraw.test.js +30 -0
  165. package/dist/cli/commands/ants/withdraw.test.js.map +1 -0
  166. package/dist/cli/commands/emissions.d.ts +7 -0
  167. package/dist/cli/commands/emissions.d.ts.map +1 -1
  168. package/dist/cli/commands/emissions.js +105 -27
  169. package/dist/cli/commands/emissions.js.map +1 -1
  170. package/dist/cli/commands/emissions.test.js +7 -1
  171. package/dist/cli/commands/emissions.test.js.map +1 -1
  172. package/dist/cli/commands/network/chain-config-helper.d.ts +18 -0
  173. package/dist/cli/commands/network/chain-config-helper.d.ts.map +1 -1
  174. package/dist/cli/commands/network/chain-config-helper.js.map +1 -1
  175. package/dist/cli/commands/parse-positive-integer.d.ts +2 -0
  176. package/dist/cli/commands/parse-positive-integer.d.ts.map +1 -0
  177. package/dist/cli/commands/parse-positive-integer.js +9 -0
  178. package/dist/cli/commands/parse-positive-integer.js.map +1 -0
  179. package/dist/cli/commands/reward-actions.d.ts +11 -0
  180. package/dist/cli/commands/reward-actions.d.ts.map +1 -0
  181. package/dist/cli/commands/reward-actions.js +22 -0
  182. package/dist/cli/commands/reward-actions.js.map +1 -0
  183. package/dist/cli/commands/seller/contract-clients.test.d.ts +2 -0
  184. package/dist/cli/commands/seller/contract-clients.test.d.ts.map +1 -0
  185. package/dist/cli/commands/seller/contract-clients.test.js +45 -0
  186. package/dist/cli/commands/seller/contract-clients.test.js.map +1 -0
  187. package/dist/cli/commands/seller/index.d.ts.map +1 -1
  188. package/dist/cli/commands/seller/index.js +4 -2
  189. package/dist/cli/commands/seller/index.js.map +1 -1
  190. package/dist/cli/commands/seller/pool.d.ts +15 -0
  191. package/dist/cli/commands/seller/pool.d.ts.map +1 -0
  192. package/dist/cli/commands/seller/pool.js +201 -0
  193. package/dist/cli/commands/seller/pool.js.map +1 -0
  194. package/dist/cli/commands/seller/pool.test.d.ts +2 -0
  195. package/dist/cli/commands/seller/pool.test.d.ts.map +1 -0
  196. package/dist/cli/commands/seller/pool.test.js +16 -0
  197. package/dist/cli/commands/seller/pool.test.js.map +1 -0
  198. package/dist/cli/commands/seller/register.d.ts.map +1 -1
  199. package/dist/cli/commands/seller/register.js +38 -8
  200. package/dist/cli/commands/seller/register.js.map +1 -1
  201. package/dist/cli/commands/seller/rewards.d.ts +13 -0
  202. package/dist/cli/commands/seller/rewards.d.ts.map +1 -0
  203. package/dist/cli/commands/seller/rewards.js +115 -0
  204. package/dist/cli/commands/seller/rewards.js.map +1 -0
  205. package/dist/cli/commands/seller/rewards.test.d.ts +2 -0
  206. package/dist/cli/commands/seller/rewards.test.d.ts.map +1 -0
  207. package/dist/cli/commands/seller/rewards.test.js +21 -0
  208. package/dist/cli/commands/seller/rewards.test.js.map +1 -0
  209. package/dist/cli/commands/seller/setup.d.ts.map +1 -1
  210. package/dist/cli/commands/seller/setup.js +2 -1
  211. package/dist/cli/commands/seller/setup.js.map +1 -1
  212. package/dist/cli/commands/seller/stake.d.ts.map +1 -1
  213. package/dist/cli/commands/seller/stake.js +104 -65
  214. package/dist/cli/commands/seller/stake.js.map +1 -1
  215. package/dist/cli/commands/seller/stake.test.d.ts +2 -0
  216. package/dist/cli/commands/seller/stake.test.d.ts.map +1 -0
  217. package/dist/cli/commands/seller/stake.test.js +99 -0
  218. package/dist/cli/commands/seller/stake.test.js.map +1 -0
  219. package/dist/cli/commands/seller/start.d.ts.map +1 -1
  220. package/dist/cli/commands/seller/start.js +6 -0
  221. package/dist/cli/commands/seller/start.js.map +1 -1
  222. package/dist/cli/commands/seller/status.d.ts.map +1 -1
  223. package/dist/cli/commands/seller/status.js +44 -2
  224. package/dist/cli/commands/seller/status.js.map +1 -1
  225. package/dist/cli/index.js +2 -0
  226. package/dist/cli/index.js.map +1 -1
  227. package/dist/cli/payment-utils.d.ts +33 -2
  228. package/dist/cli/payment-utils.d.ts.map +1 -1
  229. package/dist/cli/payment-utils.js +101 -2
  230. package/dist/cli/payment-utils.js.map +1 -1
  231. package/dist/config/types.d.ts +20 -0
  232. package/dist/config/types.d.ts.map +1 -1
  233. package/dist/proxy/buyer-proxy.d.ts.map +1 -1
  234. package/dist/proxy/buyer-proxy.js +27 -8
  235. package/dist/proxy/buyer-proxy.js.map +1 -1
  236. package/dist/proxy/buyer-proxy.test.js +126 -2
  237. package/dist/proxy/buyer-proxy.test.js.map +1 -1
  238. package/package.json +7 -6
  239. package/dist/cli/commands/seller/emissions.d.ts +0 -3
  240. package/dist/cli/commands/seller/emissions.d.ts.map +0 -1
  241. package/dist/cli/commands/seller/emissions.js +0 -5
  242. package/dist/cli/commands/seller/emissions.js.map +0 -1
package/README.md CHANGED
@@ -13,9 +13,27 @@ Command-line interface and web dashboard for the AntSeed Network — a P2P netwo
13
13
  | **Providing** | |
14
14
  | `antseed seller start` | Start providing AI services on the P2P network |
15
15
  | `antseed seller register` | Register peer identity on-chain (ERC-8004) |
16
- | `antseed seller stake <amount>` | Stake USDC as a provider (min $10) |
17
- | `antseed seller unstake` | Withdraw staked USDC |
18
- | `antseed seller emissions claim` | Claim accumulated seller payouts |
16
+ | `antseed seller stake <ants> --epochs <n>` | Stake ANTS into your seller pool; never stakes USDC |
17
+ | `antseed seller legacy stake <amount>` | Stake USDC as a provider before cutover (min $10) |
18
+ | `antseed seller legacy unstake` | Withdraw legacy USDC stake |
19
+ | `antseed seller legacy claim-starter` | Claim the legacy-seller starter ANTS position after the recognized-usage upgrade |
20
+ | `antseed seller pool positions` | List seller-pool positions and lifecycle state |
21
+ | `antseed seller pool withdraw <id...> [--accept-slashing]` | Withdraw positions, with a slashing estimate and confirmation for early exits |
22
+ | `antseed seller rewards [claim]` | View or claim all seller rewards |
23
+ | **ANTS staking** | |
24
+ | `antseed ants` | Open the local ANTS staking dashboard (wallet-signed, `--port`, `--no-open`) |
25
+ | `antseed ants status` | Protocol phase, epoch countdown, balances, stake, claimable rewards |
26
+ | `antseed ants stake <ants> --agent <id> --epochs <n>` | Stake ANTS into any registered seller pool |
27
+ | `antseed ants positions` | List open lANTS positions with state, pending rewards, and exit slash |
28
+ | `antseed ants move <id...> --to <agent>` | Move positions to another pool (terms preserved, effective next epoch) |
29
+ | `antseed ants split <id> <ants>` / `merge <id...>` | Split a position or merge same-pool positions |
30
+ | `antseed ants extend <id> --epochs <n>` / `max-lock <id> [--off]` | Extend a lock or toggle max lock |
31
+ | `antseed ants withdraw <id...> [--preview] [--accept-slashing]` | Withdraw with a slashing estimate and explicit consent for early exits |
32
+ | `antseed ants rewards [claim\|compound\|restake\|stake-usage]` | View, claim, or restake rewards; `compound` restakes every restakable bucket in one go |
33
+ | `antseed ants pools` / `pool <agent>` | Compare pools: power and share of network, settled volume per epoch, staker ANTS per 1k power (last and projected), your power and share; explorer names via Antscan |
34
+ | `antseed ants usage` / `emissions` / `addresses` | Usage points per epoch, emission schedule and buckets, contract addresses |
35
+ | `antseed ants seller [register\|claim-starter]` | Seller binding, eligibility, and starter grant |
36
+ | `antseed ants verify [seller]` / `verify submit <artifact.json>` / `verify proof <id>` | Wash-trading status, resumable proof submission, proof progress |
19
37
  | **Buying** | |
20
38
  | `antseed buyer start` | Start the buyer proxy and connect to sellers |
21
39
  | `antseed buyer start --router <name>` | Start the buyer proxy with a non-default router |
@@ -40,7 +58,6 @@ Command-line interface and web dashboard for the AntSeed Network — a P2P netwo
40
58
  | `antseed dashboard` | Start the web dashboard |
41
59
  | `antseed metrics serve` | Serve Prometheus metrics for buyers and sellers |
42
60
  | `antseed buyer channels` | List payment channels |
43
- | `antseed seller emissions info` | View ANTS emissions and epoch info |
44
61
  | `antseed dev` | Run seller + buyer locally for testing |
45
62
  | `antseed network bootstrap` | Run a dedicated DHT bootstrap node |
46
63
 
@@ -329,7 +346,56 @@ For tools that can only set a model name, use `<peerId>@<model>` as the model. T
329
346
 
330
347
  Payments run on **Base Mainnet** by default. Contract addresses are resolved automatically — no manual configuration needed.
331
348
 
332
- ### Provider Setup (Selling)
349
+ **Protocol start: September 10, 2026 at 09:54:21 UTC (epoch 22).**
350
+ See [Recognized Usage and ANTS Rewards](../website/docs/protocol/recognized-usage.md)
351
+ for ANTS pool positions, seller eligibility, and usage rewards. The SDK exposes
352
+ the contract inventory as `getChainConfig('base-mainnet').recognizedUsage`.
353
+ See [Reward Policies](../website/docs/protocol/reward-policies.md) for how usage
354
+ points are adjusted and historical wash-trading evidence affects rewards.
355
+
356
+ Looking for pre-migration USDC staking or rewards? See
357
+ [Legacy emissions and claims](../website/docs/protocol/legacy-emissions.md).
358
+ The setup commands below use that legacy USDC interface; they do not create
359
+ ANTS pool positions.
360
+
361
+ ### ANTS Staking Dashboard and Commands
362
+
363
+ `antseed ants` starts a local dashboard on `http://127.0.0.1:3119` and opens it
364
+ in your browser. It signs with the node wallet in `--data-dir`, binds to
365
+ localhost only, and requires the one-time session token embedded in the URL
366
+ it prints, so no other page can act with your wallet. Pass `--no-open` to
367
+ print the URL only, or `--port` to change the port.
368
+
369
+ Pool statistics, volume history, and closed positions come from the Antscan
370
+ indexer (`payments.crypto.explorerApiUrl`); the chain is read only for your
371
+ wallet's live state and when sending transactions.
372
+
373
+ Everything the dashboard does is also a command under `antseed ants`, so the
374
+ dashboard is optional:
375
+
376
+ ```bash
377
+ antseed ants status # phase, epoch countdown, balances, claimable rewards
378
+ antseed ants stake 250 --agent 84990 --epochs 12 # stake into a registered seller pool
379
+ antseed ants positions --json # positions, pending rewards, exit slash
380
+ antseed ants split 7 100 && antseed ants merge 8 9 # restructure (effective next epoch)
381
+ antseed ants move 7 --to 84991 # move stake to another pool
382
+ antseed ants withdraw 7 --preview # slashing estimate before an early exit
383
+ antseed ants rewards && antseed ants rewards claim # all buckets: staker, seller, buyer, legacy, locked
384
+ antseed ants rewards compound --epochs 8 --to 59096 # restake all rewards (bonus kept), move them into pool 59096
385
+ antseed ants verify submit seller-proof.json # stage → authenticate chunks → finalize
386
+ ```
387
+
388
+ Before the cutover (phase `deployed`) the commands read the deployed contracts
389
+ and can stake once ANTS transfers are enabled for your wallet; reward accounting
390
+ starts at the effective epoch. Buyer usage rewards are paid to the deposits
391
+ operator, so they are claimable here only when the node wallet is its own
392
+ operator. Loop-proof artifacts come from the `antseed-loop-proof` host
393
+ (`kind: antseed-wash-trading-seller-proof`); submission is resumable, so a
394
+ partially authenticated proof can be re-submitted with the same file.
395
+ The [staking guide](../website/docs/guides/staking.md) walks through the
396
+ dashboard tabs and how to read the pool table.
397
+
398
+ ### Legacy USDC Provider Setup (Pre-Migration)
333
399
 
334
400
  ```bash
335
401
  # 1. Set your identity (secp256k1 private key)
@@ -341,12 +407,69 @@ export ANTSEED_IDENTITY_HEX=<your-private-key-hex>
341
407
  antseed seller register
342
408
 
343
409
  # 4. Stake USDC (minimum $10)
344
- antseed seller stake 10
410
+ antseed seller legacy stake 10
345
411
 
346
412
  # 6. Start providing
347
413
  antseed seller start
348
414
  ```
349
415
 
416
+ After the M001 recognized-usage cutover, new seller stake moves from legacy USDC staking to ANTS seller pools:
417
+
418
+ ```bash
419
+ antseed seller register
420
+ antseed seller legacy claim-starter
421
+ antseed seller stake 100 --epochs 4
422
+ antseed seller pool positions
423
+ antseed seller rewards
424
+ antseed seller rewards claim
425
+ ```
426
+
427
+ `antseed seller stake <ants> --epochs <n>` always stakes ANTS and requires the recognized-usage upgrade. On older networks it stops without sending a transaction and directs you to `antseed seller legacy stake <usdc>`. New legacy USDC stakes are rejected after the upgrade. `antseed seller legacy unstake` withdraws legacy stake and warns that doing so can remove temporary eligibility before an ANTS position becomes active. `antseed seller legacy claim-starter` claims the starter position for an eligible legacy seller. `antseed seller rewards` combines legacy emissions, recognized-use emissions, and pool-staking rewards.
428
+
429
+ `seller register` explicitly binds your existing agent identity to the current seller registry, independently of legacy stake. Repeating it when already bound sends no transaction. If registration needs updating, `seller stake` stops and asks you to run `antseed seller register`; staking never registers you silently.
430
+
431
+ `seller rewards` is read-only: it calculates unclaimed rewards from completed epochs using existing contract getters, including pool earnings that have not yet been indexed. It does not sign transactions or spend gas. Pool previews use the same reward-index and position-segment rounding as the payout calculation. The pool contribution is read at a single block; amounts can change before a claim confirms. Historical position discovery includes withdrawn and closed positions using receipt burn events and may require an archive-capable RPC with historical log support. Read failures are reported rather than treated as zero rewards.
432
+
433
+ `seller rewards claim` prepares pool accounting in bounded transactions when necessary, then claims all eligible seller rewards to the current wallet. Preparation and claims require gas. Confirmed transaction hashes are printed immediately, and received amounts are read from ANTS transfer receipts. If a later step fails, the CLI reports partial completion; rerun the command to collect remaining rewards. Position-specific claims and alternate reward recipients are not exposed by this minimal command.
434
+
435
+ #### Command migration
436
+
437
+ These are intentional command-surface breaks, not hidden aliases:
438
+
439
+ | Removed command or behavior | Replacement |
440
+ |---|---|
441
+ | `seller stake <amount>` staking USDC | `seller legacy stake <usdc>` |
442
+ | `seller stake --agent-id <id>` | Bind the identity with `seller register --agent-id <id>` first, then stake ANTS without an identity override |
443
+ | `seller unstake` | `seller legacy unstake` |
444
+ | `seller pool claim-starter`, `seller pool bootstrap`, `seller pool init` | `seller legacy claim-starter` |
445
+ | `seller emissions info`, `seller pool rewards` | `seller rewards` |
446
+ | `seller emissions claim`, `seller pool rewards claim` | `seller rewards claim` (all eligible rewards to the current wallet; no era, position, or recipient flags) |
447
+ | `network contracts` | No replacement command; registry/address validation remains automatic inside payment commands |
448
+
449
+ Buyer emissions commands and their `--legacy-only` / `--new-only` filters are unchanged.
450
+
451
+ Early withdrawal requires `--accept-slashing` and interactive confirmation; add `--yes` for automation. The CLI rechecks the estimate before submitting. Existing contracts determine slashing at execution and do not accept a maximum-loss bound, so the displayed estimate is not a guaranteed cap if rates change before confirmation.
452
+
453
+ ### M001 Anvil rehearsal
454
+
455
+ The repository includes a persistent Base-mainnet fork sandbox for exercising the exact pre-cutover and post-cutover CLI paths. It requires an archive-capable `BASE_MAINNET_RPC_URL` and an `ANTS_HOLDER` address with ANTS at the pinned fork block. Seller USDC is sourced from the forked legacy staking contract.
456
+
457
+ ```bash
458
+ export BASE_MAINNET_RPC_URL=https://your-archive-base-rpc.example
459
+ export ANTS_HOLDER=0x...
460
+
461
+ pnpm m001:sandbox up
462
+ pnpm m001:sandbox status
463
+
464
+ # Use .m001-sandbox/cli-config.json with CLI commands before cutover.
465
+ pnpm m001:sandbox cutover
466
+ pnpm m001:sandbox advance-epoch 2
467
+ pnpm m001:sandbox fund-ants 0xYourCliWallet 100
468
+ pnpm m001:sandbox down
469
+ ```
470
+
471
+ Use `--port <port>` and `--out <dir>` on each sandbox command to override the defaults (`8545` and `.m001-sandbox/`).
472
+
350
473
  ### Buyer Setup (Consuming)
351
474
 
352
475
  ```bash
@@ -419,6 +542,12 @@ See [Metrics](../../apps/website/docs/guides/metrics.md) for metric names, label
419
542
 
420
543
  ## Development
421
544
 
545
+ Blockchain access and reward calculations live in `@antseed/node/payments`.
546
+ The CLI uses those SDK clients for registration, position discovery, reward
547
+ previews/claims, slashing estimates, and confirmed token receipts. Command
548
+ parsing, output, actionable instructions, and withdrawal confirmation stay in
549
+ the CLI; it has no direct `ethers` dependency.
550
+
422
551
  ```bash
423
552
  npm install
424
553
  npm run build
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerAntsAddressesCommand(antsCmd: Command): void;
3
+ //# sourceMappingURL=addresses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAanE"}
@@ -0,0 +1,20 @@
1
+ import chalk from 'chalk';
2
+ import Table from 'cli-table3';
3
+ import { printJson, runRead } from './shared.js';
4
+ export function registerAntsAddressesCommand(antsCmd) {
5
+ antsCmd
6
+ .command('addresses')
7
+ .description('Contract addresses in use')
8
+ .option('--json', 'output as JSON', false)
9
+ .action(async (options) => runRead(antsCmd, 'Loading addresses...', async ({ ctx, chain }) => {
10
+ const addresses = ctx.addresses();
11
+ if (options.json)
12
+ return printJson({ chainId: chain.chainId, evmChainId: chain.evmChainId, rpcUrl: chain.rpcUrl, addresses });
13
+ const table = new Table({ head: ['Contract', 'Address'] });
14
+ for (const [name, address] of Object.entries(addresses))
15
+ table.push([name, String(address)]);
16
+ console.log(table.toString());
17
+ console.log(chalk.dim(`${chain.chainId} via ${chain.rpcUrl}`));
18
+ }));
19
+ }
20
+ //# sourceMappingURL=addresses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/addresses.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,CAAC;SACzC,MAAM,CAAC,KAAK,EAAE,OAA0B,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE;QAC9G,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAClC,IAAI,OAAO,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9H,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;QAC3D,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=addresses.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/addresses.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import { Command } from 'commander';
4
+ import { registerAntsAddressesCommand } from './addresses.js';
5
+ test('addresses offers JSON output', () => {
6
+ const ants = new Command('ants');
7
+ registerAntsAddressesCommand(ants);
8
+ const addresses = ants.commands.find((command) => command.name() === 'addresses');
9
+ assert.ok(addresses);
10
+ assert.ok(addresses.options.some((option) => option.long === '--json'));
11
+ });
12
+ //# sourceMappingURL=addresses.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.test.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/addresses.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAE9D,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACxC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,4BAA4B,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,WAAW,CAAC,CAAC;IAClF,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=arguments.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/arguments.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import { Command } from 'commander';
4
+ import { parsePositiveInteger } from '../parse-positive-integer.js';
5
+ import { registerAntsCommands } from './index.js';
6
+ async function parse(args) {
7
+ const program = new Command().exitOverride().configureOutput({ writeErr: () => { } });
8
+ registerAntsCommands(program);
9
+ let options = {};
10
+ const capture = (command) => {
11
+ command.action(() => { options = command.opts(); });
12
+ for (const child of command.commands)
13
+ capture(child);
14
+ };
15
+ capture(program);
16
+ await program.parseAsync(['ants', ...args], { from: 'user' });
17
+ return options;
18
+ }
19
+ test('usage epochs are decimal regardless of the default or previous value', async () => {
20
+ assert.equal((await parse(['usage'])).epochs, 8);
21
+ assert.equal((await parse(['usage', '--epochs', '10'])).epochs, 10);
22
+ assert.equal((await parse(['usage', '--epochs', '8'])).epochs, 8);
23
+ assert.equal((await parse(['usage', '--epochs', '7', '--epochs', '10'])).epochs, 10);
24
+ });
25
+ test('repeated destination and epoch options use the last decimal value', async () => {
26
+ assert.deepEqual(await parse(['stake', '1', '--agent', '7', '--agent', '10', '--epochs', '4', '--epochs', '12']), { agent: 10, epochs: 12 });
27
+ assert.equal((await parse(['move', '1', '--to', '7', '--to', '10'])).to, 10);
28
+ assert.equal((await parse(['rewards', 'compound', '--epochs', '4', '--to', '7', '--to', '10'])).to, 10);
29
+ });
30
+ test('integer parsing rejects malformed, fractional, zero, negative, and unsafe values', () => {
31
+ for (const value of ['12garbage', '4.8', '1e2', '0x10', '0', '-1', '', ' ', '9007199254740992']) {
32
+ assert.throws(() => parsePositiveInteger(value), /positive safe integer/);
33
+ }
34
+ assert.equal(parsePositiveInteger('10'), 10);
35
+ });
36
+ test('invalid numeric flags fail during parsing before a command action runs', async () => {
37
+ for (const args of [
38
+ ['stake', '1', '--agent', '12garbage', '--epochs', '4'],
39
+ ['stake', '1', '--agent', '7', '--epochs', '4.8'],
40
+ ['move', '1', '--to', '12garbage'],
41
+ ['extend', '1', '--epochs', '4.8'],
42
+ ['usage', '--epochs', '0'],
43
+ ['rewards', 'restake', '--epochs', '4.8'],
44
+ ['rewards', 'compound', '--epochs', '4', '--to', '12garbage'],
45
+ ['rewards', 'stake-usage', '--side', 'buyer', '--epochs', '4', '--agent', '12garbage'],
46
+ ['seller', 'register', '--agent-id', '12garbage'],
47
+ ]) {
48
+ await assert.rejects(parse(args), { code: 'commander.invalidArgument' });
49
+ }
50
+ });
51
+ //# sourceMappingURL=arguments.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arguments.test.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/arguments.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,KAAK,UAAU,KAAK,CAAC,IAAc;IACjC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC,YAAY,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IACxF,KAAK,MAAM,IAAI,IAAI;QACjB,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,CAAC;QACvD,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC;QACjD,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC;QAClC,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC;QAClC,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC;QAC1B,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC;QACzC,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,WAAW,CAAC;QAC7D,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,CAAC;QACtF,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAC;KAClD,EAAE,CAAC;QACF,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ export declare const DEFAULT_ANTS_PORT = 3119;
3
+ export declare function registerAntsDashboardAction(antsCmd: Command): void;
4
+ //# sourceMappingURL=dashboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqClE"}
@@ -0,0 +1,45 @@
1
+ import chalk from 'chalk';
2
+ import { createAntsServer } from '@antseed/ants';
3
+ import { loadAntsContext } from './shared.js';
4
+ export const DEFAULT_ANTS_PORT = 3119;
5
+ export function registerAntsDashboardAction(antsCmd) {
6
+ antsCmd
7
+ .option('-p, --port <port>', 'dashboard port', String(DEFAULT_ANTS_PORT))
8
+ .option('--no-open', 'do not open the browser automatically')
9
+ .action(async (options) => {
10
+ const port = Number(options.port) || DEFAULT_ANTS_PORT;
11
+ try {
12
+ const { ctx, chain, dataDir, configPath } = await loadAntsContext(antsCmd);
13
+ const server = await createAntsServer({ port, dataDir, configPath, chain, signer: ctx.signer, address: ctx.address });
14
+ const url = await server.listen();
15
+ console.log('');
16
+ console.log(chalk.bold('ANTS staking dashboard'));
17
+ console.log(` Wallet: ${ctx.address}`);
18
+ console.log(` Chain: ${chain.chainId} (${chain.rpcUrl})`);
19
+ console.log(` URL: ${chalk.cyan(url)}`);
20
+ console.log(chalk.dim(' The URL carries a one-time session token; only this browser session can act with your wallet.'));
21
+ console.log(chalk.dim(' Every dashboard action has a CLI equivalent: antseed ants --help. Press Ctrl+C to stop.'));
22
+ console.log('');
23
+ if (options.open) {
24
+ try {
25
+ const { default: open } = await import('open');
26
+ await open(url);
27
+ }
28
+ catch {
29
+ console.log(chalk.yellow('Could not open a browser automatically; open the URL above manually.'));
30
+ }
31
+ }
32
+ const shutdown = async () => {
33
+ await server.close();
34
+ process.exit(0);
35
+ };
36
+ process.on('SIGINT', () => { void shutdown(); });
37
+ process.on('SIGTERM', () => { void shutdown(); });
38
+ }
39
+ catch (error) {
40
+ console.error(chalk.red(`Failed to start the ANTS dashboard: ${error.message}`));
41
+ process.exit(1);
42
+ }
43
+ });
44
+ }
45
+ //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/dashboard.ts"],"names":[],"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board.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/dashboard.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import { Command } from 'commander';
4
+ import { DEFAULT_ANTS_PORT, registerAntsDashboardAction } from './dashboard.js';
5
+ test('antseed ants defaults to the dashboard with a port and --no-open switch', () => {
6
+ const ants = new Command('ants');
7
+ registerAntsDashboardAction(ants);
8
+ const port = ants.options.find((option) => option.long === '--port');
9
+ assert.ok(port);
10
+ assert.equal(port.defaultValue, String(DEFAULT_ANTS_PORT));
11
+ assert.equal(DEFAULT_ANTS_PORT, 3119);
12
+ assert.ok(ants.options.some((option) => option.long === '--no-open'));
13
+ });
14
+ //# sourceMappingURL=dashboard.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.test.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/dashboard.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAEhF,IAAI,CAAC,yEAAyE,EAAE,GAAG,EAAE;IACnF,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,2BAA2B,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IACrE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAChB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC3D,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Command } from 'commander';
2
+ /** Share of the epoch emission as a percentage, e.g. 2000/100000 → "2%". */
3
+ export declare function sharePercent(value: number, denominator: number): string;
4
+ export declare function registerAntsEmissionsCommand(antsCmd: Command): void;
5
+ //# sourceMappingURL=emissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emissions.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/emissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiCnE"}
@@ -0,0 +1,44 @@
1
+ import chalk from 'chalk';
2
+ import Table from 'cli-table3';
3
+ import { emissions, formatAnts } from '@antseed/ants';
4
+ import { ants, epochDate, printJson, runRead } from './shared.js';
5
+ /** Share of the epoch emission as a percentage, e.g. 2000/100000 → "2%". */
6
+ export function sharePercent(value, denominator) {
7
+ return `${(value * 100 / denominator).toFixed(1).replace(/\.0$/, '')}%`;
8
+ }
9
+ export function registerAntsEmissionsCommand(antsCmd) {
10
+ antsCmd
11
+ .command('emissions')
12
+ .description('Emission schedule, gate buckets, and dynamic reward shares')
13
+ .option('--json', 'output as JSON', false)
14
+ .action(async (options) => runRead(antsCmd, 'Loading emissions...', async ({ ctx }) => {
15
+ const view = await emissions(ctx);
16
+ if (options.json)
17
+ return printJson(view);
18
+ const share = (value) => sharePercent(value, view.shareDenominator);
19
+ console.log(chalk.bold('Emissions\n'));
20
+ console.log(` Genesis ${epochDate(view.genesis, view.epochDuration, 0)}`);
21
+ console.log(` Epoch length ${view.epochDuration / 86_400} days`);
22
+ console.log(` Current epoch ${view.currentEpoch}${view.effectiveEpoch !== null ? ` (recognized usage from epoch ${view.effectiveEpoch})` : ''}`);
23
+ console.log(` Initial emission ${ants(view.initialEmission, 0)} per epoch, halving every ${view.halvingInterval} epochs`);
24
+ console.log(` Current rate ${formatAnts(view.currentRate)} ANTS per second`);
25
+ console.log(` Emitted so far ${ants(view.cumulativeThroughCurrent, 0)} (through the current epoch)`);
26
+ if (view.minters.length > 0) {
27
+ const table = new Table({ head: ['Bucket', 'Share', 'Controller', 'Editable', 'Budget this epoch'] });
28
+ for (const minter of view.minters) {
29
+ table.push([minter.name, `${(minter.shareBps * 100 / view.shareDenominator).toFixed(1)}%`, minter.controller, minter.editable ? 'yes' : 'no', ants(minter.epochBudget, 0)]);
30
+ }
31
+ console.log(table.toString());
32
+ }
33
+ if (view.dynamicStaker) {
34
+ console.log(chalk.dim(` Staker rewards scale from ${share(view.dynamicStaker.minShareBps)} to ${share(view.dynamicStaker.maxShareBps)} of the epoch emission as active stake approaches ${formatAnts(view.dynamicStaker.stakeShareTarget, 0)} ANTS`));
35
+ }
36
+ if (view.dynamicUsage) {
37
+ console.log(chalk.dim(` Usage rewards scale with volume (target ${(Number(view.dynamicUsage.volumeShareTarget) / 1e6).toLocaleString()} USDC/epoch): buyers ${share(view.dynamicUsage.buyerMinShareBps)}–${share(view.dynamicUsage.buyerMaxShareBps)}, sellers ${share(view.dynamicUsage.sellerMinShareBps)}–${share(view.dynamicUsage.sellerMaxShareBps)} of the epoch emission`));
38
+ }
39
+ if (view.legacy) {
40
+ console.log(chalk.dim(` Legacy V2 ${view.legacy.contract}: sellers ${view.legacy.sellerPct}% / buyers ${view.legacy.buyerPct}% / reserve ${view.legacy.reservePct}% / team ${view.legacy.teamPct}%`));
41
+ }
42
+ }));
43
+ }
44
+ //# sourceMappingURL=emissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emissions.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/emissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAElE,4EAA4E;AAC5E,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,WAAmB;IAC7D,OAAO,GAAG,CAAC,KAAK,GAAG,GAAG,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC3D,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,4DAA4D,CAAC;SACzE,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,CAAC;SACzC,MAAM,CAAC,KAAK,EAAE,OAA0B,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QACvG,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,OAAO,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC5E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI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Ae,IAAI,CAAC,MAAM,CAAC,UAAU,YAAY,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;QACzM,CAAC;IACH,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=emissions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emissions.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/emissions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import { Command } from 'commander';
4
+ import { registerAntsEmissionsCommand, sharePercent } from './emissions.js';
5
+ test('emissions offers JSON output', () => {
6
+ const ants = new Command('ants');
7
+ registerAntsEmissionsCommand(ants);
8
+ const emissions = ants.commands.find((command) => command.name() === 'emissions');
9
+ assert.ok(emissions);
10
+ assert.ok(emissions.options.some((option) => option.long === '--json'));
11
+ });
12
+ test('sharePercent renders 1/100000 shares as percentages', () => {
13
+ assert.equal(sharePercent(2000, 100_000), '2%');
14
+ assert.equal(sharePercent(12_500, 100_000), '12.5%');
15
+ assert.equal(sharePercent(5000, 10_000), '50%');
16
+ });
17
+ //# sourceMappingURL=emissions.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emissions.test.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/emissions.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5E,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACxC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,4BAA4B,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,WAAW,CAAC,CAAC;IAClF,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,qDAAqD,EAAE,GAAG,EAAE;IAC/D,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerAntsExtendCommand(antsCmd: Command): void;
3
+ //# sourceMappingURL=extend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAShE"}
@@ -0,0 +1,14 @@
1
+ import { parsePositiveInteger } from '../parse-positive-integer.js';
2
+ import { extend } from '@antseed/ants';
3
+ import { runAction } from './shared.js';
4
+ export function registerAntsExtendCommand(antsCmd) {
5
+ antsCmd
6
+ .command('extend <id>')
7
+ .description('Extend a position lock by additional epochs')
8
+ .requiredOption('--epochs <n>', 'additional epochs', parsePositiveInteger)
9
+ .action(async (id, options) => runAction(antsCmd, 'Extending lock...', async ({ ctx }, report) => {
10
+ await extend(ctx, { positionId: Number(id), epochs: options.epochs }, report);
11
+ return `Extended position ${id} by ${options.epochs} epoch(s)`;
12
+ }));
13
+ }
14
+ //# sourceMappingURL=extend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/extend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,OAAO;SACJ,OAAO,CAAC,aAAa,CAAC;SACtB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,cAAc,CAAC,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,CAAC;SACzE,MAAM,CAAC,KAAK,EAAE,EAAU,EAAE,OAA2B,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE;QAC3H,MAAM,MAAM,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9E,OAAO,qBAAqB,EAAE,OAAO,OAAO,CAAC,MAAM,WAAW,CAAC;IACjE,CAAC,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=extend.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/extend.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import { Command } from 'commander';
4
+ import { registerAntsExtendCommand } from './extend.js';
5
+ test('extend takes one position id and requires the number of extra epochs', () => {
6
+ const ants = new Command('ants');
7
+ registerAntsExtendCommand(ants);
8
+ const extend = ants.commands.find((command) => command.name() === 'extend');
9
+ assert.ok(extend);
10
+ assert.deepEqual(extend.registeredArguments.map((argument) => argument.name()), ['id']);
11
+ assert.ok(extend.options.find((option) => option.long === '--epochs')?.mandatory, '--epochs is required');
12
+ });
13
+ //# sourceMappingURL=extend.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.test.js","sourceRoot":"","sources":["../../../../src/cli/commands/ants/extend.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,IAAI,CAAC,sEAAsE,EAAE,GAAG,EAAE;IAChF,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,QAAQ,CAAC,CAAC;IAC5E,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAClB,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACxF,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,EAAE,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAC5G,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * `antseed ants` opens the local ANTS staking dashboard; every dashboard
4
+ * action is also a subcommand so the dashboard stays optional.
5
+ */
6
+ export declare function registerAntsCommands(program: Command): void;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/ants/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuB3D"}
@@ -0,0 +1,46 @@
1
+ import { registerAntsDashboardAction } from './dashboard.js';
2
+ import { registerAntsStatusCommand } from './status.js';
3
+ import { registerAntsPositionsCommand } from './positions.js';
4
+ import { registerAntsStakeCommand } from './stake.js';
5
+ import { registerAntsMoveCommand } from './move.js';
6
+ import { registerAntsSplitCommand } from './split.js';
7
+ import { registerAntsMergeCommand } from './merge.js';
8
+ import { registerAntsExtendCommand } from './extend.js';
9
+ import { registerAntsMaxLockCommand } from './max-lock.js';
10
+ import { registerAntsWithdrawCommand } from './withdraw.js';
11
+ import { registerAntsRewardsCommand } from './rewards.js';
12
+ import { registerAntsPoolsCommand } from './pools.js';
13
+ import { registerAntsPoolCommand } from './pool.js';
14
+ import { registerAntsUsageCommand } from './usage.js';
15
+ import { registerAntsEmissionsCommand } from './emissions.js';
16
+ import { registerAntsAddressesCommand } from './addresses.js';
17
+ import { registerAntsSellerCommand } from './seller.js';
18
+ import { registerAntsVerifyCommand } from './verify.js';
19
+ /**
20
+ * `antseed ants` opens the local ANTS staking dashboard; every dashboard
21
+ * action is also a subcommand so the dashboard stays optional.
22
+ */
23
+ export function registerAntsCommands(program) {
24
+ const antsCmd = program
25
+ .command('ants')
26
+ .description('ANTS staking: local dashboard (default) or CLI commands for positions, rewards, pools, verification');
27
+ registerAntsDashboardAction(antsCmd);
28
+ registerAntsStatusCommand(antsCmd);
29
+ registerAntsPositionsCommand(antsCmd);
30
+ registerAntsStakeCommand(antsCmd);
31
+ registerAntsMoveCommand(antsCmd);
32
+ registerAntsSplitCommand(antsCmd);
33
+ registerAntsMergeCommand(antsCmd);
34
+ registerAntsExtendCommand(antsCmd);
35
+ registerAntsMaxLockCommand(antsCmd);
36
+ registerAntsWithdrawCommand(antsCmd);
37
+ registerAntsRewardsCommand(antsCmd);
38
+ registerAntsPoolsCommand(antsCmd);
39
+ registerAntsPoolCommand(antsCmd);
40
+ registerAntsUsageCommand(antsCmd);
41
+ registerAntsEmissionsCommand(antsCmd);
42
+ registerAntsAddressesCommand(antsCmd);
43
+ registerAntsSellerCommand(antsCmd);
44
+ registerAntsVerifyCommand(antsCmd);
45
+ }
46
+ //# sourceMappingURL=index.js.map