@deeeed/metamask-harness 0.36.0 → 0.38.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 (140) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/adapters/extension/artifact-runtime-state.cjs +138 -0
  3. package/adapters/extension/inject.mjs +2 -0
  4. package/adapters/extension/launch-browser.cjs +24 -0
  5. package/adapters/extension/live.sh +82 -12
  6. package/adapters/extension/readiness.mjs +77 -36
  7. package/adapters/extension/snapshot-dist.sh +88 -3
  8. package/adapters/extension/verify.sh +6 -2
  9. package/adapters/manifest.json +17 -1
  10. package/adapters/shared/log-tui.mjs +1 -1
  11. package/dist/adapters/extension/artifact-integrity.js +38 -0
  12. package/dist/adapters/extension/extension-id.js +23 -4
  13. package/dist/adapters/extension/release-artifact.js +386 -0
  14. package/dist/adapters/extension/runtime-decision.js +164 -20
  15. package/dist/adapters/extension/runtime.js +169 -3
  16. package/dist/adapters/mobile/provision.js +38 -3
  17. package/dist/adapters/mobile/release-artifact-state.js +124 -0
  18. package/dist/adapters/mobile/release-artifact.js +295 -0
  19. package/dist/adapters.js +78 -6
  20. package/dist/app-lifecycle.js +4 -3
  21. package/dist/command-contract.js +16 -0
  22. package/dist/commands/call.js +6 -2
  23. package/dist/commands/launch/extension.js +74 -9
  24. package/dist/commands/launch/index.js +3 -0
  25. package/dist/commands/launch/mobile.js +2 -0
  26. package/dist/commands/provision.js +2 -0
  27. package/dist/commands/run-engine.js +109 -14
  28. package/dist/commands/run.js +4 -2
  29. package/dist/commands/runtime-launch.js +178 -10
  30. package/dist/heal-bounds.js +1 -1
  31. package/dist/live-adapter-contract.js +3 -1
  32. package/dist/metamask-action-validation.js +47 -1
  33. package/dist/mm-harness-cli.js +31 -1
  34. package/dist/recipe-security.js +40 -0
  35. package/dist/run-diagnostics.js +1 -1
  36. package/dist/runner.js +3 -0
  37. package/docs/RELEASE-QA-CAPABILITY-MAP.md +125 -0
  38. package/library/actions/extension/assets/finish_send.mjs +128 -0
  39. package/library/actions/extension/assets/import_custom_token.mjs +227 -0
  40. package/library/actions/extension/assets/prepare_send.mjs +53 -0
  41. package/library/actions/extension/assets/read_details.mjs +57 -0
  42. package/library/actions/extension/assets/read_visible_state.mjs +50 -0
  43. package/library/actions/extension/assets/review_send.mjs +23 -0
  44. package/library/actions/extension/assets/select_network_scope.mjs +30 -0
  45. package/library/actions/extension/assets/send.mjs +104 -0
  46. package/library/actions/extension/assets/set_custom_gas.mjs +56 -0
  47. package/library/actions/extension/assets/set_token_visibility.mjs +129 -0
  48. package/library/actions/extension/assets/verify_sorting.mjs +89 -0
  49. package/library/actions/extension/networks/add_chainlist.mjs +94 -0
  50. package/library/actions/extension/networks/add_custom.mjs +123 -0
  51. package/library/actions/extension/networks/custom_network.mjs +103 -0
  52. package/library/actions/extension/networks/read_visible_state.mjs +50 -0
  53. package/library/actions/extension/networks/remove_custom.mjs +68 -0
  54. package/library/actions/extension/perps/close_orders.mjs +1 -0
  55. package/library/actions/extension/perps/close_visible_position.mjs +133 -0
  56. package/library/actions/extension/perps/compare_provider_market.mjs +109 -0
  57. package/library/actions/extension/perps/edit_margin.mjs +82 -0
  58. package/library/actions/extension/perps/open_balance_action.mjs +58 -0
  59. package/library/actions/extension/perps/open_position_action.mjs +80 -0
  60. package/library/actions/extension/perps/perps.mjs +196 -2
  61. package/library/actions/extension/perps/place_order.mjs +5 -2
  62. package/library/actions/extension/perps/read_eligibility.mjs +34 -0
  63. package/library/actions/extension/perps/read_funds_confirmation.mjs +69 -0
  64. package/library/actions/extension/perps/read_snapshot.mjs +470 -0
  65. package/library/actions/extension/perps/read_visible_state.mjs +98 -0
  66. package/library/actions/extension/perps/select_activity_filter.mjs +44 -0
  67. package/library/actions/extension/perps/select_market_filter.mjs +71 -0
  68. package/library/actions/extension/perps/set_market_favorite.mjs +47 -0
  69. package/library/actions/extension/perps/update_position_tpsl.mjs +106 -0
  70. package/library/actions/extension/platform/cdp.mjs +109 -3
  71. package/library/actions/extension/settings/set_basic_functionality.mjs +58 -0
  72. package/library/actions/extension/swap_bridge/read_visible_state.mjs +71 -0
  73. package/library/actions/extension/swap_bridge/select_assets.mjs +103 -0
  74. package/library/actions/extension/swap_bridge/set_amount.mjs +36 -0
  75. package/library/actions/extension/swap_bridge/set_max_amount.mjs +58 -0
  76. package/library/actions/extension/swap_bridge/set_slippage.mjs +121 -0
  77. package/library/actions/extension/swap_bridge/submit_transaction.mjs +363 -0
  78. package/library/actions/extension/ui/activate_and_observe.mjs +96 -0
  79. package/library/actions/extension/ui/navigate.mjs +264 -8
  80. package/library/actions/extension/wallet/ensure_unlocked.mjs +2 -6
  81. package/library/actions/extension/wallet/import.mjs +13 -46
  82. package/library/actions/extension/wallet/lock.mjs +35 -0
  83. package/library/actions/extension/wallet/secret-input.mjs +98 -0
  84. package/library/actions/extension/wallet/select_account.mjs +71 -7
  85. package/library/actions/mobile/assets/read_visible_state.mjs +37 -0
  86. package/library/actions/mobile/perps/read_visible_state.mjs +31 -0
  87. package/library/actions/mobile/platform/native-session-name.mjs +5 -0
  88. package/library/actions/mobile/platform/observe-ui.mjs +86 -2
  89. package/library/actions/mobile/swap_bridge/native-session.mjs +45 -0
  90. package/library/actions/mobile/swap_bridge/read_visible_state.mjs +31 -0
  91. package/library/actions/mobile/swap_bridge/select_assets.mjs +94 -0
  92. package/library/actions/mobile/swap_bridge/set_amount.mjs +73 -0
  93. package/library/actions/mobile/ui/native-navigation.mjs +265 -0
  94. package/library/actions/mobile/ui/navigate.mjs +10 -1
  95. package/library/actions/mobile/wallet/ensure_unlocked.mjs +17 -0
  96. package/library/actions/mobile/wallet/import.mjs +71 -2
  97. package/library/actions/mobile/wallet/native-ui.mjs +512 -0
  98. package/library/actions/mobile/wallet/read_state.mjs +16 -0
  99. package/library/actions/mobile/wallet/reset.mjs +17 -4
  100. package/library/actions/shared/assets/visible-state.mjs +176 -0
  101. package/library/actions/shared/networks/visible-state.mjs +70 -0
  102. package/library/actions/shared/perps/visible-state.mjs +354 -0
  103. package/library/actions/shared/swap-bridge/transaction.mjs +54 -0
  104. package/library/actions/shared/swap-bridge/visible-state.mjs +97 -0
  105. package/library/actions/shared/ui/locators.mjs +7 -0
  106. package/library/manifests/extension.action-manifest.json +1366 -184
  107. package/library/manifests/mobile.action-manifest.json +235 -1
  108. package/library/recipes/assets/release-custom-gas-send.recipe.json +88 -0
  109. package/library/recipes/assets/release-custom-network-token-persistence.recipe.json +106 -0
  110. package/library/recipes/assets/release-native-max-cancel.recipe.json +70 -0
  111. package/library/recipes/assets/release-native-max-send.recipe.json +78 -0
  112. package/library/recipes/assets/release-own-account-send.recipe.json +80 -0
  113. package/library/recipes/assets/release-token-address-import.recipe.json +47 -0
  114. package/library/recipes/assets/release-token-details.recipe.json +48 -0
  115. package/library/recipes/assets/release-token-hide-readd.recipe.json +55 -0
  116. package/library/recipes/assets/release-token-list.recipe.json +75 -0
  117. package/library/recipes/assets/release-token-persistence.recipe.json +73 -0
  118. package/library/recipes/assets/release-token-search-import.recipe.json +40 -0
  119. package/library/recipes/assets/release-token-sorting.recipe.json +29 -0
  120. package/library/recipes/extension/networks/release-balance-stability.recipe.json +51 -0
  121. package/library/recipes/extension/perps/release-live-limit-order.recipe.json +104 -0
  122. package/library/recipes/extension/perps/release-order-entry.recipe.json +155 -0
  123. package/library/recipes/extension/perps/release-order-validation.recipe.json +220 -0
  124. package/library/recipes/extension/runner/action-validation.recipe.json +12 -1
  125. package/library/recipes/perps/release-activity-filters.recipe.json +51 -0
  126. package/library/recipes/perps/release-funds-flows.recipe.json +76 -0
  127. package/library/recipes/perps/release-live-market-order.recipe.json +122 -0
  128. package/library/recipes/perps/release-market-details.recipe.json +83 -0
  129. package/library/recipes/perps/release-market-search.recipe.json +79 -0
  130. package/library/recipes/perps/release-watchlist.recipe.json +99 -0
  131. package/library/recipes/swap-bridge/release-custom-slippage.recipe.json +90 -0
  132. package/library/recipes/swap-bridge/release-live-max-swap.recipe.json +99 -0
  133. package/library/recipes/swap-bridge/release-live-swap.recipe.json +101 -0
  134. package/library/recipes/swap-bridge/release-max-quote.recipe.json +72 -0
  135. package/library/recipes/swap-bridge/release-quote.recipe.json +72 -0
  136. package/library/recipes/swap-bridge/release-surface.recipe.json +43 -0
  137. package/library/recipes/wallet/import.recipe.json +20 -1
  138. package/library/recipes/wallet/reset-import.recipe.json +20 -1
  139. package/package.json +6 -5
  140. package/scripts/validate-release-report.mjs +319 -0
@@ -432,17 +432,33 @@
432
432
  "page": {
433
433
  "type": "string",
434
434
  "enum": [
435
- "home",
436
- "perps",
437
- "perps-market"
435
+ "back",
436
+ "home",
437
+ "network",
438
+ "perps",
439
+ "perps-market-list",
440
+ "perps-market",
441
+ "perps-activity",
442
+ "swap"
438
443
  ]
439
444
  },
440
445
  "market": {
441
446
  "type": "string"
442
447
  },
443
- "symbol": {
444
- "type": "string"
445
- },
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
+ },
446
462
  "url": {
447
463
  "type": "string"
448
464
  },
@@ -529,6 +545,70 @@
529
545
  "additionalProperties": false
530
546
  }
531
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
+ },
532
612
  "ui.key_press": {
533
613
  "description": "Send a trusted keyboard press to the currently focused UI element through the UI transport.",
534
614
  "schema": {
@@ -1180,6 +1260,21 @@
1180
1260
  "default": false,
1181
1261
  "description": "Enable MetaMetrics during visible onboarding."
1182
1262
  },
1263
+ "biometrics": {
1264
+ "type": "boolean",
1265
+ "default": false,
1266
+ "description": "Mobile-only biometric onboarding preference; ignored on Extension."
1267
+ },
1268
+ "notifications": {
1269
+ "type": "boolean",
1270
+ "default": false,
1271
+ "description": "Mobile-only push notification onboarding preference; ignored on Extension."
1272
+ },
1273
+ "skip_wallet_tour": {
1274
+ "type": "boolean",
1275
+ "default": true,
1276
+ "description": "Mobile-only wallet-home tour preference; ignored on Extension."
1277
+ },
1183
1278
  "interests": {
1184
1279
  "type": "array",
1185
1280
  "items": {
@@ -1433,219 +1528,1263 @@
1433
1528
  ],
1434
1529
  "execution_capabilities": []
1435
1530
  },
1436
- "metamask.perps.read_positions": {
1437
- "description": "extension Read live Perps positions; without a selector, return all live positions.",
1531
+ "metamask.assets.read_visible_state": {
1532
+ "description": "Read and assert bounded visible wallet assets from an untouched Extension runtime without product background hooks.",
1438
1533
  "schema": {
1439
1534
  "type": "object",
1440
1535
  "properties": {
1441
- "market": {
1442
- "type": "string",
1443
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
1536
+ "minimum_asset_count": {
1537
+ "type": "integer",
1538
+ "minimum": 0,
1539
+ "default": 0
1444
1540
  },
1445
- "symbol": {
1446
- "type": "string",
1447
- "description": "Alias for market."
1541
+ "minimum_price_change_count": {
1542
+ "type": "integer",
1543
+ "minimum": 0,
1544
+ "default": 0
1448
1545
  },
1449
- "markets": {
1450
- "type": "array",
1451
- "items": {
1452
- "type": "string"
1453
- },
1454
- "description": "Explicit list of market symbols."
1546
+ "minimum_without_price_change_count": {
1547
+ "type": "integer",
1548
+ "minimum": 0,
1549
+ "default": 0
1455
1550
  },
1456
- "symbols": {
1551
+ "require_symbols": {
1457
1552
  "type": "array",
1458
- "items": {
1459
- "type": "string"
1460
- },
1461
- "description": "Alias for markets."
1462
- },
1463
- "mode": {
1464
- "type": "string",
1465
- "enum": [
1466
- "matching",
1467
- "all"
1468
- ],
1469
- "description": "matching selects requested symbols; all selects every live item returned by the product."
1553
+ "items": { "type": "string" },
1554
+ "maxItems": 50
1470
1555
  },
1471
- "selector": {
1472
- "type": "object",
1473
- "properties": {
1474
- "mode": {
1475
- "type": "string",
1476
- "enum": [
1477
- "matching",
1478
- "all"
1479
- ]
1480
- },
1481
- "market": {
1482
- "type": "string"
1483
- },
1484
- "symbol": {
1485
- "type": "string"
1486
- },
1487
- "markets": {
1488
- "type": "array",
1489
- "items": {
1490
- "type": "string"
1491
- }
1492
- },
1493
- "symbols": {
1494
- "type": "array",
1495
- "items": {
1496
- "type": "string"
1497
- }
1498
- },
1499
- "side": {
1500
- "type": "string",
1501
- "enum": [
1502
- "long",
1503
- "short"
1504
- ]
1505
- }
1506
- },
1507
- "additionalProperties": false
1556
+ "require_fiat": {
1557
+ "type": "boolean",
1558
+ "default": false
1508
1559
  },
1509
- "side": {
1510
- "type": "string",
1511
- "enum": [
1512
- "long",
1513
- "short"
1514
- ],
1515
- "description": "Optional position/order side filter."
1560
+ "require_price_change_styling": {
1561
+ "type": "boolean",
1562
+ "default": false
1516
1563
  },
1517
- "timeout_ms": {
1518
- "type": "number"
1564
+ "max_items": {
1565
+ "type": "integer",
1566
+ "minimum": 1,
1567
+ "default": 100
1519
1568
  }
1520
1569
  },
1521
1570
  "additionalProperties": false
1522
1571
  },
1523
1572
  "examples": [
1524
1573
  {
1525
- "action": "metamask.perps.read_positions",
1526
- "market": "BTC",
1527
- "intent": "Read Perps positions needed for the proof",
1574
+ "action": "metamask.assets.read_visible_state",
1575
+ "minimum_asset_count": 2,
1576
+ "require_symbols": ["USDC", "BNB"],
1577
+ "require_fiat": true,
1578
+ "require_price_change_styling": true,
1579
+ "minimum_price_change_count": 1,
1580
+ "minimum_without_price_change_count": 1,
1581
+ "intent": "Assert live wallet assets through visible UI",
1528
1582
  "next": "done"
1529
1583
  }
1530
1584
  ],
1531
- "execution_capabilities": []
1585
+ "execution_capabilities": ["host-read-export"]
1532
1586
  },
1533
- "metamask.perps.read_orders": {
1534
- "description": "extension Read live Perps open orders; without a selector, return all live orders.",
1587
+ "metamask.assets.read_details": {
1588
+ "description": "Read and assert the current Extension asset details page through visible UI.",
1535
1589
  "schema": {
1536
1590
  "type": "object",
1537
1591
  "properties": {
1538
- "market": {
1539
- "type": "string",
1540
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
1541
- },
1542
- "symbol": {
1543
- "type": "string",
1544
- "description": "Alias for market."
1545
- },
1546
- "markets": {
1547
- "type": "array",
1548
- "items": {
1549
- "type": "string"
1550
- },
1551
- "description": "Explicit list of market symbols."
1552
- },
1553
- "symbols": {
1554
- "type": "array",
1555
- "items": {
1556
- "type": "string"
1557
- },
1558
- "description": "Alias for markets."
1559
- },
1560
- "mode": {
1561
- "type": "string",
1562
- "enum": [
1563
- "matching",
1564
- "all"
1565
- ],
1566
- "description": "matching selects requested symbols; all selects every live item returned by the product."
1567
- },
1568
- "selector": {
1569
- "type": "object",
1570
- "properties": {
1571
- "mode": {
1572
- "type": "string",
1573
- "enum": [
1574
- "matching",
1575
- "all"
1576
- ]
1577
- },
1578
- "market": {
1579
- "type": "string"
1580
- },
1581
- "symbol": {
1582
- "type": "string"
1583
- },
1584
- "markets": {
1585
- "type": "array",
1586
- "items": {
1587
- "type": "string"
1588
- }
1589
- },
1590
- "symbols": {
1591
- "type": "array",
1592
- "items": {
1593
- "type": "string"
1594
- }
1595
- },
1596
- "side": {
1597
- "type": "string",
1598
- "enum": [
1599
- "long",
1600
- "short"
1601
- ]
1602
- }
1603
- },
1604
- "additionalProperties": false
1605
- },
1606
- "side": {
1607
- "type": "string",
1608
- "enum": [
1609
- "long",
1610
- "short"
1611
- ],
1612
- "description": "Optional position/order side filter."
1613
- },
1614
- "timeout_ms": {
1615
- "type": "number"
1616
- }
1592
+ "expected_symbol": { "type": "string" },
1593
+ "require_chart": { "type": "boolean", "default": false },
1594
+ "require_market_cap": { "type": "boolean", "default": false }
1617
1595
  },
1618
1596
  "additionalProperties": false
1619
1597
  },
1620
1598
  "examples": [
1621
1599
  {
1622
- "action": "metamask.perps.read_orders",
1623
- "market": "BTC",
1624
- "intent": "Read Perps open orders needed for the proof",
1600
+ "action": "metamask.assets.read_details",
1601
+ "expected_symbol": "ETH",
1602
+ "require_chart": true,
1603
+ "require_market_cap": true,
1604
+ "intent": "Prove the current asset details render live market data",
1625
1605
  "next": "done"
1626
1606
  }
1627
1607
  ],
1628
- "execution_capabilities": []
1608
+ "execution_capabilities": ["host-read-export"]
1629
1609
  },
1630
- "metamask.perps.close_positions": {
1631
- "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.",
1610
+ "metamask.assets.verify_sorting": {
1611
+ "description": "Select both visible Extension asset sort modes, assert their row order, and restore declining balance.",
1612
+ "schema": {
1613
+ "type": "object",
1614
+ "properties": {},
1615
+ "additionalProperties": false
1616
+ },
1617
+ "examples": [
1618
+ {
1619
+ "action": "metamask.assets.verify_sorting",
1620
+ "intent": "Verify A-Z and fiat high-low asset sorting",
1621
+ "next": "done"
1622
+ }
1623
+ ],
1624
+ "execution_capabilities": ["app-mutation"]
1625
+ },
1626
+ "metamask.assets.set_token_visibility": {
1627
+ "description": "Enable or disable one searched Extension token through Manage tokens and verify the home list state.",
1632
1628
  "schema": {
1633
1629
  "type": "object",
1634
1630
  "properties": {
1635
- "market": {
1636
- "type": "string",
1637
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
1638
- },
1639
- "symbol": {
1640
- "type": "string",
1641
- "description": "Alias for market."
1642
- },
1643
- "markets": {
1644
- "type": "array",
1645
- "items": {
1646
- "type": "string"
1647
- },
1648
- "description": "Explicit list of market symbols."
1631
+ "query": { "type": "string" },
1632
+ "visible": { "type": "boolean" },
1633
+ "require_unchanged": { "type": "boolean", "default": false },
1634
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 45000 }
1635
+ },
1636
+ "required": ["query", "visible"],
1637
+ "additionalProperties": false
1638
+ },
1639
+ "examples": [
1640
+ {
1641
+ "action": "metamask.assets.set_token_visibility",
1642
+ "query": "DAI",
1643
+ "visible": true,
1644
+ "intent": "Import DAI through live token search",
1645
+ "next": "done"
1646
+ }
1647
+ ],
1648
+ "execution_capabilities": ["app-mutation"]
1649
+ },
1650
+ "metamask.wallet.lock": {
1651
+ "description": "Lock the Extension wallet through the visible global menu and prove the unlock page appears.",
1652
+ "schema": {
1653
+ "type": "object",
1654
+ "properties": {
1655
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 15000 }
1656
+ },
1657
+ "additionalProperties": false
1658
+ },
1659
+ "examples": [
1660
+ {
1661
+ "action": "metamask.wallet.lock",
1662
+ "intent": "Lock the wallet through visible UI",
1663
+ "next": "done"
1664
+ }
1665
+ ],
1666
+ "execution_capabilities": ["app-mutation"]
1667
+ },
1668
+ "metamask.assets.import_custom_token": {
1669
+ "description": "Import one ERC-20 on a selected Extension network through the custom-token form and verify its row.",
1670
+ "schema": {
1671
+ "type": "object",
1672
+ "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 }
1679
+ },
1680
+ "required": ["network", "chain_id", "address", "expected_symbol"],
1681
+ "additionalProperties": false
1682
+ },
1683
+ "examples": [
1684
+ {
1685
+ "action": "metamask.assets.import_custom_token",
1686
+ "network": "Polygon",
1687
+ "chain_id": 137,
1688
+ "address": "0xc2132D05D31c914a87C6611C10748AaCbC5327aE",
1689
+ "expected_symbol": "USDT",
1690
+ "decimals": 6,
1691
+ "intent": "Import Polygon USDT by contract address",
1692
+ "next": "done"
1693
+ }
1694
+ ],
1695
+ "execution_capabilities": ["app-mutation"]
1696
+ },
1697
+ "metamask.assets.prepare_send": {
1698
+ "description": "Prepare a wallet-initiated EVM asset send through visible UI without advancing to confirmation.",
1699
+ "schema": {
1700
+ "type": "object",
1701
+ "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 }
1707
+ },
1708
+ "required": ["symbol", "recipient"],
1709
+ "additionalProperties": false
1710
+ },
1711
+ "examples": [
1712
+ {
1713
+ "action": "metamask.assets.prepare_send",
1714
+ "symbol": "USDC",
1715
+ "recipient": "0x5993d2153f080470bfe765ae81f4fa5fa2080916",
1716
+ "amount": "0.01",
1717
+ "intent": "Prepare a tiny own-account USDC send",
1718
+ "next": "done"
1719
+ }
1720
+ ],
1721
+ "execution_capabilities": ["app-mutation"]
1722
+ },
1723
+ "metamask.assets.review_send": {
1724
+ "description": "Advance a prepared Extension send to confirmation and prove its visible network fee.",
1725
+ "schema": {
1726
+ "type": "object",
1727
+ "properties": {
1728
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
1729
+ },
1730
+ "additionalProperties": false
1731
+ },
1732
+ "examples": [
1733
+ {
1734
+ "action": "metamask.assets.review_send",
1735
+ "intent": "Review the prepared send and its fee",
1736
+ "next": "done"
1737
+ }
1738
+ ],
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"]
1769
+ },
1770
+ "metamask.assets.set_custom_gas": {
1771
+ "description": "Set a custom EVM gas limit on the current Extension send confirmation through visible controls.",
1772
+ "schema": {
1773
+ "type": "object",
1774
+ "properties": {
1775
+ "gas_limit": { "type": ["string", "number"] },
1776
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
1777
+ },
1778
+ "required": ["gas_limit"],
1779
+ "additionalProperties": false
1780
+ },
1781
+ "examples": [
1782
+ {
1783
+ "action": "metamask.assets.set_custom_gas",
1784
+ "gas_limit": 70000,
1785
+ "intent": "Apply a custom gas limit to the reviewed send",
1786
+ "next": "done"
1787
+ }
1788
+ ],
1789
+ "execution_capabilities": ["app-mutation"]
1790
+ },
1791
+ "metamask.assets.select_network_scope": {
1792
+ "description": "Select the all-networks Extension asset scope through the visible network filter.",
1793
+ "schema": {
1794
+ "type": "object",
1795
+ "properties": {
1796
+ "scope": { "type": "string", "enum": ["all"], "default": "all" },
1797
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
1798
+ },
1799
+ "additionalProperties": false
1800
+ },
1801
+ "examples": [
1802
+ {
1803
+ "action": "metamask.assets.select_network_scope",
1804
+ "scope": "all",
1805
+ "intent": "Show assets across all enabled networks",
1806
+ "next": "done"
1807
+ }
1808
+ ],
1809
+ "execution_capabilities": ["app-mutation"]
1810
+ },
1811
+ "metamask.networks.read_visible_state": {
1812
+ "description": "Read one selected Extension network and prove its visible balance rows remain stable across a bounded settle window.",
1813
+ "schema": {
1814
+ "type": "object",
1815
+ "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 }
1826
+ },
1827
+ "required": ["network"],
1828
+ "additionalProperties": false
1829
+ },
1830
+ "examples": [
1831
+ {
1832
+ "action": "metamask.networks.read_visible_state",
1833
+ "network": "HyperEVM",
1834
+ "chain_id": 999,
1835
+ "require_symbols": ["HYPE"],
1836
+ "settle_ms": 30000,
1837
+ "intent": "Assert the selected custom-network balance remains visible",
1838
+ "next": "done"
1839
+ }
1840
+ ],
1841
+ "execution_capabilities": ["host-read-export"]
1842
+ },
1843
+ "metamask.networks.add_custom": {
1844
+ "description": "Add or select one custom Extension network through visible network management controls.",
1845
+ "schema": {
1846
+ "type": "object",
1847
+ "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 }
1854
+ },
1855
+ "required": ["network", "rpc_url", "chain_id", "symbol"],
1856
+ "additionalProperties": false
1857
+ },
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"]
1869
+ },
1870
+ "metamask.networks.add_chainlist": {
1871
+ "description": "Add or select one Extension network from the visible ChainList search results.",
1872
+ "schema": {
1873
+ "type": "object",
1874
+ "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 }
1880
+ },
1881
+ "required": ["network", "chain_id", "symbol"],
1882
+ "additionalProperties": false
1883
+ },
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"]
1894
+ },
1895
+ "metamask.networks.remove_custom": {
1896
+ "description": "Remove one custom Extension network through visible network management controls.",
1897
+ "schema": {
1898
+ "type": "object",
1899
+ "properties": {
1900
+ "network": { "type": "string" },
1901
+ "chain_id": { "type": "integer", "minimum": 1 },
1902
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
1903
+ },
1904
+ "required": ["network", "chain_id"],
1905
+ "additionalProperties": false
1906
+ },
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"]
1915
+ },
1916
+ "metamask.swap_bridge.read_visible_state": {
1917
+ "description": "Read and assert the visible Swap surface from an untouched Extension runtime without product background hooks.",
1918
+ "schema": {
1919
+ "type": "object",
1920
+ "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 }
1927
+ },
1928
+ "additionalProperties": false
1929
+ },
1930
+ "examples": [
1931
+ {
1932
+ "action": "metamask.swap_bridge.read_visible_state",
1933
+ "require_amount_inputs": true,
1934
+ "require_settings": true,
1935
+ "intent": "Assert the visible Swap surface",
1936
+ "next": "done"
1937
+ }
1938
+ ],
1939
+ "execution_capabilities": ["host-read-export"]
1940
+ },
1941
+ "metamask.swap_bridge.select_assets": {
1942
+ "description": "Select exact Swap source and destination assets through the visible asset pickers.",
1943
+ "schema": {
1944
+ "type": "object",
1945
+ "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 }
1955
+ },
1956
+ "required": ["source_symbol", "destination_symbol", "source_chain", "destination_chain"],
1957
+ "additionalProperties": false
1958
+ },
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"]
1969
+ },
1970
+ "metamask.swap_bridge.set_amount": {
1971
+ "description": "Enter a positive Swap amount through visible UI and wait for a quote or explicit no-route state.",
1972
+ "schema": {
1973
+ "type": "object",
1974
+ "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 }
1978
+ },
1979
+ "required": ["amount"],
1980
+ "additionalProperties": false
1981
+ },
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"]
1989
+ },
1990
+ "metamask.swap_bridge.set_slippage": {
1991
+ "description": "Set a custom Swap slippage percentage through the visible transaction settings.",
1992
+ "schema": {
1993
+ "type": "object",
1994
+ "properties": {
1995
+ "percent": { "type": "number", "minimum": 0.01 },
1996
+ "timeout_ms": { "type": "integer", "minimum": 1000, "default": 30000 }
1997
+ },
1998
+ "required": ["percent"],
1999
+ "additionalProperties": false
2000
+ },
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"]
2008
+ },
2009
+ "metamask.swap_bridge.set_max_amount": {
2010
+ "description": "Use the visible Swap Max control and wait for the derived live quote.",
2011
+ "schema": {
2012
+ "type": "object",
2013
+ "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 }
2041
+ },
2042
+ "required": ["source_symbol", "destination_symbol", "amount"],
2043
+ "additionalProperties": false
2044
+ },
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"]
2055
+ },
2056
+ "metamask.perps.read_visible_state": {
2057
+ "description": "Read and assert bounded visible Perps UI state from an untouched Extension runtime without product background hooks.",
2058
+ "schema": {
2059
+ "type": "object",
2060
+ "properties": {
2061
+ "surface": {
2062
+ "type": "string",
2063
+ "enum": ["auto", "home", "market-list", "market-details", "order-entry", "activity", "funds"],
2064
+ "default": "auto"
2065
+ },
2066
+ "market": {
2067
+ "type": "string",
2068
+ "description": "Optional market that must be present in the visible state."
2069
+ },
2070
+ "direction": {
2071
+ "type": "string",
2072
+ "enum": ["long", "short"]
2073
+ },
2074
+ "order_type": {
2075
+ "type": "string",
2076
+ "enum": ["market", "limit"]
2077
+ },
2078
+ "amount": {
2079
+ "type": ["string", "number"]
2080
+ },
2081
+ "percent": {
2082
+ "type": ["string", "number"]
2083
+ },
2084
+ "leverage": {
2085
+ "type": ["string", "number"]
2086
+ },
2087
+ "auto_close": {
2088
+ "type": "boolean"
2089
+ },
2090
+ "submit_enabled": {
2091
+ "type": "boolean"
2092
+ },
2093
+ "require_validation_text": {
2094
+ "type": "array",
2095
+ "items": { "type": "string" },
2096
+ "maxItems": 20
2097
+ },
2098
+ "minimum_market_count": {
2099
+ "type": "integer",
2100
+ "minimum": 0,
2101
+ "default": 0
2102
+ },
2103
+ "maximum_market_count": {
2104
+ "type": "integer",
2105
+ "minimum": 0,
2106
+ "default": 200
2107
+ },
2108
+ "minimum_position_count": {
2109
+ "type": "integer",
2110
+ "minimum": 0,
2111
+ "default": 0
2112
+ },
2113
+ "maximum_position_count": {
2114
+ "type": "integer",
2115
+ "minimum": 0,
2116
+ "default": 200
2117
+ },
2118
+ "minimum_order_count": {
2119
+ "type": "integer",
2120
+ "minimum": 0,
2121
+ "default": 0
2122
+ },
2123
+ "maximum_order_count": {
2124
+ "type": "integer",
2125
+ "minimum": 0,
2126
+ "default": 200
2127
+ },
2128
+ "minimum_activity_count": {
2129
+ "type": "integer",
2130
+ "minimum": 0,
2131
+ "default": 0
2132
+ },
2133
+ "require_no_horizontal_overflow": {
2134
+ "type": "boolean",
2135
+ "default": false
2136
+ },
2137
+ "forbid_test_ids": {
2138
+ "type": "array",
2139
+ "items": { "type": "string" },
2140
+ "maxItems": 100
2141
+ },
2142
+ "require_test_ids": {
2143
+ "type": "array",
2144
+ "items": { "type": "string" },
2145
+ "maxItems": 100
2146
+ },
2147
+ "require_features": {
2148
+ "type": "array",
2149
+ "items": {
2150
+ "type": "string",
2151
+ "enum": ["activity", "balance", "chart", "long-short", "market-list", "order-entry", "price", "price-change", "stats"]
2152
+ },
2153
+ "maxItems": 9
2154
+ },
2155
+ "include_offscreen": {
2156
+ "type": "boolean",
2157
+ "default": true
2158
+ },
2159
+ "max_items": {
2160
+ "type": "integer",
2161
+ "minimum": 1,
2162
+ "default": 100
2163
+ }
2164
+ },
2165
+ "additionalProperties": false
2166
+ },
2167
+ "examples": [
2168
+ {
2169
+ "action": "metamask.perps.read_visible_state",
2170
+ "surface": "home",
2171
+ "minimum_market_count": 1,
2172
+ "require_features": ["balance", "market-list"],
2173
+ "require_test_ids": ["perps-balance-dropdown-balance"],
2174
+ "intent": "Assert the live Perps home surface through visible UI",
2175
+ "next": "done"
2176
+ }
2177
+ ],
2178
+ "execution_capabilities": ["host-read-export"]
2179
+ },
2180
+ "metamask.perps.select_market_filter": {
2181
+ "description": "Select and assert a live Perps market category through trusted visible UI controls.",
2182
+ "schema": {
2183
+ "type": "object",
2184
+ "properties": {
2185
+ "filter": {
2186
+ "type": "string",
2187
+ "enum": ["all", "crypto", "stocks", "pre-ipo", "index", "etf", "commodities", "forex", "new"]
2188
+ },
2189
+ "minimum_market_count": {
2190
+ "type": "integer",
2191
+ "minimum": 0,
2192
+ "default": 1
2193
+ },
2194
+ "maximum_market_count": {
2195
+ "type": "integer",
2196
+ "minimum": 0,
2197
+ "default": 200
2198
+ },
2199
+ "max_items": {
2200
+ "type": "integer",
2201
+ "minimum": 1,
2202
+ "default": 100
2203
+ }
2204
+ },
2205
+ "required": ["filter"],
2206
+ "additionalProperties": false
2207
+ },
2208
+ "examples": [
2209
+ {
2210
+ "action": "metamask.perps.select_market_filter",
2211
+ "filter": "crypto",
2212
+ "minimum_market_count": 1,
2213
+ "intent": "Prove the Crypto market category through visible UI",
2214
+ "next": "done"
2215
+ }
2216
+ ],
2217
+ "execution_capabilities": ["app-mutation"]
2218
+ },
2219
+ "metamask.perps.close_visible_position": {
2220
+ "description": "Close all or part of one live Perps position through semantic visible controls.",
2221
+ "schema": {
2222
+ "type": "object",
2223
+ "properties": {
2224
+ "market": { "type": "string" },
2225
+ "confirm_live": { "type": "boolean", "enum": [true] },
2226
+ "amount": {
2227
+ "type": ["string", "number"],
2228
+ "description": "Optional USD amount for a partial close; omit to close the full position."
2229
+ }
2230
+ },
2231
+ "required": ["market", "confirm_live"],
2232
+ "additionalProperties": false
2233
+ },
2234
+ "examples": [
2235
+ {
2236
+ "action": "metamask.perps.close_visible_position",
2237
+ "market": "BTC",
2238
+ "confirm_live": true,
2239
+ "intent": "Close the visible BTC position after the live release check",
2240
+ "next": "done"
2241
+ }
2242
+ ],
2243
+ "execution_capabilities": ["app-mutation", "external-mutation"]
2244
+ },
2245
+ "metamask.perps.compare_provider_market": {
2246
+ "description": "Compare one visible Perps market with the live Hyperliquid production response.",
2247
+ "schema": {
2248
+ "type": "object",
2249
+ "properties": {
2250
+ "market": { "type": "string" },
2251
+ "endpoint": { "type": "string", "enum": ["https://api.hyperliquid.xyz/info"] },
2252
+ "timeout_ms": { "type": "integer", "minimum": 1 }
2253
+ },
2254
+ "required": ["market"],
2255
+ "additionalProperties": false
2256
+ },
2257
+ "examples": [
2258
+ {
2259
+ "action": "metamask.perps.compare_provider_market",
2260
+ "market": "BTC",
2261
+ "intent": "Compare the visible BTC market with the live production provider",
2262
+ "next": "done"
2263
+ }
2264
+ ],
2265
+ "execution_capabilities": ["host-read-export"]
2266
+ },
2267
+ "metamask.perps.read_eligibility": {
2268
+ "description": "Read the current Extension Perps eligibility and live MetaMask geolocation without changing either.",
2269
+ "schema": {
2270
+ "type": "object",
2271
+ "properties": {
2272
+ "timeout_ms": { "type": "integer", "minimum": 1 }
2273
+ },
2274
+ "additionalProperties": false
2275
+ },
2276
+ "examples": [
2277
+ {
2278
+ "action": "metamask.perps.read_eligibility",
2279
+ "intent": "Record the current release eligibility boundary",
2280
+ "next": "done"
2281
+ }
2282
+ ],
2283
+ "execution_capabilities": ["host-read-export"]
2284
+ },
2285
+ "metamask.perps.set_market_favorite": {
2286
+ "description": "Converge one live Perps market favorite to the requested state through its semantic visible control.",
2287
+ "schema": {
2288
+ "type": "object",
2289
+ "properties": {
2290
+ "market": { "type": "string" },
2291
+ "favorite": { "type": "boolean" }
2292
+ },
2293
+ "required": ["market", "favorite"],
2294
+ "additionalProperties": false
2295
+ },
2296
+ "examples": [
2297
+ {
2298
+ "action": "metamask.perps.set_market_favorite",
2299
+ "market": "BTC",
2300
+ "favorite": true,
2301
+ "intent": "Ensure BTC appears in the Perps watchlist",
2302
+ "next": "done"
2303
+ }
2304
+ ],
2305
+ "execution_capabilities": ["app-mutation"]
2306
+ },
2307
+ "metamask.perps.select_activity_filter": {
2308
+ "description": "Select and read one live Perps activity category through semantic visible controls.",
2309
+ "schema": {
2310
+ "type": "object",
2311
+ "properties": {
2312
+ "filter": {
2313
+ "type": "string",
2314
+ "enum": ["trades", "orders", "funding", "deposits"]
2315
+ }
2316
+ },
2317
+ "required": ["filter"],
2318
+ "additionalProperties": false
2319
+ },
2320
+ "examples": [
2321
+ {
2322
+ "action": "metamask.perps.select_activity_filter",
2323
+ "filter": "trades",
2324
+ "intent": "Show only Perps trade activity",
2325
+ "next": "done"
2326
+ }
2327
+ ],
2328
+ "execution_capabilities": ["app-mutation"]
2329
+ },
2330
+ "metamask.perps.open_balance_action": {
2331
+ "description": "Open Add funds or Withdraw from the live Perps balance dropdown in one trusted UI session.",
2332
+ "schema": {
2333
+ "type": "object",
2334
+ "properties": {
2335
+ "balance_action": {
2336
+ "type": "string",
2337
+ "enum": ["add-funds", "withdraw"]
2338
+ }
2339
+ },
2340
+ "required": ["balance_action"],
2341
+ "additionalProperties": false
2342
+ },
2343
+ "examples": [
2344
+ {
2345
+ "action": "metamask.perps.open_balance_action",
2346
+ "balance_action": "withdraw",
2347
+ "intent": "Open the Perps withdraw flow",
2348
+ "next": "done"
2349
+ }
2350
+ ],
2351
+ "execution_capabilities": ["app-mutation"]
2352
+ },
2353
+ "metamask.perps.open_position_action": {
2354
+ "description": "Open a position-management flow from a live Perps position through visible controls in one trusted UI session.",
2355
+ "schema": {
2356
+ "type": "object",
2357
+ "properties": {
2358
+ "market": { "type": "string" },
2359
+ "position_action": {
2360
+ "type": "string",
2361
+ "enum": ["add-exposure", "reduce-exposure", "reverse", "add-margin", "remove-margin", "auto-close"]
2362
+ }
2363
+ },
2364
+ "required": ["market", "position_action"],
2365
+ "additionalProperties": false
2366
+ },
2367
+ "examples": [
2368
+ {
2369
+ "action": "metamask.perps.open_position_action",
2370
+ "market": "BTC",
2371
+ "position_action": "add-margin",
2372
+ "intent": "Open Add margin for the BTC position",
2373
+ "next": "done"
2374
+ }
2375
+ ],
2376
+ "execution_capabilities": ["app-mutation"]
2377
+ },
2378
+ "metamask.perps.edit_margin": {
2379
+ "description": "Add or remove isolated margin from a live Perps position through visible controls and prove the reconciled position values.",
2380
+ "schema": {
2381
+ "type": "object",
2382
+ "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" }
2388
+ },
2389
+ "required": ["market", "amount", "confirm_live"],
2390
+ "additionalProperties": false
2391
+ },
2392
+ "examples": [
2393
+ {
2394
+ "action": "metamask.perps.edit_margin",
2395
+ "market": "BTC",
2396
+ "margin_action": "add",
2397
+ "amount": 1,
2398
+ "confirm_live": true,
2399
+ "intent": "Add one USDC of margin to the BTC position",
2400
+ "next": "done"
2401
+ }
2402
+ ],
2403
+ "execution_capabilities": ["app-mutation", "external-mutation"]
2404
+ },
2405
+ "metamask.perps.update_position_tpsl": {
2406
+ "description": "Update take-profit and stop-loss for a live Extension Perps position through visible controls and prove the reconciled position row.",
2407
+ "schema": {
2408
+ "type": "object",
2409
+ "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" }
2415
+ },
2416
+ "required": ["market", "confirm_live"],
2417
+ "additionalProperties": false
2418
+ },
2419
+ "examples": [
2420
+ {
2421
+ "action": "metamask.perps.update_position_tpsl",
2422
+ "market": "BTC",
2423
+ "take_profit_price": 65000,
2424
+ "stop_loss_price": 55000,
2425
+ "confirm_live": true,
2426
+ "intent": "Update BTC position auto-close prices",
2427
+ "next": "done"
2428
+ }
2429
+ ],
2430
+ "execution_capabilities": ["app-mutation", "external-mutation"]
2431
+ },
2432
+ "metamask.settings.set_basic_functionality": {
2433
+ "description": "Converge the Extension Basic Functionality privacy setting through its visible toggle and confirmation modal.",
2434
+ "schema": {
2435
+ "type": "object",
2436
+ "properties": {
2437
+ "enabled": { "type": "boolean" }
2438
+ },
2439
+ "required": ["enabled"],
2440
+ "additionalProperties": false
2441
+ },
2442
+ "examples": [
2443
+ {
2444
+ "action": "metamask.settings.set_basic_functionality",
2445
+ "enabled": false,
2446
+ "intent": "Turn Basic Functionality off through Privacy settings",
2447
+ "next": "done"
2448
+ }
2449
+ ],
2450
+ "execution_capabilities": ["app-mutation"]
2451
+ },
2452
+ "metamask.perps.read_funds_confirmation": {
2453
+ "description": "Read the loaded Perps deposit or withdraw confirmation without submitting it.",
2454
+ "schema": {
2455
+ "type": "object",
2456
+ "properties": {
2457
+ "mode": { "type": "string", "enum": ["deposit", "withdraw"] },
2458
+ "require_no_horizontal_overflow": { "type": "boolean", "default": false },
2459
+ "expected_submit_enabled": { "type": "boolean" }
2460
+ },
2461
+ "required": ["mode"],
2462
+ "additionalProperties": false
2463
+ },
2464
+ "examples": [
2465
+ {
2466
+ "action": "metamask.perps.read_funds_confirmation",
2467
+ "mode": "withdraw",
2468
+ "intent": "Read the Perps withdraw fee and receive context",
2469
+ "next": "done"
2470
+ }
2471
+ ],
2472
+ "execution_capabilities": ["host-read-export"]
2473
+ },
2474
+ "metamask.perps.read_snapshot": {
2475
+ "description": "Read a bounded, redacted snapshot of live Extension Perps state through product background APIs.",
2476
+ "schema": {
2477
+ "type": "object",
2478
+ "properties": {
2479
+ "include": {
2480
+ "type": "array",
2481
+ "items": {
2482
+ "type": "string",
2483
+ "enum": [
2484
+ "account",
2485
+ "markets",
2486
+ "positions",
2487
+ "orders",
2488
+ "history",
2489
+ "watchlist"
2490
+ ]
2491
+ },
2492
+ "minItems": 1,
2493
+ "default": [
2494
+ "account",
2495
+ "markets",
2496
+ "positions",
2497
+ "orders",
2498
+ "history",
2499
+ "watchlist"
2500
+ ],
2501
+ "description": "Sections to request. Every requested section must be available or the action fails."
2502
+ },
2503
+ "market": {
2504
+ "type": "string",
2505
+ "description": "Optional single market filter."
2506
+ },
2507
+ "markets": {
2508
+ "type": "array",
2509
+ "items": {
2510
+ "type": "string"
2511
+ },
2512
+ "maxItems": 100,
2513
+ "description": "Optional market filters applied to market-scoped sections."
2514
+ },
2515
+ "history": {
2516
+ "type": "object",
2517
+ "properties": {
2518
+ "start_time_ms": {
2519
+ "type": "integer",
2520
+ "minimum": 0,
2521
+ "description": "Inclusive history start time in Unix milliseconds. Defaults to 30 days before end_time_ms."
2522
+ },
2523
+ "end_time_ms": {
2524
+ "type": "integer",
2525
+ "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."
2531
+ },
2532
+ "limit": {
2533
+ "type": "integer",
2534
+ "minimum": 1,
2535
+ "default": 100,
2536
+ "description": "Maximum history items returned after product filtering."
2537
+ }
2538
+ },
2539
+ "additionalProperties": false
2540
+ },
2541
+ "max_items_per_section": {
2542
+ "type": "integer",
2543
+ "minimum": 1,
2544
+ "default": 100,
2545
+ "description": "Maximum normalized items returned for each requested list section."
2546
+ },
2547
+ "timeout_ms": {
2548
+ "type": "integer",
2549
+ "minimum": 1000,
2550
+ "default": 20000,
2551
+ "description": "Per-request background API timeout."
2552
+ }
2553
+ },
2554
+ "additionalProperties": false
2555
+ },
2556
+ "examples": [
2557
+ {
2558
+ "action": "metamask.perps.read_snapshot",
2559
+ "include": [
2560
+ "account",
2561
+ "markets",
2562
+ "positions",
2563
+ "orders"
2564
+ ],
2565
+ "markets": [
2566
+ "BTC",
2567
+ "ETH"
2568
+ ],
2569
+ "intent": "Read the bounded Perps state needed for release validation",
2570
+ "next": "done"
2571
+ }
2572
+ ],
2573
+ "execution_capabilities": []
2574
+ },
2575
+ "metamask.perps.read_positions": {
2576
+ "description": "extension Read live Perps positions; without a selector, return all live positions.",
2577
+ "schema": {
2578
+ "type": "object",
2579
+ "properties": {
2580
+ "market": {
2581
+ "type": "string",
2582
+ "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
2583
+ },
2584
+ "symbol": {
2585
+ "type": "string",
2586
+ "description": "Alias for market."
2587
+ },
2588
+ "markets": {
2589
+ "type": "array",
2590
+ "items": {
2591
+ "type": "string"
2592
+ },
2593
+ "description": "Explicit list of market symbols."
2594
+ },
2595
+ "symbols": {
2596
+ "type": "array",
2597
+ "items": {
2598
+ "type": "string"
2599
+ },
2600
+ "description": "Alias for markets."
2601
+ },
2602
+ "mode": {
2603
+ "type": "string",
2604
+ "enum": [
2605
+ "matching",
2606
+ "all"
2607
+ ],
2608
+ "description": "matching selects requested symbols; all selects every live item returned by the product."
2609
+ },
2610
+ "selector": {
2611
+ "type": "object",
2612
+ "properties": {
2613
+ "mode": {
2614
+ "type": "string",
2615
+ "enum": [
2616
+ "matching",
2617
+ "all"
2618
+ ]
2619
+ },
2620
+ "market": {
2621
+ "type": "string"
2622
+ },
2623
+ "symbol": {
2624
+ "type": "string"
2625
+ },
2626
+ "markets": {
2627
+ "type": "array",
2628
+ "items": {
2629
+ "type": "string"
2630
+ }
2631
+ },
2632
+ "symbols": {
2633
+ "type": "array",
2634
+ "items": {
2635
+ "type": "string"
2636
+ }
2637
+ },
2638
+ "side": {
2639
+ "type": "string",
2640
+ "enum": [
2641
+ "long",
2642
+ "short"
2643
+ ]
2644
+ }
2645
+ },
2646
+ "additionalProperties": false
2647
+ },
2648
+ "side": {
2649
+ "type": "string",
2650
+ "enum": [
2651
+ "long",
2652
+ "short"
2653
+ ],
2654
+ "description": "Optional position/order side filter."
2655
+ },
2656
+ "timeout_ms": {
2657
+ "type": "number"
2658
+ }
2659
+ },
2660
+ "additionalProperties": false
2661
+ },
2662
+ "examples": [
2663
+ {
2664
+ "action": "metamask.perps.read_positions",
2665
+ "market": "BTC",
2666
+ "intent": "Read Perps positions needed for the proof",
2667
+ "next": "done"
2668
+ }
2669
+ ],
2670
+ "execution_capabilities": []
2671
+ },
2672
+ "metamask.perps.read_orders": {
2673
+ "description": "extension Read live Perps open orders; without a selector, return all live orders.",
2674
+ "schema": {
2675
+ "type": "object",
2676
+ "properties": {
2677
+ "market": {
2678
+ "type": "string",
2679
+ "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
2680
+ },
2681
+ "symbol": {
2682
+ "type": "string",
2683
+ "description": "Alias for market."
2684
+ },
2685
+ "markets": {
2686
+ "type": "array",
2687
+ "items": {
2688
+ "type": "string"
2689
+ },
2690
+ "description": "Explicit list of market symbols."
2691
+ },
2692
+ "symbols": {
2693
+ "type": "array",
2694
+ "items": {
2695
+ "type": "string"
2696
+ },
2697
+ "description": "Alias for markets."
2698
+ },
2699
+ "mode": {
2700
+ "type": "string",
2701
+ "enum": [
2702
+ "matching",
2703
+ "all"
2704
+ ],
2705
+ "description": "matching selects requested symbols; all selects every live item returned by the product."
2706
+ },
2707
+ "selector": {
2708
+ "type": "object",
2709
+ "properties": {
2710
+ "mode": {
2711
+ "type": "string",
2712
+ "enum": [
2713
+ "matching",
2714
+ "all"
2715
+ ]
2716
+ },
2717
+ "market": {
2718
+ "type": "string"
2719
+ },
2720
+ "symbol": {
2721
+ "type": "string"
2722
+ },
2723
+ "markets": {
2724
+ "type": "array",
2725
+ "items": {
2726
+ "type": "string"
2727
+ }
2728
+ },
2729
+ "symbols": {
2730
+ "type": "array",
2731
+ "items": {
2732
+ "type": "string"
2733
+ }
2734
+ },
2735
+ "side": {
2736
+ "type": "string",
2737
+ "enum": [
2738
+ "long",
2739
+ "short"
2740
+ ]
2741
+ }
2742
+ },
2743
+ "additionalProperties": false
2744
+ },
2745
+ "side": {
2746
+ "type": "string",
2747
+ "enum": [
2748
+ "long",
2749
+ "short"
2750
+ ],
2751
+ "description": "Optional position/order side filter."
2752
+ },
2753
+ "timeout_ms": {
2754
+ "type": "number"
2755
+ }
2756
+ },
2757
+ "additionalProperties": false
2758
+ },
2759
+ "examples": [
2760
+ {
2761
+ "action": "metamask.perps.read_orders",
2762
+ "market": "BTC",
2763
+ "intent": "Read Perps open orders needed for the proof",
2764
+ "next": "done"
2765
+ }
2766
+ ],
2767
+ "execution_capabilities": []
2768
+ },
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.",
2771
+ "schema": {
2772
+ "type": "object",
2773
+ "properties": {
2774
+ "market": {
2775
+ "type": "string",
2776
+ "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
2777
+ },
2778
+ "symbol": {
2779
+ "type": "string",
2780
+ "description": "Alias for market."
2781
+ },
2782
+ "markets": {
2783
+ "type": "array",
2784
+ "items": {
2785
+ "type": "string"
2786
+ },
2787
+ "description": "Explicit list of market symbols."
1649
2788
  },
1650
2789
  "symbols": {
1651
2790
  "type": "array",
@@ -1819,6 +2958,10 @@
1819
2958
  },
1820
2959
  "timeout_ms": {
1821
2960
  "type": "number"
2961
+ },
2962
+ "confirm_live": {
2963
+ "type": "boolean",
2964
+ "description": "Required when cancellation uses visible controls against the live provider."
1822
2965
  }
1823
2966
  },
1824
2967
  "additionalProperties": false
@@ -1947,6 +3090,45 @@
1947
3090
  "leverage": {
1948
3091
  "type": "number",
1949
3092
  "default": 3
3093
+ },
3094
+ "order_type": {
3095
+ "type": "string",
3096
+ "enum": [
3097
+ "market",
3098
+ "limit"
3099
+ ],
3100
+ "default": "market"
3101
+ },
3102
+ "position_mode": {
3103
+ "type": "string",
3104
+ "enum": [
3105
+ "new",
3106
+ "modify"
3107
+ ],
3108
+ "default": "new"
3109
+ },
3110
+ "submit_attempts": {
3111
+ "type": "integer",
3112
+ "enum": [
3113
+ 1,
3114
+ 2
3115
+ ],
3116
+ "default": 1,
3117
+ "description": "Dispatch one or two immediate trusted-pointer submissions; two asserts exactly one new limit order."
3118
+ },
3119
+ "limit_price": {
3120
+ "type": [
3121
+ "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."
1950
3132
  }
1951
3133
  },
1952
3134
  "additionalProperties": false