@deeeed/metamask-harness 0.38.1 → 0.40.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/adapters/extension/lib/playwright-cdp.cjs +17 -1
  3. package/adapters/extension/sidepanel-toggle.sh +135 -13
  4. package/dist/adapters/mobile/release-artifact.js +65 -0
  5. package/dist/adapters.js +27 -17
  6. package/dist/command-contract.js +10 -2
  7. package/dist/commands/call.js +7 -4
  8. package/dist/commands/launch/index.js +55 -3
  9. package/dist/commands/parse-args.js +6 -0
  10. package/dist/commands/run-engine.js +75 -39
  11. package/dist/funding-execution-context.js +1386 -0
  12. package/dist/live-adapter-contract.js +3 -1
  13. package/dist/metamask-action-validation.js +170 -3
  14. package/dist/mm-harness-cli.js +8 -2
  15. package/dist/recipe-security.js +5 -12
  16. package/dist/runner.js +102 -6
  17. package/docs/RECIPES.md +74 -1
  18. package/docs/RELEASE-QA-CAPABILITY-MAP.md +6 -5
  19. package/library/actions/extension/assets/open_details.mjs +30 -0
  20. package/library/actions/extension/assets/set_token_visibility.mjs +5 -0
  21. package/library/actions/extension/networks/add_chainlist.mjs +4 -0
  22. package/library/actions/extension/networks/add_custom.mjs +4 -0
  23. package/library/actions/extension/networks/custom_network.mjs +48 -1
  24. package/library/actions/extension/perps/assert_visible_consistency.mjs +366 -0
  25. package/library/actions/extension/perps/close_visible_position.mjs +299 -37
  26. package/library/actions/extension/perps/compare_provider_market.mjs +77 -0
  27. package/library/actions/extension/perps/edit_margin.mjs +285 -44
  28. package/library/actions/extension/perps/mutation-receipt.mjs +781 -0
  29. package/library/actions/extension/perps/perps.mjs +1029 -363
  30. package/library/actions/extension/perps/read_funds_confirmation.mjs +126 -13
  31. package/library/actions/extension/perps/read_snapshot.mjs +124 -3
  32. package/library/actions/extension/perps/read_visible_state.mjs +63 -5
  33. package/library/actions/extension/perps/search_markets.mjs +32 -0
  34. package/library/actions/extension/perps/select_activity_filter.mjs +81 -18
  35. package/library/actions/extension/perps/select_market_filter.mjs +48 -4
  36. package/library/actions/extension/perps/set_market_favorite.mjs +6 -1
  37. package/library/actions/extension/perps/update_position_tpsl.mjs +251 -69
  38. package/library/actions/extension/perps/visible-mutation-identity.mjs +164 -0
  39. package/library/actions/extension/platform/cdp.mjs +88 -9
  40. package/library/actions/extension/settings/set_basic_functionality.mjs +35 -7
  41. package/library/actions/extension/swap_bridge/read_visible_state.mjs +2 -6
  42. package/library/actions/extension/swap_bridge/set_amount.mjs +11 -2
  43. package/library/actions/extension/ui/navigate.mjs +45 -5
  44. package/library/actions/extension/wallet/import.mjs +70 -29
  45. package/library/actions/extension/wallet/lock.mjs +62 -5
  46. package/library/actions/extension/wallet/visible-session.mjs +218 -0
  47. package/library/actions/mobile/assets/import_custom_token.mjs +181 -0
  48. package/library/actions/mobile/assets/open_details.mjs +43 -0
  49. package/library/actions/mobile/assets/read_details.mjs +96 -0
  50. package/library/actions/mobile/assets/set_token_visibility.mjs +302 -0
  51. package/library/actions/mobile/assets/verify_sorting.mjs +104 -0
  52. package/library/actions/mobile/networks/add_custom.mjs +125 -0
  53. package/library/actions/mobile/networks/network-management.mjs +132 -0
  54. package/library/actions/mobile/networks/read_visible_state.mjs +43 -0
  55. package/library/actions/mobile/networks/remove_custom.mjs +100 -0
  56. package/library/actions/mobile/perps/search_markets.mjs +46 -0
  57. package/library/actions/mobile/perps/set_market_favorite.mjs +117 -0
  58. package/library/actions/mobile/platform/native-session-name.mjs +14 -0
  59. package/library/actions/mobile/platform/native-session.mjs +59 -0
  60. package/library/actions/mobile/platform/observe-ui.mjs +9 -1
  61. package/library/actions/mobile/swap_bridge/native-session.mjs +10 -45
  62. package/library/actions/mobile/swap_bridge/select_assets.mjs +15 -1
  63. package/library/actions/mobile/swap_bridge/set_amount.mjs +1 -1
  64. package/library/actions/mobile/swap_bridge/set_max_amount.mjs +55 -0
  65. package/library/actions/mobile/swap_bridge/set_slippage.mjs +96 -0
  66. package/library/actions/mobile/swap_bridge/submit_transaction.mjs +141 -0
  67. package/library/actions/mobile/ui/native-navigation.mjs +120 -23
  68. package/library/actions/mobile/ui/navigate.mjs +13 -2
  69. package/library/actions/mobile/wallet/import.mjs +17 -10
  70. package/library/actions/mobile/wallet/lock.mjs +14 -0
  71. package/library/actions/mobile/wallet/native-ui.mjs +88 -15
  72. package/library/actions/shared/perps/visible-state.mjs +33 -11
  73. package/library/actions/shared/swap-bridge/visible-state.mjs +15 -0
  74. package/library/manifests/extension.action-manifest.json +1707 -1241
  75. package/library/manifests/mobile.action-manifest.json +308 -1
  76. package/library/recipes/assets/release-token-details.recipe.json +5 -4
  77. package/library/recipes/assets/release-token-hide-readd.recipe.json +2 -0
  78. package/library/recipes/{assets → extension/assets}/release-custom-network-token-persistence.recipe.json +1 -0
  79. package/library/recipes/{perps → extension/perps}/release-activity-filters.recipe.json +5 -5
  80. package/library/recipes/{perps → extension/perps}/release-funds-flows.recipe.json +3 -3
  81. package/library/recipes/extension/perps/release-live-limit-order.recipe.json +24 -19
  82. package/library/recipes/extension/perps/release-market-filters.recipe.json +97 -0
  83. package/library/recipes/extension/perps/release-order-entry.recipe.json +4 -1
  84. package/library/recipes/extension/perps/release-order-validation.recipe.json +53 -14
  85. package/library/recipes/extension/perps/release-visible-consistency.recipe.json +47 -0
  86. package/library/recipes/extension/perps/source-dev-snapshot-consistency.recipe.json +76 -0
  87. package/library/recipes/mobile/networks/release-custom-network-persistence.recipe.json +90 -0
  88. package/library/recipes/mobile/networks/release-multichain-visibility.recipe.json +58 -0
  89. package/library/recipes/perps/release-live-market-order.recipe.json +30 -13
  90. package/library/recipes/perps/release-market-details.recipe.json +1 -1
  91. package/library/recipes/perps/release-market-search.recipe.json +8 -4
  92. package/library/recipes/perps/release-watchlist.recipe.json +31 -19
  93. package/library/recipes/swap-bridge/release-custom-slippage.recipe.json +5 -13
  94. package/library/recipes/swap-bridge/release-quote.recipe.json +1 -0
  95. package/library/recipes/wallet/import.recipe.json +4 -14
  96. package/package.json +1 -1
  97. package/library/actions/extension/assets/finish_send.mjs +0 -128
  98. package/library/actions/extension/swap_bridge/submit_transaction.mjs +0 -363
  99. package/library/actions/extension/ui/activate_and_observe.mjs +0 -96
  100. package/library/recipes/assets/release-custom-gas-send.recipe.json +0 -88
  101. package/library/recipes/assets/release-native-max-cancel.recipe.json +0 -70
  102. package/library/recipes/assets/release-native-max-send.recipe.json +0 -78
  103. package/library/recipes/assets/release-own-account-send.recipe.json +0 -80
  104. package/library/recipes/extension/runner/action-validation.recipe.json +0 -343
@@ -432,10 +432,10 @@
432
432
  "page": {
433
433
  "type": "string",
434
434
  "enum": [
435
- "back",
436
- "home",
437
- "network",
438
- "perps",
435
+ "back",
436
+ "home",
437
+ "network",
438
+ "perps",
439
439
  "perps-market-list",
440
440
  "perps-market",
441
441
  "perps-activity",
@@ -445,20 +445,20 @@
445
445
  "market": {
446
446
  "type": "string"
447
447
  },
448
- "symbol": {
449
- "type": "string"
450
- },
451
- "network": {
452
- "type": "string"
453
- },
454
- "chain_id": {
455
- "type": "integer",
456
- "minimum": 1
457
- },
458
- "add_if_missing": {
459
- "type": "boolean",
460
- "default": true
461
- },
448
+ "symbol": {
449
+ "type": "string"
450
+ },
451
+ "network": {
452
+ "type": "string"
453
+ },
454
+ "chain_id": {
455
+ "type": "integer",
456
+ "minimum": 1
457
+ },
458
+ "add_if_missing": {
459
+ "type": "boolean",
460
+ "default": true
461
+ },
462
462
  "url": {
463
463
  "type": "string"
464
464
  },
@@ -545,70 +545,6 @@
545
545
  "additionalProperties": false
546
546
  }
547
547
  },
548
- "ui.activate_and_observe": {
549
- "description": "Activate a visible Extension control with a selector-derived trusted pointer and observe the resulting transient UI in the same CDP session.",
550
- "execution_capabilities": [
551
- "host-read-export",
552
- "app-mutation",
553
- "external-mutation"
554
- ],
555
- "schema": {
556
- "type": "object",
557
- "properties": {
558
- "selector": {
559
- "type": "string"
560
- },
561
- "test_id": {
562
- "type": "string"
563
- },
564
- "testID": {
565
- "type": "string"
566
- },
567
- "require_test_ids": {
568
- "type": "array",
569
- "items": {
570
- "type": "string"
571
- },
572
- "maxItems": 100
573
- },
574
- "require_text": {
575
- "type": "array",
576
- "items": {
577
- "type": "string"
578
- },
579
- "maxItems": 100
580
- },
581
- "settle_ms": {
582
- "type": "integer",
583
- "minimum": 0,
584
- "default": 250
585
- },
586
- "timeout_ms": {
587
- "type": "integer",
588
- "minimum": 1,
589
- "default": 10000
590
- },
591
- "max_items": {
592
- "type": "integer",
593
- "minimum": 1,
594
- "default": 100
595
- }
596
- },
597
- "additionalProperties": false
598
- },
599
- "examples": [
600
- {
601
- "action": "ui.activate_and_observe",
602
- "test_id": "perps-balance-dropdown-balance",
603
- "require_test_ids": [
604
- "perps-balance-dropdown-add-funds",
605
- "perps-balance-dropdown-withdraw"
606
- ],
607
- "intent": "Open and prove the transient balance menu.",
608
- "next": "done"
609
- }
610
- ]
611
- },
612
548
  "ui.key_press": {
613
549
  "description": "Send a trusted keyboard press to the currently focused UI element through the UI transport.",
614
550
  "schema": {
@@ -750,24 +686,55 @@
750
686
  "type": "object",
751
687
  "properties": {
752
688
  "target": {
753
- "type": ["string", "object"],
689
+ "type": [
690
+ "string",
691
+ "object"
692
+ ],
754
693
  "properties": {
755
- "x": { "type": "number" },
756
- "y": { "type": "number" }
694
+ "x": {
695
+ "type": "number"
696
+ },
697
+ "y": {
698
+ "type": "number"
699
+ }
757
700
  },
758
- "required": ["x", "y"],
701
+ "required": [
702
+ "x",
703
+ "y"
704
+ ],
759
705
  "additionalProperties": false
760
706
  },
761
707
  "direction": {
762
708
  "type": "string",
763
- "enum": ["up", "down", "left", "right"]
709
+ "enum": [
710
+ "up",
711
+ "down",
712
+ "left",
713
+ "right"
714
+ ]
715
+ },
716
+ "distance": {
717
+ "type": "number",
718
+ "minimum": 1
719
+ },
720
+ "duration_ms": {
721
+ "type": "integer",
722
+ "minimum": 1
764
723
  },
765
- "distance": { "type": "number", "minimum": 1 },
766
- "duration_ms": { "type": "integer", "minimum": 1 },
767
- "timeout_ms": { "type": "integer", "minimum": 1 },
768
- "settle": { "type": "boolean" }
724
+ "timeout_ms": {
725
+ "type": "integer",
726
+ "minimum": 1
727
+ },
728
+ "settle": {
729
+ "type": "boolean"
730
+ }
769
731
  },
770
- "required": ["target", "direction", "distance", "duration_ms"],
732
+ "required": [
733
+ "target",
734
+ "direction",
735
+ "distance",
736
+ "duration_ms"
737
+ ],
771
738
  "additionalProperties": false
772
739
  },
773
740
  "examples": [
@@ -788,12 +755,22 @@
788
755
  "type": "object",
789
756
  "properties": {
790
757
  "target": {
791
- "type": ["string", "object"],
758
+ "type": [
759
+ "string",
760
+ "object"
761
+ ],
792
762
  "properties": {
793
- "x": { "type": "number" },
794
- "y": { "type": "number" }
763
+ "x": {
764
+ "type": "number"
765
+ },
766
+ "y": {
767
+ "type": "number"
768
+ }
795
769
  },
796
- "required": ["x", "y"],
770
+ "required": [
771
+ "x",
772
+ "y"
773
+ ],
797
774
  "additionalProperties": false
798
775
  },
799
776
  "path": {
@@ -802,34 +779,68 @@
802
779
  "items": {
803
780
  "type": "object",
804
781
  "properties": {
805
- "x": { "type": "number" },
806
- "y": { "type": "number" }
782
+ "x": {
783
+ "type": "number"
784
+ },
785
+ "y": {
786
+ "type": "number"
787
+ }
807
788
  },
808
- "required": ["x", "y"],
789
+ "required": [
790
+ "x",
791
+ "y"
792
+ ],
809
793
  "additionalProperties": false
810
794
  }
811
795
  },
812
796
  "delta": {
813
797
  "type": "object",
814
798
  "properties": {
815
- "x": { "type": "number" },
816
- "y": { "type": "number" }
799
+ "x": {
800
+ "type": "number"
801
+ },
802
+ "y": {
803
+ "type": "number"
804
+ }
817
805
  },
818
- "required": ["x", "y"],
806
+ "required": [
807
+ "x",
808
+ "y"
809
+ ],
819
810
  "additionalProperties": false
820
811
  },
821
- "duration_ms": { "type": "integer", "minimum": 1 },
822
- "timeout_ms": { "type": "integer", "minimum": 1 },
823
- "settle": { "type": "boolean" }
812
+ "duration_ms": {
813
+ "type": "integer",
814
+ "minimum": 1
815
+ },
816
+ "timeout_ms": {
817
+ "type": "integer",
818
+ "minimum": 1
819
+ },
820
+ "settle": {
821
+ "type": "boolean"
822
+ }
824
823
  },
825
- "required": ["target", "duration_ms"],
824
+ "required": [
825
+ "target",
826
+ "duration_ms"
827
+ ],
826
828
  "additionalProperties": false
827
829
  },
828
830
  "examples": [
829
831
  {
830
832
  "action": "ui.pan",
831
833
  "target": "example-surface",
832
- "path": [{ "x": 40, "y": 10 }, { "x": 80, "y": 20 }],
834
+ "path": [
835
+ {
836
+ "x": 40,
837
+ "y": 10
838
+ },
839
+ {
840
+ "x": 80,
841
+ "y": 20
842
+ }
843
+ ],
833
844
  "duration_ms": 400,
834
845
  "intent": "Pan through the requested pointer path.",
835
846
  "next": "done"
@@ -842,12 +853,22 @@
842
853
  "type": "object",
843
854
  "properties": {
844
855
  "target": {
845
- "type": ["string", "object"],
856
+ "type": [
857
+ "string",
858
+ "object"
859
+ ],
846
860
  "properties": {
847
- "x": { "type": "number" },
848
- "y": { "type": "number" }
861
+ "x": {
862
+ "type": "number"
863
+ },
864
+ "y": {
865
+ "type": "number"
866
+ }
849
867
  },
850
- "required": ["x", "y"],
868
+ "required": [
869
+ "x",
870
+ "y"
871
+ ],
851
872
  "additionalProperties": false
852
873
  },
853
874
  "path": {
@@ -856,34 +877,62 @@
856
877
  "items": {
857
878
  "type": "object",
858
879
  "properties": {
859
- "x": { "type": "number" },
860
- "y": { "type": "number" }
880
+ "x": {
881
+ "type": "number"
882
+ },
883
+ "y": {
884
+ "type": "number"
885
+ }
861
886
  },
862
- "required": ["x", "y"],
887
+ "required": [
888
+ "x",
889
+ "y"
890
+ ],
863
891
  "additionalProperties": false
864
892
  }
865
893
  },
866
894
  "delta": {
867
895
  "type": "object",
868
896
  "properties": {
869
- "x": { "type": "number" },
870
- "y": { "type": "number" }
897
+ "x": {
898
+ "type": "number"
899
+ },
900
+ "y": {
901
+ "type": "number"
902
+ }
871
903
  },
872
- "required": ["x", "y"],
904
+ "required": [
905
+ "x",
906
+ "y"
907
+ ],
873
908
  "additionalProperties": false
874
909
  },
875
- "duration_ms": { "type": "integer", "minimum": 1 },
876
- "timeout_ms": { "type": "integer", "minimum": 1 },
877
- "settle": { "type": "boolean" }
910
+ "duration_ms": {
911
+ "type": "integer",
912
+ "minimum": 1
913
+ },
914
+ "timeout_ms": {
915
+ "type": "integer",
916
+ "minimum": 1
917
+ },
918
+ "settle": {
919
+ "type": "boolean"
920
+ }
878
921
  },
879
- "required": ["target", "duration_ms"],
922
+ "required": [
923
+ "target",
924
+ "duration_ms"
925
+ ],
880
926
  "additionalProperties": false
881
927
  },
882
928
  "examples": [
883
929
  {
884
930
  "action": "ui.drag",
885
931
  "target": "example-slider",
886
- "delta": { "x": 120, "y": 0 },
932
+ "delta": {
933
+ "x": 120,
934
+ "y": 0
935
+ },
887
936
  "duration_ms": 500,
888
937
  "intent": "Drag the requested control to a new value.",
889
938
  "next": "done"
@@ -896,19 +945,40 @@
896
945
  "type": "object",
897
946
  "properties": {
898
947
  "target": {
899
- "type": ["string", "object"],
948
+ "type": [
949
+ "string",
950
+ "object"
951
+ ],
900
952
  "properties": {
901
- "x": { "type": "number" },
902
- "y": { "type": "number" }
953
+ "x": {
954
+ "type": "number"
955
+ },
956
+ "y": {
957
+ "type": "number"
958
+ }
903
959
  },
904
- "required": ["x", "y"],
960
+ "required": [
961
+ "x",
962
+ "y"
963
+ ],
905
964
  "additionalProperties": false
906
965
  },
907
- "hold_ms": { "type": "integer", "minimum": 1 },
908
- "timeout_ms": { "type": "integer", "minimum": 1 },
909
- "settle": { "type": "boolean" }
966
+ "hold_ms": {
967
+ "type": "integer",
968
+ "minimum": 1
969
+ },
970
+ "timeout_ms": {
971
+ "type": "integer",
972
+ "minimum": 1
973
+ },
974
+ "settle": {
975
+ "type": "boolean"
976
+ }
910
977
  },
911
- "required": ["target", "hold_ms"],
978
+ "required": [
979
+ "target",
980
+ "hold_ms"
981
+ ],
912
982
  "additionalProperties": false
913
983
  },
914
984
  "examples": [
@@ -1025,10 +1095,18 @@
1025
1095
  "schema": {
1026
1096
  "type": "object",
1027
1097
  "properties": {
1028
- "path": { "type": "string" },
1029
- "label": { "type": "string" },
1030
- "category": { "type": "string" },
1031
- "timeout_ms": { "type": "number" }
1098
+ "path": {
1099
+ "type": "string"
1100
+ },
1101
+ "label": {
1102
+ "type": "string"
1103
+ },
1104
+ "category": {
1105
+ "type": "string"
1106
+ },
1107
+ "timeout_ms": {
1108
+ "type": "number"
1109
+ }
1032
1110
  },
1033
1111
  "additionalProperties": false
1034
1112
  },
@@ -1186,7 +1264,11 @@
1186
1264
  "properties": {
1187
1265
  "credential_source": {
1188
1266
  "type": "string",
1189
- "enum": ["auto", "environment", "fixture"]
1267
+ "enum": [
1268
+ "auto",
1269
+ "environment",
1270
+ "fixture"
1271
+ ]
1190
1272
  },
1191
1273
  "srp_env": {
1192
1274
  "type": "string"
@@ -1237,17 +1319,25 @@
1237
1319
  ]
1238
1320
  },
1239
1321
  "metamask.wallet.import": {
1240
- "description": "Make the wallet ready by reusing a fixture-backed profile or importing the primary mnemonic through visible onboarding UI.",
1322
+ "description": "Make the wallet ready through visible onboarding or prove and select the derived account in an existing visible session when method=ui.",
1241
1323
  "schema": {
1242
1324
  "type": "object",
1243
1325
  "properties": {
1244
1326
  "method": {
1245
1327
  "type": "string",
1246
- "enum": ["auto", "profile", "ui"]
1328
+ "enum": [
1329
+ "auto",
1330
+ "profile",
1331
+ "ui"
1332
+ ]
1247
1333
  },
1248
1334
  "credential_source": {
1249
1335
  "type": "string",
1250
- "enum": ["auto", "environment", "fixture"]
1336
+ "enum": [
1337
+ "auto",
1338
+ "environment",
1339
+ "fixture"
1340
+ ]
1251
1341
  },
1252
1342
  "srp_env": {
1253
1343
  "type": "string"
@@ -1279,7 +1369,14 @@
1279
1369
  "type": "array",
1280
1370
  "items": {
1281
1371
  "type": "string",
1282
- "enum": ["swap_tokens", "trade_perpetuals", "prediction_markets", "send_receive_crypto", "earn_and_spend", "use_other_crypto_apps"]
1372
+ "enum": [
1373
+ "swap_tokens",
1374
+ "trade_perpetuals",
1375
+ "prediction_markets",
1376
+ "send_receive_crypto",
1377
+ "earn_and_spend",
1378
+ "use_other_crypto_apps"
1379
+ ]
1283
1380
  },
1284
1381
  "default": [],
1285
1382
  "description": "Mobile-only onboarding interests; ignored when empty on Extension."
@@ -1433,18 +1530,54 @@
1433
1530
  "schema": {
1434
1531
  "type": "object",
1435
1532
  "properties": {
1436
- "screen_hash": { "type": "string" },
1437
- "screen_test_id": { "type": "string" },
1438
- "return_hash": { "type": "string", "default": "#/" },
1439
- "cycles": { "type": "integer", "minimum": 2, "default": 8 },
1440
- "max_nodes_per_cycle": { "type": "number", "default": 2 },
1441
- "max_listeners_per_cycle": { "type": "number", "default": 4 },
1442
- "settle_ms": { "type": "integer", "minimum": 0, "default": 1500 },
1443
- "gc_settle_ms": { "type": "integer", "minimum": 0, "default": 300 },
1444
- "screen_timeout_ms": { "type": "integer", "minimum": 1, "default": 15000 },
1445
- "timeout_ms": { "type": "integer", "minimum": 1, "default": 400000 }
1533
+ "screen_hash": {
1534
+ "type": "string"
1535
+ },
1536
+ "screen_test_id": {
1537
+ "type": "string"
1538
+ },
1539
+ "return_hash": {
1540
+ "type": "string",
1541
+ "default": "#/"
1542
+ },
1543
+ "cycles": {
1544
+ "type": "integer",
1545
+ "minimum": 2,
1546
+ "default": 8
1547
+ },
1548
+ "max_nodes_per_cycle": {
1549
+ "type": "number",
1550
+ "default": 2
1551
+ },
1552
+ "max_listeners_per_cycle": {
1553
+ "type": "number",
1554
+ "default": 4
1555
+ },
1556
+ "settle_ms": {
1557
+ "type": "integer",
1558
+ "minimum": 0,
1559
+ "default": 1500
1560
+ },
1561
+ "gc_settle_ms": {
1562
+ "type": "integer",
1563
+ "minimum": 0,
1564
+ "default": 300
1565
+ },
1566
+ "screen_timeout_ms": {
1567
+ "type": "integer",
1568
+ "minimum": 1,
1569
+ "default": 15000
1570
+ },
1571
+ "timeout_ms": {
1572
+ "type": "integer",
1573
+ "minimum": 1,
1574
+ "default": 400000
1575
+ }
1446
1576
  },
1447
- "required": ["screen_hash", "screen_test_id"],
1577
+ "required": [
1578
+ "screen_hash",
1579
+ "screen_test_id"
1580
+ ],
1448
1581
  "additionalProperties": false
1449
1582
  },
1450
1583
  "examples": [
@@ -1467,17 +1600,50 @@
1467
1600
  "schema": {
1468
1601
  "type": "object",
1469
1602
  "properties": {
1470
- "screen_hash": { "type": "string" },
1471
- "screen_test_id": { "type": "string" },
1472
- "return_hash": { "type": "string", "default": "#/" },
1473
- "cycles": { "type": "integer", "minimum": 2, "default": 5 },
1474
- "max_detached_growth": { "type": "number", "default": 50 },
1475
- "settle_ms": { "type": "integer", "minimum": 0, "default": 1500 },
1476
- "gc_settle_ms": { "type": "integer", "minimum": 0, "default": 300 },
1477
- "screen_timeout_ms": { "type": "integer", "minimum": 1, "default": 15000 },
1478
- "timeout_ms": { "type": "integer", "minimum": 1, "default": 400000 }
1603
+ "screen_hash": {
1604
+ "type": "string"
1605
+ },
1606
+ "screen_test_id": {
1607
+ "type": "string"
1608
+ },
1609
+ "return_hash": {
1610
+ "type": "string",
1611
+ "default": "#/"
1612
+ },
1613
+ "cycles": {
1614
+ "type": "integer",
1615
+ "minimum": 2,
1616
+ "default": 5
1617
+ },
1618
+ "max_detached_growth": {
1619
+ "type": "number",
1620
+ "default": 50
1621
+ },
1622
+ "settle_ms": {
1623
+ "type": "integer",
1624
+ "minimum": 0,
1625
+ "default": 1500
1626
+ },
1627
+ "gc_settle_ms": {
1628
+ "type": "integer",
1629
+ "minimum": 0,
1630
+ "default": 300
1631
+ },
1632
+ "screen_timeout_ms": {
1633
+ "type": "integer",
1634
+ "minimum": 1,
1635
+ "default": 15000
1636
+ },
1637
+ "timeout_ms": {
1638
+ "type": "integer",
1639
+ "minimum": 1,
1640
+ "default": 400000
1641
+ }
1479
1642
  },
1480
- "required": ["screen_hash", "screen_test_id"],
1643
+ "required": [
1644
+ "screen_hash",
1645
+ "screen_test_id"
1646
+ ],
1481
1647
  "additionalProperties": false
1482
1648
  },
1483
1649
  "examples": [
@@ -1499,22 +1665,59 @@
1499
1665
  "schema": {
1500
1666
  "type": "object",
1501
1667
  "properties": {
1502
- "screen_hash": { "type": "string" },
1503
- "screen_test_id": { "type": "string" },
1504
- "return_hash": { "type": "string", "default": "#/" },
1505
- "rounds": { "type": "integer", "minimum": 2, "default": 8 },
1506
- "round_duration_ms": { "type": "integer", "minimum": 1, "default": 10000 },
1507
- "max_attributable_listeners_per_cycle": { "type": "number", "default": 2 },
1508
- "settle_ms": { "type": "integer", "minimum": 0, "default": 1500 },
1509
- "gc_settle_ms": { "type": "integer", "minimum": 0, "default": 300 },
1510
- "screen_timeout_ms": { "type": "integer", "minimum": 1, "default": 15000 },
1511
- "timeout_ms": { "type": "integer", "minimum": 1, "default": 400000 }
1512
- },
1513
- "required": ["screen_hash", "screen_test_id"],
1514
- "additionalProperties": false
1515
- },
1516
- "examples": [
1517
- {
1668
+ "screen_hash": {
1669
+ "type": "string"
1670
+ },
1671
+ "screen_test_id": {
1672
+ "type": "string"
1673
+ },
1674
+ "return_hash": {
1675
+ "type": "string",
1676
+ "default": "#/"
1677
+ },
1678
+ "rounds": {
1679
+ "type": "integer",
1680
+ "minimum": 2,
1681
+ "default": 8
1682
+ },
1683
+ "round_duration_ms": {
1684
+ "type": "integer",
1685
+ "minimum": 1,
1686
+ "default": 10000
1687
+ },
1688
+ "max_attributable_listeners_per_cycle": {
1689
+ "type": "number",
1690
+ "default": 2
1691
+ },
1692
+ "settle_ms": {
1693
+ "type": "integer",
1694
+ "minimum": 0,
1695
+ "default": 1500
1696
+ },
1697
+ "gc_settle_ms": {
1698
+ "type": "integer",
1699
+ "minimum": 0,
1700
+ "default": 300
1701
+ },
1702
+ "screen_timeout_ms": {
1703
+ "type": "integer",
1704
+ "minimum": 1,
1705
+ "default": 15000
1706
+ },
1707
+ "timeout_ms": {
1708
+ "type": "integer",
1709
+ "minimum": 1,
1710
+ "default": 400000
1711
+ }
1712
+ },
1713
+ "required": [
1714
+ "screen_hash",
1715
+ "screen_test_id"
1716
+ ],
1717
+ "additionalProperties": false
1718
+ },
1719
+ "examples": [
1720
+ {
1518
1721
  "action": "metamask.performance.compare_idle_navigation_memory",
1519
1722
  "screen_hash": "#/settings",
1520
1723
  "screen_test_id": "settings-tab-bar-grouped",
@@ -1550,7 +1753,9 @@
1550
1753
  },
1551
1754
  "require_symbols": {
1552
1755
  "type": "array",
1553
- "items": { "type": "string" },
1756
+ "items": {
1757
+ "type": "string"
1758
+ },
1554
1759
  "maxItems": 50
1555
1760
  },
1556
1761
  "require_fiat": {
@@ -1573,7 +1778,10 @@
1573
1778
  {
1574
1779
  "action": "metamask.assets.read_visible_state",
1575
1780
  "minimum_asset_count": 2,
1576
- "require_symbols": ["USDC", "BNB"],
1781
+ "require_symbols": [
1782
+ "USDC",
1783
+ "BNB"
1784
+ ],
1577
1785
  "require_fiat": true,
1578
1786
  "require_price_change_styling": true,
1579
1787
  "minimum_price_change_count": 1,
@@ -1582,16 +1790,62 @@
1582
1790
  "next": "done"
1583
1791
  }
1584
1792
  ],
1585
- "execution_capabilities": ["host-read-export"]
1793
+ "execution_capabilities": [
1794
+ "host-read-export"
1795
+ ]
1796
+ },
1797
+ "metamask.assets.open_details": {
1798
+ "description": "Open one visible Extension asset by symbol.",
1799
+ "schema": {
1800
+ "type": "object",
1801
+ "properties": {
1802
+ "symbol": {
1803
+ "type": "string"
1804
+ },
1805
+ "timeout_ms": {
1806
+ "type": "integer",
1807
+ "minimum": 1000,
1808
+ "default": 30000
1809
+ }
1810
+ },
1811
+ "required": [
1812
+ "symbol"
1813
+ ],
1814
+ "additionalProperties": false
1815
+ },
1816
+ "examples": [
1817
+ {
1818
+ "action": "metamask.assets.open_details",
1819
+ "symbol": "ETH",
1820
+ "intent": "Open the funded ETH details",
1821
+ "next": "done"
1822
+ }
1823
+ ],
1824
+ "execution_capabilities": [
1825
+ "app-mutation"
1826
+ ]
1586
1827
  },
1587
1828
  "metamask.assets.read_details": {
1588
1829
  "description": "Read and assert the current Extension asset details page through visible UI.",
1589
1830
  "schema": {
1590
1831
  "type": "object",
1591
1832
  "properties": {
1592
- "expected_symbol": { "type": "string" },
1593
- "require_chart": { "type": "boolean", "default": false },
1594
- "require_market_cap": { "type": "boolean", "default": false }
1833
+ "expected_symbol": {
1834
+ "type": "string"
1835
+ },
1836
+ "require_chart": {
1837
+ "type": "boolean",
1838
+ "default": false
1839
+ },
1840
+ "require_market_cap": {
1841
+ "type": "boolean",
1842
+ "default": false
1843
+ },
1844
+ "timeout_ms": {
1845
+ "type": "integer",
1846
+ "minimum": 1000,
1847
+ "default": 30000
1848
+ }
1595
1849
  },
1596
1850
  "additionalProperties": false
1597
1851
  },
@@ -1605,7 +1859,9 @@
1605
1859
  "next": "done"
1606
1860
  }
1607
1861
  ],
1608
- "execution_capabilities": ["host-read-export"]
1862
+ "execution_capabilities": [
1863
+ "host-read-export"
1864
+ ]
1609
1865
  },
1610
1866
  "metamask.assets.verify_sorting": {
1611
1867
  "description": "Select both visible Extension asset sort modes, assert their row order, and restore declining balance.",
@@ -1621,19 +1877,39 @@
1621
1877
  "next": "done"
1622
1878
  }
1623
1879
  ],
1624
- "execution_capabilities": ["app-mutation"]
1880
+ "execution_capabilities": [
1881
+ "app-mutation"
1882
+ ]
1625
1883
  },
1626
1884
  "metamask.assets.set_token_visibility": {
1627
1885
  "description": "Enable or disable one searched Extension token through Manage tokens and verify the home list state.",
1628
1886
  "schema": {
1629
1887
  "type": "object",
1630
1888
  "properties": {
1631
- "query": { "type": "string" },
1632
- "visible": { "type": "boolean" },
1633
- "require_unchanged": { "type": "boolean", "default": false },
1634
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 45000 }
1889
+ "query": {
1890
+ "type": "string"
1891
+ },
1892
+ "visible": {
1893
+ "type": "boolean"
1894
+ },
1895
+ "require_unchanged": {
1896
+ "type": "boolean",
1897
+ "default": false
1898
+ },
1899
+ "require_change": {
1900
+ "type": "boolean",
1901
+ "default": false
1902
+ },
1903
+ "timeout_ms": {
1904
+ "type": "integer",
1905
+ "minimum": 1000,
1906
+ "default": 45000
1907
+ }
1635
1908
  },
1636
- "required": ["query", "visible"],
1909
+ "required": [
1910
+ "query",
1911
+ "visible"
1912
+ ],
1637
1913
  "additionalProperties": false
1638
1914
  },
1639
1915
  "examples": [
@@ -1645,14 +1921,20 @@
1645
1921
  "next": "done"
1646
1922
  }
1647
1923
  ],
1648
- "execution_capabilities": ["app-mutation"]
1924
+ "execution_capabilities": [
1925
+ "app-mutation"
1926
+ ]
1649
1927
  },
1650
1928
  "metamask.wallet.lock": {
1651
1929
  "description": "Lock the Extension wallet through the visible global menu and prove the unlock page appears.",
1652
1930
  "schema": {
1653
1931
  "type": "object",
1654
1932
  "properties": {
1655
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 15000 }
1933
+ "timeout_ms": {
1934
+ "type": "integer",
1935
+ "minimum": 1000,
1936
+ "default": 15000
1937
+ }
1656
1938
  },
1657
1939
  "additionalProperties": false
1658
1940
  },
@@ -1663,21 +1945,44 @@
1663
1945
  "next": "done"
1664
1946
  }
1665
1947
  ],
1666
- "execution_capabilities": ["app-mutation"]
1948
+ "execution_capabilities": [
1949
+ "app-mutation"
1950
+ ]
1667
1951
  },
1668
1952
  "metamask.assets.import_custom_token": {
1669
1953
  "description": "Import one ERC-20 on a selected Extension network through the custom-token form and verify its row.",
1670
1954
  "schema": {
1671
1955
  "type": "object",
1672
1956
  "properties": {
1673
- "network": { "type": "string" },
1674
- "chain_id": { "type": "integer", "minimum": 1 },
1675
- "address": { "type": "string" },
1676
- "expected_symbol": { "type": "string" },
1677
- "decimals": { "type": "integer", "minimum": 0 },
1678
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
1957
+ "network": {
1958
+ "type": "string"
1959
+ },
1960
+ "chain_id": {
1961
+ "type": "integer",
1962
+ "minimum": 1
1963
+ },
1964
+ "address": {
1965
+ "type": "string"
1966
+ },
1967
+ "expected_symbol": {
1968
+ "type": "string"
1969
+ },
1970
+ "decimals": {
1971
+ "type": "integer",
1972
+ "minimum": 0
1973
+ },
1974
+ "timeout_ms": {
1975
+ "type": "integer",
1976
+ "minimum": 1000,
1977
+ "default": 60000
1978
+ }
1679
1979
  },
1680
- "required": ["network", "chain_id", "address", "expected_symbol"],
1980
+ "required": [
1981
+ "network",
1982
+ "chain_id",
1983
+ "address",
1984
+ "expected_symbol"
1985
+ ],
1681
1986
  "additionalProperties": false
1682
1987
  },
1683
1988
  "examples": [
@@ -1692,20 +1997,41 @@
1692
1997
  "next": "done"
1693
1998
  }
1694
1999
  ],
1695
- "execution_capabilities": ["app-mutation"]
2000
+ "execution_capabilities": [
2001
+ "app-mutation"
2002
+ ]
1696
2003
  },
1697
2004
  "metamask.assets.prepare_send": {
1698
2005
  "description": "Prepare a wallet-initiated EVM asset send through visible UI without advancing to confirmation.",
1699
2006
  "schema": {
1700
2007
  "type": "object",
1701
2008
  "properties": {
1702
- "symbol": { "type": "string" },
1703
- "recipient": { "type": "string" },
1704
- "amount": { "type": ["string", "number"] },
1705
- "max": { "type": "boolean", "default": false },
1706
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
2009
+ "symbol": {
2010
+ "type": "string"
2011
+ },
2012
+ "recipient": {
2013
+ "type": "string"
2014
+ },
2015
+ "amount": {
2016
+ "type": [
2017
+ "string",
2018
+ "number"
2019
+ ]
2020
+ },
2021
+ "max": {
2022
+ "type": "boolean",
2023
+ "default": false
2024
+ },
2025
+ "timeout_ms": {
2026
+ "type": "integer",
2027
+ "minimum": 1000,
2028
+ "default": 30000
2029
+ }
1707
2030
  },
1708
- "required": ["symbol", "recipient"],
2031
+ "required": [
2032
+ "symbol",
2033
+ "recipient"
2034
+ ],
1709
2035
  "additionalProperties": false
1710
2036
  },
1711
2037
  "examples": [
@@ -1718,14 +2044,20 @@
1718
2044
  "next": "done"
1719
2045
  }
1720
2046
  ],
1721
- "execution_capabilities": ["app-mutation"]
2047
+ "execution_capabilities": [
2048
+ "app-mutation"
2049
+ ]
1722
2050
  },
1723
2051
  "metamask.assets.review_send": {
1724
2052
  "description": "Advance a prepared Extension send to confirmation and prove its visible network fee.",
1725
2053
  "schema": {
1726
2054
  "type": "object",
1727
2055
  "properties": {
1728
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
2056
+ "timeout_ms": {
2057
+ "type": "integer",
2058
+ "minimum": 1000,
2059
+ "default": 30000
2060
+ }
1729
2061
  },
1730
2062
  "additionalProperties": false
1731
2063
  },
@@ -1736,46 +2068,30 @@
1736
2068
  "next": "done"
1737
2069
  }
1738
2070
  ],
1739
- "execution_capabilities": ["app-mutation"]
1740
- },
1741
- "metamask.assets.finish_send": {
1742
- "description": "Confirm or cancel a reviewed Extension send, requiring explicit live consent for confirmation and proving confirmed Activity details.",
1743
- "schema": {
1744
- "type": "object",
1745
- "properties": {
1746
- "decision": { "type": "string", "enum": ["confirm", "cancel"] },
1747
- "symbol": { "type": "string" },
1748
- "amount": { "type": ["string", "number"] },
1749
- "confirm_live": { "type": "boolean", "default": false },
1750
- "resume_submitted": { "type": "boolean", "default": false },
1751
- "transaction_hash": { "type": "string" },
1752
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 120000 }
1753
- },
1754
- "required": ["decision", "symbol", "amount"],
1755
- "additionalProperties": false
1756
- },
1757
- "examples": [
1758
- {
1759
- "action": "metamask.assets.finish_send",
1760
- "decision": "confirm",
1761
- "symbol": "USDC",
1762
- "amount": "0.01",
1763
- "confirm_live": true,
1764
- "intent": "Confirm the authorized tiny send and prove final Activity state",
1765
- "next": "done"
1766
- }
1767
- ],
1768
- "execution_capabilities": ["app-mutation", "external-mutation"]
2071
+ "execution_capabilities": [
2072
+ "app-mutation"
2073
+ ]
1769
2074
  },
1770
2075
  "metamask.assets.set_custom_gas": {
1771
2076
  "description": "Set a custom EVM gas limit on the current Extension send confirmation through visible controls.",
1772
2077
  "schema": {
1773
2078
  "type": "object",
1774
2079
  "properties": {
1775
- "gas_limit": { "type": ["string", "number"] },
1776
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
2080
+ "gas_limit": {
2081
+ "type": [
2082
+ "string",
2083
+ "number"
2084
+ ]
2085
+ },
2086
+ "timeout_ms": {
2087
+ "type": "integer",
2088
+ "minimum": 1000,
2089
+ "default": 30000
2090
+ }
1777
2091
  },
1778
- "required": ["gas_limit"],
2092
+ "required": [
2093
+ "gas_limit"
2094
+ ],
1779
2095
  "additionalProperties": false
1780
2096
  },
1781
2097
  "examples": [
@@ -1786,15 +2102,27 @@
1786
2102
  "next": "done"
1787
2103
  }
1788
2104
  ],
1789
- "execution_capabilities": ["app-mutation"]
2105
+ "execution_capabilities": [
2106
+ "app-mutation"
2107
+ ]
1790
2108
  },
1791
2109
  "metamask.assets.select_network_scope": {
1792
2110
  "description": "Select the all-networks Extension asset scope through the visible network filter.",
1793
2111
  "schema": {
1794
2112
  "type": "object",
1795
2113
  "properties": {
1796
- "scope": { "type": "string", "enum": ["all"], "default": "all" },
1797
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
2114
+ "scope": {
2115
+ "type": "string",
2116
+ "enum": [
2117
+ "all"
2118
+ ],
2119
+ "default": "all"
2120
+ },
2121
+ "timeout_ms": {
2122
+ "type": "integer",
2123
+ "minimum": 1000,
2124
+ "default": 30000
2125
+ }
1798
2126
  },
1799
2127
  "additionalProperties": false
1800
2128
  },
@@ -1806,25 +2134,66 @@
1806
2134
  "next": "done"
1807
2135
  }
1808
2136
  ],
1809
- "execution_capabilities": ["app-mutation"]
2137
+ "execution_capabilities": [
2138
+ "app-mutation"
2139
+ ]
1810
2140
  },
1811
2141
  "metamask.networks.read_visible_state": {
1812
2142
  "description": "Read one selected Extension network and prove its visible balance rows remain stable across a bounded settle window.",
1813
2143
  "schema": {
1814
2144
  "type": "object",
1815
2145
  "properties": {
1816
- "network": { "type": "string" },
1817
- "chain_id": { "type": "integer", "minimum": 1 },
1818
- "settle_ms": { "type": "integer", "minimum": 0, "default": 0 },
1819
- "minimum_asset_count": { "type": "integer", "minimum": 0, "default": 0 },
1820
- "minimum_price_change_count": { "type": "integer", "minimum": 0, "default": 0 },
1821
- "minimum_without_price_change_count": { "type": "integer", "minimum": 0, "default": 0 },
1822
- "require_symbols": { "type": "array", "items": { "type": "string" }, "maxItems": 50 },
1823
- "require_fiat": { "type": "boolean", "default": false },
1824
- "require_price_change_styling": { "type": "boolean", "default": false },
1825
- "max_items": { "type": "integer", "minimum": 1, "default": 100 }
2146
+ "network": {
2147
+ "type": "string"
2148
+ },
2149
+ "chain_id": {
2150
+ "type": "integer",
2151
+ "minimum": 1
2152
+ },
2153
+ "settle_ms": {
2154
+ "type": "integer",
2155
+ "minimum": 0,
2156
+ "default": 0
2157
+ },
2158
+ "minimum_asset_count": {
2159
+ "type": "integer",
2160
+ "minimum": 0,
2161
+ "default": 0
2162
+ },
2163
+ "minimum_price_change_count": {
2164
+ "type": "integer",
2165
+ "minimum": 0,
2166
+ "default": 0
2167
+ },
2168
+ "minimum_without_price_change_count": {
2169
+ "type": "integer",
2170
+ "minimum": 0,
2171
+ "default": 0
2172
+ },
2173
+ "require_symbols": {
2174
+ "type": "array",
2175
+ "items": {
2176
+ "type": "string"
2177
+ },
2178
+ "maxItems": 50
2179
+ },
2180
+ "require_fiat": {
2181
+ "type": "boolean",
2182
+ "default": false
2183
+ },
2184
+ "require_price_change_styling": {
2185
+ "type": "boolean",
2186
+ "default": false
2187
+ },
2188
+ "max_items": {
2189
+ "type": "integer",
2190
+ "minimum": 1,
2191
+ "default": 100
2192
+ }
1826
2193
  },
1827
- "required": ["network"],
2194
+ "required": [
2195
+ "network"
2196
+ ],
1828
2197
  "additionalProperties": false
1829
2198
  },
1830
2199
  "examples": [
@@ -1832,98 +2201,189 @@
1832
2201
  "action": "metamask.networks.read_visible_state",
1833
2202
  "network": "HyperEVM",
1834
2203
  "chain_id": 999,
1835
- "require_symbols": ["HYPE"],
2204
+ "require_symbols": [
2205
+ "HYPE"
2206
+ ],
1836
2207
  "settle_ms": 30000,
1837
2208
  "intent": "Assert the selected custom-network balance remains visible",
1838
2209
  "next": "done"
1839
2210
  }
1840
2211
  ],
1841
- "execution_capabilities": ["host-read-export"]
2212
+ "execution_capabilities": [
2213
+ "host-read-export"
2214
+ ]
1842
2215
  },
1843
2216
  "metamask.networks.add_custom": {
1844
2217
  "description": "Add or select one custom Extension network through visible network management controls.",
1845
2218
  "schema": {
1846
2219
  "type": "object",
1847
2220
  "properties": {
1848
- "network": { "type": "string" },
1849
- "rpc_url": { "type": "string" },
1850
- "chain_id": { "type": "integer", "minimum": 1 },
1851
- "symbol": { "type": "string" },
1852
- "explorer_url": { "type": "string" },
1853
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
2221
+ "network": {
2222
+ "type": "string"
2223
+ },
2224
+ "rpc_url": {
2225
+ "type": "string"
2226
+ },
2227
+ "chain_id": {
2228
+ "type": "integer",
2229
+ "minimum": 1
2230
+ },
2231
+ "symbol": {
2232
+ "type": "string"
2233
+ },
2234
+ "explorer_url": {
2235
+ "type": "string"
2236
+ },
2237
+ "require_absent": {
2238
+ "type": "boolean",
2239
+ "default": false
2240
+ },
2241
+ "timeout_ms": {
2242
+ "type": "integer",
2243
+ "minimum": 1000,
2244
+ "default": 60000
2245
+ }
1854
2246
  },
1855
- "required": ["network", "rpc_url", "chain_id", "symbol"],
2247
+ "required": [
2248
+ "network",
2249
+ "rpc_url",
2250
+ "chain_id",
2251
+ "symbol"
2252
+ ],
1856
2253
  "additionalProperties": false
1857
2254
  },
1858
- "examples": [{
1859
- "action": "metamask.networks.add_custom",
1860
- "network": "PulseChain",
1861
- "rpc_url": "https://rpc.pulsechain.com",
1862
- "chain_id": 369,
1863
- "symbol": "PLS",
1864
- "explorer_url": "https://scan.pulsechain.com",
1865
- "intent": "Add and select PulseChain",
1866
- "next": "done"
1867
- }],
1868
- "execution_capabilities": ["app-mutation"]
2255
+ "examples": [
2256
+ {
2257
+ "action": "metamask.networks.add_custom",
2258
+ "network": "PulseChain",
2259
+ "rpc_url": "https://rpc.pulsechain.com",
2260
+ "chain_id": 369,
2261
+ "symbol": "PLS",
2262
+ "explorer_url": "https://scan.pulsechain.com",
2263
+ "require_absent": true,
2264
+ "intent": "Add and select PulseChain",
2265
+ "next": "done"
2266
+ }
2267
+ ],
2268
+ "execution_capabilities": [
2269
+ "app-mutation"
2270
+ ]
1869
2271
  },
1870
2272
  "metamask.networks.add_chainlist": {
1871
2273
  "description": "Add or select one Extension network from the visible ChainList search results.",
1872
2274
  "schema": {
1873
2275
  "type": "object",
1874
2276
  "properties": {
1875
- "network": { "type": "string" },
1876
- "query": { "type": "string" },
1877
- "chain_id": { "type": "integer", "minimum": 1 },
1878
- "symbol": { "type": "string" },
1879
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
2277
+ "network": {
2278
+ "type": "string"
2279
+ },
2280
+ "query": {
2281
+ "type": "string"
2282
+ },
2283
+ "chain_id": {
2284
+ "type": "integer",
2285
+ "minimum": 1
2286
+ },
2287
+ "symbol": {
2288
+ "type": "string"
2289
+ },
2290
+ "require_absent": {
2291
+ "type": "boolean",
2292
+ "default": false
2293
+ },
2294
+ "timeout_ms": {
2295
+ "type": "integer",
2296
+ "minimum": 1000,
2297
+ "default": 60000
2298
+ }
1880
2299
  },
1881
- "required": ["network", "chain_id", "symbol"],
2300
+ "required": [
2301
+ "network",
2302
+ "chain_id",
2303
+ "symbol"
2304
+ ],
1882
2305
  "additionalProperties": false
1883
2306
  },
1884
- "examples": [{
1885
- "action": "metamask.networks.add_chainlist",
1886
- "network": "XDC Network",
1887
- "query": "XDC",
1888
- "chain_id": 50,
1889
- "symbol": "XDC",
1890
- "intent": "Add and select XDC Network from the exact ChainList result",
1891
- "next": "done"
1892
- }],
1893
- "execution_capabilities": ["app-mutation"]
2307
+ "examples": [
2308
+ {
2309
+ "action": "metamask.networks.add_chainlist",
2310
+ "network": "XDC Network",
2311
+ "query": "XDC",
2312
+ "chain_id": 50,
2313
+ "symbol": "XDC",
2314
+ "require_absent": true,
2315
+ "intent": "Add and select XDC Network from the exact ChainList result",
2316
+ "next": "done"
2317
+ }
2318
+ ],
2319
+ "execution_capabilities": [
2320
+ "app-mutation"
2321
+ ]
1894
2322
  },
1895
2323
  "metamask.networks.remove_custom": {
1896
2324
  "description": "Remove one custom Extension network through visible network management controls.",
1897
2325
  "schema": {
1898
2326
  "type": "object",
1899
2327
  "properties": {
1900
- "network": { "type": "string" },
1901
- "chain_id": { "type": "integer", "minimum": 1 },
1902
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
2328
+ "network": {
2329
+ "type": "string"
2330
+ },
2331
+ "chain_id": {
2332
+ "type": "integer",
2333
+ "minimum": 1
2334
+ },
2335
+ "timeout_ms": {
2336
+ "type": "integer",
2337
+ "minimum": 1000,
2338
+ "default": 30000
2339
+ }
1903
2340
  },
1904
- "required": ["network", "chain_id"],
2341
+ "required": [
2342
+ "network",
2343
+ "chain_id"
2344
+ ],
1905
2345
  "additionalProperties": false
1906
2346
  },
1907
- "examples": [{
1908
- "action": "metamask.networks.remove_custom",
1909
- "network": "PulseChain",
1910
- "chain_id": 369,
1911
- "intent": "Remove PulseChain after validation",
1912
- "next": "done"
1913
- }],
1914
- "execution_capabilities": ["app-mutation"]
2347
+ "examples": [
2348
+ {
2349
+ "action": "metamask.networks.remove_custom",
2350
+ "network": "PulseChain",
2351
+ "chain_id": 369,
2352
+ "intent": "Remove PulseChain after validation",
2353
+ "next": "done"
2354
+ }
2355
+ ],
2356
+ "execution_capabilities": [
2357
+ "app-mutation"
2358
+ ]
1915
2359
  },
1916
2360
  "metamask.swap_bridge.read_visible_state": {
1917
2361
  "description": "Read and assert the visible Swap surface from an untouched Extension runtime without product background hooks.",
1918
2362
  "schema": {
1919
2363
  "type": "object",
1920
2364
  "properties": {
1921
- "source_symbol": { "type": "string" },
1922
- "destination_symbol": { "type": "string" },
1923
- "require_amount_inputs": { "type": "boolean", "default": true },
1924
- "require_settings": { "type": "boolean", "default": false },
1925
- "require_quote": { "type": "boolean", "default": false },
1926
- "expected_slippage": { "type": "number", "minimum": 0 }
2365
+ "source_symbol": {
2366
+ "type": "string"
2367
+ },
2368
+ "destination_symbol": {
2369
+ "type": "string"
2370
+ },
2371
+ "require_amount_inputs": {
2372
+ "type": "boolean",
2373
+ "default": true
2374
+ },
2375
+ "require_settings": {
2376
+ "type": "boolean",
2377
+ "default": false
2378
+ },
2379
+ "require_quote": {
2380
+ "type": "boolean",
2381
+ "default": false
2382
+ },
2383
+ "expected_slippage": {
2384
+ "type": "number",
2385
+ "minimum": 0
2386
+ }
1927
2387
  },
1928
2388
  "additionalProperties": false
1929
2389
  },
@@ -1936,122 +2396,164 @@
1936
2396
  "next": "done"
1937
2397
  }
1938
2398
  ],
1939
- "execution_capabilities": ["host-read-export"]
2399
+ "execution_capabilities": [
2400
+ "host-read-export"
2401
+ ]
1940
2402
  },
1941
2403
  "metamask.swap_bridge.select_assets": {
1942
2404
  "description": "Select exact Swap source and destination assets through the visible asset pickers.",
1943
2405
  "schema": {
1944
2406
  "type": "object",
1945
2407
  "properties": {
1946
- "source_symbol": { "type": "string" },
1947
- "destination_symbol": { "type": "string" },
1948
- "source_chain": { "type": "string" },
1949
- "destination_chain": { "type": "string" },
1950
- "source_query": { "type": "string" },
1951
- "destination_query": { "type": "string" },
1952
- "source_asset_id": { "type": "string" },
1953
- "destination_asset_id": { "type": "string" },
1954
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
2408
+ "source_symbol": {
2409
+ "type": "string"
2410
+ },
2411
+ "destination_symbol": {
2412
+ "type": "string"
2413
+ },
2414
+ "source_chain": {
2415
+ "type": "string"
2416
+ },
2417
+ "destination_chain": {
2418
+ "type": "string"
2419
+ },
2420
+ "source_query": {
2421
+ "type": "string"
2422
+ },
2423
+ "destination_query": {
2424
+ "type": "string"
2425
+ },
2426
+ "source_asset_id": {
2427
+ "type": "string"
2428
+ },
2429
+ "destination_asset_id": {
2430
+ "type": "string"
2431
+ },
2432
+ "timeout_ms": {
2433
+ "type": "integer",
2434
+ "minimum": 1000,
2435
+ "default": 60000
2436
+ }
1955
2437
  },
1956
- "required": ["source_symbol", "destination_symbol", "source_chain", "destination_chain"],
2438
+ "required": [
2439
+ "source_symbol",
2440
+ "destination_symbol",
2441
+ "source_chain",
2442
+ "destination_chain"
2443
+ ],
1957
2444
  "additionalProperties": false
1958
2445
  },
1959
- "examples": [{
1960
- "action": "metamask.swap_bridge.select_assets",
1961
- "source_symbol": "ETH",
1962
- "destination_symbol": "WETH",
1963
- "source_chain": "eip155:1",
1964
- "destination_chain": "eip155:1",
1965
- "intent": "Select the funded Swap pair",
1966
- "next": "done"
1967
- }],
1968
- "execution_capabilities": ["app-mutation"]
2446
+ "examples": [
2447
+ {
2448
+ "action": "metamask.swap_bridge.select_assets",
2449
+ "source_symbol": "ETH",
2450
+ "destination_symbol": "WETH",
2451
+ "source_chain": "eip155:1",
2452
+ "destination_chain": "eip155:1",
2453
+ "intent": "Select the funded Swap pair",
2454
+ "next": "done"
2455
+ }
2456
+ ],
2457
+ "execution_capabilities": [
2458
+ "app-mutation"
2459
+ ]
1969
2460
  },
1970
2461
  "metamask.swap_bridge.set_amount": {
1971
2462
  "description": "Enter a positive Swap amount through visible UI and wait for a quote or explicit no-route state.",
1972
2463
  "schema": {
1973
2464
  "type": "object",
1974
2465
  "properties": {
1975
- "amount": { "type": "number", "minimum": 0.00000001 },
1976
- "wait_for_quote": { "type": "boolean", "default": true },
1977
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
2466
+ "amount": {
2467
+ "type": "number",
2468
+ "minimum": 1E-8
2469
+ },
2470
+ "wait_for_quote": {
2471
+ "type": "boolean",
2472
+ "default": true
2473
+ },
2474
+ "timeout_ms": {
2475
+ "type": "integer",
2476
+ "minimum": 1000,
2477
+ "default": 60000
2478
+ }
1978
2479
  },
1979
- "required": ["amount"],
2480
+ "required": [
2481
+ "amount"
2482
+ ],
1980
2483
  "additionalProperties": false
1981
2484
  },
1982
- "examples": [{
1983
- "action": "metamask.swap_bridge.set_amount",
1984
- "amount": 0.0001,
1985
- "intent": "Enter a capped Swap amount and wait for the quote",
1986
- "next": "done"
1987
- }],
1988
- "execution_capabilities": ["app-mutation"]
2485
+ "examples": [
2486
+ {
2487
+ "action": "metamask.swap_bridge.set_amount",
2488
+ "amount": 0.0001,
2489
+ "intent": "Enter a capped Swap amount and wait for the quote",
2490
+ "next": "done"
2491
+ }
2492
+ ],
2493
+ "execution_capabilities": [
2494
+ "app-mutation"
2495
+ ]
1989
2496
  },
1990
2497
  "metamask.swap_bridge.set_slippage": {
1991
2498
  "description": "Set a custom Swap slippage percentage through the visible transaction settings.",
1992
2499
  "schema": {
1993
2500
  "type": "object",
1994
2501
  "properties": {
1995
- "percent": { "type": "number", "minimum": 0.01 },
1996
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
2502
+ "percent": {
2503
+ "type": "number",
2504
+ "minimum": 0.01
2505
+ },
2506
+ "timeout_ms": {
2507
+ "type": "integer",
2508
+ "minimum": 1000,
2509
+ "default": 30000
2510
+ }
1997
2511
  },
1998
- "required": ["percent"],
2512
+ "required": [
2513
+ "percent"
2514
+ ],
1999
2515
  "additionalProperties": false
2000
2516
  },
2001
- "examples": [{
2002
- "action": "metamask.swap_bridge.set_slippage",
2003
- "percent": 3,
2004
- "intent": "Set the release checklist custom slippage value",
2005
- "next": "done"
2006
- }],
2007
- "execution_capabilities": ["app-mutation"]
2517
+ "examples": [
2518
+ {
2519
+ "action": "metamask.swap_bridge.set_slippage",
2520
+ "percent": 3,
2521
+ "intent": "Set the release checklist custom slippage value",
2522
+ "next": "done"
2523
+ }
2524
+ ],
2525
+ "execution_capabilities": [
2526
+ "app-mutation"
2527
+ ]
2008
2528
  },
2009
2529
  "metamask.swap_bridge.set_max_amount": {
2010
2530
  "description": "Use the visible Swap Max control and wait for the derived live quote.",
2011
2531
  "schema": {
2012
2532
  "type": "object",
2013
2533
  "properties": {
2014
- "wait_for_quote": { "type": "boolean", "default": true },
2015
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 60000 }
2016
- },
2017
- "additionalProperties": false
2018
- },
2019
- "examples": [{
2020
- "action": "metamask.swap_bridge.set_max_amount",
2021
- "wait_for_quote": true,
2022
- "intent": "Use the available token balance for the return Swap",
2023
- "next": "done"
2024
- }],
2025
- "execution_capabilities": ["app-mutation"]
2026
- },
2027
- "metamask.swap_bridge.submit_transaction": {
2028
- "description": "Submit an explicitly authorized live Swap and prove its confirmed Activity details and destination balance.",
2029
- "schema": {
2030
- "type": "object",
2031
- "properties": {
2032
- "source_symbol": { "type": "string" },
2033
- "destination_symbol": { "type": "string" },
2034
- "amount": { "type": ["string", "number"] },
2035
- "confirm_live": { "type": "boolean", "default": false },
2036
- "resume_submitted": { "type": "boolean", "default": false },
2037
- "transaction_hash": { "type": "string" },
2038
- "activity_occurrence": { "type": "integer", "minimum": 0, "default": 0 },
2039
- "require_destination_balance": { "type": "boolean", "default": true },
2040
- "timeout_ms": { "type": "integer", "minimum": 1000, "default": 300000 }
2534
+ "wait_for_quote": {
2535
+ "type": "boolean",
2536
+ "default": true
2537
+ },
2538
+ "timeout_ms": {
2539
+ "type": "integer",
2540
+ "minimum": 1000,
2541
+ "default": 60000
2542
+ }
2041
2543
  },
2042
- "required": ["source_symbol", "destination_symbol", "amount"],
2043
2544
  "additionalProperties": false
2044
2545
  },
2045
- "examples": [{
2046
- "action": "metamask.swap_bridge.submit_transaction",
2047
- "source_symbol": "ETH",
2048
- "destination_symbol": "USDC",
2049
- "amount": "0.002",
2050
- "confirm_live": true,
2051
- "intent": "Submit the authorized release-check swap and prove its confirmed Activity details",
2052
- "next": "done"
2053
- }],
2054
- "execution_capabilities": ["app-mutation", "external-mutation"]
2546
+ "examples": [
2547
+ {
2548
+ "action": "metamask.swap_bridge.set_max_amount",
2549
+ "wait_for_quote": true,
2550
+ "intent": "Use the available token balance for the return Swap",
2551
+ "next": "done"
2552
+ }
2553
+ ],
2554
+ "execution_capabilities": [
2555
+ "app-mutation"
2556
+ ]
2055
2557
  },
2056
2558
  "metamask.perps.read_visible_state": {
2057
2559
  "description": "Read and assert bounded visible Perps UI state from an untouched Extension runtime without product background hooks.",
@@ -2060,7 +2562,15 @@
2060
2562
  "properties": {
2061
2563
  "surface": {
2062
2564
  "type": "string",
2063
- "enum": ["auto", "home", "market-list", "market-details", "order-entry", "activity", "funds"],
2565
+ "enum": [
2566
+ "auto",
2567
+ "home",
2568
+ "market-list",
2569
+ "market-details",
2570
+ "order-entry",
2571
+ "activity",
2572
+ "funds"
2573
+ ],
2064
2574
  "default": "auto"
2065
2575
  },
2066
2576
  "market": {
@@ -2069,20 +2579,35 @@
2069
2579
  },
2070
2580
  "direction": {
2071
2581
  "type": "string",
2072
- "enum": ["long", "short"]
2582
+ "enum": [
2583
+ "long",
2584
+ "short"
2585
+ ]
2073
2586
  },
2074
- "order_type": {
2587
+ "order_type": {
2075
2588
  "type": "string",
2076
- "enum": ["market", "limit"]
2589
+ "enum": [
2590
+ "market",
2591
+ "limit"
2592
+ ]
2077
2593
  },
2078
2594
  "amount": {
2079
- "type": ["string", "number"]
2595
+ "type": [
2596
+ "string",
2597
+ "number"
2598
+ ]
2080
2599
  },
2081
2600
  "percent": {
2082
- "type": ["string", "number"]
2601
+ "type": [
2602
+ "string",
2603
+ "number"
2604
+ ]
2083
2605
  },
2084
2606
  "leverage": {
2085
- "type": ["string", "number"]
2607
+ "type": [
2608
+ "string",
2609
+ "number"
2610
+ ]
2086
2611
  },
2087
2612
  "auto_close": {
2088
2613
  "type": "boolean"
@@ -2092,7 +2617,9 @@
2092
2617
  },
2093
2618
  "require_validation_text": {
2094
2619
  "type": "array",
2095
- "items": { "type": "string" },
2620
+ "items": {
2621
+ "type": "string"
2622
+ },
2096
2623
  "maxItems": 20
2097
2624
  },
2098
2625
  "minimum_market_count": {
@@ -2134,21 +2661,39 @@
2134
2661
  "type": "boolean",
2135
2662
  "default": false
2136
2663
  },
2664
+ "require_no_control_overlap": {
2665
+ "type": "boolean",
2666
+ "default": false
2667
+ },
2137
2668
  "forbid_test_ids": {
2138
2669
  "type": "array",
2139
- "items": { "type": "string" },
2670
+ "items": {
2671
+ "type": "string"
2672
+ },
2140
2673
  "maxItems": 100
2141
2674
  },
2142
2675
  "require_test_ids": {
2143
2676
  "type": "array",
2144
- "items": { "type": "string" },
2677
+ "items": {
2678
+ "type": "string"
2679
+ },
2145
2680
  "maxItems": 100
2146
2681
  },
2147
2682
  "require_features": {
2148
2683
  "type": "array",
2149
2684
  "items": {
2150
2685
  "type": "string",
2151
- "enum": ["activity", "balance", "chart", "long-short", "market-list", "order-entry", "price", "price-change", "stats"]
2686
+ "enum": [
2687
+ "activity",
2688
+ "balance",
2689
+ "chart",
2690
+ "long-short",
2691
+ "market-list",
2692
+ "order-entry",
2693
+ "price",
2694
+ "price-change",
2695
+ "stats"
2696
+ ]
2152
2697
  },
2153
2698
  "maxItems": 9
2154
2699
  },
@@ -2169,13 +2714,51 @@
2169
2714
  "action": "metamask.perps.read_visible_state",
2170
2715
  "surface": "home",
2171
2716
  "minimum_market_count": 1,
2172
- "require_features": ["balance", "market-list"],
2173
- "require_test_ids": ["perps-balance-dropdown-balance"],
2717
+ "require_features": [
2718
+ "balance",
2719
+ "market-list"
2720
+ ],
2721
+ "require_test_ids": [
2722
+ "perps-balance-dropdown-balance"
2723
+ ],
2174
2724
  "intent": "Assert the live Perps home surface through visible UI",
2175
2725
  "next": "done"
2176
2726
  }
2177
2727
  ],
2178
- "execution_capabilities": ["host-read-export"]
2728
+ "execution_capabilities": [
2729
+ "host-read-export"
2730
+ ]
2731
+ },
2732
+ "metamask.perps.search_markets": {
2733
+ "description": "Enter a Perps market query through the visible search field and prove visible results are returned.",
2734
+ "schema": {
2735
+ "type": "object",
2736
+ "properties": {
2737
+ "query": {
2738
+ "type": "string"
2739
+ },
2740
+ "timeout_ms": {
2741
+ "type": "integer",
2742
+ "minimum": 1000,
2743
+ "default": 30000
2744
+ }
2745
+ },
2746
+ "required": [
2747
+ "query"
2748
+ ],
2749
+ "additionalProperties": false
2750
+ },
2751
+ "examples": [
2752
+ {
2753
+ "action": "metamask.perps.search_markets",
2754
+ "query": "Bitcoin",
2755
+ "intent": "Filter the visible Perps market list",
2756
+ "next": "done"
2757
+ }
2758
+ ],
2759
+ "execution_capabilities": [
2760
+ "app-mutation"
2761
+ ]
2179
2762
  },
2180
2763
  "metamask.perps.select_market_filter": {
2181
2764
  "description": "Select and assert a live Perps market category through trusted visible UI controls.",
@@ -2184,7 +2767,17 @@
2184
2767
  "properties": {
2185
2768
  "filter": {
2186
2769
  "type": "string",
2187
- "enum": ["all", "crypto", "stocks", "pre-ipo", "index", "etf", "commodities", "forex", "new"]
2770
+ "enum": [
2771
+ "all",
2772
+ "crypto",
2773
+ "stocks",
2774
+ "pre-ipo",
2775
+ "index",
2776
+ "etf",
2777
+ "commodities",
2778
+ "forex",
2779
+ "new"
2780
+ ]
2188
2781
  },
2189
2782
  "minimum_market_count": {
2190
2783
  "type": "integer",
@@ -2200,9 +2793,16 @@
2200
2793
  "type": "integer",
2201
2794
  "minimum": 1,
2202
2795
  "default": 100
2203
- }
2204
- },
2205
- "required": ["filter"],
2796
+ },
2797
+ "timeout_ms": {
2798
+ "type": "integer",
2799
+ "minimum": 1000,
2800
+ "default": 10000
2801
+ }
2802
+ },
2803
+ "required": [
2804
+ "filter"
2805
+ ],
2206
2806
  "additionalProperties": false
2207
2807
  },
2208
2808
  "examples": [
@@ -2214,21 +2814,88 @@
2214
2814
  "next": "done"
2215
2815
  }
2216
2816
  ],
2217
- "execution_capabilities": ["app-mutation"]
2817
+ "execution_capabilities": [
2818
+ "app-mutation"
2819
+ ]
2218
2820
  },
2219
2821
  "metamask.perps.close_visible_position": {
2220
2822
  "description": "Close all or part of one live Perps position through semantic visible controls.",
2221
2823
  "schema": {
2222
2824
  "type": "object",
2223
2825
  "properties": {
2224
- "market": { "type": "string" },
2225
- "confirm_live": { "type": "boolean", "enum": [true] },
2826
+ "market": {
2827
+ "type": "string"
2828
+ },
2829
+ "confirm_live": {
2830
+ "type": "boolean",
2831
+ "enum": [
2832
+ true
2833
+ ]
2834
+ },
2835
+ "funding_side": {
2836
+ "type": "string",
2837
+ "enum": [
2838
+ "long",
2839
+ "short"
2840
+ ]
2841
+ },
2842
+ "funding_amount": {
2843
+ "type": [
2844
+ "string",
2845
+ "number"
2846
+ ]
2847
+ },
2848
+ "provider": {
2849
+ "type": "string"
2850
+ },
2851
+ "network": {
2852
+ "type": "string",
2853
+ "enum": [
2854
+ "mainnet",
2855
+ "testnet"
2856
+ ]
2857
+ },
2858
+ "funding_position_size": {
2859
+ "type": "string",
2860
+ "description": "Exact visible position size required for a close-only cleanup."
2861
+ },
2862
+ "leverage": {
2863
+ "type": "integer",
2864
+ "minimum": 1
2865
+ },
2866
+ "cleanup_only": {
2867
+ "type": "boolean",
2868
+ "enum": [
2869
+ true
2870
+ ],
2871
+ "description": "Use a fresh exact close-only authorization and current visible balance baseline."
2872
+ },
2873
+ "identity_rounding_tolerance_base_units": {
2874
+ "type": "string",
2875
+ "default": "10000",
2876
+ "description": "Maximum visible USD rounding delta in six-decimal USDC base units; default 10000 and capped at 1000000."
2877
+ },
2878
+ "balance_reconciliation_tolerance_base_units": {
2879
+ "type": "string",
2880
+ "description": "Maximum final-versus-preorder balance delta in six-decimal USDC base units; default/cap 1000000."
2881
+ },
2226
2882
  "amount": {
2227
- "type": ["string", "number"],
2883
+ "type": [
2884
+ "string",
2885
+ "number"
2886
+ ],
2228
2887
  "description": "Optional USD amount for a partial close; omit to close the full position."
2229
2888
  }
2230
2889
  },
2231
- "required": ["market", "confirm_live"],
2890
+ "required": [
2891
+ "market",
2892
+ "confirm_live",
2893
+ "funding_side",
2894
+ "funding_amount",
2895
+ "provider",
2896
+ "network",
2897
+ "leverage"
2898
+ ],
2232
2899
  "additionalProperties": false
2233
2900
  },
2234
2901
  "examples": [
@@ -2236,22 +2903,43 @@
2236
2903
  "action": "metamask.perps.close_visible_position",
2237
2904
  "market": "BTC",
2238
2905
  "confirm_live": true,
2906
+ "funding_side": "long",
2907
+ "funding_amount": "10",
2908
+ "provider": "hyperliquid",
2909
+ "network": "mainnet",
2910
+ "leverage": 3,
2911
+ "identity_rounding_tolerance_base_units": "10000",
2239
2912
  "intent": "Close the visible BTC position after the live release check",
2240
2913
  "next": "done"
2241
2914
  }
2242
2915
  ],
2243
- "execution_capabilities": ["app-mutation", "external-mutation"]
2916
+ "execution_capabilities": [
2917
+ "app-mutation",
2918
+ "external-mutation"
2919
+ ]
2244
2920
  },
2245
2921
  "metamask.perps.compare_provider_market": {
2246
2922
  "description": "Compare one visible Perps market with the live Hyperliquid production response.",
2247
2923
  "schema": {
2248
2924
  "type": "object",
2249
2925
  "properties": {
2250
- "market": { "type": "string" },
2251
- "endpoint": { "type": "string", "enum": ["https://api.hyperliquid.xyz/info"] },
2252
- "timeout_ms": { "type": "integer", "minimum": 1 }
2926
+ "market": {
2927
+ "type": "string"
2928
+ },
2929
+ "endpoint": {
2930
+ "type": "string",
2931
+ "enum": [
2932
+ "https://api.hyperliquid.xyz/info"
2933
+ ]
2934
+ },
2935
+ "timeout_ms": {
2936
+ "type": "integer",
2937
+ "minimum": 1
2938
+ }
2253
2939
  },
2254
- "required": ["market"],
2940
+ "required": [
2941
+ "market"
2942
+ ],
2255
2943
  "additionalProperties": false
2256
2944
  },
2257
2945
  "examples": [
@@ -2262,14 +2950,19 @@
2262
2950
  "next": "done"
2263
2951
  }
2264
2952
  ],
2265
- "execution_capabilities": ["host-read-export"]
2953
+ "execution_capabilities": [
2954
+ "host-read-export"
2955
+ ]
2266
2956
  },
2267
2957
  "metamask.perps.read_eligibility": {
2268
2958
  "description": "Read the current Extension Perps eligibility and live MetaMask geolocation without changing either.",
2269
2959
  "schema": {
2270
2960
  "type": "object",
2271
2961
  "properties": {
2272
- "timeout_ms": { "type": "integer", "minimum": 1 }
2962
+ "timeout_ms": {
2963
+ "type": "integer",
2964
+ "minimum": 1
2965
+ }
2273
2966
  },
2274
2967
  "additionalProperties": false
2275
2968
  },
@@ -2280,17 +2973,30 @@
2280
2973
  "next": "done"
2281
2974
  }
2282
2975
  ],
2283
- "execution_capabilities": ["host-read-export"]
2976
+ "execution_capabilities": [
2977
+ "host-read-export"
2978
+ ]
2284
2979
  },
2285
2980
  "metamask.perps.set_market_favorite": {
2286
2981
  "description": "Converge one live Perps market favorite to the requested state through its semantic visible control.",
2287
2982
  "schema": {
2288
2983
  "type": "object",
2289
2984
  "properties": {
2290
- "market": { "type": "string" },
2291
- "favorite": { "type": "boolean" }
2985
+ "market": {
2986
+ "type": "string"
2987
+ },
2988
+ "favorite": {
2989
+ "type": "boolean"
2990
+ },
2991
+ "require_unchanged": {
2992
+ "type": "boolean",
2993
+ "default": false
2994
+ }
2292
2995
  },
2293
- "required": ["market", "favorite"],
2996
+ "required": [
2997
+ "market",
2998
+ "favorite"
2999
+ ],
2294
3000
  "additionalProperties": false
2295
3001
  },
2296
3002
  "examples": [
@@ -2302,7 +3008,9 @@
2302
3008
  "next": "done"
2303
3009
  }
2304
3010
  ],
2305
- "execution_capabilities": ["app-mutation"]
3011
+ "execution_capabilities": [
3012
+ "app-mutation"
3013
+ ]
2306
3014
  },
2307
3015
  "metamask.perps.select_activity_filter": {
2308
3016
  "description": "Select and read one live Perps activity category through semantic visible controls.",
@@ -2311,10 +3019,17 @@
2311
3019
  "properties": {
2312
3020
  "filter": {
2313
3021
  "type": "string",
2314
- "enum": ["trades", "orders", "funding", "deposits"]
3022
+ "enum": [
3023
+ "trades",
3024
+ "orders",
3025
+ "funding",
3026
+ "deposits"
3027
+ ]
2315
3028
  }
2316
3029
  },
2317
- "required": ["filter"],
3030
+ "required": [
3031
+ "filter"
3032
+ ],
2318
3033
  "additionalProperties": false
2319
3034
  },
2320
3035
  "examples": [
@@ -2325,7 +3040,9 @@
2325
3040
  "next": "done"
2326
3041
  }
2327
3042
  ],
2328
- "execution_capabilities": ["app-mutation"]
3043
+ "execution_capabilities": [
3044
+ "app-mutation"
3045
+ ]
2329
3046
  },
2330
3047
  "metamask.perps.open_balance_action": {
2331
3048
  "description": "Open Add funds or Withdraw from the live Perps balance dropdown in one trusted UI session.",
@@ -2334,10 +3051,15 @@
2334
3051
  "properties": {
2335
3052
  "balance_action": {
2336
3053
  "type": "string",
2337
- "enum": ["add-funds", "withdraw"]
3054
+ "enum": [
3055
+ "add-funds",
3056
+ "withdraw"
3057
+ ]
2338
3058
  }
2339
3059
  },
2340
- "required": ["balance_action"],
3060
+ "required": [
3061
+ "balance_action"
3062
+ ],
2341
3063
  "additionalProperties": false
2342
3064
  },
2343
3065
  "examples": [
@@ -2348,20 +3070,34 @@
2348
3070
  "next": "done"
2349
3071
  }
2350
3072
  ],
2351
- "execution_capabilities": ["app-mutation"]
3073
+ "execution_capabilities": [
3074
+ "app-mutation"
3075
+ ]
2352
3076
  },
2353
3077
  "metamask.perps.open_position_action": {
2354
3078
  "description": "Open a position-management flow from a live Perps position through visible controls in one trusted UI session.",
2355
3079
  "schema": {
2356
3080
  "type": "object",
2357
3081
  "properties": {
2358
- "market": { "type": "string" },
3082
+ "market": {
3083
+ "type": "string"
3084
+ },
2359
3085
  "position_action": {
2360
3086
  "type": "string",
2361
- "enum": ["add-exposure", "reduce-exposure", "reverse", "add-margin", "remove-margin", "auto-close"]
3087
+ "enum": [
3088
+ "add-exposure",
3089
+ "reduce-exposure",
3090
+ "reverse",
3091
+ "add-margin",
3092
+ "remove-margin",
3093
+ "auto-close"
3094
+ ]
2362
3095
  }
2363
3096
  },
2364
- "required": ["market", "position_action"],
3097
+ "required": [
3098
+ "market",
3099
+ "position_action"
3100
+ ],
2365
3101
  "additionalProperties": false
2366
3102
  },
2367
3103
  "examples": [
@@ -2373,20 +3109,85 @@
2373
3109
  "next": "done"
2374
3110
  }
2375
3111
  ],
2376
- "execution_capabilities": ["app-mutation"]
3112
+ "execution_capabilities": [
3113
+ "app-mutation"
3114
+ ]
2377
3115
  },
2378
3116
  "metamask.perps.edit_margin": {
2379
3117
  "description": "Add or remove isolated margin from a live Perps position through visible controls and prove the reconciled position values.",
2380
3118
  "schema": {
2381
3119
  "type": "object",
2382
3120
  "properties": {
2383
- "market": { "type": "string" },
2384
- "margin_action": { "type": "string", "enum": ["add", "remove"], "default": "add" },
2385
- "amount": { "type": ["string", "number"] },
2386
- "confirm_live": { "type": "boolean" },
2387
- "timeout_ms": { "type": "number" }
3121
+ "market": {
3122
+ "type": "string"
3123
+ },
3124
+ "margin_action": {
3125
+ "type": "string",
3126
+ "enum": [
3127
+ "add",
3128
+ "remove"
3129
+ ],
3130
+ "default": "add"
3131
+ },
3132
+ "amount": {
3133
+ "type": [
3134
+ "string",
3135
+ "number"
3136
+ ]
3137
+ },
3138
+ "funding_side": {
3139
+ "type": "string",
3140
+ "enum": [
3141
+ "long",
3142
+ "short"
3143
+ ]
3144
+ },
3145
+ "funding_amount": {
3146
+ "type": [
3147
+ "string",
3148
+ "number"
3149
+ ]
3150
+ },
3151
+ "funding_position_size": {
3152
+ "type": "string",
3153
+ "description": "Exact stable visible position size identity."
3154
+ },
3155
+ "provider": {
3156
+ "type": "string"
3157
+ },
3158
+ "network": {
3159
+ "type": "string",
3160
+ "enum": [
3161
+ "mainnet",
3162
+ "testnet"
3163
+ ]
3164
+ },
3165
+ "leverage": {
3166
+ "type": "integer",
3167
+ "minimum": 1
3168
+ },
3169
+ "balance_reconciliation_tolerance_base_units": {
3170
+ "type": "string",
3171
+ "default": "1000000"
3172
+ },
3173
+ "confirm_live": {
3174
+ "type": "boolean"
3175
+ },
3176
+ "timeout_ms": {
3177
+ "type": "number"
3178
+ }
2388
3179
  },
2389
- "required": ["market", "amount", "confirm_live"],
3180
+ "required": [
3181
+ "market",
3182
+ "amount",
3183
+ "funding_side",
3184
+ "funding_amount",
3185
+ "funding_position_size",
3186
+ "provider",
3187
+ "network",
3188
+ "leverage",
3189
+ "confirm_live"
3190
+ ],
2390
3191
  "additionalProperties": false
2391
3192
  },
2392
3193
  "examples": [
@@ -2395,25 +3196,92 @@
2395
3196
  "market": "BTC",
2396
3197
  "margin_action": "add",
2397
3198
  "amount": 1,
3199
+ "funding_side": "long",
3200
+ "funding_amount": 10,
3201
+ "funding_position_size": "0.00016 BTC",
3202
+ "provider": "hyperliquid",
3203
+ "network": "mainnet",
3204
+ "leverage": 1,
2398
3205
  "confirm_live": true,
2399
3206
  "intent": "Add one USDC of margin to the BTC position",
2400
3207
  "next": "done"
2401
3208
  }
2402
3209
  ],
2403
- "execution_capabilities": ["app-mutation", "external-mutation"]
3210
+ "execution_capabilities": [
3211
+ "app-mutation",
3212
+ "external-mutation"
3213
+ ]
2404
3214
  },
2405
3215
  "metamask.perps.update_position_tpsl": {
2406
3216
  "description": "Update take-profit and stop-loss for a live Extension Perps position through visible controls and prove the reconciled position row.",
2407
3217
  "schema": {
2408
3218
  "type": "object",
2409
3219
  "properties": {
2410
- "market": { "type": "string" },
2411
- "take_profit_price": { "type": ["string", "number"] },
2412
- "stop_loss_price": { "type": ["string", "number"] },
2413
- "confirm_live": { "type": "boolean" },
2414
- "timeout_ms": { "type": "number" }
3220
+ "market": {
3221
+ "type": "string"
3222
+ },
3223
+ "take_profit_price": {
3224
+ "type": [
3225
+ "string",
3226
+ "number"
3227
+ ]
3228
+ },
3229
+ "stop_loss_price": {
3230
+ "type": [
3231
+ "string",
3232
+ "number"
3233
+ ]
3234
+ },
3235
+ "funding_side": {
3236
+ "type": "string",
3237
+ "enum": [
3238
+ "long",
3239
+ "short"
3240
+ ]
3241
+ },
3242
+ "funding_amount": {
3243
+ "type": [
3244
+ "string",
3245
+ "number"
3246
+ ]
3247
+ },
3248
+ "funding_position_size": {
3249
+ "type": "string",
3250
+ "description": "Exact stable visible position size identity."
3251
+ },
3252
+ "provider": {
3253
+ "type": "string"
3254
+ },
3255
+ "network": {
3256
+ "type": "string",
3257
+ "enum": [
3258
+ "mainnet",
3259
+ "testnet"
3260
+ ]
3261
+ },
3262
+ "leverage": {
3263
+ "type": "integer",
3264
+ "minimum": 1
3265
+ },
3266
+ "confirm_live": {
3267
+ "type": "boolean"
3268
+ },
3269
+ "timeout_ms": {
3270
+ "type": "number"
3271
+ }
2415
3272
  },
2416
- "required": ["market", "confirm_live"],
3273
+ "required": [
3274
+ "market",
3275
+ "take_profit_price",
3276
+ "stop_loss_price",
3277
+ "funding_side",
3278
+ "funding_amount",
3279
+ "funding_position_size",
3280
+ "provider",
3281
+ "network",
3282
+ "leverage",
3283
+ "confirm_live"
3284
+ ],
2417
3285
  "additionalProperties": false
2418
3286
  },
2419
3287
  "examples": [
@@ -2422,21 +3290,34 @@
2422
3290
  "market": "BTC",
2423
3291
  "take_profit_price": 65000,
2424
3292
  "stop_loss_price": 55000,
3293
+ "funding_side": "long",
3294
+ "funding_amount": 10,
3295
+ "funding_position_size": "0.00016 BTC",
3296
+ "provider": "hyperliquid",
3297
+ "network": "mainnet",
3298
+ "leverage": 1,
2425
3299
  "confirm_live": true,
2426
3300
  "intent": "Update BTC position auto-close prices",
2427
3301
  "next": "done"
2428
3302
  }
2429
3303
  ],
2430
- "execution_capabilities": ["app-mutation", "external-mutation"]
3304
+ "execution_capabilities": [
3305
+ "app-mutation",
3306
+ "external-mutation"
3307
+ ]
2431
3308
  },
2432
3309
  "metamask.settings.set_basic_functionality": {
2433
3310
  "description": "Converge the Extension Basic Functionality privacy setting through its visible toggle and confirmation modal.",
2434
3311
  "schema": {
2435
3312
  "type": "object",
2436
3313
  "properties": {
2437
- "enabled": { "type": "boolean" }
3314
+ "enabled": {
3315
+ "type": "boolean"
3316
+ }
2438
3317
  },
2439
- "required": ["enabled"],
3318
+ "required": [
3319
+ "enabled"
3320
+ ],
2440
3321
  "additionalProperties": false
2441
3322
  },
2442
3323
  "examples": [
@@ -2447,18 +3328,75 @@
2447
3328
  "next": "done"
2448
3329
  }
2449
3330
  ],
2450
- "execution_capabilities": ["app-mutation"]
3331
+ "execution_capabilities": [
3332
+ "app-mutation"
3333
+ ]
2451
3334
  },
2452
3335
  "metamask.perps.read_funds_confirmation": {
2453
3336
  "description": "Read the loaded Perps deposit or withdraw confirmation without submitting it.",
2454
3337
  "schema": {
2455
3338
  "type": "object",
2456
3339
  "properties": {
2457
- "mode": { "type": "string", "enum": ["deposit", "withdraw"] },
2458
- "require_no_horizontal_overflow": { "type": "boolean", "default": false },
2459
- "expected_submit_enabled": { "type": "boolean" }
3340
+ "mode": {
3341
+ "type": "string",
3342
+ "enum": [
3343
+ "deposit",
3344
+ "withdraw"
3345
+ ]
3346
+ },
3347
+ "require_no_horizontal_overflow": {
3348
+ "type": "boolean",
3349
+ "default": false
3350
+ },
3351
+ "require_preview_fields": {
3352
+ "type": "boolean",
3353
+ "default": false
3354
+ },
3355
+ "expected_submit_enabled": {
3356
+ "type": "boolean"
3357
+ },
3358
+ "expected_submit_label": {
3359
+ "type": "string"
3360
+ },
3361
+ "expected_amount": {
3362
+ "type": [
3363
+ "string",
3364
+ "number"
3365
+ ]
3366
+ },
3367
+ "expected_amount_symbol": {
3368
+ "type": "string"
3369
+ },
3370
+ "expected_pay_token_amount_visible": {
3371
+ "type": "boolean"
3372
+ },
3373
+ "expected_pay_token": {
3374
+ "type": "string"
3375
+ },
3376
+ "expected_receive_token": {
3377
+ "type": "string"
3378
+ },
3379
+ "expected_visible_network": {
3380
+ "type": "string"
3381
+ },
3382
+ "expected_percentage_controls": {
3383
+ "type": "array",
3384
+ "items": {
3385
+ "type": "string"
3386
+ },
3387
+ "maxItems": 10
3388
+ },
3389
+ "require_visible_text": {
3390
+ "type": "array",
3391
+ "items": {
3392
+ "type": "string"
3393
+ },
3394
+ "maxItems": 20
3395
+ }
2460
3396
  },
2461
- "required": ["mode"],
3397
+ "required": [
3398
+ "mode"
3399
+ ],
2462
3400
  "additionalProperties": false
2463
3401
  },
2464
3402
  "examples": [
@@ -2469,10 +3407,93 @@
2469
3407
  "next": "done"
2470
3408
  }
2471
3409
  ],
2472
- "execution_capabilities": ["host-read-export"]
3410
+ "execution_capabilities": [
3411
+ "host-read-export"
3412
+ ]
3413
+ },
3414
+ "metamask.perps.assert_visible_consistency": {
3415
+ "description": "Assert bounded rendered Perps market or price changes, or recent-to-full activity containment, through visible Extension UI.",
3416
+ "schema": {
3417
+ "type": "object",
3418
+ "properties": {
3419
+ "mode": {
3420
+ "type": "string",
3421
+ "enum": [
3422
+ "market-stream",
3423
+ "watchlist-stream",
3424
+ "activity-containment",
3425
+ "price-stream"
3426
+ ]
3427
+ },
3428
+ "surface": {
3429
+ "type": "string",
3430
+ "enum": [
3431
+ "home",
3432
+ "market-list",
3433
+ "market-details",
3434
+ "order-entry"
3435
+ ]
3436
+ },
3437
+ "market": {
3438
+ "type": "string"
3439
+ },
3440
+ "sample_count": {
3441
+ "type": "integer",
3442
+ "minimum": 2,
3443
+ "default": 3
3444
+ },
3445
+ "sample_interval_ms": {
3446
+ "type": "integer",
3447
+ "minimum": 100,
3448
+ "default": 1000
3449
+ },
3450
+ "minimum_changed_count": {
3451
+ "type": "integer",
3452
+ "minimum": 0,
3453
+ "default": 1
3454
+ },
3455
+ "minimum_recent_activity_count": {
3456
+ "type": "integer",
3457
+ "minimum": 0,
3458
+ "default": 1
3459
+ },
3460
+ "require_unique_ids": {
3461
+ "type": "boolean",
3462
+ "default": false
3463
+ },
3464
+ "timeout_ms": {
3465
+ "type": "integer",
3466
+ "minimum": 1000,
3467
+ "default": 30000
3468
+ },
3469
+ "max_items": {
3470
+ "type": "integer",
3471
+ "minimum": 1,
3472
+ "default": 100
3473
+ }
3474
+ },
3475
+ "required": [
3476
+ "mode"
3477
+ ],
3478
+ "additionalProperties": false
3479
+ },
3480
+ "examples": [
3481
+ {
3482
+ "action": "metamask.perps.assert_visible_consistency",
3483
+ "mode": "market-stream",
3484
+ "sample_count": 3,
3485
+ "minimum_changed_count": 1,
3486
+ "intent": "Prove rendered Perps market rows change over a bounded sample",
3487
+ "next": "done"
3488
+ }
3489
+ ],
3490
+ "execution_capabilities": [
3491
+ "host-read-export",
3492
+ "app-mutation"
3493
+ ]
2473
3494
  },
2474
3495
  "metamask.perps.read_snapshot": {
2475
- "description": "Read a bounded, redacted snapshot of live Extension Perps state through product background APIs.",
3496
+ "description": "Read a bounded, redacted source-dev snapshot of Extension Perps state through the optional product background hook.",
2476
3497
  "schema": {
2477
3498
  "type": "object",
2478
3499
  "properties": {
@@ -2518,22 +3539,58 @@
2518
3539
  "start_time_ms": {
2519
3540
  "type": "integer",
2520
3541
  "minimum": 0,
2521
- "description": "Inclusive history start time in Unix milliseconds. Defaults to 30 days before end_time_ms."
3542
+ "description": "Inclusive history start time in Unix milliseconds. Defaults to 30 days before end_time_ms."
3543
+ },
3544
+ "end_time_ms": {
3545
+ "type": "integer",
3546
+ "minimum": 0,
3547
+ "description": "Inclusive history end time in Unix milliseconds. Defaults to the current time."
3548
+ },
3549
+ "account_id": {
3550
+ "type": "string",
3551
+ "description": "Optional CAIP account ID passed to the product history API; the value is not returned."
3552
+ },
3553
+ "limit": {
3554
+ "type": "integer",
3555
+ "minimum": 1,
3556
+ "default": 100,
3557
+ "description": "Maximum history items returned after product filtering."
3558
+ }
3559
+ },
3560
+ "additionalProperties": false
3561
+ },
3562
+ "sampling": {
3563
+ "type": "object",
3564
+ "properties": {
3565
+ "count": {
3566
+ "type": "integer",
3567
+ "minimum": 1,
3568
+ "default": 1
3569
+ },
3570
+ "interval_ms": {
3571
+ "type": "integer",
3572
+ "minimum": 100,
3573
+ "default": 1000
3574
+ }
3575
+ },
3576
+ "additionalProperties": false
3577
+ },
3578
+ "expect": {
3579
+ "type": "object",
3580
+ "properties": {
3581
+ "minimum_changed_market_count": {
3582
+ "type": "integer",
3583
+ "minimum": 0,
3584
+ "default": 0
2522
3585
  },
2523
- "end_time_ms": {
3586
+ "minimum_history_count": {
2524
3587
  "type": "integer",
2525
3588
  "minimum": 0,
2526
- "description": "Inclusive history end time in Unix milliseconds. Defaults to the current time."
2527
- },
2528
- "account_id": {
2529
- "type": "string",
2530
- "description": "Optional CAIP account ID passed to the product history API; the value is not returned."
3589
+ "default": 0
2531
3590
  },
2532
- "limit": {
2533
- "type": "integer",
2534
- "minimum": 1,
2535
- "default": 100,
2536
- "description": "Maximum history items returned after product filtering."
3591
+ "require_activity_history_agreement": {
3592
+ "type": "boolean",
3593
+ "default": false
2537
3594
  }
2538
3595
  },
2539
3596
  "additionalProperties": false
@@ -2570,7 +3627,9 @@
2570
3627
  "next": "done"
2571
3628
  }
2572
3629
  ],
2573
- "execution_capabilities": []
3630
+ "execution_capabilities": [
3631
+ "host-read-export"
3632
+ ]
2574
3633
  },
2575
3634
  "metamask.perps.read_positions": {
2576
3635
  "description": "extension Read live Perps positions; without a selector, return all live positions.",
@@ -2766,8 +3825,8 @@
2766
3825
  ],
2767
3826
  "execution_capabilities": []
2768
3827
  },
2769
- "metamask.perps.close_positions": {
2770
- "description": "extension Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Close selected live Perps positions. Use selector/mode params to close matching symbols or all positions.",
3828
+ "metamask.perps.close_orders": {
3829
+ "description": "extension 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.",
2771
3830
  "schema": {
2772
3831
  "type": "object",
2773
3832
  "properties": {
@@ -2849,134 +3908,77 @@
2849
3908
  },
2850
3909
  "timeout_ms": {
2851
3910
  "type": "number"
2852
- }
2853
- },
2854
- "additionalProperties": false
2855
- },
2856
- "examples": [
2857
- {
2858
- "action": "metamask.perps.close_positions",
2859
- "mode": "all",
2860
- "intent": "Close selected Perps positions before continuing",
2861
- "next": "done"
2862
- },
2863
- {
2864
- "action": "metamask.perps.close_positions",
2865
- "markets": [
2866
- "BTC",
2867
- "ETH"
2868
- ],
2869
- "intent": "Close selected Perps positions before continuing",
2870
- "next": "done"
2871
- }
2872
- ],
2873
- "execution_capabilities": [
2874
- "app-mutation",
2875
- "external-mutation"
2876
- ]
2877
- },
2878
- "metamask.perps.close_orders": {
2879
- "description": "extension 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.",
2880
- "schema": {
2881
- "type": "object",
2882
- "properties": {
2883
- "market": {
2884
- "type": "string",
2885
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
2886
3911
  },
2887
- "symbol": {
2888
- "type": "string",
2889
- "description": "Alias for market."
3912
+ "confirm_live": {
3913
+ "type": "boolean",
3914
+ "description": "Required when cancellation uses visible controls against the live provider."
2890
3915
  },
2891
- "markets": {
2892
- "type": "array",
2893
- "items": {
2894
- "type": "string"
2895
- },
2896
- "description": "Explicit list of market symbols."
3916
+ "amount": {
3917
+ "type": [
3918
+ "string",
3919
+ "number"
3920
+ ]
2897
3921
  },
2898
- "symbols": {
2899
- "type": "array",
2900
- "items": {
2901
- "type": "string"
2902
- },
2903
- "description": "Alias for markets."
3922
+ "leverage": {
3923
+ "type": "integer",
3924
+ "minimum": 1
2904
3925
  },
2905
- "mode": {
3926
+ "provider": {
3927
+ "type": "string",
3928
+ "description": "Exact Perps provider required before background cancellation dispatch."
3929
+ },
3930
+ "network": {
2906
3931
  "type": "string",
2907
3932
  "enum": [
2908
- "matching",
2909
- "all"
3933
+ "mainnet",
3934
+ "testnet"
2910
3935
  ],
2911
- "description": "matching selects requested symbols; all selects every live item returned by the product."
3936
+ "description": "Exact Perps network required before background cancellation dispatch; the action never toggles it."
2912
3937
  },
2913
- "selector": {
2914
- "type": "object",
2915
- "properties": {
2916
- "mode": {
2917
- "type": "string",
2918
- "enum": [
2919
- "matching",
2920
- "all"
2921
- ]
2922
- },
2923
- "market": {
2924
- "type": "string"
2925
- },
2926
- "symbol": {
2927
- "type": "string"
2928
- },
2929
- "markets": {
2930
- "type": "array",
2931
- "items": {
2932
- "type": "string"
2933
- }
2934
- },
2935
- "symbols": {
2936
- "type": "array",
2937
- "items": {
2938
- "type": "string"
2939
- }
2940
- },
2941
- "side": {
2942
- "type": "string",
2943
- "enum": [
2944
- "long",
2945
- "short"
2946
- ]
2947
- }
2948
- },
2949
- "additionalProperties": false
3938
+ "limit_price": {
3939
+ "type": [
3940
+ "string",
3941
+ "number"
3942
+ ]
2950
3943
  },
2951
- "side": {
3944
+ "order_id": {
2952
3945
  "type": "string",
2953
- "enum": [
2954
- "long",
2955
- "short"
2956
- ],
2957
- "description": "Optional position/order side filter."
3946
+ "description": "Exact product order ID required for receipt-bound background cancellation."
2958
3947
  },
2959
- "timeout_ms": {
3948
+ "offset_pct": {
2960
3949
  "type": "number"
2961
3950
  },
2962
- "confirm_live": {
2963
- "type": "boolean",
2964
- "description": "Required when cancellation uses visible controls against the live provider."
3951
+ "identity_rounding_tolerance_base_units": {
3952
+ "type": "string",
3953
+ "default": "10000",
3954
+ "description": "Maximum visible notional/price rounding delta in six-decimal USDC base units; default 10000 and capped at 1000000."
2965
3955
  }
2966
3956
  },
3957
+ "required": [
3958
+ "market",
3959
+ "side",
3960
+ "amount",
3961
+ "leverage",
3962
+ "provider",
3963
+ "network",
3964
+ "limit_price",
3965
+ "confirm_live"
3966
+ ],
2967
3967
  "additionalProperties": false
2968
3968
  },
2969
3969
  "examples": [
2970
- {
2971
- "action": "metamask.perps.close_orders",
2972
- "mode": "all",
2973
- "intent": "Cancel selected Perps orders before continuing",
2974
- "next": "done"
2975
- },
2976
3970
  {
2977
3971
  "action": "metamask.perps.close_orders",
2978
3972
  "market": "BTC",
2979
- "intent": "Cancel selected Perps orders before continuing",
3973
+ "side": "long",
3974
+ "amount": "10",
3975
+ "leverage": 3,
3976
+ "provider": "hyperliquid",
3977
+ "network": "testnet",
3978
+ "limit_price": "100000",
3979
+ "identity_rounding_tolerance_base_units": "10000",
3980
+ "confirm_live": true,
3981
+ "intent": "Cancel the exact trusted BTC limit order",
2980
3982
  "next": "done"
2981
3983
  }
2982
3984
  ],
@@ -3089,7 +4091,19 @@
3089
4091
  },
3090
4092
  "leverage": {
3091
4093
  "type": "number",
3092
- "default": 3
4094
+ "default": 1
4095
+ },
4096
+ "provider": {
4097
+ "type": "string",
4098
+ "description": "Exact Perps provider required before background dispatch."
4099
+ },
4100
+ "network": {
4101
+ "type": "string",
4102
+ "enum": [
4103
+ "mainnet",
4104
+ "testnet"
4105
+ ],
4106
+ "description": "Exact Perps network required before background dispatch; the action never toggles it."
3093
4107
  },
3094
4108
  "order_type": {
3095
4109
  "type": "string",
@@ -3119,150 +4133,44 @@
3119
4133
  "limit_price": {
3120
4134
  "type": [
3121
4135
  "string",
3122
- "number"
3123
- ]
3124
- },
3125
- "offset_pct": {
3126
- "type": "number",
3127
- "description": "Limit price offset from the current market price when limit_price is omitted."
3128
- },
3129
- "confirm_live": {
3130
- "type": "boolean",
3131
- "description": "Required when submission uses visible controls against the live provider."
3132
- }
3133
- },
3134
- "additionalProperties": false
3135
- },
3136
- "examples": [
3137
- {
3138
- "action": "metamask.perps.place_order",
3139
- "market": "BTC",
3140
- "side": "long",
3141
- "notional": "10",
3142
- "leverage": 2,
3143
- "intent": "Place the requested Perps order",
3144
- "next": "done"
3145
- }
3146
- ],
3147
- "execution_capabilities": [
3148
- "app-mutation",
3149
- "external-mutation"
3150
- ]
3151
- },
3152
- "metamask.perps.assert_positions": {
3153
- "description": "extension Assert live Perps positions are present or absent for an explicit market selection or mode=all.",
3154
- "schema": {
3155
- "type": "object",
3156
- "properties": {
3157
- "market": {
3158
- "type": "string",
3159
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
3160
- },
3161
- "symbol": {
3162
- "type": "string",
3163
- "description": "Alias for market."
3164
- },
3165
- "markets": {
3166
- "type": "array",
3167
- "items": {
3168
- "type": "string"
3169
- },
3170
- "description": "Explicit list of market symbols."
3171
- },
3172
- "symbols": {
3173
- "type": "array",
3174
- "items": {
3175
- "type": "string"
3176
- },
3177
- "description": "Alias for markets."
3178
- },
3179
- "mode": {
3180
- "type": "string",
3181
- "enum": [
3182
- "matching",
3183
- "all"
3184
- ],
3185
- "description": "matching selects requested symbols; all selects every live item returned by the product."
3186
- },
3187
- "selector": {
3188
- "type": "object",
3189
- "properties": {
3190
- "mode": {
3191
- "type": "string",
3192
- "enum": [
3193
- "matching",
3194
- "all"
3195
- ]
3196
- },
3197
- "market": {
3198
- "type": "string"
3199
- },
3200
- "symbol": {
3201
- "type": "string"
3202
- },
3203
- "markets": {
3204
- "type": "array",
3205
- "items": {
3206
- "type": "string"
3207
- }
3208
- },
3209
- "symbols": {
3210
- "type": "array",
3211
- "items": {
3212
- "type": "string"
3213
- }
3214
- },
3215
- "side": {
3216
- "type": "string",
3217
- "enum": [
3218
- "long",
3219
- "short"
3220
- ]
3221
- }
3222
- },
3223
- "additionalProperties": false
4136
+ "number"
4137
+ ]
3224
4138
  },
3225
- "side": {
3226
- "type": "string",
3227
- "enum": [
3228
- "long",
3229
- "short"
3230
- ],
3231
- "description": "Optional position/order side filter."
4139
+ "offset_pct": {
4140
+ "type": "number",
4141
+ "description": "Limit price offset from the current market price when limit_price is omitted."
3232
4142
  },
3233
- "timeout_ms": {
3234
- "type": "number"
4143
+ "confirm_live": {
4144
+ "type": "boolean",
4145
+ "description": "Required when submission uses visible controls against the live provider."
3235
4146
  },
3236
- "state": {
4147
+ "identity_rounding_tolerance_base_units": {
3237
4148
  "type": "string",
3238
- "enum": [
3239
- "none",
3240
- "absent",
3241
- "closed",
3242
- "open",
3243
- "present"
3244
- ],
3245
- "description": "Desired/expected selected collection state."
4149
+ "default": "10000",
4150
+ "description": "Maximum visible amount/price rounding delta in six-decimal USDC base units; default 10000 and capped at 1000000."
3246
4151
  }
3247
4152
  },
3248
- "required": [
3249
- "state"
3250
- ],
3251
4153
  "additionalProperties": false
3252
4154
  },
3253
4155
  "examples": [
3254
4156
  {
3255
- "action": "metamask.perps.assert_positions",
3256
- "state": "open",
4157
+ "action": "metamask.perps.place_order",
3257
4158
  "market": "BTC",
3258
- "intent": "Assert the expected Perps position state",
4159
+ "side": "long",
4160
+ "notional": "10",
4161
+ "leverage": 1,
4162
+ "identity_rounding_tolerance_base_units": "10000",
4163
+ "intent": "Place the requested Perps order",
3259
4164
  "next": "done"
3260
4165
  }
3261
4166
  ],
3262
- "execution_capabilities": []
4167
+ "execution_capabilities": [
4168
+ "app-mutation",
4169
+ "external-mutation"
4170
+ ]
3263
4171
  },
3264
- "metamask.perps.assert_orders": {
3265
- "description": "extension Assert live Perps open orders are present or absent for an explicit market selection or mode=all.",
4172
+ "metamask.perps.assert_positions": {
4173
+ "description": "extension Assert live Perps positions are present or absent for an explicit market selection or mode=all.",
3266
4174
  "schema": {
3267
4175
  "type": "object",
3268
4176
  "properties": {
@@ -3364,17 +4272,17 @@
3364
4272
  },
3365
4273
  "examples": [
3366
4274
  {
3367
- "action": "metamask.perps.assert_orders",
3368
- "state": "none",
4275
+ "action": "metamask.perps.assert_positions",
4276
+ "state": "open",
3369
4277
  "market": "BTC",
3370
- "intent": "Assert the expected Perps open order state",
4278
+ "intent": "Assert the expected Perps position state",
3371
4279
  "next": "done"
3372
4280
  }
3373
4281
  ],
3374
4282
  "execution_capabilities": []
3375
4283
  },
3376
- "metamask.perps.ensure_positions": {
3377
- "description": "extension Default to testnet for Perps mutations; mainnet is read-only unless explicitly requested. Higher-level wrapper that reads selected positions, closes or places when needed, then asserts final position state.",
4284
+ "metamask.perps.assert_orders": {
4285
+ "description": "extension Assert live Perps open orders are present or absent for an explicit market selection or mode=all.",
3378
4286
  "schema": {
3379
4287
  "type": "object",
3380
4288
  "properties": {
@@ -3452,25 +4360,11 @@
3452
4360
  "long",
3453
4361
  "short"
3454
4362
  ],
3455
- "description": "Required when state=open/present; otherwise filters selected positions."
4363
+ "description": "Optional position/order side filter."
3456
4364
  },
3457
4365
  "timeout_ms": {
3458
4366
  "type": "number"
3459
4367
  },
3460
- "amount": {
3461
- "type": [
3462
- "string",
3463
- "number"
3464
- ],
3465
- "description": "Explicit USD notional used only when creating a missing open position. Alias: notional."
3466
- },
3467
- "notional": {
3468
- "type": [
3469
- "string",
3470
- "number"
3471
- ],
3472
- "description": "Alias for amount."
3473
- },
3474
4368
  "state": {
3475
4369
  "type": "string",
3476
4370
  "enum": [
@@ -3490,36 +4384,17 @@
3490
4384
  },
3491
4385
  "examples": [
3492
4386
  {
3493
- "action": "metamask.perps.ensure_positions",
4387
+ "action": "metamask.perps.assert_orders",
3494
4388
  "state": "none",
3495
4389
  "market": "BTC",
3496
- "intent": "Converge Perps positions to the requested state",
3497
- "next": "done"
3498
- },
3499
- {
3500
- "action": "metamask.perps.ensure_positions",
3501
- "state": "none",
3502
- "mode": "all",
3503
- "intent": "Converge Perps positions to the requested state",
3504
- "next": "done"
3505
- },
3506
- {
3507
- "action": "metamask.perps.ensure_positions",
3508
- "market": "ETH",
3509
- "side": "long",
3510
- "state": "open",
3511
- "notional": "10",
3512
- "intent": "Converge ETH positions to one explicit testnet precondition",
4390
+ "intent": "Assert the expected Perps open order state",
3513
4391
  "next": "done"
3514
4392
  }
3515
4393
  ],
3516
- "execution_capabilities": [
3517
- "app-mutation",
3518
- "external-mutation"
3519
- ]
4394
+ "execution_capabilities": []
3520
4395
  },
3521
- "metamask.perps.ensure_orders": {
3522
- "description": "extension Converge selected testnet orders to open or absent, then independently assert the final state. Creating an open state uses a resting limit order.",
4396
+ "metamask.perps.ensure_positions": {
4397
+ "description": "Read and assert the selected Extension Perps position state without creating or closing a position. Use an explicitly funded leaf action for any transition.",
3523
4398
  "schema": {
3524
4399
  "type": "object",
3525
4400
  "properties": {
@@ -3597,30 +4472,11 @@
3597
4472
  "long",
3598
4473
  "short"
3599
4474
  ],
3600
- "description": "Required when state=open/present; otherwise filters selected orders."
4475
+ "description": "Required when state=open/present; otherwise filters selected positions."
3601
4476
  },
3602
4477
  "timeout_ms": {
3603
4478
  "type": "number"
3604
4479
  },
3605
- "amount": {
3606
- "type": [
3607
- "string",
3608
- "number"
3609
- ],
3610
- "description": "Explicit USD notional used only when creating a missing open order. Alias: notional."
3611
- },
3612
- "notional": {
3613
- "type": [
3614
- "string",
3615
- "number"
3616
- ],
3617
- "description": "Alias for amount."
3618
- },
3619
- "leverage": {
3620
- "type": "number",
3621
- "default": 3,
3622
- "description": "Testnet leverage used only when creating a missing open order."
3623
- },
3624
4480
  "state": {
3625
4481
  "type": "string",
3626
4482
  "enum": [
@@ -3640,198 +4496,69 @@
3640
4496
  },
3641
4497
  "examples": [
3642
4498
  {
3643
- "action": "metamask.perps.ensure_orders",
4499
+ "action": "metamask.perps.ensure_positions",
4500
+ "state": "none",
4501
+ "market": "BTC",
4502
+ "intent": "Assert that no matching Perps position exists",
4503
+ "next": "done"
4504
+ },
4505
+ {
4506
+ "action": "metamask.perps.ensure_positions",
3644
4507
  "state": "none",
3645
4508
  "mode": "all",
3646
- "intent": "Converge Perps orders to the requested state",
4509
+ "intent": "Assert that no Perps position exists",
3647
4510
  "next": "done"
3648
4511
  },
3649
4512
  {
3650
- "action": "metamask.perps.ensure_orders",
4513
+ "action": "metamask.perps.ensure_positions",
3651
4514
  "market": "ETH",
3652
- "side": "short",
4515
+ "side": "long",
3653
4516
  "state": "open",
3654
- "notional": 10,
3655
- "leverage": 2,
3656
- "intent": "Converge ETH open orders to one deterministic testnet precondition",
4517
+ "intent": "Assert that the matching ETH long position already exists",
3657
4518
  "next": "done"
3658
4519
  }
3659
4520
  ],
3660
4521
  "execution_capabilities": [
3661
- "app-mutation",
3662
- "external-mutation"
3663
- ]
3664
- },
3665
- "metamask.perps.start_state": {
3666
- "description": "extension 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.",
3667
- "schema": {
3668
- "type": "object",
3669
- "properties": {
3670
- "profile": {
3671
- "type": "string",
3672
- "description": "Optional profile such as clean_market_testnet, open_position_testnet, open_order_testnet, or provider_mainnet_readonly."
3673
- },
3674
- "account": {
3675
- "type": "string"
3676
- },
3677
- "provider": {
3678
- "type": "string",
3679
- "description": "Requested Perps provider, e.g. hyperliquid."
3680
- },
3681
- "network": {
3682
- "type": "string",
3683
- "enum": [
3684
- "testnet",
3685
- "mainnet"
3686
- ]
3687
- },
3688
- "market": {
3689
- "type": "string"
3690
- },
3691
- "symbol": {
3692
- "type": "string"
3693
- },
3694
- "markets": {
3695
- "type": "array",
3696
- "items": {
3697
- "type": "string"
3698
- }
3699
- },
3700
- "symbols": {
3701
- "type": "array",
3702
- "items": {
3703
- "type": "string"
3704
- }
3705
- },
3706
- "page": {
3707
- "type": "string",
3708
- "enum": [
3709
- "home",
3710
- "perps",
3711
- "perps_home",
3712
- "market",
3713
- "market_details",
3714
- "trade",
3715
- "order"
3716
- ],
3717
- "description": "Initial Perps page target; omit it to use the profile or market default. Extension start_state always enters Perps before convergence."
3718
- },
3719
- "positions": {
3720
- "type": [
3721
- "object",
3722
- "boolean"
3723
- ],
3724
- "properties": {
3725
- "mode": {
3726
- "type": "string",
3727
- "enum": [
3728
- "matching",
3729
- "all"
3730
- ]
3731
- },
3732
- "market": {
3733
- "type": "string"
3734
- },
3735
- "symbol": {
3736
- "type": "string"
3737
- },
3738
- "markets": {
3739
- "type": "array",
3740
- "items": {
3741
- "type": "string"
3742
- }
3743
- },
3744
- "symbols": {
3745
- "type": "array",
3746
- "items": {
3747
- "type": "string"
3748
- }
3749
- },
3750
- "side": {
3751
- "type": "string",
3752
- "enum": [
3753
- "long",
3754
- "short"
3755
- ]
3756
- },
3757
- "state": {
3758
- "type": "string",
3759
- "enum": [
3760
- "none",
3761
- "closed",
3762
- "absent",
3763
- "open",
3764
- "present"
3765
- ]
3766
- },
3767
- "amount": {
3768
- "type": [
3769
- "string",
3770
- "number"
3771
- ]
3772
- },
3773
- "notional": {
3774
- "type": [
3775
- "string",
3776
- "number"
3777
- ]
3778
- },
3779
- "size": {
3780
- "type": [
3781
- "string",
3782
- "number"
3783
- ]
3784
- },
3785
- "leverage": {
3786
- "type": "number"
3787
- },
3788
- "order_type": {
3789
- "type": "string"
3790
- },
3791
- "orderType": {
3792
- "type": "string"
3793
- },
3794
- "limit_price": {
3795
- "type": "number"
3796
- },
3797
- "limitPrice": {
3798
- "type": "number"
3799
- },
3800
- "offset_pct": {
3801
- "type": "number"
3802
- },
3803
- "offsetPct": {
3804
- "type": "number"
3805
- },
3806
- "current_price": {
3807
- "type": "number"
3808
- },
3809
- "currentPrice": {
3810
- "type": "number"
3811
- },
3812
- "max_slippage_bps": {
3813
- "type": "number"
3814
- },
3815
- "maxSlippageBps": {
3816
- "type": "number"
3817
- },
3818
- "close_attempts": {
3819
- "type": "integer"
3820
- },
3821
- "close_retry_delay_ms": {
3822
- "type": "integer"
3823
- },
3824
- "timeout_ms": {
3825
- "type": "number"
3826
- }
4522
+ "host-read-export"
4523
+ ]
4524
+ },
4525
+ "metamask.perps.ensure_orders": {
4526
+ "description": "Read and assert the selected Extension Perps order state without creating or canceling an order. Use an explicitly funded leaf action for any transition.",
4527
+ "schema": {
4528
+ "type": "object",
4529
+ "properties": {
4530
+ "market": {
4531
+ "type": "string",
4532
+ "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
4533
+ },
4534
+ "symbol": {
4535
+ "type": "string",
4536
+ "description": "Alias for market."
4537
+ },
4538
+ "markets": {
4539
+ "type": "array",
4540
+ "items": {
4541
+ "type": "string"
3827
4542
  },
3828
- "additionalProperties": false
4543
+ "description": "Explicit list of market symbols."
3829
4544
  },
3830
- "orders": {
3831
- "type": [
3832
- "object",
3833
- "boolean"
4545
+ "symbols": {
4546
+ "type": "array",
4547
+ "items": {
4548
+ "type": "string"
4549
+ },
4550
+ "description": "Alias for markets."
4551
+ },
4552
+ "mode": {
4553
+ "type": "string",
4554
+ "enum": [
4555
+ "matching",
4556
+ "all"
3834
4557
  ],
4558
+ "description": "matching selects requested symbols; all selects every live item returned by the product."
4559
+ },
4560
+ "selector": {
4561
+ "type": "object",
3835
4562
  "properties": {
3836
4563
  "mode": {
3837
4564
  "type": "string",
@@ -3864,184 +4591,64 @@
3864
4591
  "long",
3865
4592
  "short"
3866
4593
  ]
3867
- },
3868
- "state": {
3869
- "type": "string",
3870
- "enum": [
3871
- "none",
3872
- "closed",
3873
- "absent",
3874
- "open",
3875
- "present"
3876
- ]
3877
- },
3878
- "amount": {
3879
- "type": [
3880
- "string",
3881
- "number"
3882
- ]
3883
- },
3884
- "notional": {
3885
- "type": [
3886
- "string",
3887
- "number"
3888
- ]
3889
- },
3890
- "size": {
3891
- "type": [
3892
- "string",
3893
- "number"
3894
- ]
3895
- },
3896
- "leverage": {
3897
- "type": "number"
3898
- },
3899
- "order_type": {
3900
- "type": "string"
3901
- },
3902
- "orderType": {
3903
- "type": "string"
3904
- },
3905
- "limit_price": {
3906
- "type": "number"
3907
- },
3908
- "limitPrice": {
3909
- "type": "number"
3910
- },
3911
- "offset_pct": {
3912
- "type": "number"
3913
- },
3914
- "offsetPct": {
3915
- "type": "number"
3916
- },
3917
- "current_price": {
3918
- "type": "number"
3919
- },
3920
- "currentPrice": {
3921
- "type": "number"
3922
- },
3923
- "max_slippage_bps": {
3924
- "type": "number"
3925
- },
3926
- "maxSlippageBps": {
3927
- "type": "number"
3928
- },
3929
- "close_attempts": {
3930
- "type": "integer"
3931
- },
3932
- "close_retry_delay_ms": {
3933
- "type": "integer"
3934
- },
3935
- "timeout_ms": {
3936
- "type": "number"
3937
4594
  }
3938
4595
  },
3939
4596
  "additionalProperties": false
3940
4597
  },
3941
- "hud": {
3942
- "type": "object",
3943
- "properties": {},
3944
- "additionalProperties": false
3945
- },
3946
- "timeout_ms": {
3947
- "type": "number"
3948
- },
3949
4598
  "side": {
3950
4599
  "type": "string",
3951
4600
  "enum": [
3952
4601
  "long",
3953
4602
  "short"
3954
- ]
3955
- },
3956
- "account_name": {
3957
- "type": "string"
3958
- },
3959
- "readyToTrade": {
3960
- "type": "boolean"
4603
+ ],
4604
+ "description": "Required when state=open/present; otherwise filters selected orders."
3961
4605
  },
3962
- "balance": {
3963
- "type": "object",
3964
- "properties": {
3965
- "minWithdrawableUsd": {
3966
- "type": "number"
3967
- },
3968
- "minUsd": {
3969
- "type": "number"
3970
- },
3971
- "minSpendableUsd": {
3972
- "type": "number"
3973
- }
3974
- },
3975
- "additionalProperties": false
4606
+ "timeout_ms": {
4607
+ "type": "number"
3976
4608
  },
3977
- "mode": {
4609
+ "state": {
3978
4610
  "type": "string",
3979
4611
  "enum": [
3980
- "matching",
3981
- "all"
3982
- ]
4612
+ "none",
4613
+ "absent",
4614
+ "closed",
4615
+ "open",
4616
+ "present"
4617
+ ],
4618
+ "description": "Desired/expected selected collection state."
3983
4619
  }
3984
4620
  },
4621
+ "required": [
4622
+ "state"
4623
+ ],
3985
4624
  "additionalProperties": false
3986
4625
  },
3987
4626
  "examples": [
3988
4627
  {
3989
- "action": "metamask.perps.start_state",
3990
- "profile": "clean_market_testnet",
3991
- "market": "BTC",
3992
- "positions": {
3993
- "state": "none"
3994
- },
3995
- "orders": {
3996
- "state": "none"
3997
- },
3998
- "intent": "Prepare the Perps start state for the proof",
3999
- "network": "testnet",
4628
+ "action": "metamask.perps.ensure_orders",
4629
+ "state": "none",
4630
+ "mode": "all",
4631
+ "intent": "Assert that no Perps order exists",
4000
4632
  "next": "done"
4001
4633
  },
4002
4634
  {
4003
- "action": "metamask.perps.start_state",
4004
- "profile": "open_position_testnet",
4635
+ "action": "metamask.perps.ensure_orders",
4005
4636
  "market": "ETH",
4006
- "side": "long",
4007
- "positions": {
4008
- "state": "open",
4009
- "notional": "10",
4010
- "leverage": 2
4011
- },
4012
- "intent": "Prepare the Perps start state for the proof",
4013
- "network": "testnet",
4637
+ "side": "short",
4638
+ "state": "open",
4639
+ "intent": "Assert that the matching ETH short order already exists",
4014
4640
  "next": "done"
4015
4641
  }
4016
4642
  ],
4017
4643
  "execution_capabilities": [
4018
- "app-mutation",
4019
- "external-mutation"
4644
+ "host-read-export"
4020
4645
  ]
4021
4646
  },
4022
4647
  "metamask.perps.teardown_state": {
4023
- "description": "extension Recommended configurable Perps teardown state that restores the selected environment after proof.",
4648
+ "description": "Observe and assert the requested final Extension Perps order and position state, then optionally navigate. This action never closes or cancels financial state.",
4024
4649
  "schema": {
4025
4650
  "type": "object",
4026
4651
  "properties": {
4027
- "profile": {
4028
- "type": "string",
4029
- "description": "Optional profile such as clean_market_testnet, open_position_testnet, open_order_testnet, or provider_mainnet_readonly."
4030
- },
4031
- "account": {
4032
- "type": "string"
4033
- },
4034
- "provider": {
4035
- "type": "string",
4036
- "description": "Requested Perps provider, e.g. hyperliquid."
4037
- },
4038
- "network": {
4039
- "type": "string",
4040
- "enum": [
4041
- "testnet",
4042
- "mainnet"
4043
- ]
4044
- },
4045
4652
  "market": {
4046
4653
  "type": "string"
4047
4654
  },
@@ -4125,63 +4732,6 @@
4125
4732
  "present"
4126
4733
  ]
4127
4734
  },
4128
- "amount": {
4129
- "type": [
4130
- "string",
4131
- "number"
4132
- ]
4133
- },
4134
- "notional": {
4135
- "type": [
4136
- "string",
4137
- "number"
4138
- ]
4139
- },
4140
- "size": {
4141
- "type": [
4142
- "string",
4143
- "number"
4144
- ]
4145
- },
4146
- "leverage": {
4147
- "type": "number"
4148
- },
4149
- "order_type": {
4150
- "type": "string"
4151
- },
4152
- "orderType": {
4153
- "type": "string"
4154
- },
4155
- "limit_price": {
4156
- "type": "number"
4157
- },
4158
- "limitPrice": {
4159
- "type": "number"
4160
- },
4161
- "offset_pct": {
4162
- "type": "number"
4163
- },
4164
- "offsetPct": {
4165
- "type": "number"
4166
- },
4167
- "current_price": {
4168
- "type": "number"
4169
- },
4170
- "currentPrice": {
4171
- "type": "number"
4172
- },
4173
- "max_slippage_bps": {
4174
- "type": "number"
4175
- },
4176
- "maxSlippageBps": {
4177
- "type": "number"
4178
- },
4179
- "close_attempts": {
4180
- "type": "integer"
4181
- },
4182
- "close_retry_delay_ms": {
4183
- "type": "integer"
4184
- },
4185
4735
  "timeout_ms": {
4186
4736
  "type": "number"
4187
4737
  }
@@ -4236,74 +4786,12 @@
4236
4786
  "present"
4237
4787
  ]
4238
4788
  },
4239
- "amount": {
4240
- "type": [
4241
- "string",
4242
- "number"
4243
- ]
4244
- },
4245
- "notional": {
4246
- "type": [
4247
- "string",
4248
- "number"
4249
- ]
4250
- },
4251
- "size": {
4252
- "type": [
4253
- "string",
4254
- "number"
4255
- ]
4256
- },
4257
- "leverage": {
4258
- "type": "number"
4259
- },
4260
- "order_type": {
4261
- "type": "string"
4262
- },
4263
- "orderType": {
4264
- "type": "string"
4265
- },
4266
- "limit_price": {
4267
- "type": "number"
4268
- },
4269
- "limitPrice": {
4270
- "type": "number"
4271
- },
4272
- "offset_pct": {
4273
- "type": "number"
4274
- },
4275
- "offsetPct": {
4276
- "type": "number"
4277
- },
4278
- "current_price": {
4279
- "type": "number"
4280
- },
4281
- "currentPrice": {
4282
- "type": "number"
4283
- },
4284
- "max_slippage_bps": {
4285
- "type": "number"
4286
- },
4287
- "maxSlippageBps": {
4288
- "type": "number"
4289
- },
4290
- "close_attempts": {
4291
- "type": "integer"
4292
- },
4293
- "close_retry_delay_ms": {
4294
- "type": "integer"
4295
- },
4296
4789
  "timeout_ms": {
4297
4790
  "type": "number"
4298
4791
  }
4299
4792
  },
4300
4793
  "additionalProperties": false
4301
4794
  },
4302
- "hud": {
4303
- "type": "object",
4304
- "properties": {},
4305
- "additionalProperties": false
4306
- },
4307
4795
  "timeout_ms": {
4308
4796
  "type": "number"
4309
4797
  },
@@ -4314,27 +4802,6 @@
4314
4802
  "short"
4315
4803
  ]
4316
4804
  },
4317
- "account_name": {
4318
- "type": "string"
4319
- },
4320
- "readyToTrade": {
4321
- "type": "boolean"
4322
- },
4323
- "balance": {
4324
- "type": "object",
4325
- "properties": {
4326
- "minWithdrawableUsd": {
4327
- "type": "number"
4328
- },
4329
- "minUsd": {
4330
- "type": "number"
4331
- },
4332
- "minSpendableUsd": {
4333
- "type": "number"
4334
- }
4335
- },
4336
- "additionalProperties": false
4337
- },
4338
4805
  "mode": {
4339
4806
  "type": "string",
4340
4807
  "enum": [
@@ -4356,19 +4823,18 @@
4356
4823
  "state": "none"
4357
4824
  },
4358
4825
  "page": "home",
4359
- "intent": "Restore Perps state after the proof",
4826
+ "intent": "Assert the final BTC Perps state and return home",
4360
4827
  "next": "done"
4361
4828
  },
4362
4829
  {
4363
4830
  "action": "metamask.perps.teardown_state",
4364
4831
  "market": "BTC",
4365
- "intent": "Restore Perps state after the proof",
4832
+ "intent": "Assert that no matching BTC position or order exists",
4366
4833
  "next": "done"
4367
4834
  }
4368
4835
  ],
4369
4836
  "execution_capabilities": [
4370
- "app-mutation",
4371
- "external-mutation"
4837
+ "app-mutation"
4372
4838
  ]
4373
4839
  },
4374
4840
  "metamask.deeplink.open": {