pandora-cli-skills 1.0.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.
@@ -0,0 +1,98 @@
1
+ # Pandora CLI & Skills — Shareable Package
2
+
3
+ This is a sanitized, shareable copy of the Pandora market setup skill.
4
+
5
+ ## What is included
6
+ - `SKILL.md` (usage/behavior)
7
+ - `package.json`
8
+ - `package-lock.json`
9
+ - `.gitignore`
10
+ - `scripts/.env.example`
11
+ - `scripts/create_market_launcher.ts`
12
+ - `scripts/create_polymarket_clone_and_bet.ts`
13
+ - `references/creation-script.md`
14
+ - `references/contracts.md`
15
+ - `references/checklist.md`
16
+
17
+ ## What is intentionally omitted
18
+ - `.env` (contains PRIVATE_KEY / RPC overrides)
19
+ - `wallet.json` (contains privateKey/address)
20
+ - any local runtime secrets
21
+ - `node_modules`
22
+
23
+ ## Setup
24
+ Prerequisite: Node.js `>=18`.
25
+
26
+ 1. Install dependencies:
27
+ - `npm install`
28
+ 2. Initialize env file:
29
+ - `npm run init-env`
30
+ - or one-shot guided flow: `npm run setup`
31
+ 3. Fill `scripts/.env`:
32
+ - `CHAIN_ID`
33
+ - `PRIVATE_KEY`
34
+ - `RPC_URL`
35
+ - `ORACLE`
36
+ - `FACTORY`
37
+ - `USDC`
38
+ 4. Validate and build:
39
+ - `npm run doctor`
40
+ - `npm run build`
41
+ 5. Run:
42
+ - `npm run dry-run`
43
+ - `npm run dry-run:clone`
44
+ - `node cli/pandora.cjs help`
45
+
46
+ ## New CLI capabilities
47
+ - Global machine-readable output:
48
+ - `pandora --output json doctor`
49
+ - `pandora --output table polls list --limit 10`
50
+ - `--output json` is for non-execution commands; `launch`/`clone-bet` stream script output directly.
51
+ - Guided setup:
52
+ - `pandora setup`
53
+ - `pandora setup --check-usdc-code`
54
+ - Stronger doctor checks:
55
+ - Required env and value validation
56
+ - RPC reachability + chain-id match
57
+ - Contract bytecode checks (`ORACLE`, `FACTORY`, optional `USDC`)
58
+ - Read-only indexer commands (GraphQL-backed):
59
+ - `pandora markets list|get`
60
+ - `pandora polls list|get`
61
+ - `pandora events list|get`
62
+ - `pandora positions list`
63
+
64
+ ## Read-only examples
65
+ - `pandora markets list --limit 20 --order-by createdAt --order-direction desc`
66
+ - `pandora markets get --id <market-id>`
67
+ - `pandora polls list --status 1 --category 3`
68
+ - `pandora events list --type all --wallet <0x...> --limit 25`
69
+ - `pandora positions list --wallet <0x...> --limit 50`
70
+
71
+ ## Release and verified install
72
+ - CI workflow: `.github/workflows/ci.yml` runs on Linux/macOS/Windows and covers install, lint/typecheck, full tests, and `npm pack --dry-run`.
73
+ - Release workflow: `.github/workflows/release.yml` runs on pushed `v*` tags, runs tests, builds `npm pack`, generates `checksums.sha256`, and uploads both workflow artifacts + GitHub Release assets.
74
+ - Verified install helper:
75
+ - `scripts/release/install_release.sh --repo <owner/repo> --tag <tag> --no-install`
76
+ - `scripts/release/install_release.sh --repo <owner/repo> --tag <tag>`
77
+ - optional out-of-band digest pin: `scripts/release/install_release.sh --repo <owner/repo> --tag <tag> --expected-sha256 <64-hex>`
78
+ - The helper downloads `checksums.sha256` from the tag release, verifies SHA-256 for the tarball, verifies keyless cosign signature (`<asset>.sig` + `<asset>.pem`) against the release workflow identity, then installs via npm (global by default).
79
+ - `cosign` is required for default secure install. Use `--skip-signature-verify` only for legacy unsigned releases.
80
+
81
+ ## CLI
82
+ - Entry command: `pandora` (from package `bin`) or `node cli/pandora.cjs`.
83
+ - Commands:
84
+ - `pandora init-env`
85
+ - `pandora setup`
86
+ - `pandora doctor`
87
+ - `pandora markets list|get`
88
+ - `pandora polls list|get`
89
+ - `pandora events list|get`
90
+ - `pandora positions list`
91
+ - `pandora launch ...`
92
+ - `pandora clone-bet ...`
93
+ - Optional global link in this checkout:
94
+ - `npm link`
95
+ - then run `pandora help`
96
+
97
+ ## Security
98
+ Never share real private keys. Use environment files only locally.
package/SKILL.md ADDED
@@ -0,0 +1,121 @@
1
+ # Pandora CLI & Skills
2
+
3
+ Create and publish Pandora prediction markets from deployed contracts.
4
+
5
+ ## Purpose
6
+ Use this skill to launch Parimutuel or AMM markets with explicit market parameters, strict DAO-ready resolution rules, and optional scripted bet placement.
7
+
8
+ ## Safety & Resolution Rules (enforced)
9
+ - At least **2 public source URLs** are required (`http/https` only).
10
+ - `--rules` must include explicit **Yes/No** outcomes and edge-case handling (cancel/postpone/abandoned/unresolved cases).
11
+ - `--target-timestamp` uses a `+1h` buffer by default (`--target-timestamp-offset-hours` to override).
12
+ - `deadline` must be in the future (12h+ window strongly recommended).
13
+ - `distribution-yes + distribution-no = 1_000_000_000`.
14
+ - `--liquidity` minimum is **10 USDC**.
15
+ - `--arbiter` cannot be zero-address.
16
+
17
+ ## Setup
18
+ ```bash
19
+ # Node.js >=18 required
20
+ npm install
21
+ npm run init-env
22
+ # or one-shot setup + diagnostics:
23
+ npm run setup
24
+ # edit scripts/.env with your values
25
+ npm run build
26
+ npm run doctor
27
+
28
+ # optional: expose "pandora" command globally in this checkout
29
+ npm link
30
+ ```
31
+
32
+ ## CLI ergonomics
33
+ - Global output mode: `--output table|json` (default `table`)
34
+ - `--output json` applies to non-execution commands; `launch`/`clone-bet` stream script output directly.
35
+ - Guided setup command: `pandora setup`
36
+ - Doctor checks:
37
+ - env presence + format validation
38
+ - RPC reachability and chain id match
39
+ - bytecode checks for `ORACLE` + `FACTORY` (`--check-usdc-code` optional)
40
+
41
+ ## Read-only indexer commands
42
+ Indexer URL resolution order:
43
+ 1. `--indexer-url`
44
+ 2. `PANDORA_INDEXER_URL`
45
+ 3. `INDEXER_URL`
46
+ 4. default public indexer
47
+
48
+ ```bash
49
+ pandora markets list --limit 20 --order-by createdAt --order-direction desc
50
+ pandora markets get --id <market-id>
51
+
52
+ pandora polls list --status 1 --category 3
53
+ pandora polls get --id <poll-id>
54
+
55
+ pandora events list --type all --wallet <0x...> --limit 25
56
+ pandora events get --id <event-id>
57
+
58
+ pandora positions list --wallet <0x...> --limit 50
59
+ ```
60
+
61
+ JSON mode for automation:
62
+ ```bash
63
+ pandora --output json polls list --limit 5
64
+ ```
65
+
66
+ ## Release verification
67
+ - CI coverage includes Linux, macOS, and Windows.
68
+ - Release artifacts are signed keylessly with cosign in the release workflow.
69
+ - Installer verifies checksum + cosign signature by default:
70
+ - `scripts/release/install_release.sh --repo <owner/repo> --tag <tag>`
71
+ - `cosign` is required unless you explicitly pass `--skip-signature-verify` for legacy unsigned tags.
72
+
73
+ ## Launch Parimutuel + auto-bet
74
+ Use `--allow-duplicate` only if you intentionally want to bypass duplicate-question checks.
75
+
76
+ ```bash
77
+ pandora clone-bet \
78
+ --dry-run \
79
+ --question "Will Arsenal FC win against Chelsea FC on 2026-03-01?" \
80
+ --rules "Resolves YES if Arsenal FC wins in regulation time on March 1, 2026. Resolves NO for draw/Chelsea win. If cancelled, postponed beyond 48h, abandoned, or unresolved by official competition records, resolves NO." \
81
+ --sources "https://www.premierleague.com" "https://www.bbc.com/sport/football" \
82
+ --target-timestamp 1772323200 \
83
+ --target-timestamp-offset-hours 1 \
84
+ --arbiter 0x818457C9e2b18D87981CCB09b75AE183D107b257 \
85
+ --category 3 \
86
+ --liquidity 10 \
87
+ --curve-flattener 7 \
88
+ --curve-offset 30000 \
89
+ --bet-usd 10 \
90
+ --bet-on yes
91
+ ```
92
+
93
+ For live execution, replace `--dry-run` with `--execute`.
94
+ If `pandora` is not linked yet, use `node cli/pandora.cjs clone-bet ...`.
95
+
96
+ Default arbiter (whitelisted): `0x818457C9e2b18D87981CCB09b75AE183D107b257`
97
+
98
+ ## Launch AMM/Parimutuel (market launcher)
99
+ ```bash
100
+ pandora launch \
101
+ --dry-run \
102
+ --market-type amm \
103
+ --question "Will BTC close above $100k by end of 2026?" \
104
+ --rules "Resolves YES if BTC/USD closes above 100000 on 2026-12-31 per listed public sources. Resolves NO otherwise. If data feed is cancelled, postponed, abandoned, or unresolved by 2027-01-02, resolves NO." \
105
+ --sources "https://coinmarketcap.com/currencies/bitcoin/" "https://www.coingecko.com/en/coins/bitcoin" \
106
+ --target-timestamp 1798675200 \
107
+ --target-timestamp-offset-hours 1 \
108
+ --category 3 \
109
+ --liquidity 100 \
110
+ --fee-tier 3000 \
111
+ --distribution-yes 600000000 \
112
+ --distribution-no 400000000
113
+ ```
114
+
115
+ If `pandora` is not linked yet, use `node cli/pandora.cjs launch ...`.
116
+
117
+ ## Notes
118
+ - For AMM launch: `--market-type amm --fee-tier ...`.
119
+ - For PariMutuel launch: `--market-type parimutuel` with `--curve-flattener` and `--curve-offset`.
120
+ - If `createPariMutuel` reverts with `transfer amount exceeds balance`, top up USDC and retry.
121
+ - Duplicate guard checks recent on-chain poll questions and blocks repeats unless `--allow-duplicate` is set.