@deeeed/metamask-harness 0.2.0
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/CHANGELOG.md +161 -0
- package/README.md +140 -0
- package/bin/mm-harness +99 -0
- package/docs/CHEATSHEET.md +61 -0
- package/docs/CLI-SPEC.md +915 -0
- package/docs/MENTAL-MODEL.md +295 -0
- package/docs/architecture.md +367 -0
- package/docs/extension-runtime-commands.md +60 -0
- package/docs/harness-cli.md +43 -0
- package/docs/live-adapter-contract.md +188 -0
- package/docs/package-boundaries.md +47 -0
- package/docs/perps-flow-catalog.md +235 -0
- package/docs/recipe-libraries.md +95 -0
- package/docs/runtime-file-conventions.md +36 -0
- package/library/actions/core/perps/_controller.mjs +727 -0
- package/library/actions/core/perps/assert_orders.mjs +53 -0
- package/library/actions/core/perps/assert_positions.mjs +52 -0
- package/library/actions/core/perps/close_orders.mjs +97 -0
- package/library/actions/core/perps/close_positions.mjs +118 -0
- package/library/actions/core/perps/ensure_orders.mjs +40 -0
- package/library/actions/core/perps/ensure_positions.mjs +37 -0
- package/library/actions/core/perps/place_order.mjs +201 -0
- package/library/actions/core/perps/read_account.mjs +30 -0
- package/library/actions/core/perps/read_orders.mjs +27 -0
- package/library/actions/core/perps/read_positions.mjs +27 -0
- package/library/actions/core/perps/start_state.mjs +92 -0
- package/library/actions/core/perps/teardown_state.mjs +86 -0
- package/library/actions/extension/perps/assert_orders.mjs +11 -0
- package/library/actions/extension/perps/assert_positions.mjs +11 -0
- package/library/actions/extension/perps/close_orders.mjs +8 -0
- package/library/actions/extension/perps/close_positions.mjs +8 -0
- package/library/actions/extension/perps/ensure_orders.mjs +4 -0
- package/library/actions/extension/perps/ensure_positions.mjs +4 -0
- package/library/actions/extension/perps/perps.mjs +730 -0
- package/library/actions/extension/perps/place_order.mjs +7 -0
- package/library/actions/extension/perps/read_orders.mjs +4 -0
- package/library/actions/extension/perps/read_positions.mjs +3 -0
- package/library/actions/extension/platform/cdp.mjs +541 -0
- package/library/actions/extension/ui/navigate.mjs +44 -0
- package/library/actions/extension/wallet/ensure_unlocked.mjs +36 -0
- package/library/actions/extension/wallet/read_state.mjs +27 -0
- package/library/actions/extension/wallet/select_account.mjs +48 -0
- package/library/actions/extension/wallet/setup.mjs +35 -0
- package/library/actions/mobile/app-overlay/app/dev-tools/AgenticService/AgentStepHud.tsx.patch +185 -0
- package/library/actions/mobile/app-overlay/app/dev-tools/AgenticService/AgenticService.ts.patch +1662 -0
- package/library/actions/mobile/bridge-runtime/cdp-bridge.cjs +686 -0
- package/library/actions/mobile/bridge-runtime/lib/cdp-eval.cjs +110 -0
- package/library/actions/mobile/bridge-runtime/lib/config.cjs +39 -0
- package/library/actions/mobile/bridge-runtime/lib/issue-capture.cjs +446 -0
- package/library/actions/mobile/bridge-runtime/lib/target-discovery.cjs +204 -0
- package/library/actions/mobile/bridge-runtime/lib/ws-client.cjs +108 -0
- package/library/actions/mobile/bridge-runtime/setup-wallet.sh +442 -0
- package/library/actions/mobile/perps/assert_orders.mjs +11 -0
- package/library/actions/mobile/perps/assert_positions.mjs +11 -0
- package/library/actions/mobile/perps/close_orders.mjs +8 -0
- package/library/actions/mobile/perps/close_positions.mjs +8 -0
- package/library/actions/mobile/perps/ensure_orders.mjs +4 -0
- package/library/actions/mobile/perps/ensure_positions.mjs +4 -0
- package/library/actions/mobile/perps/perps.mjs +709 -0
- package/library/actions/mobile/perps/place_order.mjs +7 -0
- package/library/actions/mobile/perps/read_orders.mjs +4 -0
- package/library/actions/mobile/perps/read_positions.mjs +3 -0
- package/library/actions/mobile/platform/bridge.mjs +283 -0
- package/library/actions/mobile/ui/navigate.mjs +38 -0
- package/library/actions/mobile/wallet/ensure_unlocked.mjs +107 -0
- package/library/actions/mobile/wallet/home.mjs +35 -0
- package/library/actions/mobile/wallet/read_state.mjs +40 -0
- package/library/actions/mobile/wallet/select_account.mjs +48 -0
- package/library/actions/mobile/wallet/setup.mjs +220 -0
- package/library/flows/perps.flows.json +64 -0
- package/library/library.json +7 -0
- package/library/manifests/core.action-manifest.json +1282 -0
- package/library/manifests/extension.action-manifest.json +1749 -0
- package/library/manifests/mobile.action-manifest.json +1753 -0
- package/library/recipes/action-validation.extension.recipe.json +417 -0
- package/library/recipes/action-validation.mobile.recipe.json +422 -0
- package/library/recipes/order-lifecycle.core.recipe.json +78 -0
- package/library/recipes/perps-lifecycle.recipe.json +194 -0
- package/library/recipes/read-markets.core.recipe.json +38 -0
- package/library/recipes/smoke.extension.recipe.json +31 -0
- package/library/recipes/smoke.mobile.recipe.json +31 -0
- package/library/recipes/trading-lifecycle.core.recipe.json +76 -0
- package/orchestration/compat-overlays/README.md +19 -0
- package/orchestration/compat-overlays/mobile/README.md +13 -0
- package/orchestration/compat-overlays/mobile/rn81-message-event-source.patch +42 -0
- package/orchestration/core/cleanup.sh +37 -0
- package/orchestration/core/inject.sh +154 -0
- package/orchestration/doctor.mjs +72 -0
- package/orchestration/extension/cleanup.mjs +60 -0
- package/orchestration/extension/console-tail.mjs +228 -0
- package/orchestration/extension/ensure-browser.sh +416 -0
- package/orchestration/extension/ensure-ready.ts +185 -0
- package/orchestration/extension/extension-id.ts +107 -0
- package/orchestration/extension/inject.mjs +266 -0
- package/orchestration/extension/launch-browser.cjs +216 -0
- package/orchestration/extension/launch.sh +175 -0
- package/orchestration/extension/live.sh +320 -0
- package/orchestration/extension/pin-remote-flags.cjs +45 -0
- package/orchestration/extension/readiness.mjs +414 -0
- package/orchestration/extension/refresh-build.sh +190 -0
- package/orchestration/extension/runtime-decision.ts +445 -0
- package/orchestration/extension/runtime.ts +407 -0
- package/orchestration/extension/seed-fixture.sh +177 -0
- package/orchestration/extension/sidepanel-toggle.sh +291 -0
- package/orchestration/extension/snapshot-dist.sh +84 -0
- package/orchestration/extension/start-watch.sh +339 -0
- package/orchestration/extension/wallet-fixture-state.cjs +1086 -0
- package/orchestration/lib/activate-repo-node.sh +144 -0
- package/orchestration/lib/cli-color.mjs +84 -0
- package/orchestration/lib/cli-commands.mjs +243 -0
- package/orchestration/lib/cli-home.mjs +354 -0
- package/orchestration/lib/cli-ux.sh +252 -0
- package/orchestration/lib/cli-version.mjs +123 -0
- package/orchestration/lib/ensure-runner-deps.sh +56 -0
- package/orchestration/lib/harness-path.sh +55 -0
- package/orchestration/lib/hash-helpers.sh +44 -0
- package/orchestration/lib/json-field.sh +23 -0
- package/orchestration/lib/log-tui.mjs +304 -0
- package/orchestration/lib/open-debug.mjs +317 -0
- package/orchestration/lib/path-defaults.json +4 -0
- package/orchestration/lib/progress.mjs +107 -0
- package/orchestration/lib/recipe-paths.mjs +26 -0
- package/orchestration/lib/resolve-farmslot-ports.sh +144 -0
- package/orchestration/manifest.json +358 -0
- package/orchestration/mobile/cleanup.sh +192 -0
- package/orchestration/mobile/deps-markers.ts +21 -0
- package/orchestration/mobile/inject.sh +681 -0
- package/orchestration/mobile/launch.sh +137 -0
- package/orchestration/mobile/live.sh +125 -0
- package/orchestration/mobile/runtime-decision.ts +292 -0
- package/orchestration/porcelain/metamask-recipe +99 -0
- package/orchestration/porcelain/mm-recipe +1591 -0
- package/orchestration/porcelain/mme-recipe +1181 -0
- package/package.json +59 -0
- package/runner/extension/verify.sh +511 -0
- package/runner/mobile/verify.sh +501 -0
- package/runner/src/adapters.ts +601 -0
- package/runner/src/cli.ts +1820 -0
- package/runner/src/commands/debug.ts +44 -0
- package/runner/src/commands/fixtures.ts +99 -0
- package/runner/src/commands/launch.ts +397 -0
- package/runner/src/commands/logs.ts +60 -0
- package/runner/src/commands/shared.ts +138 -0
- package/runner/src/completions-cache.ts +86 -0
- package/runner/src/doctor.ts +203 -0
- package/runner/src/harness.ts +516 -0
- package/runner/src/heal-bounds.ts +179 -0
- package/runner/src/index.ts +6 -0
- package/runner/src/live-adapter-contract.ts +274 -0
- package/runner/src/manifest.ts +47 -0
- package/runner/src/mm-harness-cli.ts +488 -0
- package/runner/src/paths.ts +198 -0
- package/runner/src/recording-target.ts +147 -0
- package/runner/src/run-recording.ts +329 -0
- package/runner/src/runner.ts +108 -0
- package/runner/src/types.ts +57 -0
- package/scripts/completions.sh +125 -0
- package/scripts/install-completions.sh +62 -0
|
@@ -0,0 +1,1282 @@
|
|
|
1
|
+
{
|
|
2
|
+
"runner_protocol_version": 1,
|
|
3
|
+
"action_registry_version": 1,
|
|
4
|
+
"supported_official_actions": [
|
|
5
|
+
"command",
|
|
6
|
+
"wait",
|
|
7
|
+
"assert_file",
|
|
8
|
+
"assert_json",
|
|
9
|
+
"assert_exit_code",
|
|
10
|
+
"assert_output",
|
|
11
|
+
"watch_logs",
|
|
12
|
+
"index_artifacts",
|
|
13
|
+
"end",
|
|
14
|
+
"call",
|
|
15
|
+
"app.status"
|
|
16
|
+
],
|
|
17
|
+
"action_metadata": {
|
|
18
|
+
"command": {
|
|
19
|
+
"description": "Run a shell command from the project root.",
|
|
20
|
+
"examples": [
|
|
21
|
+
{
|
|
22
|
+
"node": {
|
|
23
|
+
"action": "command",
|
|
24
|
+
"cmd": "pwd",
|
|
25
|
+
"intent": "Run a shell command from the project root"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"wait": {
|
|
31
|
+
"description": "Base wait action.",
|
|
32
|
+
"examples": [
|
|
33
|
+
{
|
|
34
|
+
"node": {
|
|
35
|
+
"action": "wait",
|
|
36
|
+
"duration_ms": 1,
|
|
37
|
+
"intent": "Base wait action"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"watch_logs": {
|
|
43
|
+
"description": "Base log assertion/capture action.",
|
|
44
|
+
"examples": [
|
|
45
|
+
{
|
|
46
|
+
"node": {
|
|
47
|
+
"action": "watch_logs",
|
|
48
|
+
"path": "logs/app.log",
|
|
49
|
+
"intent": "Base log assertion/capture action"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"index_artifacts": {
|
|
55
|
+
"description": "Index extra recipe-authored artifacts that already exist on disk.",
|
|
56
|
+
"examples": [
|
|
57
|
+
{
|
|
58
|
+
"node": {
|
|
59
|
+
"action": "index_artifacts",
|
|
60
|
+
"artifacts": [
|
|
61
|
+
{
|
|
62
|
+
"path": "reports/result.json",
|
|
63
|
+
"type": "report",
|
|
64
|
+
"category": "validation",
|
|
65
|
+
"label": "Validation report"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"intent": "Register a pre-existing report artifact"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"end": {
|
|
74
|
+
"description": "Base terminal action.",
|
|
75
|
+
"examples": [
|
|
76
|
+
{
|
|
77
|
+
"node": {
|
|
78
|
+
"action": "end",
|
|
79
|
+
"status": "pass"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"assert_file": {
|
|
85
|
+
"description": "Assert that a project file exists and optionally contains text.",
|
|
86
|
+
"examples": [
|
|
87
|
+
{
|
|
88
|
+
"node": {
|
|
89
|
+
"action": "assert_file",
|
|
90
|
+
"path": "reports/result.txt",
|
|
91
|
+
"contains": "ok",
|
|
92
|
+
"intent": "Assert that a project file exists and optionally contains text"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"assert_json": {
|
|
98
|
+
"description": "Assert a JSON file value with a JSONPath-style selector.",
|
|
99
|
+
"examples": [
|
|
100
|
+
{
|
|
101
|
+
"node": {
|
|
102
|
+
"action": "assert_json",
|
|
103
|
+
"path": "reports/result.json",
|
|
104
|
+
"assert": {
|
|
105
|
+
"path": "$.status",
|
|
106
|
+
"operator": "eq",
|
|
107
|
+
"value": "ok"
|
|
108
|
+
},
|
|
109
|
+
"intent": "Assert a JSON file value with a JSONPath-style selector"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"assert_exit_code": {
|
|
115
|
+
"description": "Assert the exit code captured from a command node output.",
|
|
116
|
+
"examples": [
|
|
117
|
+
{
|
|
118
|
+
"node": {
|
|
119
|
+
"action": "assert_exit_code",
|
|
120
|
+
"source": "run-tests",
|
|
121
|
+
"expected": 0,
|
|
122
|
+
"intent": "Assert the exit code captured from a command node output"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"assert_output": {
|
|
128
|
+
"description": "Assert stdout or stderr captured from a command node output.",
|
|
129
|
+
"examples": [
|
|
130
|
+
{
|
|
131
|
+
"node": {
|
|
132
|
+
"action": "assert_output",
|
|
133
|
+
"source": "run-tests",
|
|
134
|
+
"stream": "stdout",
|
|
135
|
+
"contains": "PASS",
|
|
136
|
+
"intent": "Assert stdout or stderr captured from a command node output"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"app.status": {
|
|
142
|
+
"description": "Report the core checkout shape and headless compatibility mode for the perps controller.",
|
|
143
|
+
"examples": [
|
|
144
|
+
{
|
|
145
|
+
"node": {
|
|
146
|
+
"action": "app.status",
|
|
147
|
+
"intent": "Report the resolved core checkout status",
|
|
148
|
+
"next": "done"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"custom_actions": [
|
|
155
|
+
{
|
|
156
|
+
"name": "metamask.perps.read_positions",
|
|
157
|
+
"owner": "metamask",
|
|
158
|
+
"description": "core Read live Perps positions directly from the perps controller (HyperLiquid testnet, HTTP read-only) and return the selected subset.",
|
|
159
|
+
"schema": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"action": {
|
|
163
|
+
"const": "metamask.perps.read_positions"
|
|
164
|
+
},
|
|
165
|
+
"market": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
168
|
+
},
|
|
169
|
+
"symbol": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "Alias for market."
|
|
172
|
+
},
|
|
173
|
+
"markets": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"items": {
|
|
176
|
+
"type": "string"
|
|
177
|
+
},
|
|
178
|
+
"description": "Explicit list of market symbols."
|
|
179
|
+
},
|
|
180
|
+
"symbols": {
|
|
181
|
+
"type": "array",
|
|
182
|
+
"items": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"description": "Alias for markets."
|
|
186
|
+
},
|
|
187
|
+
"mode": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"enum": [
|
|
190
|
+
"matching",
|
|
191
|
+
"all"
|
|
192
|
+
],
|
|
193
|
+
"description": "matching selects requested symbols; all selects every live item returned by the controller."
|
|
194
|
+
},
|
|
195
|
+
"selector": {
|
|
196
|
+
"type": "object",
|
|
197
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
198
|
+
},
|
|
199
|
+
"side": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"enum": [
|
|
202
|
+
"long",
|
|
203
|
+
"short"
|
|
204
|
+
],
|
|
205
|
+
"description": "Optional position side filter."
|
|
206
|
+
},
|
|
207
|
+
"account": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"description": "EVM address to read positions for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
210
|
+
},
|
|
211
|
+
"timeout_ms": {
|
|
212
|
+
"type": "number"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"required": [
|
|
216
|
+
"action"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
"examples": [
|
|
220
|
+
{
|
|
221
|
+
"description": "Read every live position for the configured account",
|
|
222
|
+
"node": {
|
|
223
|
+
"action": "metamask.perps.read_positions",
|
|
224
|
+
"mode": "all",
|
|
225
|
+
"intent": "Read Perps positions from the headless controller"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output.",
|
|
230
|
+
"safety_notes": "Read-only HyperLiquid testnet HTTP query; must not inject controller/UI state to fabricate proof."
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"name": "metamask.perps.read_orders",
|
|
234
|
+
"owner": "metamask",
|
|
235
|
+
"description": "core Read live Perps open orders directly from the perps controller (HyperLiquid testnet, HTTP read-only) and return the selected subset.",
|
|
236
|
+
"schema": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"properties": {
|
|
239
|
+
"action": {
|
|
240
|
+
"const": "metamask.perps.read_orders"
|
|
241
|
+
},
|
|
242
|
+
"market": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
245
|
+
},
|
|
246
|
+
"symbol": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"description": "Alias for market."
|
|
249
|
+
},
|
|
250
|
+
"markets": {
|
|
251
|
+
"type": "array",
|
|
252
|
+
"items": {
|
|
253
|
+
"type": "string"
|
|
254
|
+
},
|
|
255
|
+
"description": "Explicit list of market symbols."
|
|
256
|
+
},
|
|
257
|
+
"symbols": {
|
|
258
|
+
"type": "array",
|
|
259
|
+
"items": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
},
|
|
262
|
+
"description": "Alias for markets."
|
|
263
|
+
},
|
|
264
|
+
"mode": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"enum": [
|
|
267
|
+
"matching",
|
|
268
|
+
"all"
|
|
269
|
+
],
|
|
270
|
+
"description": "matching selects requested symbols; all selects every live item returned by the controller."
|
|
271
|
+
},
|
|
272
|
+
"selector": {
|
|
273
|
+
"type": "object",
|
|
274
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
275
|
+
},
|
|
276
|
+
"side": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"enum": [
|
|
279
|
+
"long",
|
|
280
|
+
"short"
|
|
281
|
+
],
|
|
282
|
+
"description": "Optional order side filter."
|
|
283
|
+
},
|
|
284
|
+
"account": {
|
|
285
|
+
"type": "string",
|
|
286
|
+
"description": "EVM address to read orders for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
287
|
+
},
|
|
288
|
+
"timeout_ms": {
|
|
289
|
+
"type": "number"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"required": [
|
|
293
|
+
"action"
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
"examples": [
|
|
297
|
+
{
|
|
298
|
+
"description": "Read every live open order for the configured account",
|
|
299
|
+
"node": {
|
|
300
|
+
"action": "metamask.perps.read_orders",
|
|
301
|
+
"mode": "all",
|
|
302
|
+
"intent": "Read Perps open orders from the headless controller"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output.",
|
|
307
|
+
"safety_notes": "Read-only HyperLiquid testnet HTTP query; must not inject controller/UI state to fabricate proof."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "metamask.perps.read_account",
|
|
311
|
+
"owner": "metamask",
|
|
312
|
+
"description": "core Read live Perps account state (balances, margin) directly from the perps controller (HyperLiquid testnet, HTTP read-only).",
|
|
313
|
+
"schema": {
|
|
314
|
+
"type": "object",
|
|
315
|
+
"properties": {
|
|
316
|
+
"action": {
|
|
317
|
+
"const": "metamask.perps.read_account"
|
|
318
|
+
},
|
|
319
|
+
"account": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"description": "EVM address to read account state for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
322
|
+
},
|
|
323
|
+
"timeout_ms": {
|
|
324
|
+
"type": "number"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
"required": [
|
|
328
|
+
"action"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
"examples": [
|
|
332
|
+
{
|
|
333
|
+
"description": "Read account state for the configured account",
|
|
334
|
+
"node": {
|
|
335
|
+
"action": "metamask.perps.read_account",
|
|
336
|
+
"intent": "Read Perps account state from the headless controller"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output.",
|
|
341
|
+
"safety_notes": "Read-only HyperLiquid testnet HTTP query; must not inject controller/UI state to fabricate proof."
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"name": "metamask.perps.place_order",
|
|
345
|
+
"owner": "metamask",
|
|
346
|
+
"description": "core Place a real Perps order on HyperLiquid testnet by driving the headless perps controller placeOrder() through the full signing/provider path. Testnet only Supports market (default) and resting limit orders (order_type=limit with price/offset_pct).",
|
|
347
|
+
"schema": {
|
|
348
|
+
"type": "object",
|
|
349
|
+
"properties": {
|
|
350
|
+
"action": {
|
|
351
|
+
"const": "metamask.perps.place_order"
|
|
352
|
+
},
|
|
353
|
+
"market": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
356
|
+
},
|
|
357
|
+
"symbol": {
|
|
358
|
+
"type": "string",
|
|
359
|
+
"description": "Alias for market."
|
|
360
|
+
},
|
|
361
|
+
"markets": {
|
|
362
|
+
"type": "array",
|
|
363
|
+
"items": {
|
|
364
|
+
"type": "string"
|
|
365
|
+
},
|
|
366
|
+
"description": "Explicit list of market symbols (place_order requires exactly one)."
|
|
367
|
+
},
|
|
368
|
+
"symbols": {
|
|
369
|
+
"type": "array",
|
|
370
|
+
"items": {
|
|
371
|
+
"type": "string"
|
|
372
|
+
},
|
|
373
|
+
"description": "Alias for markets."
|
|
374
|
+
},
|
|
375
|
+
"selector": {
|
|
376
|
+
"type": "object",
|
|
377
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
378
|
+
},
|
|
379
|
+
"side": {
|
|
380
|
+
"type": "string",
|
|
381
|
+
"enum": [
|
|
382
|
+
"long",
|
|
383
|
+
"short"
|
|
384
|
+
],
|
|
385
|
+
"description": "Order direction (default: long)."
|
|
386
|
+
},
|
|
387
|
+
"order_type": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"enum": [
|
|
390
|
+
"market",
|
|
391
|
+
"limit"
|
|
392
|
+
],
|
|
393
|
+
"description": "market (default) fills immediately; limit places a RESTING order at price/offset_pct that does not fill. Alias: orderType."
|
|
394
|
+
},
|
|
395
|
+
"limit_price": {
|
|
396
|
+
"type": "string",
|
|
397
|
+
"description": "Absolute resting limit price (limit orders). Takes precedence over offset_pct. Alias: price/limitPrice."
|
|
398
|
+
},
|
|
399
|
+
"offset_pct": {
|
|
400
|
+
"type": "number",
|
|
401
|
+
"description": "Resting limit price as a percent offset from live mid for limit orders (e.g. -30 = 30%% below mid for a non-filling BUY; default -30 buy / +30 sell). Alias: offsetPct."
|
|
402
|
+
},
|
|
403
|
+
"amount": {
|
|
404
|
+
"type": "string",
|
|
405
|
+
"description": "USD notional alias."
|
|
406
|
+
},
|
|
407
|
+
"notional": {
|
|
408
|
+
"type": "string",
|
|
409
|
+
"description": "USD notional alias."
|
|
410
|
+
},
|
|
411
|
+
"leverage": {
|
|
412
|
+
"type": "number"
|
|
413
|
+
},
|
|
414
|
+
"account": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"description": "EVM address to trade for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
417
|
+
},
|
|
418
|
+
"timeout_ms": {
|
|
419
|
+
"type": "number"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"required": [
|
|
423
|
+
"action"
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
"examples": [
|
|
427
|
+
{
|
|
428
|
+
"description": "Place a small BTC long market order on testnet",
|
|
429
|
+
"node": {
|
|
430
|
+
"action": "metamask.perps.place_order",
|
|
431
|
+
"market": "BTC",
|
|
432
|
+
"side": "long",
|
|
433
|
+
"notional": "11",
|
|
434
|
+
"leverage": 2,
|
|
435
|
+
"intent": "Place the requested Perps order via the headless controller",
|
|
436
|
+
"network": "testnet"
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"description": "Place a resting BTC limit BUY 30%% below mid on testnet (does not fill)",
|
|
441
|
+
"node": {
|
|
442
|
+
"action": "metamask.perps.place_order",
|
|
443
|
+
"market": "BTC",
|
|
444
|
+
"side": "long",
|
|
445
|
+
"order_type": "limit",
|
|
446
|
+
"offset_pct": -30,
|
|
447
|
+
"notional": "11",
|
|
448
|
+
"leverage": 2,
|
|
449
|
+
"intent": "Place a resting Perps limit order via the headless controller",
|
|
450
|
+
"network": "testnet"
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
],
|
|
454
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output (order id, opened position).",
|
|
455
|
+
"safety_notes": "Submits a REAL signed order to HyperLiquid testnet; must not mock the signer/provider or inject controller state to fabricate proof."
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "metamask.perps.close_positions",
|
|
459
|
+
"owner": "metamask",
|
|
460
|
+
"description": "core Close selected live Perps positions on HyperLiquid testnet by driving the headless perps controller closePosition() through the full signing/provider path. Testnet only.",
|
|
461
|
+
"schema": {
|
|
462
|
+
"type": "object",
|
|
463
|
+
"properties": {
|
|
464
|
+
"action": {
|
|
465
|
+
"const": "metamask.perps.close_positions"
|
|
466
|
+
},
|
|
467
|
+
"market": {
|
|
468
|
+
"type": "string",
|
|
469
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
470
|
+
},
|
|
471
|
+
"symbol": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"description": "Alias for market."
|
|
474
|
+
},
|
|
475
|
+
"markets": {
|
|
476
|
+
"type": "array",
|
|
477
|
+
"items": {
|
|
478
|
+
"type": "string"
|
|
479
|
+
},
|
|
480
|
+
"description": "Explicit list of market symbols."
|
|
481
|
+
},
|
|
482
|
+
"symbols": {
|
|
483
|
+
"type": "array",
|
|
484
|
+
"items": {
|
|
485
|
+
"type": "string"
|
|
486
|
+
},
|
|
487
|
+
"description": "Alias for markets."
|
|
488
|
+
},
|
|
489
|
+
"mode": {
|
|
490
|
+
"type": "string",
|
|
491
|
+
"enum": [
|
|
492
|
+
"matching",
|
|
493
|
+
"all"
|
|
494
|
+
],
|
|
495
|
+
"description": "matching selects requested symbols; all selects every live position."
|
|
496
|
+
},
|
|
497
|
+
"selector": {
|
|
498
|
+
"type": "object",
|
|
499
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
500
|
+
},
|
|
501
|
+
"side": {
|
|
502
|
+
"type": "string",
|
|
503
|
+
"enum": [
|
|
504
|
+
"long",
|
|
505
|
+
"short"
|
|
506
|
+
],
|
|
507
|
+
"description": "Optional position side filter."
|
|
508
|
+
},
|
|
509
|
+
"account": {
|
|
510
|
+
"type": "string",
|
|
511
|
+
"description": "EVM address to close for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
512
|
+
},
|
|
513
|
+
"timeout_ms": {
|
|
514
|
+
"type": "number"
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"required": [
|
|
518
|
+
"action"
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
"examples": [
|
|
522
|
+
{
|
|
523
|
+
"description": "Close the BTC position on testnet",
|
|
524
|
+
"node": {
|
|
525
|
+
"action": "metamask.perps.close_positions",
|
|
526
|
+
"market": "BTC",
|
|
527
|
+
"intent": "Close selected Perps positions via the headless controller",
|
|
528
|
+
"network": "testnet"
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output (positions absent after close).",
|
|
533
|
+
"safety_notes": "Submits REAL signed close orders to HyperLiquid testnet; must not mock the signer/provider or inject controller state to fabricate proof."
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "metamask.perps.assert_positions",
|
|
537
|
+
"owner": "metamask",
|
|
538
|
+
"description": "core Assert selected live Perps positions are present or absent via the headless controller standalone read path. Throws on mismatch.",
|
|
539
|
+
"schema": {
|
|
540
|
+
"type": "object",
|
|
541
|
+
"properties": {
|
|
542
|
+
"action": {
|
|
543
|
+
"const": "metamask.perps.assert_positions"
|
|
544
|
+
},
|
|
545
|
+
"market": {
|
|
546
|
+
"type": "string",
|
|
547
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
548
|
+
},
|
|
549
|
+
"symbol": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"description": "Alias for market."
|
|
552
|
+
},
|
|
553
|
+
"markets": {
|
|
554
|
+
"type": "array",
|
|
555
|
+
"items": {
|
|
556
|
+
"type": "string"
|
|
557
|
+
},
|
|
558
|
+
"description": "Explicit list of market symbols."
|
|
559
|
+
},
|
|
560
|
+
"symbols": {
|
|
561
|
+
"type": "array",
|
|
562
|
+
"items": {
|
|
563
|
+
"type": "string"
|
|
564
|
+
},
|
|
565
|
+
"description": "Alias for markets."
|
|
566
|
+
},
|
|
567
|
+
"mode": {
|
|
568
|
+
"type": "string",
|
|
569
|
+
"enum": [
|
|
570
|
+
"matching",
|
|
571
|
+
"all"
|
|
572
|
+
],
|
|
573
|
+
"description": "matching selects requested symbols; all selects every live position."
|
|
574
|
+
},
|
|
575
|
+
"selector": {
|
|
576
|
+
"type": "object",
|
|
577
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
578
|
+
},
|
|
579
|
+
"side": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"enum": [
|
|
582
|
+
"long",
|
|
583
|
+
"short"
|
|
584
|
+
],
|
|
585
|
+
"description": "Optional position side filter."
|
|
586
|
+
},
|
|
587
|
+
"state": {
|
|
588
|
+
"type": "string",
|
|
589
|
+
"enum": [
|
|
590
|
+
"none",
|
|
591
|
+
"absent",
|
|
592
|
+
"closed",
|
|
593
|
+
"open",
|
|
594
|
+
"present"
|
|
595
|
+
],
|
|
596
|
+
"description": "Expected selected position state."
|
|
597
|
+
},
|
|
598
|
+
"account": {
|
|
599
|
+
"type": "string",
|
|
600
|
+
"description": "EVM address to read for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
601
|
+
},
|
|
602
|
+
"timeout_ms": {
|
|
603
|
+
"type": "number"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
"required": [
|
|
607
|
+
"action"
|
|
608
|
+
]
|
|
609
|
+
},
|
|
610
|
+
"examples": [
|
|
611
|
+
{
|
|
612
|
+
"description": "Assert BTC position is open",
|
|
613
|
+
"node": {
|
|
614
|
+
"action": "metamask.perps.assert_positions",
|
|
615
|
+
"state": "open",
|
|
616
|
+
"market": "BTC",
|
|
617
|
+
"intent": "Assert the expected Perps position state via the headless controller"
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
],
|
|
621
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output.",
|
|
622
|
+
"safety_notes": "Read-only HyperLiquid testnet HTTP query; must not inject controller state to fabricate proof."
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"name": "metamask.perps.ensure_positions",
|
|
626
|
+
"owner": "metamask",
|
|
627
|
+
"description": "core Higher-level wrapper that reads selected positions, places or closes via the headless controller as needed, then asserts the final position state. Testnet only.",
|
|
628
|
+
"schema": {
|
|
629
|
+
"type": "object",
|
|
630
|
+
"properties": {
|
|
631
|
+
"action": {
|
|
632
|
+
"const": "metamask.perps.ensure_positions"
|
|
633
|
+
},
|
|
634
|
+
"market": {
|
|
635
|
+
"type": "string",
|
|
636
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
637
|
+
},
|
|
638
|
+
"symbol": {
|
|
639
|
+
"type": "string",
|
|
640
|
+
"description": "Alias for market."
|
|
641
|
+
},
|
|
642
|
+
"markets": {
|
|
643
|
+
"type": "array",
|
|
644
|
+
"items": {
|
|
645
|
+
"type": "string"
|
|
646
|
+
},
|
|
647
|
+
"description": "Explicit list of market symbols."
|
|
648
|
+
},
|
|
649
|
+
"symbols": {
|
|
650
|
+
"type": "array",
|
|
651
|
+
"items": {
|
|
652
|
+
"type": "string"
|
|
653
|
+
},
|
|
654
|
+
"description": "Alias for markets."
|
|
655
|
+
},
|
|
656
|
+
"mode": {
|
|
657
|
+
"type": "string",
|
|
658
|
+
"enum": [
|
|
659
|
+
"matching",
|
|
660
|
+
"all"
|
|
661
|
+
],
|
|
662
|
+
"description": "matching selects requested symbols; all selects every live position."
|
|
663
|
+
},
|
|
664
|
+
"selector": {
|
|
665
|
+
"type": "object",
|
|
666
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
667
|
+
},
|
|
668
|
+
"side": {
|
|
669
|
+
"type": "string",
|
|
670
|
+
"enum": [
|
|
671
|
+
"long",
|
|
672
|
+
"short"
|
|
673
|
+
],
|
|
674
|
+
"description": "Order/position direction (default: long when placing)."
|
|
675
|
+
},
|
|
676
|
+
"state": {
|
|
677
|
+
"type": "string",
|
|
678
|
+
"enum": [
|
|
679
|
+
"none",
|
|
680
|
+
"absent",
|
|
681
|
+
"closed",
|
|
682
|
+
"open",
|
|
683
|
+
"present"
|
|
684
|
+
],
|
|
685
|
+
"description": "Desired selected position state to converge to."
|
|
686
|
+
},
|
|
687
|
+
"amount": {
|
|
688
|
+
"type": "string",
|
|
689
|
+
"description": "USD notional alias (used when placing to reach state open)."
|
|
690
|
+
},
|
|
691
|
+
"notional": {
|
|
692
|
+
"type": "string",
|
|
693
|
+
"description": "USD notional alias."
|
|
694
|
+
},
|
|
695
|
+
"leverage": {
|
|
696
|
+
"type": "number"
|
|
697
|
+
},
|
|
698
|
+
"account": {
|
|
699
|
+
"type": "string",
|
|
700
|
+
"description": "EVM address to trade for; defaults to MM_TEST_ACCOUNT_ADDRESS."
|
|
701
|
+
},
|
|
702
|
+
"timeout_ms": {
|
|
703
|
+
"type": "number"
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
"required": [
|
|
707
|
+
"action"
|
|
708
|
+
]
|
|
709
|
+
},
|
|
710
|
+
"examples": [
|
|
711
|
+
{
|
|
712
|
+
"description": "Ensure no BTC position before the proof window",
|
|
713
|
+
"node": {
|
|
714
|
+
"action": "metamask.perps.ensure_positions",
|
|
715
|
+
"state": "none",
|
|
716
|
+
"market": "BTC",
|
|
717
|
+
"intent": "Converge Perps positions to the requested state via the headless controller",
|
|
718
|
+
"network": "testnet"
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
],
|
|
722
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or controller output.",
|
|
723
|
+
"safety_notes": "May submit REAL signed orders to HyperLiquid testnet; must not mock the signer/provider or inject controller state to fabricate proof."
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "metamask.perps.close_orders",
|
|
727
|
+
"owner": "metamask",
|
|
728
|
+
"description": "core Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested.Cancel selected live Perps open orders. Use selector/mode params to cancel matching symbols or all orders.",
|
|
729
|
+
"schema": {
|
|
730
|
+
"type": "object",
|
|
731
|
+
"properties": {
|
|
732
|
+
"action": {
|
|
733
|
+
"const": "metamask.perps.close_orders"
|
|
734
|
+
},
|
|
735
|
+
"market": {
|
|
736
|
+
"type": "string",
|
|
737
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
738
|
+
},
|
|
739
|
+
"symbol": {
|
|
740
|
+
"type": "string",
|
|
741
|
+
"description": "Alias for market."
|
|
742
|
+
},
|
|
743
|
+
"markets": {
|
|
744
|
+
"type": "array",
|
|
745
|
+
"items": {
|
|
746
|
+
"type": "string"
|
|
747
|
+
},
|
|
748
|
+
"description": "Explicit list of market symbols."
|
|
749
|
+
},
|
|
750
|
+
"symbols": {
|
|
751
|
+
"type": "array",
|
|
752
|
+
"items": {
|
|
753
|
+
"type": "string"
|
|
754
|
+
},
|
|
755
|
+
"description": "Alias for markets."
|
|
756
|
+
},
|
|
757
|
+
"mode": {
|
|
758
|
+
"type": "string",
|
|
759
|
+
"enum": [
|
|
760
|
+
"matching",
|
|
761
|
+
"all"
|
|
762
|
+
],
|
|
763
|
+
"description": "matching selects requested symbols; all selects every live item returned by the product."
|
|
764
|
+
},
|
|
765
|
+
"selector": {
|
|
766
|
+
"type": "object",
|
|
767
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
768
|
+
},
|
|
769
|
+
"side": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"enum": [
|
|
772
|
+
"long",
|
|
773
|
+
"short"
|
|
774
|
+
],
|
|
775
|
+
"description": "Optional position/order side filter."
|
|
776
|
+
},
|
|
777
|
+
"timeout_ms": {
|
|
778
|
+
"type": "number"
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
"required": [
|
|
782
|
+
"action"
|
|
783
|
+
]
|
|
784
|
+
},
|
|
785
|
+
"examples": [
|
|
786
|
+
{
|
|
787
|
+
"description": "Cancel every open order",
|
|
788
|
+
"node": {
|
|
789
|
+
"action": "metamask.perps.close_orders",
|
|
790
|
+
"mode": "all",
|
|
791
|
+
"intent": "Cancel selected Perps orders before continuing",
|
|
792
|
+
"network": "testnet"
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"description": "Cancel BTC orders only",
|
|
797
|
+
"node": {
|
|
798
|
+
"action": "metamask.perps.close_orders",
|
|
799
|
+
"market": "BTC",
|
|
800
|
+
"intent": "Cancel selected Perps orders before continuing",
|
|
801
|
+
"network": "testnet"
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
],
|
|
805
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or target runtime output.",
|
|
806
|
+
"safety_notes": "Must not inject mid-recipe UI/app state to fabricate proof."
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
"name": "metamask.perps.assert_orders",
|
|
810
|
+
"owner": "metamask",
|
|
811
|
+
"description": "core Assert selected live Perps open orders are present or absent.",
|
|
812
|
+
"schema": {
|
|
813
|
+
"type": "object",
|
|
814
|
+
"properties": {
|
|
815
|
+
"action": {
|
|
816
|
+
"const": "metamask.perps.assert_orders"
|
|
817
|
+
},
|
|
818
|
+
"market": {
|
|
819
|
+
"type": "string",
|
|
820
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
821
|
+
},
|
|
822
|
+
"symbol": {
|
|
823
|
+
"type": "string",
|
|
824
|
+
"description": "Alias for market."
|
|
825
|
+
},
|
|
826
|
+
"markets": {
|
|
827
|
+
"type": "array",
|
|
828
|
+
"items": {
|
|
829
|
+
"type": "string"
|
|
830
|
+
},
|
|
831
|
+
"description": "Explicit list of market symbols."
|
|
832
|
+
},
|
|
833
|
+
"symbols": {
|
|
834
|
+
"type": "array",
|
|
835
|
+
"items": {
|
|
836
|
+
"type": "string"
|
|
837
|
+
},
|
|
838
|
+
"description": "Alias for markets."
|
|
839
|
+
},
|
|
840
|
+
"mode": {
|
|
841
|
+
"type": "string",
|
|
842
|
+
"enum": [
|
|
843
|
+
"matching",
|
|
844
|
+
"all"
|
|
845
|
+
],
|
|
846
|
+
"description": "matching selects requested symbols; all selects every live item returned by the product."
|
|
847
|
+
},
|
|
848
|
+
"selector": {
|
|
849
|
+
"type": "object",
|
|
850
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
851
|
+
},
|
|
852
|
+
"side": {
|
|
853
|
+
"type": "string",
|
|
854
|
+
"enum": [
|
|
855
|
+
"long",
|
|
856
|
+
"short"
|
|
857
|
+
],
|
|
858
|
+
"description": "Optional position/order side filter."
|
|
859
|
+
},
|
|
860
|
+
"timeout_ms": {
|
|
861
|
+
"type": "number"
|
|
862
|
+
},
|
|
863
|
+
"state": {
|
|
864
|
+
"type": "string",
|
|
865
|
+
"enum": [
|
|
866
|
+
"none",
|
|
867
|
+
"absent",
|
|
868
|
+
"closed",
|
|
869
|
+
"open",
|
|
870
|
+
"present"
|
|
871
|
+
],
|
|
872
|
+
"description": "Desired/expected selected collection state."
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
"required": [
|
|
876
|
+
"action"
|
|
877
|
+
]
|
|
878
|
+
},
|
|
879
|
+
"examples": [
|
|
880
|
+
{
|
|
881
|
+
"description": "Assert no BTC open orders",
|
|
882
|
+
"node": {
|
|
883
|
+
"action": "metamask.perps.assert_orders",
|
|
884
|
+
"state": "none",
|
|
885
|
+
"market": "BTC",
|
|
886
|
+
"intent": "Assert the expected Perps open order state"
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
],
|
|
890
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or target runtime output.",
|
|
891
|
+
"safety_notes": "Must not inject mid-recipe UI/app state to fabricate proof."
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"name": "metamask.perps.ensure_orders",
|
|
895
|
+
"owner": "metamask",
|
|
896
|
+
"description": "core Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested.Higher-level wrapper that reads selected orders, cancels when needed, then asserts final order state.",
|
|
897
|
+
"schema": {
|
|
898
|
+
"type": "object",
|
|
899
|
+
"properties": {
|
|
900
|
+
"action": {
|
|
901
|
+
"const": "metamask.perps.ensure_orders"
|
|
902
|
+
},
|
|
903
|
+
"market": {
|
|
904
|
+
"type": "string",
|
|
905
|
+
"description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
|
|
906
|
+
},
|
|
907
|
+
"symbol": {
|
|
908
|
+
"type": "string",
|
|
909
|
+
"description": "Alias for market."
|
|
910
|
+
},
|
|
911
|
+
"markets": {
|
|
912
|
+
"type": "array",
|
|
913
|
+
"items": {
|
|
914
|
+
"type": "string"
|
|
915
|
+
},
|
|
916
|
+
"description": "Explicit list of market symbols."
|
|
917
|
+
},
|
|
918
|
+
"symbols": {
|
|
919
|
+
"type": "array",
|
|
920
|
+
"items": {
|
|
921
|
+
"type": "string"
|
|
922
|
+
},
|
|
923
|
+
"description": "Alias for markets."
|
|
924
|
+
},
|
|
925
|
+
"mode": {
|
|
926
|
+
"type": "string",
|
|
927
|
+
"enum": [
|
|
928
|
+
"matching",
|
|
929
|
+
"all"
|
|
930
|
+
],
|
|
931
|
+
"description": "matching selects requested symbols; all selects every live item returned by the product."
|
|
932
|
+
},
|
|
933
|
+
"selector": {
|
|
934
|
+
"type": "object",
|
|
935
|
+
"description": "Optional structured selector with mode, symbols/markets, and side."
|
|
936
|
+
},
|
|
937
|
+
"side": {
|
|
938
|
+
"type": "string",
|
|
939
|
+
"enum": [
|
|
940
|
+
"long",
|
|
941
|
+
"short"
|
|
942
|
+
],
|
|
943
|
+
"description": "Optional position/order side filter."
|
|
944
|
+
},
|
|
945
|
+
"timeout_ms": {
|
|
946
|
+
"type": "number"
|
|
947
|
+
},
|
|
948
|
+
"state": {
|
|
949
|
+
"type": "string",
|
|
950
|
+
"enum": [
|
|
951
|
+
"none",
|
|
952
|
+
"absent",
|
|
953
|
+
"closed",
|
|
954
|
+
"open",
|
|
955
|
+
"present"
|
|
956
|
+
],
|
|
957
|
+
"description": "Desired/expected selected collection state."
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
"required": [
|
|
961
|
+
"action"
|
|
962
|
+
]
|
|
963
|
+
},
|
|
964
|
+
"examples": [
|
|
965
|
+
{
|
|
966
|
+
"description": "Ensure no open orders before proof window",
|
|
967
|
+
"node": {
|
|
968
|
+
"action": "metamask.perps.ensure_orders",
|
|
969
|
+
"state": "none",
|
|
970
|
+
"mode": "all",
|
|
971
|
+
"intent": "Converge Perps orders to the requested state",
|
|
972
|
+
"network": "testnet"
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
],
|
|
976
|
+
"proof_effect": "E2E validation must record this action in trace.json; live-proof actions include liveAdapter/proofPath or target runtime output.",
|
|
977
|
+
"safety_notes": "Must not inject mid-recipe UI/app state to fabricate proof."
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"name": "metamask.perps.start_state",
|
|
981
|
+
"owner": "metamask",
|
|
982
|
+
"description": "core Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested.Recommended configurable Perps start state that composes reusable domain operations before the proof window. Headless: converges POSITION and ORDER baselines on testnet via the controller; no navigation/page/HUD.",
|
|
983
|
+
"schema": {
|
|
984
|
+
"type": "object",
|
|
985
|
+
"properties": {
|
|
986
|
+
"action": {
|
|
987
|
+
"const": "metamask.perps.start_state"
|
|
988
|
+
},
|
|
989
|
+
"profile": {
|
|
990
|
+
"type": "string",
|
|
991
|
+
"description": "Optional profile such as clean_market_testnet, open_position_testnet, open_order_testnet, or provider_mainnet_readonly."
|
|
992
|
+
},
|
|
993
|
+
"account": {
|
|
994
|
+
"type": "string"
|
|
995
|
+
},
|
|
996
|
+
"provider": {
|
|
997
|
+
"type": "string",
|
|
998
|
+
"description": "Requested Perps provider, e.g. hyperliquid."
|
|
999
|
+
},
|
|
1000
|
+
"network": {
|
|
1001
|
+
"type": "string",
|
|
1002
|
+
"enum": [
|
|
1003
|
+
"testnet",
|
|
1004
|
+
"mainnet"
|
|
1005
|
+
]
|
|
1006
|
+
},
|
|
1007
|
+
"market": {
|
|
1008
|
+
"type": "string"
|
|
1009
|
+
},
|
|
1010
|
+
"symbol": {
|
|
1011
|
+
"type": "string"
|
|
1012
|
+
},
|
|
1013
|
+
"markets": {
|
|
1014
|
+
"type": "array",
|
|
1015
|
+
"items": {
|
|
1016
|
+
"type": "string"
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
"symbols": {
|
|
1020
|
+
"type": "array",
|
|
1021
|
+
"items": {
|
|
1022
|
+
"type": "string"
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
"positions": {
|
|
1026
|
+
"oneOf": [
|
|
1027
|
+
{
|
|
1028
|
+
"type": "object"
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
"const": false
|
|
1032
|
+
}
|
|
1033
|
+
],
|
|
1034
|
+
"description": "Desired position baseline or false to skip."
|
|
1035
|
+
},
|
|
1036
|
+
"orders": {
|
|
1037
|
+
"oneOf": [
|
|
1038
|
+
{
|
|
1039
|
+
"type": "object"
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
"const": false
|
|
1043
|
+
}
|
|
1044
|
+
],
|
|
1045
|
+
"description": "Desired open-order baseline or false to skip."
|
|
1046
|
+
},
|
|
1047
|
+
"timeout_ms": {
|
|
1048
|
+
"type": "number"
|
|
1049
|
+
}
|
|
1050
|
+
},
|
|
1051
|
+
"required": [
|
|
1052
|
+
"action"
|
|
1053
|
+
]
|
|
1054
|
+
},
|
|
1055
|
+
"examples": [
|
|
1056
|
+
{
|
|
1057
|
+
"description": "Clean BTC testnet market state",
|
|
1058
|
+
"node": {
|
|
1059
|
+
"action": "metamask.perps.start_state",
|
|
1060
|
+
"profile": "clean_market_testnet",
|
|
1061
|
+
"market": "BTC",
|
|
1062
|
+
"positions": {
|
|
1063
|
+
"state": "none"
|
|
1064
|
+
},
|
|
1065
|
+
"orders": {
|
|
1066
|
+
"state": "none"
|
|
1067
|
+
},
|
|
1068
|
+
"intent": "Prepare the Perps start state for the proof",
|
|
1069
|
+
"network": "testnet"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"description": "Start with an open ETH long position",
|
|
1074
|
+
"node": {
|
|
1075
|
+
"action": "metamask.perps.start_state",
|
|
1076
|
+
"profile": "open_position_testnet",
|
|
1077
|
+
"market": "ETH",
|
|
1078
|
+
"side": "long",
|
|
1079
|
+
"positions": {
|
|
1080
|
+
"state": "open",
|
|
1081
|
+
"notional": "10",
|
|
1082
|
+
"leverage": 2
|
|
1083
|
+
},
|
|
1084
|
+
"intent": "Prepare the Perps start state for the proof",
|
|
1085
|
+
"network": "testnet"
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
],
|
|
1089
|
+
"proof_effect": "Runs in setup/teardown phase and must be visible in trace.json; proof videos can keep this as trace-only setup.",
|
|
1090
|
+
"safety_notes": "Composes supported app/API paths and must not mutate React/Redux/MobX/DOM/local storage to fabricate proof."
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
"name": "metamask.perps.teardown_state",
|
|
1094
|
+
"owner": "metamask",
|
|
1095
|
+
"description": "core Recommended configurable Perps teardown state that restores the selected environment after proof. Headless: converges POSITION and ORDER baselines on testnet via the controller; no navigation/page/HUD.",
|
|
1096
|
+
"schema": {
|
|
1097
|
+
"type": "object",
|
|
1098
|
+
"properties": {
|
|
1099
|
+
"action": {
|
|
1100
|
+
"const": "metamask.perps.teardown_state"
|
|
1101
|
+
},
|
|
1102
|
+
"profile": {
|
|
1103
|
+
"type": "string",
|
|
1104
|
+
"description": "Optional profile such as clean_market_testnet, open_position_testnet, open_order_testnet, or provider_mainnet_readonly."
|
|
1105
|
+
},
|
|
1106
|
+
"account": {
|
|
1107
|
+
"type": "string"
|
|
1108
|
+
},
|
|
1109
|
+
"provider": {
|
|
1110
|
+
"type": "string",
|
|
1111
|
+
"description": "Requested Perps provider, e.g. hyperliquid."
|
|
1112
|
+
},
|
|
1113
|
+
"network": {
|
|
1114
|
+
"type": "string",
|
|
1115
|
+
"enum": [
|
|
1116
|
+
"testnet",
|
|
1117
|
+
"mainnet"
|
|
1118
|
+
]
|
|
1119
|
+
},
|
|
1120
|
+
"market": {
|
|
1121
|
+
"type": "string"
|
|
1122
|
+
},
|
|
1123
|
+
"symbol": {
|
|
1124
|
+
"type": "string"
|
|
1125
|
+
},
|
|
1126
|
+
"markets": {
|
|
1127
|
+
"type": "array",
|
|
1128
|
+
"items": {
|
|
1129
|
+
"type": "string"
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
"symbols": {
|
|
1133
|
+
"type": "array",
|
|
1134
|
+
"items": {
|
|
1135
|
+
"type": "string"
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
"positions": {
|
|
1139
|
+
"oneOf": [
|
|
1140
|
+
{
|
|
1141
|
+
"type": "object"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
"const": false
|
|
1145
|
+
}
|
|
1146
|
+
],
|
|
1147
|
+
"description": "Desired position baseline or false to skip."
|
|
1148
|
+
},
|
|
1149
|
+
"orders": {
|
|
1150
|
+
"oneOf": [
|
|
1151
|
+
{
|
|
1152
|
+
"type": "object"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
"const": false
|
|
1156
|
+
}
|
|
1157
|
+
],
|
|
1158
|
+
"description": "Desired open-order baseline or false to skip."
|
|
1159
|
+
},
|
|
1160
|
+
"timeout_ms": {
|
|
1161
|
+
"type": "number"
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
"required": [
|
|
1165
|
+
"action"
|
|
1166
|
+
]
|
|
1167
|
+
},
|
|
1168
|
+
"examples": [
|
|
1169
|
+
{
|
|
1170
|
+
"description": "Return BTC test account to clean state",
|
|
1171
|
+
"node": {
|
|
1172
|
+
"action": "metamask.perps.teardown_state",
|
|
1173
|
+
"market": "BTC",
|
|
1174
|
+
"positions": {
|
|
1175
|
+
"state": "none"
|
|
1176
|
+
},
|
|
1177
|
+
"orders": {
|
|
1178
|
+
"state": "none"
|
|
1179
|
+
},
|
|
1180
|
+
"intent": "Restore Perps state after the proof"
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"description": "Teardown only state created by selected market",
|
|
1185
|
+
"node": {
|
|
1186
|
+
"action": "metamask.perps.teardown_state",
|
|
1187
|
+
"market": "BTC",
|
|
1188
|
+
"intent": "Restore Perps state after the proof"
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
],
|
|
1192
|
+
"proof_effect": "Runs in setup/teardown phase and must be visible in trace.json; proof videos can keep this as trace-only setup.",
|
|
1193
|
+
"safety_notes": "Composes supported app/API paths and must not mutate React/Redux/MobX/DOM/local storage to fabricate proof."
|
|
1194
|
+
}
|
|
1195
|
+
],
|
|
1196
|
+
"state_refs": [
|
|
1197
|
+
{
|
|
1198
|
+
"name": "perps.positions",
|
|
1199
|
+
"description": "Normalized Perps position state read from the headless controller."
|
|
1200
|
+
}
|
|
1201
|
+
],
|
|
1202
|
+
"pre_conditions": [
|
|
1203
|
+
{
|
|
1204
|
+
"id": "no-mid-recipe-state-injection",
|
|
1205
|
+
"description": "Recipes must drive the real perps controller read path for proof state."
|
|
1206
|
+
}
|
|
1207
|
+
],
|
|
1208
|
+
"native_bindings": [
|
|
1209
|
+
{
|
|
1210
|
+
"action": "command",
|
|
1211
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"action": "wait",
|
|
1215
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
"action": "assert_file",
|
|
1219
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
"action": "assert_json",
|
|
1223
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1224
|
+
},
|
|
1225
|
+
{
|
|
1226
|
+
"action": "assert_exit_code",
|
|
1227
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
"action": "assert_output",
|
|
1231
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
"action": "watch_logs",
|
|
1235
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"action": "index_artifacts",
|
|
1239
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
"action": "end",
|
|
1243
|
+
"implementation": "@farmslot/recipe-harness/adapters/core"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"action": "app.status",
|
|
1247
|
+
"implementation": "@metamask/recipe-runner/platform-status"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"action": "metamask.perps.read_positions",
|
|
1251
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
"action": "metamask.perps.read_orders",
|
|
1255
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
"action": "metamask.perps.read_account",
|
|
1259
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
"action": "metamask.perps.place_order",
|
|
1263
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
"action": "metamask.perps.close_positions",
|
|
1267
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"action": "metamask.perps.assert_positions",
|
|
1271
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"action": "metamask.perps.ensure_positions",
|
|
1275
|
+
"implementation": "@metamask/recipe-runner/core/perps"
|
|
1276
|
+
}
|
|
1277
|
+
],
|
|
1278
|
+
"capability_notes": [
|
|
1279
|
+
"core is a headless adapter: it instantiates @metamask/perps-controller against a resolved MetaMask/core checkout and reads HyperLiquid testnet over HTTP. No CDP, bridge, or UI is involved. Slice 1 implements read-only perps actions. Slice 2 adds a default viem signer + write actions (place_order, close_positions, ensure_positions, assert_positions) that submit real signed orders to HyperLiquid testnet via the controller's full provider path."
|
|
1280
|
+
],
|
|
1281
|
+
"action_profiles": []
|
|
1282
|
+
}
|