@deeeed/metamask-harness 0.45.1 → 0.46.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 +11 -0
- package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +12 -3
- package/library/actions/mobile/perps/perps.mjs +749 -34
- package/library/manifests/mobile.action-manifest.json +101 -6
- package/library/recipes/mobile/perps/chase-assert-running.recipe.json +110 -0
- package/library/recipes/mobile/perps/chase-place.recipe.json +145 -0
- package/library/recipes/mobile/perps/chase-terminate.recipe.json +98 -0
- package/library/recipes/mobile/perps/pro-order-setup.recipe.json +111 -0
- package/library/recipes/mobile/perps/pro-order-start-state.recipe.json +53 -0
- package/library/recipes/mobile/perps/scale-assert-orders.recipe.json +126 -0
- package/library/recipes/mobile/perps/scale-place.recipe.json +186 -0
- package/library/recipes/mobile/perps/twap-assert-active.recipe.json +97 -0
- package/library/recipes/mobile/perps/twap-place.recipe.json +146 -0
- package/package.json +1 -1
- package/site/perps-advanced-orders-qa.html +96 -0
- package/site/perps.html +11 -0
|
@@ -3321,7 +3321,7 @@
|
|
|
3321
3321
|
"execution_capabilities": ["app-mutation"]
|
|
3322
3322
|
},
|
|
3323
3323
|
"metamask.perps.start_state": {
|
|
3324
|
-
"description": "
|
|
3324
|
+
"description": "Restores the fixture-backed wallet, then changes only the account, provider, network, market route, mode, and trading-state policy supplied directly or by a named profile. Omitted values keep the app's current selection.",
|
|
3325
3325
|
"schema": {
|
|
3326
3326
|
"type": "object",
|
|
3327
3327
|
"properties": {
|
|
@@ -3340,18 +3340,21 @@
|
|
|
3340
3340
|
"description": "Bound for the fixture-backed wallet unlock within Perps state setup."
|
|
3341
3341
|
},
|
|
3342
3342
|
"account": {
|
|
3343
|
-
"type": "string"
|
|
3343
|
+
"type": "string",
|
|
3344
|
+
"description": "Optional exact account name. Omit it to keep the currently selected account."
|
|
3344
3345
|
},
|
|
3345
3346
|
"provider": {
|
|
3346
3347
|
"type": "string",
|
|
3347
|
-
"description": "Requested Perps provider, e.g. hyperliquid."
|
|
3348
|
+
"description": "Requested Perps provider, e.g. hyperliquid. Omit it to keep the current provider unless a named profile supplies one."
|
|
3348
3349
|
},
|
|
3349
3350
|
"network": {
|
|
3350
3351
|
"type": "string",
|
|
3351
|
-
"enum": ["testnet", "mainnet"]
|
|
3352
|
+
"enum": ["testnet", "mainnet"],
|
|
3353
|
+
"description": "Requested Perps network. Omit it to keep the current network unless a named profile supplies one."
|
|
3352
3354
|
},
|
|
3353
3355
|
"market": {
|
|
3354
|
-
"type": "string"
|
|
3356
|
+
"type": "string",
|
|
3357
|
+
"description": "Requested market symbol. Omit it to keep the current market route unless a named profile supplies one."
|
|
3355
3358
|
},
|
|
3356
3359
|
"symbol": {
|
|
3357
3360
|
"type": "string"
|
|
@@ -3373,7 +3376,18 @@
|
|
|
3373
3376
|
"type": ["string", "boolean"],
|
|
3374
3377
|
"enum": [false, "home", "perps", "perps_home", "market", "market_details"]
|
|
3375
3378
|
},
|
|
3379
|
+
"market_mode": {
|
|
3380
|
+
"type": "string",
|
|
3381
|
+
"enum": ["lite", "pro"],
|
|
3382
|
+
"description": "Optional market-detail mode to inspect and converge after navigation."
|
|
3383
|
+
},
|
|
3384
|
+
"trading_state": {
|
|
3385
|
+
"type": "string",
|
|
3386
|
+
"enum": ["preserve", "clean_selected_testnet_market"],
|
|
3387
|
+
"description": "High-level state policy. The clean policy removes matching positions, ordinary orders, TWAPs, and Chase sessions only on testnet and preserves them on mainnet."
|
|
3388
|
+
},
|
|
3376
3389
|
"positions": {
|
|
3390
|
+
"description": "Requested position state. Omit it or pass false to preserve current positions.",
|
|
3377
3391
|
"type": ["object", "boolean"],
|
|
3378
3392
|
"properties": {
|
|
3379
3393
|
"mode": {
|
|
@@ -3461,6 +3475,7 @@
|
|
|
3461
3475
|
"additionalProperties": false
|
|
3462
3476
|
},
|
|
3463
3477
|
"orders": {
|
|
3478
|
+
"description": "Requested ordinary-order state. Omit it or pass false to preserve current orders.",
|
|
3464
3479
|
"type": ["object", "boolean"],
|
|
3465
3480
|
"properties": {
|
|
3466
3481
|
"mode": {
|
|
@@ -3547,6 +3562,46 @@
|
|
|
3547
3562
|
},
|
|
3548
3563
|
"additionalProperties": false
|
|
3549
3564
|
},
|
|
3565
|
+
"strategies": {
|
|
3566
|
+
"description": "Matching active TWAP and Chase strategies to remove. Omit it or pass false to preserve them.",
|
|
3567
|
+
"type": ["object", "boolean"],
|
|
3568
|
+
"properties": {
|
|
3569
|
+
"mode": {
|
|
3570
|
+
"type": "string",
|
|
3571
|
+
"enum": ["matching", "all"]
|
|
3572
|
+
},
|
|
3573
|
+
"market": {
|
|
3574
|
+
"type": "string"
|
|
3575
|
+
},
|
|
3576
|
+
"symbol": {
|
|
3577
|
+
"type": "string"
|
|
3578
|
+
},
|
|
3579
|
+
"markets": {
|
|
3580
|
+
"type": "array",
|
|
3581
|
+
"items": {
|
|
3582
|
+
"type": "string"
|
|
3583
|
+
}
|
|
3584
|
+
},
|
|
3585
|
+
"symbols": {
|
|
3586
|
+
"type": "array",
|
|
3587
|
+
"items": {
|
|
3588
|
+
"type": "string"
|
|
3589
|
+
}
|
|
3590
|
+
},
|
|
3591
|
+
"side": {
|
|
3592
|
+
"type": "string",
|
|
3593
|
+
"enum": ["long", "short"]
|
|
3594
|
+
},
|
|
3595
|
+
"state": {
|
|
3596
|
+
"type": "string",
|
|
3597
|
+
"enum": ["none", "closed", "absent"]
|
|
3598
|
+
},
|
|
3599
|
+
"timeout_ms": {
|
|
3600
|
+
"type": "number"
|
|
3601
|
+
}
|
|
3602
|
+
},
|
|
3603
|
+
"additionalProperties": false
|
|
3604
|
+
},
|
|
3550
3605
|
"hud": {
|
|
3551
3606
|
"type": "object",
|
|
3552
3607
|
"properties": {},
|
|
@@ -3620,10 +3675,50 @@
|
|
|
3620
3675
|
"execution_capabilities": ["app-mutation", "external-mutation"]
|
|
3621
3676
|
},
|
|
3622
3677
|
"metamask.perps.teardown_state": {
|
|
3623
|
-
"description": "mobile
|
|
3678
|
+
"description": "mobile Configurable Perps teardown that defaults to Hyperliquid testnet, verifies the environment before mutation, and permits explicit mainnet overrides.",
|
|
3624
3679
|
"schema": {
|
|
3625
3680
|
"type": "object",
|
|
3626
3681
|
"properties": {
|
|
3682
|
+
"strategies": {
|
|
3683
|
+
"description": "Matching active TWAP and Chase strategies to remove; false preserves them.",
|
|
3684
|
+
"type": ["object", "boolean"],
|
|
3685
|
+
"properties": {
|
|
3686
|
+
"mode": {
|
|
3687
|
+
"type": "string",
|
|
3688
|
+
"enum": ["matching", "all"]
|
|
3689
|
+
},
|
|
3690
|
+
"market": {
|
|
3691
|
+
"type": "string"
|
|
3692
|
+
},
|
|
3693
|
+
"symbol": {
|
|
3694
|
+
"type": "string"
|
|
3695
|
+
},
|
|
3696
|
+
"markets": {
|
|
3697
|
+
"type": "array",
|
|
3698
|
+
"items": {
|
|
3699
|
+
"type": "string"
|
|
3700
|
+
}
|
|
3701
|
+
},
|
|
3702
|
+
"symbols": {
|
|
3703
|
+
"type": "array",
|
|
3704
|
+
"items": {
|
|
3705
|
+
"type": "string"
|
|
3706
|
+
}
|
|
3707
|
+
},
|
|
3708
|
+
"side": {
|
|
3709
|
+
"type": "string",
|
|
3710
|
+
"enum": ["long", "short"]
|
|
3711
|
+
},
|
|
3712
|
+
"state": {
|
|
3713
|
+
"type": "string",
|
|
3714
|
+
"enum": ["none", "closed", "absent"]
|
|
3715
|
+
},
|
|
3716
|
+
"timeout_ms": {
|
|
3717
|
+
"type": "number"
|
|
3718
|
+
}
|
|
3719
|
+
},
|
|
3720
|
+
"additionalProperties": false
|
|
3721
|
+
},
|
|
3627
3722
|
"profile": {
|
|
3628
3723
|
"type": "string",
|
|
3629
3724
|
"description": "Optional profile such as clean_market_testnet, open_position_testnet, open_order_testnet, or provider_mainnet_readonly."
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Assert a foreground Mobile Pro Chase order",
|
|
4
|
+
"description": "Keeps MetaMask foregrounded during a dwell and fails if the selected market's running Chase row vanishes.",
|
|
5
|
+
"paramsSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"account": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "",
|
|
12
|
+
"description": "Optional exact fixture account name, such as Trading or dev1. Omit it to keep the currently selected account."
|
|
13
|
+
},
|
|
14
|
+
"provider": { "type": "string", "default": "hyperliquid" },
|
|
15
|
+
"network": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["testnet", "mainnet"],
|
|
18
|
+
"default": "testnet",
|
|
19
|
+
"description": "Assertions are read-only and may inspect either network."
|
|
20
|
+
},
|
|
21
|
+
"market": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"default": "BTC"
|
|
24
|
+
},
|
|
25
|
+
"dwell_ms": {
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"minimum": 1000,
|
|
28
|
+
"default": 12000
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"workflow": {
|
|
33
|
+
"entry": "prepare",
|
|
34
|
+
"nodes": {
|
|
35
|
+
"prepare": {
|
|
36
|
+
"action": "call",
|
|
37
|
+
"ref": "perps.pro-order-start-state",
|
|
38
|
+
"params": {
|
|
39
|
+
"account": "{{params.account}}",
|
|
40
|
+
"provider": "{{params.provider}}",
|
|
41
|
+
"network": "{{params.network}}",
|
|
42
|
+
"market": "{{params.market}}"
|
|
43
|
+
},
|
|
44
|
+
"intent": "Reach and prove the requested Pro market without changing Chase orders.",
|
|
45
|
+
"next": "position-tab"
|
|
46
|
+
},
|
|
47
|
+
"position-tab": {
|
|
48
|
+
"action": "ui.scroll",
|
|
49
|
+
"test_id": "perps-pro-market-positions-panel-tab-chase",
|
|
50
|
+
"scroll_into_view": true,
|
|
51
|
+
"intent": "Expose the Chase tab for visible review.",
|
|
52
|
+
"next": "wait-tab"
|
|
53
|
+
},
|
|
54
|
+
"wait-tab": {
|
|
55
|
+
"action": "ui.wait_for",
|
|
56
|
+
"test_id": "perps-pro-market-positions-panel-tab-chase",
|
|
57
|
+
"expected": "visible",
|
|
58
|
+
"timeout_ms": 15000,
|
|
59
|
+
"intent": "Require the Chase tab to be visible.",
|
|
60
|
+
"next": "open-tab"
|
|
61
|
+
},
|
|
62
|
+
"open-tab": {
|
|
63
|
+
"action": "ui.press",
|
|
64
|
+
"test_id": "perps-pro-market-positions-panel-tab-chase",
|
|
65
|
+
"intent": "Open Chase monitoring.",
|
|
66
|
+
"next": "wait-running-before"
|
|
67
|
+
},
|
|
68
|
+
"wait-running-before": {
|
|
69
|
+
"action": "ui.wait_for",
|
|
70
|
+
"test_id": "perps-chase-status-active-{{params.market}}",
|
|
71
|
+
"expected": "visible",
|
|
72
|
+
"timeout_ms": 20000,
|
|
73
|
+
"intent": "Require the running Chase row before the foreground dwell.",
|
|
74
|
+
"next": "dwell"
|
|
75
|
+
},
|
|
76
|
+
"dwell": {
|
|
77
|
+
"action": "wait",
|
|
78
|
+
"duration_ms": "{{params.dwell_ms}}",
|
|
79
|
+
"intent": "Keep the app foregrounded while the Chase session reprices.",
|
|
80
|
+
"next": "position-running-after"
|
|
81
|
+
},
|
|
82
|
+
"position-running-after": {
|
|
83
|
+
"action": "ui.scroll",
|
|
84
|
+
"test_id": "perps-chase-status-active-{{params.market}}",
|
|
85
|
+
"offset": 600,
|
|
86
|
+
"intent": "Expose the surviving Chase row after the foreground dwell.",
|
|
87
|
+
"next": "wait-running-after"
|
|
88
|
+
},
|
|
89
|
+
"wait-running-after": {
|
|
90
|
+
"action": "ui.wait_for",
|
|
91
|
+
"test_id": "perps-chase-status-active-{{params.market}}",
|
|
92
|
+
"expected": "visible",
|
|
93
|
+
"timeout_ms": 5000,
|
|
94
|
+
"intent": "Fail if the Chase row vanished during the foreground dwell.",
|
|
95
|
+
"next": "capture"
|
|
96
|
+
},
|
|
97
|
+
"capture": {
|
|
98
|
+
"action": "ui.screenshot",
|
|
99
|
+
"path": "screenshots/evidence-chase-running-{{params.market}}.png",
|
|
100
|
+
"label": "The Chase row is still Running after a foreground dwell.",
|
|
101
|
+
"intent": "Preserve the surviving running Chase row for review.",
|
|
102
|
+
"next": "done"
|
|
103
|
+
},
|
|
104
|
+
"done": {
|
|
105
|
+
"action": "end",
|
|
106
|
+
"status": "pass"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Place a Mobile Pro Chase order",
|
|
4
|
+
"description": "Places one parameterized Chase order through visible Mobile Pro controls, cleaning only the testnet path.",
|
|
5
|
+
"paramsSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"account": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "",
|
|
12
|
+
"description": "Optional exact fixture account name, such as Trading or dev1. Omit it to keep the currently selected account."
|
|
13
|
+
},
|
|
14
|
+
"provider": { "type": "string", "default": "hyperliquid" },
|
|
15
|
+
"network": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["testnet", "mainnet"],
|
|
18
|
+
"default": "testnet",
|
|
19
|
+
"description": "Mainnet placement requires an explicit user request."
|
|
20
|
+
},
|
|
21
|
+
"market": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"default": "BTC"
|
|
24
|
+
},
|
|
25
|
+
"side": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": [
|
|
28
|
+
"long",
|
|
29
|
+
"short"
|
|
30
|
+
],
|
|
31
|
+
"default": "long"
|
|
32
|
+
},
|
|
33
|
+
"notional": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"default": "100"
|
|
36
|
+
},
|
|
37
|
+
"max_distance": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "5000",
|
|
40
|
+
"description": "USD guard; keep this wider than expected movement during a persistence dwell."
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"workflow": {
|
|
45
|
+
"entry": "prepare",
|
|
46
|
+
"nodes": {
|
|
47
|
+
"prepare": {
|
|
48
|
+
"action": "call",
|
|
49
|
+
"ref": "perps.pro-order-setup",
|
|
50
|
+
"params": {
|
|
51
|
+
"account": "{{params.account}}",
|
|
52
|
+
"provider": "{{params.provider}}",
|
|
53
|
+
"network": "{{params.network}}",
|
|
54
|
+
"market": "{{params.market}}",
|
|
55
|
+
"side": "{{params.side}}"
|
|
56
|
+
},
|
|
57
|
+
"intent": "Prepare the requested Pro order form and Advanced picker.",
|
|
58
|
+
"next": "position-chase"
|
|
59
|
+
},
|
|
60
|
+
"position-chase": {
|
|
61
|
+
"action": "ui.scroll",
|
|
62
|
+
"test_id": "perps-order-type-chase",
|
|
63
|
+
"scroll_into_view": true,
|
|
64
|
+
"intent": "Expose the Chase option for visible selection.",
|
|
65
|
+
"next": "wait-chase"
|
|
66
|
+
},
|
|
67
|
+
"wait-chase": {
|
|
68
|
+
"action": "ui.wait_for",
|
|
69
|
+
"test_id": "perps-order-type-chase",
|
|
70
|
+
"expected": "visible",
|
|
71
|
+
"timeout_ms": 10000,
|
|
72
|
+
"intent": "Fail closed unless Chase is visibly offered.",
|
|
73
|
+
"next": "select-chase"
|
|
74
|
+
},
|
|
75
|
+
"select-chase": {
|
|
76
|
+
"action": "ui.press",
|
|
77
|
+
"test_id": "perps-order-type-chase",
|
|
78
|
+
"intent": "Select Chase.",
|
|
79
|
+
"next": "position-size"
|
|
80
|
+
},
|
|
81
|
+
"position-size": {
|
|
82
|
+
"action": "ui.scroll",
|
|
83
|
+
"test_id": "perps-pro-order-form-size-card",
|
|
84
|
+
"scroll_into_view": true,
|
|
85
|
+
"intent": "Expose the Chase size input for visible entry.",
|
|
86
|
+
"next": "wait-size"
|
|
87
|
+
},
|
|
88
|
+
"wait-size": {
|
|
89
|
+
"action": "ui.wait_for",
|
|
90
|
+
"test_id": "perps-pro-order-form-size-card",
|
|
91
|
+
"expected": "visible",
|
|
92
|
+
"timeout_ms": 10000,
|
|
93
|
+
"intent": "Confirm the Chase size card is visible.",
|
|
94
|
+
"next": "set-size"
|
|
95
|
+
},
|
|
96
|
+
"set-size": {
|
|
97
|
+
"action": "ui.set_input",
|
|
98
|
+
"test_id": "perps-pro-order-form-size-input",
|
|
99
|
+
"value": "{{params.notional}}",
|
|
100
|
+
"intent": "Enter the requested USD notional.",
|
|
101
|
+
"next": "set-distance"
|
|
102
|
+
},
|
|
103
|
+
"set-distance": {
|
|
104
|
+
"action": "ui.set_input",
|
|
105
|
+
"test_id": "perps-pro-chase-max-distance-field",
|
|
106
|
+
"value": "{{params.max_distance}}",
|
|
107
|
+
"intent": "Bound Chase repricing to the requested distance.",
|
|
108
|
+
"next": "position-submit"
|
|
109
|
+
},
|
|
110
|
+
"position-submit": {
|
|
111
|
+
"action": "ui.scroll",
|
|
112
|
+
"test_id": "perps-pro-order-form-summary-fees",
|
|
113
|
+
"scroll_into_view": true,
|
|
114
|
+
"intent": "Expose the final Chase fee row directly above submission.",
|
|
115
|
+
"next": "wait-submit"
|
|
116
|
+
},
|
|
117
|
+
"wait-submit": {
|
|
118
|
+
"action": "ui.wait_for",
|
|
119
|
+
"test_id": "perps-pro-order-form-place-order",
|
|
120
|
+
"expected": "visible",
|
|
121
|
+
"timeout_ms": 10000,
|
|
122
|
+
"intent": "Confirm the Chase order can be submitted.",
|
|
123
|
+
"next": "submit"
|
|
124
|
+
},
|
|
125
|
+
"submit": {
|
|
126
|
+
"action": "ui.press",
|
|
127
|
+
"test_id": "perps-pro-order-form-place-order",
|
|
128
|
+
"intent": "Start the Chase session on the selected provider and network.",
|
|
129
|
+
"next": "wait-active-count"
|
|
130
|
+
},
|
|
131
|
+
"wait-active-count": {
|
|
132
|
+
"action": "ui.wait_for",
|
|
133
|
+
"test_id": "perps-pro-chase-active-count-1",
|
|
134
|
+
"expected": "present",
|
|
135
|
+
"timeout_ms": 20000,
|
|
136
|
+
"intent": "Require the form to report one live Chase session after submission.",
|
|
137
|
+
"next": "done"
|
|
138
|
+
},
|
|
139
|
+
"done": {
|
|
140
|
+
"action": "end",
|
|
141
|
+
"status": "pass"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Terminate a Mobile Pro Chase order",
|
|
4
|
+
"description": "Terminates the selected market's primary active Chase session and proves it leaves the active list.",
|
|
5
|
+
"paramsSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"account": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "",
|
|
12
|
+
"description": "Optional exact fixture account name, such as Trading or dev1. Omit it to keep the currently selected account."
|
|
13
|
+
},
|
|
14
|
+
"provider": { "type": "string", "default": "hyperliquid" },
|
|
15
|
+
"network": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["testnet", "mainnet"],
|
|
18
|
+
"default": "testnet",
|
|
19
|
+
"description": "Mainnet termination requires an explicit user request."
|
|
20
|
+
},
|
|
21
|
+
"market": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"default": "BTC"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"workflow": {
|
|
28
|
+
"entry": "prepare",
|
|
29
|
+
"nodes": {
|
|
30
|
+
"prepare": {
|
|
31
|
+
"action": "call",
|
|
32
|
+
"ref": "perps.pro-order-start-state",
|
|
33
|
+
"params": {
|
|
34
|
+
"account": "{{params.account}}",
|
|
35
|
+
"provider": "{{params.provider}}",
|
|
36
|
+
"network": "{{params.network}}",
|
|
37
|
+
"market": "{{params.market}}"
|
|
38
|
+
},
|
|
39
|
+
"intent": "Reach and prove the requested Pro market without changing Chase orders.",
|
|
40
|
+
"next": "position-tab"
|
|
41
|
+
},
|
|
42
|
+
"position-tab": {
|
|
43
|
+
"action": "ui.scroll",
|
|
44
|
+
"test_id": "perps-pro-market-positions-panel-tab-chase",
|
|
45
|
+
"scroll_into_view": true,
|
|
46
|
+
"intent": "Expose the Chase tab for visible termination.",
|
|
47
|
+
"next": "wait-tab"
|
|
48
|
+
},
|
|
49
|
+
"wait-tab": {
|
|
50
|
+
"action": "ui.wait_for",
|
|
51
|
+
"test_id": "perps-pro-market-positions-panel-tab-chase",
|
|
52
|
+
"expected": "visible",
|
|
53
|
+
"timeout_ms": 15000,
|
|
54
|
+
"intent": "Require the Chase tab to be visible before termination.",
|
|
55
|
+
"next": "open-tab"
|
|
56
|
+
},
|
|
57
|
+
"open-tab": {
|
|
58
|
+
"action": "ui.press",
|
|
59
|
+
"test_id": "perps-pro-market-positions-panel-tab-chase",
|
|
60
|
+
"intent": "Open Chase monitoring before termination.",
|
|
61
|
+
"next": "position-terminate"
|
|
62
|
+
},
|
|
63
|
+
"position-terminate": {
|
|
64
|
+
"action": "ui.scroll",
|
|
65
|
+
"test_id": "perps-chase-terminate-active-{{params.market}}",
|
|
66
|
+
"scroll_into_view": true,
|
|
67
|
+
"intent": "Expose the active Chase termination control.",
|
|
68
|
+
"next": "wait-terminate"
|
|
69
|
+
},
|
|
70
|
+
"wait-terminate": {
|
|
71
|
+
"action": "ui.wait_for",
|
|
72
|
+
"test_id": "perps-chase-terminate-active-{{params.market}}",
|
|
73
|
+
"expected": "visible",
|
|
74
|
+
"timeout_ms": 10000,
|
|
75
|
+
"intent": "Require a visible active Chase session to terminate.",
|
|
76
|
+
"next": "terminate"
|
|
77
|
+
},
|
|
78
|
+
"terminate": {
|
|
79
|
+
"action": "ui.press",
|
|
80
|
+
"test_id": "perps-chase-terminate-active-{{params.market}}",
|
|
81
|
+
"intent": "Terminate the active Chase session.",
|
|
82
|
+
"next": "wait-removed"
|
|
83
|
+
},
|
|
84
|
+
"wait-removed": {
|
|
85
|
+
"action": "ui.wait_for",
|
|
86
|
+
"test_id": "perps-chase-status-active-{{params.market}}",
|
|
87
|
+
"expected": "absent",
|
|
88
|
+
"timeout_ms": 20000,
|
|
89
|
+
"intent": "Require the terminated Chase session to leave the active list.",
|
|
90
|
+
"next": "done"
|
|
91
|
+
},
|
|
92
|
+
"done": {
|
|
93
|
+
"action": "end",
|
|
94
|
+
"status": "pass"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Prepare a Mobile Pro advanced-order form",
|
|
4
|
+
"description": "Prepares the current or requested account, cleans only the selected testnet market, and opens the Advanced Pro order picker.",
|
|
5
|
+
"paramsSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"account": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "",
|
|
12
|
+
"description": "Optional exact fixture account name, such as Trading or dev1. Omit it to keep the currently selected account."
|
|
13
|
+
},
|
|
14
|
+
"provider": { "type": "string", "default": "hyperliquid" },
|
|
15
|
+
"network": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["testnet", "mainnet"],
|
|
18
|
+
"default": "testnet",
|
|
19
|
+
"description": "Mainnet requires an explicit user request and preserves existing trading state."
|
|
20
|
+
},
|
|
21
|
+
"market": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"default": "BTC"
|
|
24
|
+
},
|
|
25
|
+
"side": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": ["long", "short"],
|
|
28
|
+
"default": "long"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"workflow": {
|
|
33
|
+
"entry": "ensure-state",
|
|
34
|
+
"nodes": {
|
|
35
|
+
"ensure-state": {
|
|
36
|
+
"action": "call",
|
|
37
|
+
"ref": "perps.pro-order-start-state",
|
|
38
|
+
"params": {
|
|
39
|
+
"account": "{{params.account}}",
|
|
40
|
+
"provider": "{{params.provider}}",
|
|
41
|
+
"network": "{{params.network}}",
|
|
42
|
+
"market": "{{params.market}}",
|
|
43
|
+
"trading_state": "clean_selected_testnet_market"
|
|
44
|
+
},
|
|
45
|
+
"intent": "Reach and prove the requested Pro market before placement setup.",
|
|
46
|
+
"next": "position-side"
|
|
47
|
+
},
|
|
48
|
+
"position-side": {
|
|
49
|
+
"action": "ui.scroll",
|
|
50
|
+
"test_id": "perps-pro-order-form-direction-control",
|
|
51
|
+
"scroll_into_view": true,
|
|
52
|
+
"intent": "Expose the direction control without resetting an already-matching market route.",
|
|
53
|
+
"next": "choose-side"
|
|
54
|
+
},
|
|
55
|
+
"choose-side": {
|
|
56
|
+
"action": "switch",
|
|
57
|
+
"value": "{{params.side}}",
|
|
58
|
+
"equals": "short",
|
|
59
|
+
"cases": {
|
|
60
|
+
"match": "select-short"
|
|
61
|
+
},
|
|
62
|
+
"default": "select-long",
|
|
63
|
+
"intent": "Choose the declared order direction."
|
|
64
|
+
},
|
|
65
|
+
"select-long": {
|
|
66
|
+
"action": "ui.press",
|
|
67
|
+
"test_id": "perps-pro-order-form-direction-long",
|
|
68
|
+
"intent": "Select the long direction explicitly.",
|
|
69
|
+
"next": "open-types"
|
|
70
|
+
},
|
|
71
|
+
"select-short": {
|
|
72
|
+
"action": "ui.press",
|
|
73
|
+
"test_id": "perps-pro-order-form-direction-short",
|
|
74
|
+
"intent": "Select the short direction explicitly.",
|
|
75
|
+
"next": "open-types"
|
|
76
|
+
},
|
|
77
|
+
"open-types": {
|
|
78
|
+
"action": "ui.press",
|
|
79
|
+
"test_id": "perps-pro-order-form-order-type",
|
|
80
|
+
"intent": "Open the order-type picker.",
|
|
81
|
+
"next": "wait-advanced-tab"
|
|
82
|
+
},
|
|
83
|
+
"wait-advanced-tab": {
|
|
84
|
+
"action": "ui.wait_for",
|
|
85
|
+
"test_id": "perps-order-type-tab-advanced",
|
|
86
|
+
"expected": "visible",
|
|
87
|
+
"timeout_ms": 10000,
|
|
88
|
+
"intent": "Require the Advanced tab before selecting it.",
|
|
89
|
+
"next": "open-advanced"
|
|
90
|
+
},
|
|
91
|
+
"open-advanced": {
|
|
92
|
+
"action": "ui.press",
|
|
93
|
+
"test_id": "perps-order-type-tab-advanced",
|
|
94
|
+
"intent": "Open the Advanced order section.",
|
|
95
|
+
"next": "wait-advanced-content"
|
|
96
|
+
},
|
|
97
|
+
"wait-advanced-content": {
|
|
98
|
+
"action": "ui.wait_for",
|
|
99
|
+
"test_id": "perps-order-type-twap",
|
|
100
|
+
"expected": "visible",
|
|
101
|
+
"timeout_ms": 10000,
|
|
102
|
+
"intent": "Prove the Advanced order section is open.",
|
|
103
|
+
"next": "done"
|
|
104
|
+
},
|
|
105
|
+
"done": {
|
|
106
|
+
"action": "end",
|
|
107
|
+
"status": "pass"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Converge Mobile Pro order start state",
|
|
4
|
+
"description": "Idempotently reaches Mobile Pro. An omitted account keeps the current selection; provider, network, and market use the declared smart defaults.",
|
|
5
|
+
"paramsSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"account": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"default": "",
|
|
12
|
+
"description": "Optional exact fixture account name, such as Trading or dev1. Omit it to keep the currently selected account."
|
|
13
|
+
},
|
|
14
|
+
"provider": { "type": "string", "default": "hyperliquid" },
|
|
15
|
+
"network": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["testnet", "mainnet"],
|
|
18
|
+
"default": "testnet"
|
|
19
|
+
},
|
|
20
|
+
"market": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "BTC"
|
|
23
|
+
},
|
|
24
|
+
"trading_state": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["preserve", "clean_selected_testnet_market"],
|
|
27
|
+
"default": "preserve"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"workflow": {
|
|
32
|
+
"entry": "ensure-state",
|
|
33
|
+
"nodes": {
|
|
34
|
+
"ensure-state": {
|
|
35
|
+
"action": "metamask.perps.start_state",
|
|
36
|
+
"account": "{{params.account}}",
|
|
37
|
+
"provider": "{{params.provider}}",
|
|
38
|
+
"network": "{{params.network}}",
|
|
39
|
+
"market": "{{params.market}}",
|
|
40
|
+
"page": "market",
|
|
41
|
+
"market_mode": "pro",
|
|
42
|
+
"trading_state": "{{params.trading_state}}",
|
|
43
|
+
"timeout_ms": 120000,
|
|
44
|
+
"intent": "Reach and prove the requested account, provider, network, market, Pro mode, and trading-state policy.",
|
|
45
|
+
"next": "done"
|
|
46
|
+
},
|
|
47
|
+
"done": {
|
|
48
|
+
"action": "end",
|
|
49
|
+
"status": "pass"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|