pandora-cli-skills 1.1.52 → 1.1.54
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 +1 -0
- package/README_FOR_SHARING.md +9 -5
- package/SKILL.md +10 -8
- package/cli/lib/claim_command_service.cjs +70 -0
- package/cli/lib/command_router.cjs +3 -0
- package/cli/lib/lp_command_service.cjs +2 -2
- package/cli/lib/market_admin_service.cjs +665 -7
- package/cli/lib/mcp_tool_registry.cjs +9 -1
- package/cli/lib/mirror_close_service.cjs +142 -29
- package/cli/lib/mirror_command_service.cjs +6 -3
- package/cli/lib/mirror_daemon_service.cjs +56 -0
- package/cli/lib/mirror_handlers/close.cjs +25 -4
- package/cli/lib/mirror_handlers/sync.cjs +2 -2
- package/cli/lib/parsers/claim_flags.cjs +139 -0
- package/cli/lib/parsers/lp_flags.cjs +19 -1
- package/cli/lib/parsers/mirror_remaining_flags.cjs +57 -2
- package/cli/lib/parsers/mirror_sync_flags.cjs +20 -2
- package/cli/lib/schema_command_service.cjs +135 -2
- package/cli/pandora.cjs +131 -11
- package/package.json +2 -1
- package/tests/unit/lp_flags.test.cjs +24 -0
- package/tests/unit/market_admin_resolution_state.test.cjs +71 -0
- package/tests/unit/mirror_close_service.test.cjs +56 -0
- package/tests/unit/new-features.test.cjs +2 -3
package/README.md
CHANGED
|
@@ -125,6 +125,7 @@ npm run analytics:mega
|
|
|
125
125
|
- `pandora lifecycle start|status|resolve`
|
|
126
126
|
- `pandora quote`
|
|
127
127
|
- `pandora trade`
|
|
128
|
+
- `pandora claim --market-address <address>|--all --dry-run|--execute`
|
|
128
129
|
- `pandora history`
|
|
129
130
|
- `pandora export`
|
|
130
131
|
- `pandora arbitrage`
|
package/README_FOR_SHARING.md
CHANGED
|
@@ -134,6 +134,7 @@ Prerequisite: Node.js `>=18`.
|
|
|
134
134
|
- `pandora analyze --market-address <0x...> --provider <name>`
|
|
135
135
|
- `pandora suggest --wallet <0x...> --risk low|medium|high --budget <amount>`
|
|
136
136
|
- `pandora resolve`
|
|
137
|
+
- `pandora claim --market-address <address>|--all --dry-run|--execute`
|
|
137
138
|
- `pandora lp add|remove|positions`
|
|
138
139
|
|
|
139
140
|
## Quant ABM baseline (current implementation)
|
|
@@ -179,6 +180,7 @@ Prerequisite: Node.js `>=18`.
|
|
|
179
180
|
- Supported families:
|
|
180
181
|
- `trade`
|
|
181
182
|
- `resolve`
|
|
183
|
+
- `claim`
|
|
182
184
|
- `lp`
|
|
183
185
|
- `polymarket check|approve|preflight|trade`
|
|
184
186
|
- `polymarket trade --execute` in fork mode is simulation-only unless `--polymarket-mock-url` is provided.
|
|
@@ -332,7 +334,7 @@ Mirror advanced flags (for operator tuning):
|
|
|
332
334
|
- `data.live` now includes additive position diagnostics: `polymarketPosition.{yesBalance,noBalance,openOrdersCount,estimatedValueUsd,diagnostics[]}` plus `netDeltaApprox` and `pnlApprox`.
|
|
333
335
|
- if Polymarket credentials/endpoints are unavailable, `--with-live` remains non-fatal and returns diagnostics with null position fields.
|
|
334
336
|
- `mirror close`:
|
|
335
|
-
- envelope is `ok=true`, `command="mirror.close"`, with `data.mode`
|
|
337
|
+
- envelope is `ok=true`, `command="mirror.close"`, with `data.mode`, `data.target`, unwind `data.steps[]`, and `data.summary`.
|
|
336
338
|
- `webhook test`:
|
|
337
339
|
- envelope is `ok=true`, `command="webhook.test"`, with per-target delivery and retry metadata.
|
|
338
340
|
- `leaderboard`:
|
|
@@ -357,8 +359,8 @@ Mirror advanced flags (for operator tuning):
|
|
|
357
359
|
## Additional JSON response shapes
|
|
358
360
|
- `doctor`: `{ ok: true, command: "doctor", data: { schemaVersion, generatedAt, env, rpc, codeChecks, polymarket, summary } }`
|
|
359
361
|
- `resolve`:
|
|
360
|
-
- dry-run: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "dry-run", txPlan } }`
|
|
361
|
-
- execute: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "execute", tx } }`
|
|
362
|
+
- dry-run: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "dry-run", runtime: { mode, chainId, rpcUrl }, txPlan, precheck?, diagnostics[] } }`
|
|
363
|
+
- execute: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "execute", runtime: { mode, chainId, rpcUrl }, tx, precheck, diagnostics[] } }`
|
|
362
364
|
- `lp`:
|
|
363
365
|
- add/remove: `{ ok: true, command: "lp", data: { schemaVersion, generatedAt, action: "add"|"remove", mode, txPlan, tx? } }`
|
|
364
366
|
- positions: `{ ok: true, command: "lp", data: { schemaVersion, generatedAt, action: "positions", mode: "read", wallet, count, items } }`
|
|
@@ -367,7 +369,7 @@ Mirror advanced flags (for operator tuning):
|
|
|
367
369
|
|
|
368
370
|
### Resolve command
|
|
369
371
|
- Usage:
|
|
370
|
-
- `pandora [--output table|json] resolve [--dotenv-path <path>] [--skip-dotenv] --poll-address <address> --answer yes|no|invalid --reason <text> --dry-run|--execute [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>]`
|
|
372
|
+
- `pandora [--output table|json] resolve [--dotenv-path <path>] [--skip-dotenv] --poll-address <address> --answer yes|no|invalid --reason <text> --dry-run|--execute [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>]`
|
|
371
373
|
- Behavior:
|
|
372
374
|
- `--dry-run` returns a deterministic execution plan.
|
|
373
375
|
- `--execute` submits the resolution transaction with decoded revert diagnostics on failure.
|
|
@@ -375,7 +377,8 @@ Mirror advanced flags (for operator tuning):
|
|
|
375
377
|
### LP command
|
|
376
378
|
- Usage:
|
|
377
379
|
- `pandora [--output table|json] lp add --market-address <address> --amount-usdc <n> --dry-run|--execute [--deadline-seconds <n>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>]`
|
|
378
|
-
- `pandora [--output table|json] lp remove --market-address <address> --lp-tokens <n
|
|
380
|
+
- `pandora [--output table|json] lp remove --market-address <address> --lp-tokens <n>|--all --dry-run|--execute [--deadline-seconds <n>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>]`
|
|
381
|
+
- `pandora [--output table|json] lp remove --all-markets [--wallet <address>] --dry-run|--execute [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--indexer-url <url>] [--timeout-ms <ms>]`
|
|
379
382
|
- `pandora [--output table|json] lp positions --wallet <address> [--market-address <address>] [--chain-id <id>] [--indexer-url <url>] [--timeout-ms <ms>]`
|
|
380
383
|
- Behavior:
|
|
381
384
|
- `add/remove` use simulation-first transaction flow.
|
|
@@ -426,6 +429,7 @@ Mirror advanced flags (for operator tuning):
|
|
|
426
429
|
- `pandora analyze`
|
|
427
430
|
- `pandora suggest`
|
|
428
431
|
- `pandora resolve`
|
|
432
|
+
- `pandora claim --market-address <address>|--all --dry-run|--execute`
|
|
429
433
|
- `pandora lp add|remove|positions`
|
|
430
434
|
- `pandora polls list|get`
|
|
431
435
|
- `pandora events list|get`
|
package/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pandora-cli-skills
|
|
3
3
|
summary: Canonical skill and operator guide for Pandora CLI including mirror, polymarket, resolve, and LP flows.
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.54
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Pandora CLI & Skills
|
|
@@ -60,6 +60,7 @@ npm link
|
|
|
60
60
|
- `pandora analyze`
|
|
61
61
|
- `pandora suggest`
|
|
62
62
|
- `pandora resolve`
|
|
63
|
+
- `pandora claim --market-address <address>|--all --dry-run|--execute`
|
|
63
64
|
- `pandora lp add|remove|positions`
|
|
64
65
|
- `pandora stream prices|events`
|
|
65
66
|
- Quant/model commands:
|
|
@@ -133,6 +134,7 @@ pandora [--output table|json] watch [--wallet <address>] [--market-address <addr
|
|
|
133
134
|
pandora [--output table|json] scan [--limit <n>] [--after <cursor>] [--before <cursor>] [--order-by <field>] [--order-direction asc|desc] [--chain-id <id>] [--creator <address>] [--poll-address <address>] [--market-type <type>] [--where-json <json>] [--active|--resolved|--expiring-soon] [--expiring-hours <n>] [--expand]
|
|
134
135
|
pandora [--output table|json] quote [--indexer-url <url>] [--timeout-ms <ms>] --market-address <address> --side yes|no --amount-usdc <amount> [--yes-pct <0-100>] [--slippage-bps <0-10000>]
|
|
135
136
|
pandora [--output table|json] trade [--indexer-url <url>] [--timeout-ms <ms>] [--dotenv-path <path>] [--skip-dotenv] --market-address <address> --side yes|no --amount-usdc <amount> --dry-run|--execute [--yes-pct <0-100>] [--slippage-bps <0-10000>] [--min-shares-out-raw <uint>] [--max-amount-usdc <amount>] [--min-probability-pct <0-100>] [--max-probability-pct <0-100>] [--allow-unquoted-execute] [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>]
|
|
137
|
+
pandora [--output table|json] claim [--dotenv-path <path>] [--skip-dotenv] --market-address <address>|--all [--wallet <address>] --dry-run|--execute [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--indexer-url <url>] [--timeout-ms <ms>]
|
|
136
138
|
pandora [--output table|json] history --wallet <address> [--chain-id <id>] [--market-address <address>] [--side yes|no|both] [--status all|open|won|lost|closed] [--limit <n>] [--after <cursor>] [--before <cursor>] [--order-by timestamp|pnl|entry-price|mark-price] [--order-direction asc|desc] [--include-seed]
|
|
137
139
|
pandora [--output table|json] export --wallet <address> --format csv|json [--chain-id <id>] [--year <yyyy>] [--from <unix>] [--to <unix>] [--out <path>]
|
|
138
140
|
pandora [--output table|json] arbitrage [--chain-id <id>] [--venues pandora,polymarket] [--limit <n>] [--min-spread-pct <n>] [--min-liquidity-usdc <n>] [--max-close-diff-hours <n>] [--similarity-threshold <0-1>] [--cross-venue-only|--allow-same-venue] [--with-rules] [--include-similarity] [--question-contains <text>] [--polymarket-host <url>] [--polymarket-mock-url <url>]
|
|
@@ -146,7 +148,7 @@ pandora [--output table|json] leaderboard [--metric profit|volume|win-rate] [--c
|
|
|
146
148
|
pandora [--output table|json] analyze --market-address <address> [--provider <name>] [--model <id>] [--max-cost-usd <n>] [--temperature <n>] [--timeout-ms <ms>]
|
|
147
149
|
pandora [--output table|json] suggest --wallet <address> --risk low|medium|high --budget <amount> [--count <n>] [--include-venues pandora,polymarket]
|
|
148
150
|
pandora [--output table|json] resolve [--dotenv-path <path>] [--skip-dotenv] --poll-address <address> --answer yes|no|invalid --reason <text> --dry-run|--execute [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>]
|
|
149
|
-
pandora [--output table|json] lp add|remove|positions [--market-address <address>] [--wallet <address>] [--amount-usdc <n>] [--lp-tokens <n
|
|
151
|
+
pandora [--output table|json] lp add|remove|positions [--market-address <address>] [--wallet <address>] [--amount-usdc <n>] [--lp-tokens <n>|--all|--all-markets] [--dry-run|--execute] [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>] [--deadline-seconds <n>] [--indexer-url <url>] [--timeout-ms <ms>]
|
|
150
152
|
pandora [--output table|json] risk show|panic [--risk-file <path>] [--clear] [--reason <text>] [--actor <id>]
|
|
151
153
|
pandora stream prices|events [--indexer-url <url>] [--indexer-ws-url <url>] [--timeout-ms <ms>] [--interval-ms <ms>] [--market-address <address>] [--chain-id <id>] [--limit <n>]
|
|
152
154
|
pandora [--output json] schema
|
|
@@ -168,7 +170,7 @@ simulate --liquidity-usdc <n> [--source-yes-pct <0-100>] [--target-yes-pct <0-10
|
|
|
168
170
|
go --polymarket-market-id <id>|--polymarket-slug <slug> [--liquidity-usdc <n>] [--fee-tier <500-50000>] [--max-imbalance <n>] [--arbiter <address>] [--category <n>] [--paper|--dry-run|--execute-live|--execute] [--auto-sync] [--sync-once] [--sync-interval-ms <ms>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--funder <address>] [--usdc <address>] [--oracle <address>] [--factory <address>] [--sources <url...>] [--manifest-file <path>] [--trust-deploy] [--skip-gate] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--with-rules] [--include-similarity] [--min-close-lead-seconds <n>]
|
|
169
171
|
sync run|once|start --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug> [--paper|--dry-run|--execute-live|--execute] [--private-key <hex>] [--funder <address>] [--usdc <address>] [--trust-deploy] [--manifest-file <path>] [--skip-gate] [--daemon] [--stream|--no-stream] [--interval-ms <ms>] [--drift-trigger-bps <n>] [--hedge-trigger-usdc <n>] [--hedge-ratio <n>] [--no-hedge] [--max-rebalance-usdc <n>] [--max-hedge-usdc <n>] [--max-open-exposure-usdc <n>] [--max-trades-per-day <n>] [--cooldown-ms <ms>] [--depth-slippage-bps <n>] [--min-time-to-close-sec <n>] [--iterations <n>] [--state-file <path>] [--kill-switch-file <path>] [--chain-id <id>] [--rpc-url <url>] [--polymarket-host <url>] [--polymarket-gamma-url <url>] [--polymarket-gamma-mock-url <url>] [--polymarket-mock-url <url>] [--webhook-url <url>] [--telegram-bot-token <token>] [--telegram-chat-id <id>] [--discord-webhook-url <url>]
|
|
170
172
|
status --state-file <path>|--strategy-hash <hash> [--with-live] [--pandora-market-address <address>|--market-address <address>] [--polymarket-market-id <id>|--polymarket-slug <slug>]
|
|
171
|
-
close --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug
|
|
173
|
+
close --pandora-market-address <address>|--market-address <address> --polymarket-market-id <id>|--polymarket-slug <slug>|--all --dry-run|--execute [--wallet <address>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--indexer-url <url>] [--timeout-ms <ms>]
|
|
172
174
|
```
|
|
173
175
|
|
|
174
176
|
Daemon selector detail:
|
|
@@ -408,7 +410,7 @@ pandora --output json schema
|
|
|
408
410
|
- `mirror status`: local mirror state inspection with optional live market diagnostics (`--with-live`).
|
|
409
411
|
- `--with-live` uses the same `POLYMARKET_*` env keys for optional position visibility (YES/NO balances, open orders count, estimated value) and adds `netDeltaApprox` / `pnlApprox`.
|
|
410
412
|
- missing credentials or unavailable position endpoints do not hard-fail status; diagnostics are returned with null position fields.
|
|
411
|
-
- `mirror close`: deterministic
|
|
413
|
+
- `mirror close`: executes deterministic closeout workflow (stop daemon -> withdraw LP -> claim), with dependency-safe step gating.
|
|
412
414
|
- `webhook test`: channel validation for generic, Telegram, and Discord payload delivery.
|
|
413
415
|
- `leaderboard`: ranked user aggregates by profit/volume/win-rate.
|
|
414
416
|
- invalid indexer aggregates are sanitized (win-rate capped to 0-100%) and emitted in diagnostics.
|
|
@@ -418,7 +420,7 @@ pandora --output json schema
|
|
|
418
420
|
|
|
419
421
|
### Resolve command
|
|
420
422
|
- Usage:
|
|
421
|
-
- `pandora [--output table|json] resolve [--dotenv-path <path>] [--skip-dotenv] --poll-address <address> --answer yes|no|invalid --reason <text> --dry-run|--execute [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>]`
|
|
423
|
+
- `pandora [--output table|json] resolve [--dotenv-path <path>] [--skip-dotenv] --poll-address <address> --answer yes|no|invalid --reason <text> --dry-run|--execute [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>]`
|
|
422
424
|
- Behavior:
|
|
423
425
|
- `--dry-run` returns the call plan and decode-ready payload.
|
|
424
426
|
- `--execute` submits on-chain resolution through configured oracle/operator path.
|
|
@@ -568,11 +570,11 @@ Error envelope:
|
|
|
568
570
|
- `{ ok: true, command: "mirror.go", data: { schemaVersion, generatedAt, mode, plan, deploy, verify, sync, polymarketPreflight, suggestedSyncCommand, trustManifest, diagnostics[] } }`
|
|
569
571
|
- `plan` is the same payload shape as `mirror.plan`; `deploy` is the same payload shape as `mirror.deploy`; `sync` is null unless `--auto-sync` is used.
|
|
570
572
|
- close peers:
|
|
571
|
-
- `mirror close`: `{ ok: true, command: "mirror.close", data: { schemaVersion, generatedAt, mode, pandoraMarketAddress, polymarketMarketId?, polymarketSlug?, steps[], diagnostics[] } }`
|
|
573
|
+
- `mirror close`: `{ ok: true, command: "mirror.close", data: { schemaVersion, generatedAt, mode, target, pandoraMarketAddress, polymarketMarketId?, polymarketSlug?, steps[], summary, diagnostics[] } }`
|
|
572
574
|
- `mirror sync start|status|stop`: `{ ok: true, command: "mirror.sync.start|mirror.sync.status|mirror.sync.stop", data: { strategyHash, pid?, pidFile, logFile?, alive, status, metadata? } }`
|
|
573
575
|
- `resolve`:
|
|
574
|
-
- dry-run: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "dry-run", txPlan } }`
|
|
575
|
-
- execute: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "execute", tx } }`
|
|
576
|
+
- dry-run: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "dry-run", runtime: { mode, chainId, rpcUrl }, txPlan, precheck?, diagnostics[] } }`
|
|
577
|
+
- execute: `{ ok: true, command: "resolve", data: { schemaVersion, generatedAt, mode: "execute", runtime: { mode, chainId, rpcUrl }, tx, precheck, diagnostics[] } }`
|
|
576
578
|
- `lp`:
|
|
577
579
|
- `lp add|remove`: `{ ok: true, command: "lp", data: { schemaVersion, generatedAt, action: "add"|"remove", mode, txPlan, tx? } }`
|
|
578
580
|
- `lp positions`: `{ ok: true, command: "lp", data: { schemaVersion, generatedAt, action: "positions", mode: "read", wallet, count, items[] } }`
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function requireDep(deps, name) {
|
|
2
|
+
if (!deps || typeof deps[name] !== 'function') {
|
|
3
|
+
throw new Error(`createRunClaimCommand requires deps.${name}()`);
|
|
4
|
+
}
|
|
5
|
+
return deps[name];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates `claim` command runner.
|
|
10
|
+
* @param {object} deps
|
|
11
|
+
* @returns {(args: string[], context: {outputMode: string}) => Promise<void>}
|
|
12
|
+
*/
|
|
13
|
+
function createRunClaimCommand(deps) {
|
|
14
|
+
const includesHelpFlag = requireDep(deps, 'includesHelpFlag');
|
|
15
|
+
const emitSuccess = requireDep(deps, 'emitSuccess');
|
|
16
|
+
const commandHelpPayload = requireDep(deps, 'commandHelpPayload');
|
|
17
|
+
const parseIndexerSharedFlags = requireDep(deps, 'parseIndexerSharedFlags');
|
|
18
|
+
const maybeLoadTradeEnv = requireDep(deps, 'maybeLoadTradeEnv');
|
|
19
|
+
const parseClaimFlags = requireDep(deps, 'parseClaimFlags');
|
|
20
|
+
const runClaim = requireDep(deps, 'runClaim');
|
|
21
|
+
const renderSingleEntityTable = requireDep(deps, 'renderSingleEntityTable');
|
|
22
|
+
const CliError = requireDep(deps, 'CliError');
|
|
23
|
+
const assertLiveWriteAllowed = typeof deps.assertLiveWriteAllowed === 'function' ? deps.assertLiveWriteAllowed : null;
|
|
24
|
+
|
|
25
|
+
return async function runClaimCommand(args, context) {
|
|
26
|
+
const shared = parseIndexerSharedFlags(args);
|
|
27
|
+
if (includesHelpFlag(shared.rest)) {
|
|
28
|
+
const usage =
|
|
29
|
+
'pandora [--output table|json] claim --market-address <address>|--all [--wallet <address>] --dry-run|--execute [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--indexer-url <url>] [--timeout-ms <ms>]';
|
|
30
|
+
if (context.outputMode === 'json') {
|
|
31
|
+
emitSuccess(context.outputMode, 'claim.help', commandHelpPayload(usage));
|
|
32
|
+
} else {
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
console.log(`Usage: ${usage}`);
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
maybeLoadTradeEnv(shared);
|
|
40
|
+
const options = parseClaimFlags(shared.rest);
|
|
41
|
+
if (!options.indexerUrl && shared.indexerUrl) {
|
|
42
|
+
options.indexerUrl = shared.indexerUrl;
|
|
43
|
+
}
|
|
44
|
+
if (Number.isFinite(shared.timeoutMs)) {
|
|
45
|
+
options.timeoutMs = shared.timeoutMs;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (options.execute && assertLiveWriteAllowed) {
|
|
49
|
+
await assertLiveWriteAllowed('claim.execute', {
|
|
50
|
+
runtimeMode: options.fork || options.forkRpcUrl ? 'fork' : 'live',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let payload;
|
|
55
|
+
try {
|
|
56
|
+
payload = await runClaim(options);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (err && err.code) {
|
|
59
|
+
throw new CliError(err.code, err.message || 'claim command failed.', err.details);
|
|
60
|
+
}
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
emitSuccess(context.outputMode, 'claim', payload, renderSingleEntityTable);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
module.exports = {
|
|
69
|
+
createRunClaimCommand,
|
|
70
|
+
};
|
|
@@ -40,6 +40,7 @@ function createCommandRouter(deps = {}) {
|
|
|
40
40
|
runAnalyzeCommand,
|
|
41
41
|
runSuggestCommand,
|
|
42
42
|
runResolveCommand,
|
|
43
|
+
runClaimCommand,
|
|
43
44
|
runLpCommand,
|
|
44
45
|
runRiskCommand,
|
|
45
46
|
runModelCommand,
|
|
@@ -94,6 +95,7 @@ function createCommandRouter(deps = {}) {
|
|
|
94
95
|
requireFn('runAnalyzeCommand', runAnalyzeCommand);
|
|
95
96
|
requireFn('runSuggestCommand', runSuggestCommand);
|
|
96
97
|
requireFn('runResolveCommand', runResolveCommand);
|
|
98
|
+
requireFn('runClaimCommand', runClaimCommand);
|
|
97
99
|
requireFn('runLpCommand', runLpCommand);
|
|
98
100
|
requireFn('runRiskCommand', runRiskCommand);
|
|
99
101
|
requireFn('runModelCommand', runModelCommand);
|
|
@@ -189,6 +191,7 @@ function createCommandRouter(deps = {}) {
|
|
|
189
191
|
analyze: async (handlerArgs, handlerContext) => runAnalyzeCommand(handlerArgs, handlerContext),
|
|
190
192
|
suggest: async (handlerArgs, handlerContext) => runSuggestCommand(handlerArgs, handlerContext),
|
|
191
193
|
resolve: async (handlerArgs, handlerContext) => runResolveCommand(handlerArgs, handlerContext),
|
|
194
|
+
claim: async (handlerArgs, handlerContext) => runClaimCommand(handlerArgs, handlerContext),
|
|
192
195
|
lp: async (handlerArgs, handlerContext) => runLpCommand(handlerArgs, handlerContext),
|
|
193
196
|
risk: async (handlerArgs, handlerContext) => runRiskCommand(handlerArgs, handlerContext),
|
|
194
197
|
model: async (handlerArgs, handlerContext) => runModelCommand(handlerArgs, handlerContext),
|
|
@@ -29,13 +29,13 @@ function createRunLpCommand(deps) {
|
|
|
29
29
|
context.outputMode,
|
|
30
30
|
'lp.help',
|
|
31
31
|
commandHelpPayload(
|
|
32
|
-
'pandora [--output table|json] lp add|remove|positions [--market-address <address>] [--wallet <address>] [--amount-usdc <n>] [--lp-tokens <n>|--all] [--dry-run|--execute] [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>] [--deadline-seconds <n>] [--indexer-url <url>] [--timeout-ms <ms>]',
|
|
32
|
+
'pandora [--output table|json] lp add|remove|positions [--market-address <address>] [--wallet <address>] [--amount-usdc <n>] [--lp-tokens <n>|--all|--all-markets] [--dry-run|--execute] [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>] [--deadline-seconds <n>] [--indexer-url <url>] [--timeout-ms <ms>]',
|
|
33
33
|
),
|
|
34
34
|
);
|
|
35
35
|
} else {
|
|
36
36
|
// eslint-disable-next-line no-console
|
|
37
37
|
console.log(
|
|
38
|
-
'Usage: pandora [--output table|json] lp add|remove|positions [--market-address <address>] [--wallet <address>] [--amount-usdc <n>] [--lp-tokens <n>|--all] [--dry-run|--execute] [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>] [--deadline-seconds <n>] [--indexer-url <url>] [--timeout-ms <ms>]',
|
|
38
|
+
'Usage: pandora [--output table|json] lp add|remove|positions [--market-address <address>] [--wallet <address>] [--amount-usdc <n>] [--lp-tokens <n>|--all|--all-markets] [--dry-run|--execute] [--fork] [--fork-rpc-url <url>] [--fork-chain-id <id>] [--chain-id <id>] [--rpc-url <url>] [--private-key <hex>] [--usdc <address>] [--deadline-seconds <n>] [--indexer-url <url>] [--timeout-ms <ms>]',
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
return;
|