@deeeed/metamask-harness 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +9 -1
- package/adapters/extension/artifact-runtime-state.cjs +128 -0
- package/adapters/extension/check-infura-readiness.cjs +102 -0
- package/adapters/extension/inject.mjs +2 -0
- package/adapters/extension/launch-browser.cjs +22 -0
- package/adapters/extension/live.sh +103 -18
- package/adapters/extension/readiness.mjs +77 -36
- package/adapters/extension/snapshot-dist.sh +88 -3
- package/adapters/extension/start-watch.sh +15 -0
- package/adapters/extension/verify.sh +6 -2
- package/adapters/extension/wallet-fixture-state.cjs +3 -1
- package/adapters/manifest.json +25 -1
- package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +73 -42
- package/adapters/mobile/reset-app-data.sh +154 -0
- package/adapters/shared/log-tui.mjs +1 -1
- package/dist/adapters/extension/artifact-integrity.js +38 -0
- package/dist/adapters/extension/extension-id.js +23 -4
- package/dist/adapters/extension/product-config.js +29 -1
- package/dist/adapters/extension/release-artifact.js +386 -0
- package/dist/adapters/extension/runtime-decision.js +161 -20
- package/dist/adapters/extension/runtime.js +127 -0
- package/dist/adapters/mobile/release-artifact-state.js +124 -0
- package/dist/adapters/mobile/release-artifact.js +295 -0
- package/dist/adapters.js +29 -4
- package/dist/cli-commands.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/command-contract.js +17 -1
- package/dist/commands/call.js +2 -1
- package/dist/commands/device-target.js +5 -0
- package/dist/commands/fixtures.js +106 -31
- package/dist/commands/launch/extension.js +92 -7
- package/dist/commands/launch/index.js +13 -0
- package/dist/commands/launch/mobile.js +2 -0
- package/dist/commands/provision.js +2 -0
- package/dist/commands/run-engine.js +89 -5
- package/dist/commands/run.js +3 -1
- package/dist/commands/runtime-launch.js +178 -10
- package/dist/heal-bounds.js +1 -1
- package/dist/live-adapter-contract.js +3 -1
- package/dist/metamask-action-validation.js +47 -1
- package/dist/mm-harness-cli.js +37 -4
- package/dist/recipe-security.js +3 -0
- package/dist/run-diagnostics.js +1 -1
- package/docs/RECIPES.md +29 -0
- package/docs/RELEASE-QA-CAPABILITY-MAP.md +150 -0
- package/library/actions/extension/perps/perps.mjs +2 -0
- package/library/actions/extension/perps/read_snapshot.mjs +470 -0
- package/library/actions/extension/platform/cdp.mjs +6 -3
- package/library/actions/extension/wallet/import.mjs +201 -0
- package/library/actions/extension/wallet/reset.mjs +98 -0
- package/library/actions/extension/wallet/secret-input.mjs +98 -0
- package/library/actions/extension/wallet/state.mjs +1 -0
- package/library/actions/mobile/analytics/consent-settings.mjs +112 -0
- package/library/actions/mobile/analytics/set_consent.mjs +4 -112
- package/library/actions/mobile/platform/bridge.mjs +8 -0
- package/library/actions/mobile/platform/observe-ui.mjs +84 -2
- package/library/actions/mobile/ui/native-navigation.mjs +225 -0
- package/library/actions/mobile/ui/navigate.mjs +7 -0
- package/library/actions/mobile/wallet/import.mjs +328 -0
- package/library/actions/mobile/wallet/native-ui.mjs +493 -0
- package/library/actions/mobile/wallet/read_state.mjs +16 -0
- package/library/actions/mobile/wallet/reset-helper.mjs +99 -0
- package/library/actions/mobile/wallet/reset.mjs +20 -0
- package/library/actions/shared/ui/locators.mjs +7 -0
- package/library/actions/shared/wallet/import-source.mjs +101 -0
- package/library/manifests/extension.action-manifest.json +228 -0
- package/library/manifests/mobile.action-manifest.json +124 -0
- package/library/recipes/extension/runner/action-validation.recipe.json +12 -1
- package/library/recipes/wallet/import.recipe.json +102 -0
- package/library/recipes/wallet/reset-import.recipe.json +107 -0
- package/package.json +1 -1
- package/scripts/completions.sh +2 -2
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Reset and import a MetaMask wallet through visible UI",
|
|
4
|
+
"description": "Delete the current Mobile or Extension wallet through its visible reset flow, import the primary mnemonic through onboarding, and prove a selected account is ready.",
|
|
5
|
+
"paramsSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"credential_source": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": ["auto", "environment", "fixture"],
|
|
12
|
+
"default": "auto",
|
|
13
|
+
"description": "Read secrets from the named environment variables first, or require one source explicitly."
|
|
14
|
+
},
|
|
15
|
+
"srp_env": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"default": "MM_HARNESS_WALLET_SRP",
|
|
18
|
+
"description": "Environment variable containing the Secret Recovery Phrase; the value is never stored in the recipe or evidence."
|
|
19
|
+
},
|
|
20
|
+
"password_env": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "MM_HARNESS_WALLET_PASSWORD",
|
|
23
|
+
"description": "Environment variable containing the wallet password; the value is never stored in the recipe or evidence."
|
|
24
|
+
},
|
|
25
|
+
"metametrics": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false,
|
|
28
|
+
"description": "Enable MetaMetrics during visible onboarding; defaults off."
|
|
29
|
+
},
|
|
30
|
+
"biometrics": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"enum": [false],
|
|
33
|
+
"default": false,
|
|
34
|
+
"description": "Enable Mobile biometric authentication during onboarding; defaults off for unattended validation."
|
|
35
|
+
},
|
|
36
|
+
"notifications": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false,
|
|
39
|
+
"description": "Enable Mobile push notifications during onboarding; defaults off."
|
|
40
|
+
},
|
|
41
|
+
"skip_wallet_tour": {
|
|
42
|
+
"type": "boolean",
|
|
43
|
+
"default": true,
|
|
44
|
+
"description": "Skip the Mobile wallet-home tour so the recipe ends at a usable wallet."
|
|
45
|
+
},
|
|
46
|
+
"interests": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": ["swap_tokens", "trade_perpetuals", "prediction_markets", "send_receive_crypto", "earn_and_spend", "use_other_crypto_apps"]
|
|
51
|
+
},
|
|
52
|
+
"default": [],
|
|
53
|
+
"description": "Mobile-only onboarding interests; an empty list skips the optional questionnaire."
|
|
54
|
+
},
|
|
55
|
+
"timeout_ms": {
|
|
56
|
+
"type": "number",
|
|
57
|
+
"default": 300000,
|
|
58
|
+
"description": "Maximum time for each reset/import transition and final wallet readiness."
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"workflow": {
|
|
63
|
+
"entry": "validate_import",
|
|
64
|
+
"nodes": {
|
|
65
|
+
"validate_import": {
|
|
66
|
+
"action": "metamask.wallet.validate_import",
|
|
67
|
+
"credential_source": "{{params.credential_source}}",
|
|
68
|
+
"srp_env": "{{params.srp_env}}",
|
|
69
|
+
"password_env": "{{params.password_env}}",
|
|
70
|
+
"metametrics": "{{params.metametrics}}",
|
|
71
|
+
"interests": "{{params.interests}}",
|
|
72
|
+
"intent": "Validate recovery credentials before deleting the current wallet",
|
|
73
|
+
"next": "reset"
|
|
74
|
+
},
|
|
75
|
+
"reset": {
|
|
76
|
+
"action": "metamask.wallet.reset",
|
|
77
|
+
"timeout_ms": "{{params.timeout_ms}}",
|
|
78
|
+
"intent": "Delete the current wallet through the client-visible reset flow and reach fresh onboarding",
|
|
79
|
+
"next": "import"
|
|
80
|
+
},
|
|
81
|
+
"import": {
|
|
82
|
+
"action": "metamask.wallet.import",
|
|
83
|
+
"method": "ui",
|
|
84
|
+
"credential_source": "{{params.credential_source}}",
|
|
85
|
+
"srp_env": "{{params.srp_env}}",
|
|
86
|
+
"password_env": "{{params.password_env}}",
|
|
87
|
+
"metametrics": "{{params.metametrics}}",
|
|
88
|
+
"biometrics": "{{params.biometrics}}",
|
|
89
|
+
"notifications": "{{params.notifications}}",
|
|
90
|
+
"skip_wallet_tour": "{{params.skip_wallet_tour}}",
|
|
91
|
+
"interests": "{{params.interests}}",
|
|
92
|
+
"timeout_ms": "{{params.timeout_ms}}",
|
|
93
|
+
"intent": "Import the primary mnemonic through visible onboarding UI",
|
|
94
|
+
"next": "state"
|
|
95
|
+
},
|
|
96
|
+
"state": {
|
|
97
|
+
"action": "metamask.wallet.read_state",
|
|
98
|
+
"intent": "Prove the imported wallet has a selected account",
|
|
99
|
+
"next": "done"
|
|
100
|
+
},
|
|
101
|
+
"done": {
|
|
102
|
+
"action": "end",
|
|
103
|
+
"status": "pass"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
package/package.json
CHANGED
package/scripts/completions.sh
CHANGED
|
@@ -77,7 +77,7 @@ if [ -n "${BASH_VERSION:-}" ]; then
|
|
|
77
77
|
|
|
78
78
|
case "$cmd" in
|
|
79
79
|
launch) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "ios android" -- "$cur")) ;;
|
|
80
|
-
fixtures) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "init sync set generate finalize" -- "$cur")) ;;
|
|
80
|
+
fixtures) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "init sync set reset generate finalize" -- "$cur")) ;;
|
|
81
81
|
checklist) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "mark closeout" -- "$cur")) ;;
|
|
82
82
|
completions) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "install bash zsh status" -- "$cur")) ;;
|
|
83
83
|
call) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "$(_mmh_actions)" -- "$cur")) ;;
|
|
@@ -111,7 +111,7 @@ if [ -n "${ZSH_VERSION:-}" ]; then
|
|
|
111
111
|
|
|
112
112
|
case "$cmd" in
|
|
113
113
|
launch) (( CURRENT == 3 )) && { candidates=(ios android); compadd -a candidates; } ;;
|
|
114
|
-
fixtures) (( CURRENT == 3 )) && { candidates=(init sync set generate finalize); compadd -a candidates; } ;;
|
|
114
|
+
fixtures) (( CURRENT == 3 )) && { candidates=(init sync set reset generate finalize); compadd -a candidates; } ;;
|
|
115
115
|
checklist) (( CURRENT == 3 )) && { candidates=(mark closeout); compadd -a candidates; } ;;
|
|
116
116
|
completions) (( CURRENT == 3 )) && { candidates=(install bash zsh status); compadd -a candidates; } ;;
|
|
117
117
|
call) (( CURRENT == 3 )) && { candidates=("${(@f)$(_mmh_actions)}"); compadd -a candidates; } ;;
|