@deeeed/metamask-harness 0.37.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 (113) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/adapters/extension/artifact-runtime-state.cjs +13 -3
  3. package/adapters/extension/inject.mjs +1 -0
  4. package/adapters/extension/launch-browser.cjs +2 -0
  5. package/adapters/extension/live.sh +1 -1
  6. package/adapters/extension/readiness.mjs +1 -1
  7. package/adapters/manifest.json +8 -0
  8. package/dist/adapters/extension/runtime-decision.js +4 -1
  9. package/dist/adapters/extension/runtime.js +42 -3
  10. package/dist/adapters/mobile/provision.js +38 -3
  11. package/dist/adapters.js +68 -3
  12. package/dist/app-lifecycle.js +4 -3
  13. package/dist/commands/call.js +4 -1
  14. package/dist/commands/launch/extension.js +21 -5
  15. package/dist/commands/launch/index.js +3 -0
  16. package/dist/commands/run-engine.js +40 -29
  17. package/dist/commands/run.js +1 -1
  18. package/dist/recipe-security.js +40 -0
  19. package/dist/runner.js +3 -0
  20. package/docs/RELEASE-QA-CAPABILITY-MAP.md +116 -141
  21. package/library/actions/extension/assets/finish_send.mjs +128 -0
  22. package/library/actions/extension/assets/import_custom_token.mjs +227 -0
  23. package/library/actions/extension/assets/prepare_send.mjs +53 -0
  24. package/library/actions/extension/assets/read_details.mjs +57 -0
  25. package/library/actions/extension/assets/read_visible_state.mjs +50 -0
  26. package/library/actions/extension/assets/review_send.mjs +23 -0
  27. package/library/actions/extension/assets/select_network_scope.mjs +30 -0
  28. package/library/actions/extension/assets/send.mjs +104 -0
  29. package/library/actions/extension/assets/set_custom_gas.mjs +56 -0
  30. package/library/actions/extension/assets/set_token_visibility.mjs +129 -0
  31. package/library/actions/extension/assets/verify_sorting.mjs +89 -0
  32. package/library/actions/extension/networks/add_chainlist.mjs +94 -0
  33. package/library/actions/extension/networks/add_custom.mjs +123 -0
  34. package/library/actions/extension/networks/custom_network.mjs +103 -0
  35. package/library/actions/extension/networks/read_visible_state.mjs +50 -0
  36. package/library/actions/extension/networks/remove_custom.mjs +68 -0
  37. package/library/actions/extension/perps/close_orders.mjs +1 -0
  38. package/library/actions/extension/perps/close_visible_position.mjs +133 -0
  39. package/library/actions/extension/perps/compare_provider_market.mjs +109 -0
  40. package/library/actions/extension/perps/edit_margin.mjs +82 -0
  41. package/library/actions/extension/perps/open_balance_action.mjs +58 -0
  42. package/library/actions/extension/perps/open_position_action.mjs +80 -0
  43. package/library/actions/extension/perps/perps.mjs +194 -2
  44. package/library/actions/extension/perps/place_order.mjs +5 -2
  45. package/library/actions/extension/perps/read_eligibility.mjs +34 -0
  46. package/library/actions/extension/perps/read_funds_confirmation.mjs +69 -0
  47. package/library/actions/extension/perps/read_visible_state.mjs +98 -0
  48. package/library/actions/extension/perps/select_activity_filter.mjs +44 -0
  49. package/library/actions/extension/perps/select_market_filter.mjs +71 -0
  50. package/library/actions/extension/perps/set_market_favorite.mjs +47 -0
  51. package/library/actions/extension/perps/update_position_tpsl.mjs +106 -0
  52. package/library/actions/extension/platform/cdp.mjs +104 -1
  53. package/library/actions/extension/settings/set_basic_functionality.mjs +58 -0
  54. package/library/actions/extension/swap_bridge/read_visible_state.mjs +71 -0
  55. package/library/actions/extension/swap_bridge/select_assets.mjs +103 -0
  56. package/library/actions/extension/swap_bridge/set_amount.mjs +36 -0
  57. package/library/actions/extension/swap_bridge/set_max_amount.mjs +58 -0
  58. package/library/actions/extension/swap_bridge/set_slippage.mjs +121 -0
  59. package/library/actions/extension/swap_bridge/submit_transaction.mjs +363 -0
  60. package/library/actions/extension/ui/activate_and_observe.mjs +96 -0
  61. package/library/actions/extension/ui/navigate.mjs +264 -8
  62. package/library/actions/extension/wallet/ensure_unlocked.mjs +2 -6
  63. package/library/actions/extension/wallet/lock.mjs +35 -0
  64. package/library/actions/extension/wallet/select_account.mjs +71 -7
  65. package/library/actions/mobile/assets/read_visible_state.mjs +37 -0
  66. package/library/actions/mobile/perps/read_visible_state.mjs +31 -0
  67. package/library/actions/mobile/platform/native-session-name.mjs +5 -0
  68. package/library/actions/mobile/platform/observe-ui.mjs +5 -3
  69. package/library/actions/mobile/swap_bridge/native-session.mjs +45 -0
  70. package/library/actions/mobile/swap_bridge/read_visible_state.mjs +31 -0
  71. package/library/actions/mobile/swap_bridge/select_assets.mjs +94 -0
  72. package/library/actions/mobile/swap_bridge/set_amount.mjs +73 -0
  73. package/library/actions/mobile/ui/native-navigation.mjs +45 -5
  74. package/library/actions/mobile/ui/navigate.mjs +3 -1
  75. package/library/actions/mobile/wallet/ensure_unlocked.mjs +17 -0
  76. package/library/actions/mobile/wallet/native-ui.mjs +21 -2
  77. package/library/actions/shared/assets/visible-state.mjs +176 -0
  78. package/library/actions/shared/networks/visible-state.mjs +70 -0
  79. package/library/actions/shared/perps/visible-state.mjs +354 -0
  80. package/library/actions/shared/swap-bridge/transaction.mjs +54 -0
  81. package/library/actions/shared/swap-bridge/visible-state.mjs +97 -0
  82. package/library/manifests/extension.action-manifest.json +1255 -189
  83. package/library/manifests/mobile.action-manifest.json +219 -1
  84. package/library/recipes/assets/release-custom-gas-send.recipe.json +88 -0
  85. package/library/recipes/assets/release-custom-network-token-persistence.recipe.json +106 -0
  86. package/library/recipes/assets/release-native-max-cancel.recipe.json +70 -0
  87. package/library/recipes/assets/release-native-max-send.recipe.json +78 -0
  88. package/library/recipes/assets/release-own-account-send.recipe.json +80 -0
  89. package/library/recipes/assets/release-token-address-import.recipe.json +47 -0
  90. package/library/recipes/assets/release-token-details.recipe.json +48 -0
  91. package/library/recipes/assets/release-token-hide-readd.recipe.json +55 -0
  92. package/library/recipes/assets/release-token-list.recipe.json +75 -0
  93. package/library/recipes/assets/release-token-persistence.recipe.json +73 -0
  94. package/library/recipes/assets/release-token-search-import.recipe.json +40 -0
  95. package/library/recipes/assets/release-token-sorting.recipe.json +29 -0
  96. package/library/recipes/extension/networks/release-balance-stability.recipe.json +51 -0
  97. package/library/recipes/extension/perps/release-live-limit-order.recipe.json +104 -0
  98. package/library/recipes/extension/perps/release-order-entry.recipe.json +155 -0
  99. package/library/recipes/extension/perps/release-order-validation.recipe.json +220 -0
  100. package/library/recipes/perps/release-activity-filters.recipe.json +51 -0
  101. package/library/recipes/perps/release-funds-flows.recipe.json +76 -0
  102. package/library/recipes/perps/release-live-market-order.recipe.json +122 -0
  103. package/library/recipes/perps/release-market-details.recipe.json +83 -0
  104. package/library/recipes/perps/release-market-search.recipe.json +79 -0
  105. package/library/recipes/perps/release-watchlist.recipe.json +99 -0
  106. package/library/recipes/swap-bridge/release-custom-slippage.recipe.json +90 -0
  107. package/library/recipes/swap-bridge/release-live-max-swap.recipe.json +99 -0
  108. package/library/recipes/swap-bridge/release-live-swap.recipe.json +101 -0
  109. package/library/recipes/swap-bridge/release-max-quote.recipe.json +72 -0
  110. package/library/recipes/swap-bridge/release-quote.recipe.json +72 -0
  111. package/library/recipes/swap-bridge/release-surface.recipe.json +43 -0
  112. package/package.json +6 -5
  113. 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": {
@@ -1448,224 +1528,1167 @@
1448
1528
  ],
1449
1529
  "execution_capabilities": []
1450
1530
  },
1451
- "metamask.perps.read_snapshot": {
1452
- "description": "Read a bounded, redacted snapshot of live Extension Perps state through product background APIs.",
1531
+ "metamask.assets.read_visible_state": {
1532
+ "description": "Read and assert bounded visible wallet assets from an untouched Extension runtime without product background hooks.",
1453
1533
  "schema": {
1454
1534
  "type": "object",
1455
1535
  "properties": {
1456
- "include": {
1457
- "type": "array",
1458
- "items": {
1459
- "type": "string",
1460
- "enum": [
1461
- "account",
1462
- "markets",
1463
- "positions",
1464
- "orders",
1465
- "history",
1466
- "watchlist"
1467
- ]
1468
- },
1469
- "minItems": 1,
1470
- "default": [
1471
- "account",
1472
- "markets",
1473
- "positions",
1474
- "orders",
1475
- "history",
1476
- "watchlist"
1477
- ],
1478
- "description": "Sections to request. Every requested section must be available or the action fails."
1536
+ "minimum_asset_count": {
1537
+ "type": "integer",
1538
+ "minimum": 0,
1539
+ "default": 0
1479
1540
  },
1480
- "market": {
1481
- "type": "string",
1482
- "description": "Optional single market filter."
1541
+ "minimum_price_change_count": {
1542
+ "type": "integer",
1543
+ "minimum": 0,
1544
+ "default": 0
1483
1545
  },
1484
- "markets": {
1546
+ "minimum_without_price_change_count": {
1547
+ "type": "integer",
1548
+ "minimum": 0,
1549
+ "default": 0
1550
+ },
1551
+ "require_symbols": {
1485
1552
  "type": "array",
1486
- "items": {
1487
- "type": "string"
1488
- },
1489
- "maxItems": 100,
1490
- "description": "Optional market filters applied to market-scoped sections."
1553
+ "items": { "type": "string" },
1554
+ "maxItems": 50
1491
1555
  },
1492
- "history": {
1493
- "type": "object",
1494
- "properties": {
1495
- "start_time_ms": {
1496
- "type": "integer",
1497
- "minimum": 0,
1498
- "description": "Inclusive history start time in Unix milliseconds. Defaults to 30 days before end_time_ms."
1499
- },
1500
- "end_time_ms": {
1501
- "type": "integer",
1502
- "minimum": 0,
1503
- "description": "Inclusive history end time in Unix milliseconds. Defaults to the current time."
1504
- },
1505
- "account_id": {
1506
- "type": "string",
1507
- "description": "Optional CAIP account ID passed to the product history API; the value is not returned."
1508
- },
1509
- "limit": {
1510
- "type": "integer",
1511
- "minimum": 1,
1512
- "default": 100,
1513
- "description": "Maximum history items returned after product filtering."
1514
- }
1515
- },
1516
- "additionalProperties": false
1556
+ "require_fiat": {
1557
+ "type": "boolean",
1558
+ "default": false
1517
1559
  },
1518
- "max_items_per_section": {
1519
- "type": "integer",
1520
- "minimum": 1,
1521
- "default": 100,
1522
- "description": "Maximum normalized items returned for each requested list section."
1560
+ "require_price_change_styling": {
1561
+ "type": "boolean",
1562
+ "default": false
1523
1563
  },
1524
- "timeout_ms": {
1564
+ "max_items": {
1525
1565
  "type": "integer",
1526
- "minimum": 1000,
1527
- "default": 20000,
1528
- "description": "Per-request background API timeout."
1566
+ "minimum": 1,
1567
+ "default": 100
1529
1568
  }
1530
1569
  },
1531
1570
  "additionalProperties": false
1532
1571
  },
1533
1572
  "examples": [
1534
1573
  {
1535
- "action": "metamask.perps.read_snapshot",
1536
- "include": [
1537
- "account",
1538
- "markets",
1539
- "positions",
1540
- "orders"
1541
- ],
1542
- "markets": [
1543
- "BTC",
1544
- "ETH"
1545
- ],
1546
- "intent": "Read the bounded Perps state needed for release validation",
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",
1547
1582
  "next": "done"
1548
1583
  }
1549
1584
  ],
1550
- "execution_capabilities": []
1585
+ "execution_capabilities": ["host-read-export"]
1551
1586
  },
1552
- "metamask.perps.read_positions": {
1553
- "description": "extension Read live Perps positions; without a selector, return all live positions.",
1587
+ "metamask.assets.read_details": {
1588
+ "description": "Read and assert the current Extension asset details page through visible UI.",
1554
1589
  "schema": {
1555
1590
  "type": "object",
1556
1591
  "properties": {
1557
- "market": {
1558
- "type": "string",
1559
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
1560
- },
1561
- "symbol": {
1562
- "type": "string",
1563
- "description": "Alias for market."
1564
- },
1565
- "markets": {
1566
- "type": "array",
1567
- "items": {
1568
- "type": "string"
1569
- },
1570
- "description": "Explicit list of market symbols."
1571
- },
1572
- "symbols": {
1573
- "type": "array",
1574
- "items": {
1575
- "type": "string"
1576
- },
1577
- "description": "Alias for markets."
1578
- },
1579
- "mode": {
1580
- "type": "string",
1581
- "enum": [
1582
- "matching",
1583
- "all"
1584
- ],
1585
- "description": "matching selects requested symbols; all selects every live item returned by the product."
1586
- },
1587
- "selector": {
1588
- "type": "object",
1589
- "properties": {
1590
- "mode": {
1591
- "type": "string",
1592
- "enum": [
1593
- "matching",
1594
- "all"
1595
- ]
1596
- },
1597
- "market": {
1598
- "type": "string"
1599
- },
1600
- "symbol": {
1601
- "type": "string"
1602
- },
1603
- "markets": {
1604
- "type": "array",
1605
- "items": {
1606
- "type": "string"
1607
- }
1608
- },
1609
- "symbols": {
1610
- "type": "array",
1611
- "items": {
1612
- "type": "string"
1613
- }
1614
- },
1615
- "side": {
1616
- "type": "string",
1617
- "enum": [
1618
- "long",
1619
- "short"
1620
- ]
1621
- }
1622
- },
1623
- "additionalProperties": false
1624
- },
1625
- "side": {
1626
- "type": "string",
1627
- "enum": [
1628
- "long",
1629
- "short"
1630
- ],
1631
- "description": "Optional position/order side filter."
1632
- },
1633
- "timeout_ms": {
1634
- "type": "number"
1635
- }
1592
+ "expected_symbol": { "type": "string" },
1593
+ "require_chart": { "type": "boolean", "default": false },
1594
+ "require_market_cap": { "type": "boolean", "default": false }
1636
1595
  },
1637
1596
  "additionalProperties": false
1638
1597
  },
1639
1598
  "examples": [
1640
1599
  {
1641
- "action": "metamask.perps.read_positions",
1642
- "market": "BTC",
1643
- "intent": "Read Perps positions 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",
1644
1605
  "next": "done"
1645
1606
  }
1646
1607
  ],
1647
- "execution_capabilities": []
1608
+ "execution_capabilities": ["host-read-export"]
1648
1609
  },
1649
- "metamask.perps.read_orders": {
1650
- "description": "extension Read live Perps open orders; without a selector, return all live orders.",
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.",
1651
1628
  "schema": {
1652
1629
  "type": "object",
1653
1630
  "properties": {
1654
- "market": {
1655
- "type": "string",
1656
- "description": "Single market symbol, e.g. BTC or ETH. Alias: symbol."
1657
- },
1658
- "symbol": {
1659
- "type": "string",
1660
- "description": "Alias for market."
1661
- },
1662
- "markets": {
1663
- "type": "array",
1664
- "items": {
1665
- "type": "string"
1666
- },
1667
- "description": "Explicit list of market symbols."
1668
- },
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
+ },
1669
2692
  "symbols": {
1670
2693
  "type": "array",
1671
2694
  "items": {
@@ -1935,6 +2958,10 @@
1935
2958
  },
1936
2959
  "timeout_ms": {
1937
2960
  "type": "number"
2961
+ },
2962
+ "confirm_live": {
2963
+ "type": "boolean",
2964
+ "description": "Required when cancellation uses visible controls against the live provider."
1938
2965
  }
1939
2966
  },
1940
2967
  "additionalProperties": false
@@ -2063,6 +3090,45 @@
2063
3090
  "leverage": {
2064
3091
  "type": "number",
2065
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."
2066
3132
  }
2067
3133
  },
2068
3134
  "additionalProperties": false