@jinn-network/client 0.1.0 → 0.1.1-canary.351ad49e

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 (293) hide show
  1. package/CONTRIBUTING.md +123 -0
  2. package/README.md +202 -26
  3. package/deployments/deployment-jinn-testnet-faucet-baseSepolia-fast.json +15 -0
  4. package/dist/adapters/claim-registry/abi.d.ts +127 -0
  5. package/dist/adapters/claim-registry/abi.js +93 -0
  6. package/dist/adapters/claim-registry/abi.js.map +1 -0
  7. package/dist/adapters/claim-registry/client.d.ts +89 -0
  8. package/dist/adapters/claim-registry/client.js +205 -0
  9. package/dist/adapters/claim-registry/client.js.map +1 -0
  10. package/dist/adapters/mech/adapter.d.ts +2 -0
  11. package/dist/adapters/mech/adapter.js +110 -41
  12. package/dist/adapters/mech/adapter.js.map +1 -1
  13. package/dist/adapters/mech/contracts.d.ts +2 -0
  14. package/dist/adapters/mech/contracts.js +32 -7
  15. package/dist/adapters/mech/contracts.js.map +1 -1
  16. package/dist/adapters/mech/ipfs.d.ts +8 -0
  17. package/dist/adapters/mech/ipfs.js +12 -0
  18. package/dist/adapters/mech/ipfs.js.map +1 -1
  19. package/dist/adapters/mech/types.d.ts +20 -46
  20. package/dist/adapters/mech/types.js +16 -35
  21. package/dist/adapters/mech/types.js.map +1 -1
  22. package/dist/api/gather-status.js +33 -1
  23. package/dist/api/gather-status.js.map +1 -1
  24. package/dist/api/portfolio-v0-build.d.ts +81 -0
  25. package/dist/api/portfolio-v0-build.js +141 -0
  26. package/dist/api/portfolio-v0-build.js.map +1 -0
  27. package/dist/api/portfolio-v0-doctor.d.ts +37 -0
  28. package/dist/api/portfolio-v0-doctor.js +123 -0
  29. package/dist/api/portfolio-v0-doctor.js.map +1 -0
  30. package/dist/api/rewards-build.js +1 -1
  31. package/dist/api/rewards-build.js.map +1 -1
  32. package/dist/api/server.js +12 -0
  33. package/dist/api/server.js.map +1 -1
  34. package/dist/api/status-build.d.ts +8 -0
  35. package/dist/api/status-build.js +1 -0
  36. package/dist/api/status-build.js.map +1 -1
  37. package/dist/api/status-rollup-build.d.ts +4 -0
  38. package/dist/api/status-rollup-build.js +4 -0
  39. package/dist/api/status-rollup-build.js.map +1 -1
  40. package/dist/bin/jinn-mcp.d.ts +14 -0
  41. package/dist/bin/jinn-mcp.js +19 -0
  42. package/dist/bin/jinn-mcp.js.map +1 -0
  43. package/dist/build-meta.json +1 -1
  44. package/dist/cli/commands/auth.d.ts +3 -0
  45. package/dist/cli/commands/auth.js +236 -0
  46. package/dist/cli/commands/auth.js.map +1 -0
  47. package/dist/cli/commands/bootstrap.js +1 -0
  48. package/dist/cli/commands/bootstrap.js.map +1 -1
  49. package/dist/cli/commands/doctor.js +153 -15
  50. package/dist/cli/commands/doctor.js.map +1 -1
  51. package/dist/cli/commands/fund-requirements.js +69 -1
  52. package/dist/cli/commands/fund-requirements.js.map +1 -1
  53. package/dist/cli/commands/history.js +1 -0
  54. package/dist/cli/commands/history.js.map +1 -1
  55. package/dist/cli/commands/init.js +31 -7
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/keys-backup.js +149 -15
  58. package/dist/cli/commands/keys-backup.js.map +1 -1
  59. package/dist/cli/commands/logs.js +28 -13
  60. package/dist/cli/commands/logs.js.map +1 -1
  61. package/dist/cli/commands/plugin-install.d.ts +3 -0
  62. package/dist/cli/commands/plugin-install.js +799 -0
  63. package/dist/cli/commands/plugin-install.js.map +1 -0
  64. package/dist/cli/commands/quickstart.d.ts +3 -0
  65. package/dist/cli/commands/quickstart.js +292 -0
  66. package/dist/cli/commands/quickstart.js.map +1 -0
  67. package/dist/cli/commands/rewards.js +27 -1
  68. package/dist/cli/commands/rewards.js.map +1 -1
  69. package/dist/cli/commands/run.js +6 -0
  70. package/dist/cli/commands/run.js.map +1 -1
  71. package/dist/cli/commands/stop.js +1 -0
  72. package/dist/cli/commands/stop.js.map +1 -1
  73. package/dist/cli/commands/submit-intent.js +79 -5
  74. package/dist/cli/commands/submit-intent.js.map +1 -1
  75. package/dist/cli/commands/update.d.ts +3 -0
  76. package/dist/cli/commands/update.js +154 -0
  77. package/dist/cli/commands/update.js.map +1 -0
  78. package/dist/cli/commands/version.js +15 -1
  79. package/dist/cli/commands/version.js.map +1 -1
  80. package/dist/cli/deployment-digest.js +20 -4
  81. package/dist/cli/deployment-digest.js.map +1 -1
  82. package/dist/cli/index.js +8 -0
  83. package/dist/cli/index.js.map +1 -1
  84. package/dist/cli/password.d.ts +28 -1
  85. package/dist/cli/password.js +59 -10
  86. package/dist/cli/password.js.map +1 -1
  87. package/dist/config.d.ts +110 -7
  88. package/dist/config.js +38 -5
  89. package/dist/config.js.map +1 -1
  90. package/dist/daemon/balance-topup-loop.d.ts +40 -0
  91. package/dist/daemon/balance-topup-loop.js +96 -0
  92. package/dist/daemon/balance-topup-loop.js.map +1 -0
  93. package/dist/daemon/daemon.d.ts +37 -0
  94. package/dist/daemon/daemon.js +98 -1
  95. package/dist/daemon/daemon.js.map +1 -1
  96. package/dist/dashboard/index.html +500 -0
  97. package/dist/earning/bootstrap.d.ts +3 -1
  98. package/dist/earning/bootstrap.js +138 -17
  99. package/dist/earning/bootstrap.js.map +1 -1
  100. package/dist/earning/contracts.d.ts +24 -0
  101. package/dist/earning/contracts.js +20 -1
  102. package/dist/earning/contracts.js.map +1 -1
  103. package/dist/earning/faucet.d.ts +15 -0
  104. package/dist/earning/faucet.js +64 -0
  105. package/dist/earning/faucet.js.map +1 -0
  106. package/dist/earning/jinn-rewards.d.ts +9 -0
  107. package/dist/earning/jinn-rewards.js +7 -0
  108. package/dist/earning/jinn-rewards.js.map +1 -1
  109. package/dist/earning/store.d.ts +5 -0
  110. package/dist/earning/store.js +7 -3
  111. package/dist/earning/store.js.map +1 -1
  112. package/dist/errors/unauthorized-account.d.ts +10 -0
  113. package/dist/errors/unauthorized-account.js +14 -0
  114. package/dist/errors/unauthorized-account.js.map +1 -0
  115. package/dist/main.js +138 -1
  116. package/dist/main.js.map +1 -1
  117. package/dist/mcp/operator-server.d.ts +34 -0
  118. package/dist/mcp/operator-server.js +219 -0
  119. package/dist/mcp/operator-server.js.map +1 -0
  120. package/dist/operator-errors.js +11 -0
  121. package/dist/operator-errors.js.map +1 -1
  122. package/dist/preflight/claude-auth.d.ts +68 -0
  123. package/dist/preflight/claude-auth.js +171 -0
  124. package/dist/preflight/claude-auth.js.map +1 -0
  125. package/dist/restorer/engine/canonical-json.d.ts +18 -0
  126. package/dist/restorer/engine/canonical-json.js +59 -0
  127. package/dist/restorer/engine/canonical-json.js.map +1 -0
  128. package/dist/restorer/engine/claim.d.ts +69 -0
  129. package/dist/restorer/engine/claim.js +104 -0
  130. package/dist/restorer/engine/claim.js.map +1 -0
  131. package/dist/restorer/engine/delivery.d.ts +52 -0
  132. package/dist/restorer/engine/delivery.js +63 -0
  133. package/dist/restorer/engine/delivery.js.map +1 -0
  134. package/dist/restorer/engine/engine.d.ts +203 -0
  135. package/dist/restorer/engine/engine.js +658 -0
  136. package/dist/restorer/engine/engine.js.map +1 -0
  137. package/dist/restorer/engine/manifest-assembly.d.ts +67 -0
  138. package/dist/restorer/engine/manifest-assembly.js +79 -0
  139. package/dist/restorer/engine/manifest-assembly.js.map +1 -0
  140. package/dist/restorer/engine/packaging.d.ts +87 -0
  141. package/dist/restorer/engine/packaging.js +350 -0
  142. package/dist/restorer/engine/packaging.js.map +1 -0
  143. package/dist/restorer/engine/persistence.d.ts +170 -0
  144. package/dist/restorer/engine/persistence.js +381 -0
  145. package/dist/restorer/engine/persistence.js.map +1 -0
  146. package/dist/restorer/engine/recovery.d.ts +22 -0
  147. package/dist/restorer/engine/recovery.js +24 -0
  148. package/dist/restorer/engine/recovery.js.map +1 -0
  149. package/dist/restorer/engine/registry.d.ts +62 -0
  150. package/dist/restorer/engine/registry.js +73 -0
  151. package/dist/restorer/engine/registry.js.map +1 -0
  152. package/dist/restorer/engine/signing.d.ts +30 -0
  153. package/dist/restorer/engine/signing.js +39 -0
  154. package/dist/restorer/engine/signing.js.map +1 -0
  155. package/dist/restorer/engine/state.d.ts +42 -0
  156. package/dist/restorer/engine/state.js +87 -0
  157. package/dist/restorer/engine/state.js.map +1 -0
  158. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.d.ts +64 -0
  159. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js +96 -0
  160. package/dist/restorer/impls/claude-mcp-hyperliquid/api-wallet.js.map +1 -0
  161. package/dist/restorer/impls/claude-mcp-hyperliquid/index.d.ts +88 -0
  162. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js +560 -0
  163. package/dist/restorer/impls/claude-mcp-hyperliquid/index.js.map +1 -0
  164. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.d.ts +137 -0
  165. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js +865 -0
  166. package/dist/restorer/impls/claude-mcp-hyperliquid/mcp-tools.js.map +1 -0
  167. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.d.ts +74 -0
  168. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js +74 -0
  169. package/dist/restorer/impls/claude-mcp-hyperliquid/safety-rails.js.map +1 -0
  170. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.d.ts +97 -0
  171. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js +226 -0
  172. package/dist/restorer/impls/claude-mcp-hyperliquid/session-orchestrator.js.map +1 -0
  173. package/dist/restorer/impls/claude-mcp-prediction/index.d.ts +43 -0
  174. package/dist/restorer/impls/claude-mcp-prediction/index.js +230 -0
  175. package/dist/restorer/impls/claude-mcp-prediction/index.js.map +1 -0
  176. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.d.ts +38 -0
  177. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js +135 -0
  178. package/dist/restorer/impls/claude-mcp-prediction/mcp-tools.js.map +1 -0
  179. package/dist/restorer/impls/claude-mcp-prediction/prompt.d.ts +8 -0
  180. package/dist/restorer/impls/claude-mcp-prediction/prompt.js +54 -0
  181. package/dist/restorer/impls/claude-mcp-prediction/prompt.js.map +1 -0
  182. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.d.ts +36 -0
  183. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js +137 -0
  184. package/dist/restorer/impls/claude-mcp-prediction/session-orchestrator.js.map +1 -0
  185. package/dist/restorer/impls/claude-mcp-prediction/types.d.ts +82 -0
  186. package/dist/restorer/impls/claude-mcp-prediction/types.js +6 -0
  187. package/dist/restorer/impls/claude-mcp-prediction/types.js.map +1 -0
  188. package/dist/restorer/impls/legacy-claude/index.d.ts +42 -0
  189. package/dist/restorer/impls/legacy-claude/index.js +60 -0
  190. package/dist/restorer/impls/legacy-claude/index.js.map +1 -0
  191. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.d.ts +68 -0
  192. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js +117 -0
  193. package/dist/restorer/impls/portfolio-v0-evaluator/canonical-metrics.js.map +1 -0
  194. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.d.ts +49 -0
  195. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js +91 -0
  196. package/dist/restorer/impls/portfolio-v0-evaluator/checks/availability.js.map +1 -0
  197. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.d.ts +78 -0
  198. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js +274 -0
  199. package/dist/restorer/impls/portfolio-v0-evaluator/checks/consistency.js.map +1 -0
  200. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.d.ts +23 -0
  201. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js +49 -0
  202. package/dist/restorer/impls/portfolio-v0-evaluator/checks/eligibility.js.map +1 -0
  203. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.d.ts +25 -0
  204. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js +44 -0
  205. package/dist/restorer/impls/portfolio-v0-evaluator/checks/integrity.js.map +1 -0
  206. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.d.ts +17 -0
  207. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js +43 -0
  208. package/dist/restorer/impls/portfolio-v0-evaluator/checks/spec.js.map +1 -0
  209. package/dist/restorer/impls/portfolio-v0-evaluator/index.d.ts +43 -0
  210. package/dist/restorer/impls/portfolio-v0-evaluator/index.js +431 -0
  211. package/dist/restorer/impls/portfolio-v0-evaluator/index.js.map +1 -0
  212. package/dist/restorer/impls/portfolio-v0-evaluator/score.d.ts +21 -0
  213. package/dist/restorer/impls/portfolio-v0-evaluator/score.js +32 -0
  214. package/dist/restorer/impls/portfolio-v0-evaluator/score.js.map +1 -0
  215. package/dist/restorer/impls/portfolio-v0-evaluator/types.d.ts +32 -0
  216. package/dist/restorer/impls/portfolio-v0-evaluator/types.js +8 -0
  217. package/dist/restorer/impls/portfolio-v0-evaluator/types.js.map +1 -0
  218. package/dist/restorer/impls/prediction-v0-baseline/index.d.ts +26 -0
  219. package/dist/restorer/impls/prediction-v0-baseline/index.js +82 -0
  220. package/dist/restorer/impls/prediction-v0-baseline/index.js.map +1 -0
  221. package/dist/restorer/impls/prediction-v0-baseline/strategy.d.ts +8 -0
  222. package/dist/restorer/impls/prediction-v0-baseline/strategy.js +41 -0
  223. package/dist/restorer/impls/prediction-v0-baseline/strategy.js.map +1 -0
  224. package/dist/restorer/impls/prediction-v0-baseline/types.d.ts +7 -0
  225. package/dist/restorer/impls/prediction-v0-baseline/types.js +2 -0
  226. package/dist/restorer/impls/prediction-v0-baseline/types.js.map +1 -0
  227. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.d.ts +20 -0
  228. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js +66 -0
  229. package/dist/restorer/impls/prediction-v0-evaluator/canonical-metrics.js.map +1 -0
  230. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.d.ts +9 -0
  231. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js +23 -0
  232. package/dist/restorer/impls/prediction-v0-evaluator/checks/availability.js.map +1 -0
  233. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.d.ts +3 -0
  234. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js +13 -0
  235. package/dist/restorer/impls/prediction-v0-evaluator/checks/eligibility.js.map +1 -0
  236. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.d.ts +7 -0
  237. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js +74 -0
  238. package/dist/restorer/impls/prediction-v0-evaluator/checks/integrity.js.map +1 -0
  239. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.d.ts +5 -0
  240. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js +20 -0
  241. package/dist/restorer/impls/prediction-v0-evaluator/checks/spec.js.map +1 -0
  242. package/dist/restorer/impls/prediction-v0-evaluator/index.d.ts +33 -0
  243. package/dist/restorer/impls/prediction-v0-evaluator/index.js +179 -0
  244. package/dist/restorer/impls/prediction-v0-evaluator/index.js.map +1 -0
  245. package/dist/restorer/impls/prediction-v0-evaluator/score.d.ts +8 -0
  246. package/dist/restorer/impls/prediction-v0-evaluator/score.js +15 -0
  247. package/dist/restorer/impls/prediction-v0-evaluator/score.js.map +1 -0
  248. package/dist/restorer/impls/prediction-v0-evaluator/types.d.ts +7 -0
  249. package/dist/restorer/impls/prediction-v0-evaluator/types.js +2 -0
  250. package/dist/restorer/impls/prediction-v0-evaluator/types.js.map +1 -0
  251. package/dist/restorer/types.d.ts +62 -0
  252. package/dist/restorer/types.js +7 -0
  253. package/dist/restorer/types.js.map +1 -0
  254. package/dist/runner/claude.js +15 -0
  255. package/dist/runner/claude.js.map +1 -1
  256. package/dist/store/store.d.ts +3 -1
  257. package/dist/store/store.js +8 -0
  258. package/dist/store/store.js.map +1 -1
  259. package/dist/tx-retry.js +11 -1
  260. package/dist/tx-retry.js.map +1 -1
  261. package/dist/types/desired-state.d.ts +53 -0
  262. package/dist/types/desired-state.js +20 -0
  263. package/dist/types/desired-state.js.map +1 -1
  264. package/dist/types/index.d.ts +3 -1
  265. package/dist/types/index.js +3 -1
  266. package/dist/types/index.js.map +1 -1
  267. package/dist/types/portfolio.d.ts +1000 -0
  268. package/dist/types/portfolio.js +168 -0
  269. package/dist/types/portfolio.js.map +1 -0
  270. package/dist/types/prediction.d.ts +751 -0
  271. package/dist/types/prediction.js +128 -0
  272. package/dist/types/prediction.js.map +1 -0
  273. package/dist/venues/chainlink/client.d.ts +99 -0
  274. package/dist/venues/chainlink/client.js +130 -0
  275. package/dist/venues/chainlink/client.js.map +1 -0
  276. package/dist/venues/chainlink/feeds.d.ts +8 -0
  277. package/dist/venues/chainlink/feeds.js +9 -0
  278. package/dist/venues/chainlink/feeds.js.map +1 -0
  279. package/dist/venues/hyperliquid/account-value.d.ts +30 -0
  280. package/dist/venues/hyperliquid/account-value.js +30 -0
  281. package/dist/venues/hyperliquid/account-value.js.map +1 -0
  282. package/dist/venues/hyperliquid/client.d.ts +63 -0
  283. package/dist/venues/hyperliquid/client.js +135 -0
  284. package/dist/venues/hyperliquid/client.js.map +1 -0
  285. package/dist/venues/hyperliquid/grid.d.ts +36 -0
  286. package/dist/venues/hyperliquid/grid.js +61 -0
  287. package/dist/venues/hyperliquid/grid.js.map +1 -0
  288. package/dist/venues/hyperliquid/types.d.ts +81 -0
  289. package/dist/venues/hyperliquid/types.js +8 -0
  290. package/dist/venues/hyperliquid/types.js.map +1 -0
  291. package/docker-compose.yml +44 -0
  292. package/package.json +21 -3
  293. package/skills/jinn-operator/SKILL.md +213 -0
@@ -0,0 +1,123 @@
1
+ # Contributing to @jinn-network/client
2
+
3
+ Development happens in the [jinn-mono](https://github.com/Jinn-Network/mono) monorepo. This guide covers running the client from source.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 22 (`corepack enable` once so Yarn matches this package's `packageManager` field)
8
+ - [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) (`claude` in PATH — the daemon spawns it as a subprocess)
9
+ - [Foundry](https://book.getfoundry.sh/) (only needed for `yarn e2e` against an Anvil fork)
10
+
11
+ ## Setup
12
+
13
+ ```bash
14
+ cd client
15
+ yarn install
16
+ yarn test # vitest suite — 267 tests
17
+ yarn typecheck # tsc --noEmit
18
+ ```
19
+
20
+ ## Running from source
21
+
22
+ ```bash
23
+ JINN_PASSWORD=your-keystore-password yarn jinn run
24
+ ```
25
+
26
+ The `yarn jinn` script uses `tsx` to run TypeScript directly without a build step.
27
+
28
+ ## Running against an Anvil fork
29
+
30
+ ```bash
31
+ # Terminal 1
32
+ anvil --fork-url https://sepolia.base.org --port 8545
33
+
34
+ # Terminal 2
35
+ JINN_RPC_URL=http://127.0.0.1:8545 JINN_PASSWORD=test yarn jinn run
36
+ ```
37
+
38
+ The bootstrap pauses at the funding gate. Fund the printed master address from one of Anvil's pre-funded keys with `cast send`, then re-run.
39
+
40
+ ## Project structure
41
+
42
+ ```
43
+ src/
44
+ bin/jinn.ts CLI entry point (compiled to dist/bin/jinn.js)
45
+ cli/ CLI dispatcher and commands
46
+ adapters/ Execution adapters (local, mech)
47
+ daemon/ Concurrent loop orchestration
48
+ earning/ Fleet bootstrap state machine
49
+ runner/ Claude subprocess management
50
+ store/ SQLite persistence
51
+ api/ HTTP API (Hono)
52
+ types/ Core type definitions
53
+ errors/ Error envelope system
54
+ mcp/ MCP server for Claude subprocess
55
+
56
+ deployments/ Bundled deployment artifacts (contract addresses)
57
+ test/ Vitest tests (mirrors src/ structure)
58
+ scripts/ Dev utilities (e2e, staking validation, sync)
59
+ ```
60
+
61
+ ## Build and pack
62
+
63
+ ```bash
64
+ yarn build # tsc output → dist/
65
+ yarn pack -o test.tgz # create publishable tarball
66
+ ```
67
+
68
+ The `files` field in `package.json` ensures only `dist/`, `deployments/`, `README.md`, and `LICENSE` are included in the tarball.
69
+
70
+ ## Releases
71
+
72
+ Use [RELEASING.md](./RELEASING.md) for the package bootstrap publish, npm trusted-publishing setup, canary/stable release flow, the fork-based operator gate (`yarn release:operator-gate`), and the manual Docker-first real testnet acceptance gate (`yarn release:testnet-acceptance`) that must pass on the exact stable release commit. The dedicated Docker acceptance environment and evidence expectations are documented in [TESTNET_ACCEPTANCE.md](./TESTNET_ACCEPTANCE.md).
73
+
74
+ ## Updating deployment artifacts
75
+
76
+ After deploying new contracts on testnet, sync the bundled defaults:
77
+
78
+ ```bash
79
+ ./scripts/sync-deployments.sh
80
+ ```
81
+
82
+ This copies the 4 deployment JSON files from `contracts/` into `client/deployments/`. Commit the updated files.
83
+
84
+ ## Scripts reference
85
+
86
+ | Command | Description |
87
+ |---|---|
88
+ | `yarn jinn run` | Run daemon from source (requires JINN_PASSWORD) |
89
+ | `yarn test` | Run vitest suite |
90
+ | `yarn build` | TypeScript compile |
91
+ | `yarn typecheck` | Typecheck without emitting |
92
+ | `yarn e2e` | End-to-end validation on Anvil fork |
93
+ | `yarn staking` | Earning bootstrap validation on Anvil fork |
94
+ | `yarn pack:smoke` | Pack tarball and run smoke tests |
95
+ | `yarn release:operator-gate` | Run the stable-release operator gate (`staking` then `e2e`) |
96
+ | `yarn release:testnet-acceptance` | Run the manual Docker-first real testnet acceptance harness |
97
+ | `yarn setup:testnet-acceptance-operator` | First-time Docker acceptance setup + bootstrap/funding helper (`TESTNET_ACCEPTANCE.md`) |
98
+ | `yarn release:testnet-acceptance:host` | Legacy host-installed acceptance smoke/debug harness |
99
+ | `yarn setup:testnet-acceptance-operator:host` | Legacy host-installed acceptance setup helper |
100
+
101
+ ## CI
102
+
103
+ In CI, use `yarn install --immutable` (equivalent to a clean `npm ci`). The CI workflow (`ci.yml`) runs:
104
+
105
+ 1. `typecheck` + `test` + `build`
106
+ 2. `yarn pack` + smoke test the packed artifact in a clean directory
107
+
108
+ ## On-chain addresses
109
+
110
+ The client resolves contract addresses automatically from deployment artifacts bundled in `deployments/` (testnet) and hardcoded constants (mainnet). Operators don't need to set any `JINN_TESTNET_*_DEPLOYMENT` env var — those exist only as overrides for protocol developers running against a custom deploy.
111
+
112
+ Base mainnet reference addresses:
113
+
114
+ | Component | Address |
115
+ |---|---|
116
+ | JinnRouter | `0xfFa7118A3D820cd4E820010837D65FAfF463181B` |
117
+ | Mech marketplace | `0xf24eE42edA0fc9b33B7D41B06Ee8ccD2Ef7C5020` |
118
+ | Staking contract | `0x51c5f4982b9b0b3c0482678f5847ea6228cc8e54` |
119
+ | OLAS token | `0x54330d28ca3357F294334BDC454a032e7f353416` |
120
+
121
+ ## Spec
122
+
123
+ The stable command-line and JSON surface is defined in [`spec/2026-04-14-client-surface.md`](../spec/2026-04-14-client-surface.md). Error envelopes emitted on non-zero exits conform to §6 of that spec.
package/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Jinn protocol client. Runs a headless daemon that participates in the Jinn training loop: create, restore, and evaluate desired states, and earn rewards for measured work.
4
4
 
5
+ **New operator?** Start with the full testnet runbook:
6
+ <https://github.com/Jinn-Network/mono/blob/main/docs/operator-testnet.md>
7
+
5
8
  ## Install
6
9
 
7
10
  ```bash
@@ -16,20 +19,86 @@ yarn global add @jinn-network/client@latest
16
19
 
17
20
  ## Quick start
18
21
 
22
+ The fast path for a new operator on Base Sepolia:
23
+
19
24
  ```bash
20
- # Generate wallet and keystore
21
- jinn init
25
+ # One-time: pick runtime mode + authenticate Claude Code (interactive).
26
+ jinn auth
27
+
28
+ # Zero-to-running (wallet + funding check + bootstrap + run).
29
+ jinn quickstart
30
+ ```
22
31
 
23
- # Check environment readiness
24
- jinn doctor
32
+ On first run, `jinn quickstart` generates a random keystore password, saves
33
+ it to `~/.jinn-client/keystore-password` (mode 0600), and prints a summary
34
+ with the master address and a pointer to back up your mnemonic. Subsequent
35
+ verbs (`jinn run`, `jinn bootstrap`, `jinn claim-rewards`, …) pick up the
36
+ password from that file automatically — no env var needed.
25
37
 
26
- # Start the daemon
27
- JINN_PASSWORD=your-keystore-password jinn run
38
+ **Back up your mnemonic before you fund anything:**
39
+
40
+ ```bash
41
+ jinn keys backup --output ~/jinn-mnemonic.txt # mode 0600; treat as seed material
28
42
  ```
29
43
 
30
- On first run, the bootstrap generates a master wallet and prints a funding address. Send testnet ETH to it, then re-run. The bootstrap is idempotent — it picks up where it left off.
44
+ Prefer to manage the password yourself? Set `JINN_PASSWORD` before
45
+ `quickstart` and no file will be written:
46
+
47
+ ```bash
48
+ JINN_PASSWORD=your-secret jinn quickstart
49
+ ```
50
+
51
+ **Step by step** (skip if `quickstart` worked):
52
+
53
+ ```bash
54
+ # 1. Generate the encrypted keystore (picks an HD wallet deterministically).
55
+ JINN_PASSWORD=your-secret jinn init
56
+
57
+ # 2. Verify the environment and resolved deployment.
58
+ jinn doctor --human
59
+
60
+ # 3. List exact funding gaps. On testnet this is ETH only — the staking pool
61
+ # is managed protocol-side and operators don't hold bond tokens directly.
62
+ jinn fund-requirements --human
63
+
64
+ # 4. Send the requested testnet funds to the printed master address, then:
65
+ jinn bootstrap
66
+
67
+ # 5. Start the daemon.
68
+ jinn run
69
+ ```
70
+
71
+ `jinn init`, `jinn fund-requirements`, `jinn bootstrap`, and `jinn run` all
72
+ share the same encrypted keystore and fleet state under `~/.jinn-client/earning/`
73
+ by default. They are idempotent — re-run any of them safely.
74
+
75
+ To keep testnet and mainnet state side-by-side on the same machine, set
76
+ `JINN_EARNING_DIR` to a network-specific path:
77
+
78
+ ```bash
79
+ # Testnet (Phase 1b default):
80
+ JINN_EARNING_DIR=~/.jinn-client/earning-testnet jinn run
81
+
82
+ # Mainnet (after Phase 2 launch):
83
+ JINN_NETWORK=mainnet JINN_EARNING_DIR=~/.jinn-client/earning-mainnet jinn run
84
+ ```
85
+
86
+ ### Password resolution
87
+
88
+ Any verb that touches private keys resolves its password in this order:
31
89
 
32
- `JINN_PASSWORD` encrypts the local keystore and is env-only; never put it in a config file.
90
+ 1. `--password-fd N` read from a file descriptor (scripted / CI)
91
+ 2. `JINN_PASSWORD` env var — explicit operator-set
92
+ 3. `~/.jinn-client/keystore-password` — auto-generated by `jinn quickstart`
93
+
94
+ The password is never read from config files. `jinn keys change-password`
95
+ rotates the keystore and deletes the auto-generated password file; after
96
+ rotation, set `JINN_PASSWORD` yourself.
97
+
98
+ **Security note:** when `quickstart` auto-generates the password, it lives
99
+ in plaintext next to the encrypted keystore. That's convenient for tester
100
+ workflows but means anyone with shell access can decrypt your mnemonic —
101
+ treat the wallet as hot and keep funds to the gas + rewards minimum.
33
102
 
34
103
  ## Try without installing
35
104
 
@@ -37,32 +106,83 @@ On first run, the bootstrap generates a master wallet and prints a funding addre
37
106
  npx @jinn-network/client@latest doctor
38
107
  ```
39
108
 
40
- ## Docker (Recommended for Operators)
109
+ ## Let your agent do it
110
+
111
+ If you already use Claude Code, Codex, Cursor, Gemini CLI, VS Code, or another
112
+ MCP-capable tool, you can skip the shell commands above. After installing
113
+ the client, wire Jinn into your agent:
114
+
115
+ ```bash
116
+ jinn plugin install
117
+ ```
118
+
119
+ This detects every supported tool on your machine and, for each one, adds the
120
+ `jinn-mcp` MCP server plus a copy of the `jinn-operator` skill. Supported:
121
+ Claude Code, Claude Desktop, Cursor, VS Code, Gemini CLI, Antigravity, Codex.
122
+ Run `jinn plugin list --human` to see what's detected.
123
+
124
+ Then open your agent and paste:
125
+
126
+ > Set up a Jinn Network testnet operator on this machine. Run `jinn quickstart`,
127
+ > fund the master address via CDP if needed, and report back when the daemon is
128
+ > running. Keep me in the loop if anything needs my input.
41
129
 
42
- The Jinn daemon runs pure Node, but spawns the Anthropic `claude` CLI as a subprocess for restorations. To keep your costs low, operators should use Claude's OAuth authentication (which leverages prompt caching and app tiers) instead of brute-forcing API keys.
130
+ The `jinn-operator` skill activates on mentions of "jinn", "jinn network", and
131
+ "jinn quickstart", then walks your agent through install, auth, bootstrap, and
132
+ daemon lifecycle. You stay in the loop for funding decisions.
43
133
 
44
- Because the macOS keychain securely encrypts OAuth tokens, you **cannot** simply mount `~/.claude` from a Mac host into Docker. Instead, the most robust way to manage credentials and daemon state is using our included `docker-compose.yml`.
134
+ ## Docker
45
135
 
46
- ### Zero-Friction Setup
136
+ The daemon spawns the Anthropic `claude` CLI as a subprocess for
137
+ restorations; to keep costs low, use Claude's OAuth authentication (prompt
138
+ caching + app tiers) rather than raw API keys. On macOS the host keychain
139
+ encrypts OAuth tokens, so mounting `~/.claude` directly into Docker
140
+ doesn't work — instead, run one `claude setup-token` on the host to mint
141
+ a long-lived OAuth token, then pass it to the daemon via `.env`.
47
142
 
48
- 1. **Configure Environment:** Create a `.env` file with your master password:
143
+ ### Recommended path: `claude setup-token` + `.env`
144
+
145
+ 1. **Mint a long-lived OAuth token on the host** (one-time, opens browser):
49
146
  ```bash
50
- echo "JINN_PASSWORD=your-secure-password" > .env
147
+ claude setup-token
51
148
  ```
149
+ Copy the `sk-ant-oat01-...` string it prints.
52
150
 
53
- 2. **Authenticate Claude (One-Time):** The image entrypoint is the `jinn` binary, so run the Anthropic CLI directly by overriding the entrypoint. This performs the OAuth flow and saves the token to the persistent `jinn-claude-state` volume (same volumes as the daemon service):
151
+ 2. **Create a `.env` file** next to the compose file:
54
152
  ```bash
55
- docker compose run --rm -it --entrypoint claude jinn-daemon auth login
153
+ cat > .env <<EOF
154
+ JINN_PASSWORD=your-secure-password
155
+ CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
156
+ EOF
56
157
  ```
57
- Use `-it` so the CLI can open a browser (or show a URL to visit) and receive input. The process stays in the foreground until you finish sign-in.
58
- *Follow the URL to authenticate in your browser.*
59
158
 
60
- 3. **Start the Fleet:** Now that the Docker volume holds the token, start the headless daemon:
159
+ 3. **Start the daemon:**
61
160
  ```bash
62
161
  docker compose up -d
162
+ docker compose logs -f jinn-daemon
63
163
  ```
64
164
 
65
- ### Quick Test
165
+ The compose file lives at `client/docker-compose.yml` if you cloned the
166
+ repo. If you installed via `npm install -g @jinn-network/client@latest`,
167
+ copy it out first:
168
+
169
+ ```bash
170
+ cp "$(npm root -g)/@jinn-network/client/docker-compose.yml" .
171
+ ```
172
+
173
+ ### Fallback: interactive OAuth inside the container
174
+
175
+ If `claude setup-token` isn't available on your host (e.g., you don't
176
+ have Claude Code installed locally), run the interactive OAuth flow
177
+ inside the container instead — it saves the token to a persistent volume
178
+ so the daemon can use it on subsequent runs:
179
+
180
+ ```bash
181
+ docker compose run --rm -it --entrypoint claude jinn-daemon auth login
182
+ docker compose up -d
183
+ ```
184
+
185
+ ### Quick test
66
186
 
67
187
  ```bash
68
188
  docker run --rm ghcr.io/jinn-network/client:latest version --json
@@ -74,13 +194,16 @@ docker run --rm ghcr.io/jinn-network/client:latest version --json
74
194
 
75
195
  | Command | Purpose | Idempotent |
76
196
  |---|---|---|
77
- | `jinn init` | Generate wallet + keystore | Yes |
197
+ | `jinn quickstart` | One-shot init + funding check + bootstrap + run | Yes |
198
+ | `jinn init` | Generate wallet + keystore + fleet state | Yes |
78
199
  | `jinn doctor` | Preflight checks without mutation | Yes |
79
200
  | `jinn bootstrap` | Advance toward a running fleet | Yes |
80
201
  | `jinn fund-requirements` | List what needs funding | Yes |
81
202
  | `jinn run` | Start the daemon (foreground) | N/A |
82
203
  | `jinn stop` | Signal a running daemon to stop | Yes |
83
204
  | `jinn version` | Version, phase, deployment digest | Yes |
205
+ | `jinn update` | Update the client package + refresh plugins | Yes |
206
+ | `jinn plugin install` | Wire Jinn into Claude Code / Codex / other AI tools | Yes |
84
207
 
85
208
  ### Monitoring
86
209
 
@@ -104,7 +227,8 @@ All action verbs support `--dry-run` and `--yes`.
104
227
  | `jinn fleet scale --to N` | Grow or shrink fleet |
105
228
  | `jinn fleet retire <index>` | Retire one service |
106
229
  | `jinn withdraw --to <addr>` | Sweep wallets to external address |
107
- | `jinn keys backup --output <path>` | Export mnemonic |
230
+ | `jinn keys backup --output <path>` | Export mnemonic (writes plaintext; treat the output file as seed material) |
231
+ | `jinn keys change-password` | Re-encrypt the keystore with a new password |
108
232
 
109
233
  ## Output contract
110
234
 
@@ -114,7 +238,7 @@ All action verbs support `--dry-run` and `--yes`.
114
238
  - Non-zero exits emit a structured error envelope on stdout with `schemaVersion`, `code`, `exitCode`, `message`, `hint`, and `exampleCli`.
115
239
  - Without a global install, use `npx @jinn-network/client@latest <verb> ...` instead of `jinn ...` (the package name is scoped; `npx jinn` resolves a different package).
116
240
 
117
- See [`spec/2026-04-14-client-surface.md`](../spec/2026-04-14-client-surface.md) for the full surface spec.
241
+ See the [client surface spec](https://github.com/Jinn-Network/mono/blob/main/spec/2026-04-14-client-surface.md) for the full CLI reference.
118
242
 
119
243
  ## Configuration
120
244
 
@@ -126,7 +250,7 @@ JINN_PASSWORD=secret jinn run --config ./my-config.json
126
250
 
127
251
  | Config key | Env override | Default |
128
252
  |---|---|---|
129
- | network | JINN_NETWORK | testnet (flips to mainnet at launch) |
253
+ | network | JINN_NETWORK | `testnet` (Phase 1b default; flips to `mainnet` at Phase 2 launch) |
130
254
  | rpcUrl | BASE_RPC_URL / JINN_RPC_URL | network-appropriate public RPC |
131
255
  | claudeModel | JINN_CLAUDE_MODEL | claude-haiku-4-5-20251001 |
132
256
  | claudePath | JINN_CLAUDE_PATH | claude |
@@ -139,14 +263,66 @@ JINN_PASSWORD=secret jinn run --config ./my-config.json
139
263
 
140
264
  `JINN_PASSWORD` is env-only (keystore encryption, never in config files). Alternatively, use `--password-fd <N>` to read from a file descriptor.
141
265
 
266
+ ## Tokens
267
+
268
+ | Role | Phase 1b (testnet, Base Sepolia) | Phase 2 (mainnet, Base) |
269
+ |---|---|---|
270
+ | Gas (native) | ETH (CDP auto-funded on testnet) | ETH |
271
+ | Staking bond | Pooled, protocol-managed via stOLAS distributor (operators hold nothing) | OLAS (operator-held) |
272
+ | Reward | stOLAS | OLAS (+ JINN incentives after launch) |
273
+
274
+ **Important:** under stOLAS standard mode (the Phase 1b default), operators
275
+ **do not hold a bond token themselves**. The stOLAS distributor pools JINN
276
+ contributed by stakers and stakes on behalf of operators; your service gets
277
+ created against that shared pool. `jinn fund-requirements` surfaces only the
278
+ per-wallet ETH you need. If the distributor pool is drained, `jinn doctor`
279
+ will warn you — the fix is a protocol-team refill, not operator action.
280
+
142
281
  ## Switching to mainnet
143
282
 
144
283
  When Phase 2 launches, the default flips. Until then:
145
284
 
146
285
  ```bash
147
- JINN_NETWORK=mainnet JINN_PASSWORD=secret jinn run
286
+ JINN_NETWORK=mainnet \
287
+ JINN_EARNING_DIR=~/.jinn-client/earning-mainnet \
288
+ JINN_PASSWORD=secret \
289
+ jinn run
148
290
  ```
149
291
 
292
+ Use a distinct `JINN_EARNING_DIR` to keep testnet and mainnet keystore
293
+ state isolated. Mixing them on the same directory is an easy way to
294
+ point a mainnet daemon at a testnet-derived master wallet.
295
+
296
+ ## Troubleshooting
297
+
298
+ Quick answers to the things that typically surprise new operators:
299
+
300
+ - **Bootstrap loops for a minute then exits with `funding_required`** —
301
+ the CDP faucet drip is small (~0.0001 ETH per call) and the bootstrap
302
+ floor is 0.005 ETH. The client now drains the faucet up to 60 times per
303
+ invocation automatically; if you still see `funding_required`, CDP rate-
304
+ limited your master address. Wait 24h or fund manually:
305
+ <https://portal.cdp.coinbase.com/products/faucet>.
306
+ - **Claude session exits in ~18 seconds with no trades** — usually means
307
+ the daemon ran from source (via `tsx`) instead of the compiled `dist/`,
308
+ so the MCP wrapper couldn't load `mcp-tools.js`. Run `yarn build && yarn
309
+ dev` (dev) or reinstall via `npm install -g @jinn-network/client@latest`
310
+ (operator). `jinn doctor` flags this as `daemon_runtime_ready`.
311
+ - **Bootstrap fails with `Overflow(20, 0)` at `distributor.stake()`** —
312
+ the testnet stOLAS distributor pool is drained. Operators cannot fix
313
+ this; the Jinn protocol team has to refill it. Report to the testnet
314
+ status channel and re-run `jinn bootstrap` once the pool is topped up.
315
+ - **Position auto-closed within seconds of opening** — most likely
316
+ a competing trading bot is active on the same Hyperliquid master. Use a
317
+ fresh HL master per protocol test; do not share master accounts between
318
+ experiments.
319
+ - **`jinn doctor` passes but `jinn run` fails** — check the specific
320
+ check names in doctor's output vs the specific error from `run`. The
321
+ most common mismatch is auth-context: if you're in the `client/` git
322
+ checkout dir, `detectAuthContext` infers `docker-compose` mode even on
323
+ a bare host. Run the daemon from `$HOME` or any directory without a
324
+ `docker-compose.yml` that names `jinn-daemon`.
325
+
150
326
  ## How it works
151
327
 
152
328
  The daemon runs three concurrent loops:
@@ -159,4 +335,4 @@ Each loop call increments on-chain activity counters. Staking contracts read the
159
335
 
160
336
  ## Development
161
337
 
162
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, running from source, and testing.
338
+ See [CONTRIBUTING.md](https://github.com/Jinn-Network/mono/blob/main/client/CONTRIBUTING.md) for development setup, running from source, and testing.
@@ -0,0 +1,15 @@
1
+ {
2
+ "network": "baseSepolia",
3
+ "chainId": 84532,
4
+ "deployer": "0x15e78734481bD31F6e183dad05225505a45ACd07",
5
+ "deployedAt": "2026-04-20T13:14:18.413Z",
6
+ "config": {
7
+ "jinnToken": "0xAB9a01cd4A379e36006ec6df2960CF39EF79df63",
8
+ "dripAmount": "100000000000000000000",
9
+ "dripInterval": 86400,
10
+ "initialSupplyBridged": "1000000000000000000000"
11
+ },
12
+ "contracts": {
13
+ "faucet": "0xa7c2DBA07E41F16eF94cbEAeAEd97bC904032619"
14
+ }
15
+ }
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Typed ABI fragments for ClaimRegistry.
3
+ *
4
+ * Mirrors the Solidity interface in contracts/src/claiming/ClaimRegistry.sol.
5
+ * Use these instead of the inline fragment in adapters/mech/types.ts when
6
+ * constructing a ClaimRegistryClient — they include the full event set.
7
+ */
8
+ export declare const CLAIM_REGISTRY_ABI: readonly [{
9
+ readonly name: "claimJob";
10
+ readonly type: "function";
11
+ readonly stateMutability: "nonpayable";
12
+ readonly inputs: readonly [{
13
+ readonly name: "requestId";
14
+ readonly type: "bytes32";
15
+ }];
16
+ readonly outputs: readonly [];
17
+ }, {
18
+ readonly name: "releaseClaim";
19
+ readonly type: "function";
20
+ readonly stateMutability: "nonpayable";
21
+ readonly inputs: readonly [{
22
+ readonly name: "requestId";
23
+ readonly type: "bytes32";
24
+ }];
25
+ readonly outputs: readonly [];
26
+ }, {
27
+ readonly name: "expireClaim";
28
+ readonly type: "function";
29
+ readonly stateMutability: "nonpayable";
30
+ readonly inputs: readonly [{
31
+ readonly name: "requestId";
32
+ readonly type: "bytes32";
33
+ }];
34
+ readonly outputs: readonly [];
35
+ }, {
36
+ readonly name: "getJobClaim";
37
+ readonly type: "function";
38
+ readonly stateMutability: "view";
39
+ readonly inputs: readonly [{
40
+ readonly name: "requestId";
41
+ readonly type: "bytes32";
42
+ }];
43
+ readonly outputs: readonly [{
44
+ readonly name: "claimer";
45
+ readonly type: "address";
46
+ }, {
47
+ readonly name: "expiresAt";
48
+ readonly type: "uint256";
49
+ }];
50
+ }, {
51
+ readonly name: "claims";
52
+ readonly type: "function";
53
+ readonly stateMutability: "view";
54
+ readonly inputs: readonly [{
55
+ readonly name: "";
56
+ readonly type: "bytes32";
57
+ }];
58
+ readonly outputs: readonly [{
59
+ readonly name: "claimer";
60
+ readonly type: "address";
61
+ }, {
62
+ readonly name: "expiresAt";
63
+ readonly type: "uint256";
64
+ }];
65
+ }, {
66
+ readonly name: "claimTTL";
67
+ readonly type: "function";
68
+ readonly stateMutability: "view";
69
+ readonly inputs: readonly [];
70
+ readonly outputs: readonly [{
71
+ readonly name: "";
72
+ readonly type: "uint256";
73
+ }];
74
+ }, {
75
+ readonly name: "expiredClaimCount";
76
+ readonly type: "function";
77
+ readonly stateMutability: "view";
78
+ readonly inputs: readonly [{
79
+ readonly name: "";
80
+ readonly type: "address";
81
+ }];
82
+ readonly outputs: readonly [{
83
+ readonly name: "";
84
+ readonly type: "uint256";
85
+ }];
86
+ }, {
87
+ readonly name: "JobClaimed";
88
+ readonly type: "event";
89
+ readonly inputs: readonly [{
90
+ readonly name: "requestId";
91
+ readonly type: "bytes32";
92
+ readonly indexed: true;
93
+ }, {
94
+ readonly name: "claimer";
95
+ readonly type: "address";
96
+ readonly indexed: true;
97
+ }, {
98
+ readonly name: "expiresAt";
99
+ readonly type: "uint256";
100
+ readonly indexed: false;
101
+ }];
102
+ }, {
103
+ readonly name: "ClaimExpired";
104
+ readonly type: "event";
105
+ readonly inputs: readonly [{
106
+ readonly name: "requestId";
107
+ readonly type: "bytes32";
108
+ readonly indexed: true;
109
+ }, {
110
+ readonly name: "previousClaimer";
111
+ readonly type: "address";
112
+ readonly indexed: true;
113
+ }];
114
+ }, {
115
+ readonly name: "ClaimReleased";
116
+ readonly type: "event";
117
+ readonly inputs: readonly [{
118
+ readonly name: "requestId";
119
+ readonly type: "bytes32";
120
+ readonly indexed: true;
121
+ }, {
122
+ readonly name: "claimer";
123
+ readonly type: "address";
124
+ readonly indexed: true;
125
+ }];
126
+ }];
127
+ export type ClaimRegistryAbi = typeof CLAIM_REGISTRY_ABI;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Typed ABI fragments for ClaimRegistry.
3
+ *
4
+ * Mirrors the Solidity interface in contracts/src/claiming/ClaimRegistry.sol.
5
+ * Use these instead of the inline fragment in adapters/mech/types.ts when
6
+ * constructing a ClaimRegistryClient — they include the full event set.
7
+ */
8
+ export const CLAIM_REGISTRY_ABI = [
9
+ // ── Write functions ──────────────────────────────────────────────────────────
10
+ {
11
+ name: 'claimJob',
12
+ type: 'function',
13
+ stateMutability: 'nonpayable',
14
+ inputs: [{ name: 'requestId', type: 'bytes32' }],
15
+ outputs: [],
16
+ },
17
+ {
18
+ name: 'releaseClaim',
19
+ type: 'function',
20
+ stateMutability: 'nonpayable',
21
+ inputs: [{ name: 'requestId', type: 'bytes32' }],
22
+ outputs: [],
23
+ },
24
+ {
25
+ name: 'expireClaim',
26
+ type: 'function',
27
+ stateMutability: 'nonpayable',
28
+ inputs: [{ name: 'requestId', type: 'bytes32' }],
29
+ outputs: [],
30
+ },
31
+ // ── Read functions ───────────────────────────────────────────────────────────
32
+ {
33
+ name: 'getJobClaim',
34
+ type: 'function',
35
+ stateMutability: 'view',
36
+ inputs: [{ name: 'requestId', type: 'bytes32' }],
37
+ outputs: [
38
+ { name: 'claimer', type: 'address' },
39
+ { name: 'expiresAt', type: 'uint256' },
40
+ ],
41
+ },
42
+ {
43
+ name: 'claims',
44
+ type: 'function',
45
+ stateMutability: 'view',
46
+ inputs: [{ name: '', type: 'bytes32' }],
47
+ outputs: [
48
+ { name: 'claimer', type: 'address' },
49
+ { name: 'expiresAt', type: 'uint256' },
50
+ ],
51
+ },
52
+ {
53
+ name: 'claimTTL',
54
+ type: 'function',
55
+ stateMutability: 'view',
56
+ inputs: [],
57
+ outputs: [{ name: '', type: 'uint256' }],
58
+ },
59
+ {
60
+ name: 'expiredClaimCount',
61
+ type: 'function',
62
+ stateMutability: 'view',
63
+ inputs: [{ name: '', type: 'address' }],
64
+ outputs: [{ name: '', type: 'uint256' }],
65
+ },
66
+ // ── Events ───────────────────────────────────────────────────────────────────
67
+ {
68
+ name: 'JobClaimed',
69
+ type: 'event',
70
+ inputs: [
71
+ { name: 'requestId', type: 'bytes32', indexed: true },
72
+ { name: 'claimer', type: 'address', indexed: true },
73
+ { name: 'expiresAt', type: 'uint256', indexed: false },
74
+ ],
75
+ },
76
+ {
77
+ name: 'ClaimExpired',
78
+ type: 'event',
79
+ inputs: [
80
+ { name: 'requestId', type: 'bytes32', indexed: true },
81
+ { name: 'previousClaimer', type: 'address', indexed: true },
82
+ ],
83
+ },
84
+ {
85
+ name: 'ClaimReleased',
86
+ type: 'event',
87
+ inputs: [
88
+ { name: 'requestId', type: 'bytes32', indexed: true },
89
+ { name: 'claimer', type: 'address', indexed: true },
90
+ ],
91
+ },
92
+ ];
93
+ //# sourceMappingURL=abi.js.map