@vercora-protocol/sdk 0.0.13 → 0.0.15
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 +3 -0
- package/agents/skill.md +72 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ Most transaction methods use **`provider.wallet.publicKey`** as the signer (`use
|
|
|
47
47
|
| `types` | Params and account shapes (`CreateMarketParams`, `ListedMarket`, …). |
|
|
48
48
|
| `marketUi` | Pure UI helpers (`getMarketLifecycleStatus`, `formatTimeLeft`, …). |
|
|
49
49
|
| `Vercora` (type) | Anchor `Program` generic for `Program<Vercora>`. |
|
|
50
|
+
| `agents/skill.md` | Short **AI agent entrypoint** (production: `https://vercora.xyz/agents/skill.md`). |
|
|
50
51
|
|
|
51
52
|
---
|
|
52
53
|
|
|
@@ -495,6 +496,8 @@ import type {
|
|
|
495
496
|
|
|
496
497
|
## AI agent integration
|
|
497
498
|
|
|
499
|
+
Start from **`agents/skill.md`** in this package for a stable entrypoint; the full playbook is at **`https://vercora.xyz/agents/playbook.md`** (production), or `docs/AI-AGENT-SDK-PLAYBOOK.md` in the monorepo.
|
|
500
|
+
|
|
498
501
|
1. **Bootstrap**: `Connection` → `AnchorProvider` → `Program<Vercora>` from `IDL` → `PredictionMarketClient`.
|
|
499
502
|
2. **Branch**: `fetchMarket` → `market.marketType` (`completeSet` vs `parimutuel`).
|
|
500
503
|
3. **Flows**:
|
package/agents/skill.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Vercora Protocol — agent skill entry (`@vercora-protocol/sdk`)
|
|
2
|
+
|
|
3
|
+
This file ships **inside** the npm package (`agents/skill.md`) so AI agents, clawbots, and operator scripts can load instructions without depending on a particular website.
|
|
4
|
+
|
|
5
|
+
## Public production deployment (Vercora)
|
|
6
|
+
|
|
7
|
+
The canonical HTTPS deployment—use this when you **do not** have the monorepo—is **[vercora.xyz](https://vercora.xyz)**. Fetch these over TLS; use a Solana `Connection` and cluster that match the deployment you operate against (see this package’s `README.md`).
|
|
8
|
+
|
|
9
|
+
| Resource | URL |
|
|
10
|
+
|----------|-----|
|
|
11
|
+
| Full AI playbook (markdown) | `https://vercora.xyz/agents/playbook.md` |
|
|
12
|
+
| This skill entry (markdown) | `https://vercora.xyz/agents/skill.md` |
|
|
13
|
+
| Pointer manifest (JSON) | `https://vercora.xyz/.well-known/vercora-agents.json` |
|
|
14
|
+
| Developer docs (human) | `https://vercora.xyz/docs` |
|
|
15
|
+
| AI / agents page (human) | `https://vercora.xyz/docs/agents` |
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
|
|
19
|
+
```http
|
|
20
|
+
GET https://vercora.xyz/agents/playbook.md
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Other front-end deployments
|
|
24
|
+
|
|
25
|
+
For self-hosted or staging sites, use the same path suffixes with your origin: `{BASE}/agents/playbook.md`, `{BASE}/agents/skill.md`, `{BASE}/.well-known/vercora-agents.json` (where `BASE` is `https://your-host` with no trailing slash).
|
|
26
|
+
|
|
27
|
+
## What to read first
|
|
28
|
+
|
|
29
|
+
1. **This package’s `README.md`** — install, exports, `PredictionMarketClient` API, and the **AI agent integration** section (workflow map).
|
|
30
|
+
2. **Full playbook** (skills, pitfalls, decision trees):
|
|
31
|
+
- **Production:** `https://vercora.xyz/agents/playbook.md`
|
|
32
|
+
- **Monorepo (contributors):** `prediction_market/docs/AI-AGENT-SDK-PLAYBOOK.md` (content matches the production mirror).
|
|
33
|
+
|
|
34
|
+
The playbook is the source of truth for instruction order, branching, and edge cases.
|
|
35
|
+
|
|
36
|
+
## Key files in the published npm package
|
|
37
|
+
|
|
38
|
+
Paths are under `node_modules/@vercora-protocol/sdk/` after install.
|
|
39
|
+
|
|
40
|
+
| Path | Purpose |
|
|
41
|
+
|------|---------|
|
|
42
|
+
| `README.md` | Install, API tables, examples, AI agent integration |
|
|
43
|
+
| `agents/skill.md` | This entry |
|
|
44
|
+
| `dist/index.js` / `dist/index.d.ts` | Package entry (`PredictionMarketClient`, re-exports) |
|
|
45
|
+
| `dist/idl/vercora.json` | Anchor **IDL** JSON (`IDL` / `PROGRAM_ID` match this release) |
|
|
46
|
+
| `dist/client.js` | `PredictionMarketClient` implementation |
|
|
47
|
+
| `dist/types.d.ts` | `CreateMarketParams`, `MarketAccount`, `UpdateParimutuelStateParams`, etc. |
|
|
48
|
+
| `dist/generated/vercora.d.ts` | Anchor codegen types; use as `Program<Vercora>` generic |
|
|
49
|
+
| `dist/pda.d.ts` | PDA helpers (`deriveMarket`, `deriveVault`, …) |
|
|
50
|
+
| `dist/marketUi.d.ts` | `getMarketLifecycleStatus`, `formatTimeLeft`, … |
|
|
51
|
+
| `package.json` | Version and peer dependencies |
|
|
52
|
+
|
|
53
|
+
## Monorepo paths (source / docs, not shipped in npm)
|
|
54
|
+
|
|
55
|
+
| Path | Purpose |
|
|
56
|
+
|------|---------|
|
|
57
|
+
| `prediction_market/docs/AI-AGENT-SDK-PLAYBOOK.md` | Full AI playbook (synced to `https://vercora.xyz/agents/playbook.md`) |
|
|
58
|
+
| `prediction_market/docs/market-mechanics-and-ux-options.md` | Mechanics and UX notes (non-normative) |
|
|
59
|
+
| `prediction_market/app/sdk/src/` | SDK TypeScript source |
|
|
60
|
+
| `prediction_market/target/idl/vercora.json` | IDL from `anchor build` (synced into SDK + web) |
|
|
61
|
+
| `prediction_market/programs/vercora/` | On-chain program (Rust) |
|
|
62
|
+
| `prediction_market/app/web/public/.well-known/vercora-agents.json` | Pointer manifest (deployed at `https://vercora.xyz/.well-known/vercora-agents.json`) |
|
|
63
|
+
|
|
64
|
+
## NPM
|
|
65
|
+
|
|
66
|
+
- Package: `@vercora-protocol/sdk`
|
|
67
|
+
- See `package.json` for the published version; align Anchor program + IDL with the same release when possible.
|
|
68
|
+
|
|
69
|
+
## Quick guardrails (parimutuel)
|
|
70
|
+
|
|
71
|
+
- After `fetchMarket(marketPda)`, read **`isEarlyWithdrawAllowed`**. If `false`, do not propose **`parimutuelWithdraw`** until close/resolution (on-chain error **`EarlyWithdrawNotAllowed`**). Creators may change this with **`updateParimutuelState`** (with penalty bps).
|
|
72
|
+
- Use **`isClosedEarly`**, **`isVoided`**, **`winningOutcomeIndex`** for lifecycle — not legacy `closed` / `voided` / `resolvedOutcomeIndex` names.
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercora-protocol/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "TypeScript SDK for the Vercora protocol on Solana",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"README.md"
|
|
9
|
+
"README.md",
|
|
10
|
+
"agents"
|
|
10
11
|
],
|
|
11
12
|
"publishConfig": {
|
|
12
13
|
"access": "public",
|