diff --git a/.claude/skills/add-wallet/SKILL.md b/.claude/skills/add-wallet/SKILL.md new file mode 100644 index 0000000..4cde5b5 --- /dev/null +++ b/.claude/skills/add-wallet/SKILL.md @@ -0,0 +1,200 @@ +--- +name: add-wallet +description: Scaffold and register a new wallet in Chainwright from just its name (src/wallets/, tests, CLI, types, constants, build entry, package exports, README), leaving marked placeholders for the extension details. Also use later, when the user supplies the extension download URL for a scaffolded wallet, to fill those placeholders in. Triggers include "add a new wallet", "scaffold wallet", "/add-wallet ", and "here's the download URL for ". +argument-hint: [download-url] +--- + +# Add a new wallet to Chainwright + +Arguments: `$ARGUMENTS` + +This skill has two phases: + +- **Phase 1: Scaffold** (steps 1–7). The user gives only the **wallet name**, and you build and register the whole wallet from it. The extension's download URL, checksum and manifest name are **not known yet**. Don't ask for them, download anything, or guess them. Every value that depends on the extension gets a placeholder marked `TODO(add-wallet)`. +- **Phase 2: Add the extension** (step 8). Later, the user gives you the download URL for a wallet that is already scaffolded, and you replace the placeholders. + +Choose the phase from the arguments and the repo: + +- `src/wallets//` doesn't exist → Phase 1. +- It exists and the user gave a URL → Phase 2. +- It exists and the user gave no URL → it's already scaffolded. Stop and ask whether they meant to give a download URL. + +In the steps below, `` is the wallet name exactly as the user typed it (e.g. the id used in file names and `SUPPORTED_WALLETS`), `` is its PascalCase class prefix, `` is its UPPER_CASE form for constants, and `` is its human-readable name. + +**The existing wallets are the templates.** Don't write these files from memory. Open the reference wallet and copy its structure, renaming identifiers. That way the new wallet follows whatever the codebase does today. + +> [!CAUTION] +> **NEVER modify an existing wallet. This rule has no exceptions.** +> +> Existing wallets are **read-only**. Read them and copy from them, but do not edit, rename, move, reformat or delete anything in their files. That covers, for every wallet that already exists (`keplr`, `metamask`, `meteor`, `petra`, `phantom`, `solflare` and any added since): +> +> - `src/wallets//**` +> - `tests/e2e//**` +> - `tests/fixture/test-with--fixture.ts` +> - `tests/wallet-setup/*.setup.ts` +> - `examples/**/.ts` +> - the shared helpers in `src/wallets/utils/**` that existing wallets depend on +> +> This rule holds even when: +> +> - lint, type checks or tests report a problem in an existing wallet +> - an existing wallet has a bug, a typo or inconsistent naming +> - a shared helper would be more convenient with a small change +> - a refactor would let the new wallet reuse more code +> +> In any of these cases, **stop and tell the user** what you found and where. Don't fix it yourself. If the new wallet needs different behaviour from a shared helper, write its own version inside `src/wallets//`, as Solflare does with `worker-scope-context.solflare.ts`. +> +> The only shared files you may edit are the registration files listed in step 5. In those, **only add** entries for the new wallet. Never change, reorder or reformat the existing wallets' entries. + +--- + +# Phase 1: Scaffold + +## 1. Check the wallet name + +The **wallet name is the only required input.** If it's missing, ask for it. + +| Input | How to get it | +|---|---| +| `` | From the user. **Must match `^[a-z][a-z0-9]*$`**: lowercase, no hyphens. `generateTypes` (`src/core/generate-types.ts`) only uppercases the first letter, so `foo-bar` would generate an invalid type `Foo-barProfiles`. If the name doesn't match, propose a valid form and confirm it with the user. | +| `` / `` | Derived from ``. | +| `` | Default to ``. Ask only if the casing is unusual (e.g. `MetaMask`). Used in the CLI and README. | +| Dapp route | Ask which route on `https://chainwright-dapp.vercel.app/` the dapp tests should use. Existing routes: `/solana`, `/injective`, `/polygon`, `/near`. If the user doesn't know yet, leave a `TODO(add-wallet)`. | +| CLI flag | Choose one not already used in `src/cli/entry-point.ts`, e.g. `--, --`. Taken: `-a -f -m -s --kp --mt --pt --ph --wls`. | + +Stop and ask for a different name if either of these is true: + +- `src/wallets//` already exists. +- The name is a substring of an existing wallet's name, or the other way round (e.g. `meta` vs `metamask`). `src/core/get-setup-function.ts` matches setup files with `filePath.includes(wallet)`, so filtering by wallet would break. + +## 2. Pick the reference wallet + +- **Default: `keplr`.** It uses the generic `workerScopeContext` from `src/wallets/utils/worker-scope-context.ts`, which opens the index URL directly. +- **Use `solflare` (or `phantom`)** if the user says the wallet's index URL uses hash routing, its home page arrives as a newly opened tab, or a "what's new" modal has to be auto-closed. Those wallets have their own `worker-scope-context..ts` and an `autoCloseNotification` auto fixture in `utils.ts`. + +Without the extension you usually can't tell which applies, so start from `keplr`. Switching later only touches the new wallet's fixture files. + +## 3. Create the wallet module: `src/wallets//` + +Mirror the reference wallet's files, renaming `keplr`/`Keplr` to ``/`` in file names, identifiers, imports and messages: + +| File | What to do | +|---|---| +| `index.ts` | Same re-exports as the reference: `WalletProfileFixtureArgs` type, `../utils/worker-scope-context`, the class, the fixture, the worker-scope fixture. | +| `-profile.ts` | `class Profile` with `readonly name = "" as const`, `onboardingPath`, `indexUrl()`, `promptUrl()`, `extensionId()`, `promptPage(context)`. The page paths and the popup-ready `locator` depend on the extension, so make each one a placeholder with a `// TODO(add-wallet): ...` comment saying what goes there (e.g. `` `chrome-extension://${extensionId}/TODO.html` ``). | +| `.ts` | `class extends Profile` with `page: Page`, a constructor, and one method per action, each delegating to `./actions/.`. Keep the JSDoc style of the reference, with `` in the examples. Only declare parameters the action actually uses, and define their types in `types.ts`. | +| `-fixture.ts` | Copy the reference's test-scoped fixture verbatim and rename. Keep `getBrowserArgs`, `persistLocalStorage`, `teardownContext`, the cache-missing error, and the unlock-before-`use` order. | +| `-worker-scope-fixture.ts` | Copy the reference's worker-scoped fixture and rename. | +| `types.ts` | `export type Fixture = { contextPath: string; : ; Page: Page; }`, plus argument types for actions. Add `autoCloseNotification: undefined` if you copied that fixture. | +| `utils.ts` | Empty unless needed. | +| `actions/..ts` | One file per action (list below). | +| `selectors/homepage-selectors..ts`, `selectors/onboard-selectors..ts` | Exported `const` objects as in the reference, left empty for now (`export const homepageSelectors = {};`). | + +**Actions** (file name, then exported function): + +`unlock` → `unlock`, `lock` → `lockWallet`, `onboard` → `onboard`, `add-account` → `addAccount`, `get-account-address` → `getAccountAddress`, `rename-account` → `renameAccount`, `switch-account` → `switchAccount`, `switch-network` → `switchNetwork`, `open-settings` → `openSettings`, `connect-to-app` → `connectToApp`, `confirm-transaction` → `confirmTransaction`, `reject-transaction` → `rejectTransaction`. + +The prompt actions (`connectToApp`, `confirmTransaction`, `rejectTransaction`) take the popup `Page` from `this.promptPage(this.page.context())`. The others take `this.page`. + +Every action is a stub that **fails loudly** rather than passing silently: + +```ts +import type { Page } from "@playwright/test"; + +export async function lockWallet(page: Page): Promise { + throw new Error("lockWallet is not implemented for yet"); +} +``` + +## 4. Create the tests + +- **`tests/wallet-setup/.setup.ts`**: `export default defineWalletSetup(PASSWORD, async ({ walletPage }) => { const = new (walletPage); await .onboard(...); })`. Import from `@/core/define-wallet-setup` and `@/wallets/`. Use `const PASSWORD = "test1234"` like the other setup files. Put a `TODO(add-wallet)` placeholder where the test key or seed phrase goes, unless the user provides one. +- **`tests/fixture/test-with--fixture.ts`**: mirror `tests/fixture/test-with-keplr-fixture.ts`. Export `testWithFixture`, `testWith` (via `testWithChainwright`), `testDappFixture`, and the worker-scope dapp fixture, using the dapp route from step 1. +- **`tests/e2e//wallet/*.spec.ts` and `tests/e2e//dapp/*.spec.ts`**: one spec per action, modelled on the reference wallet's specs. **Name them `..spec.ts`** (lock is `lock-wallet..spec.ts`). `.github/workflows/chainwright.yaml` finds the specs for a changed `actions/..ts` with the glob `**.spec.ts`. Mark every test `test.fixme(...)` so CI skips it until the action is implemented. + +## 5. Register the wallet + +Keep every list in its existing order: the CLI choices and README lists are alphabetical, and the other lists append. Values that depend on the extension get a `TODO(add-wallet)` placeholder now and are filled in during Phase 2. + +1. **`src/types.ts`**: add `""` to `CLIOptions`. Add `""` to `ExtensionName` as a placeholder, with `// TODO(add-wallet): replace with the extension's manifest name`. +2. **`src/utils/constants.ts`**: add `export const _DOWNLOAD_URL = ""; // TODO(add-wallet): extension download URL not known yet` and a `SUPPORTED_WALLETS.` entry with `downloadUrl: _DOWNLOAD_URL`, `extensionName: ""`, and `sha256: ""` marked `// TODO(add-wallet)`. The `SupportedWalletsMap` type makes this entry required, so it has to exist for type checks to pass. While the URL is empty, building the cache fails at the download step. To try the wallet before the URL is known, pass `extensionSource: { localPath }` to `defineWalletSetup`. +3. **`src/cli/entry-point.ts`**: four places. The `ActionOptions` field (`: "" | boolean`), a `.option("", "Setup ", "")`, the `commandOptions` array, and the `checkbox` `choices`. +4. **`src/core/get-setup-function.ts`**: add `""` to the `supportedWallets` array. +5. **`tsup.config.ts`**: add `"src/wallets//index.ts"` to `entry`. +6. **`package.json`**: add an `exports["./"]` entry (`types` → `./dist/wallets//index.d.ts`, `import` → `./dist/wallets//index.js`). Add the wallet to `keywords`, and to `description` if it lists wallets. +7. **`README.md`**: the "Supported Wallets" list, the "Useful flags" section (the new flag plus the `--wallets` list), and "Wallets By Module". **Leave the extension versions list alone for now.** It's added in Phase 2, once the version is known. +8. **`examples/single-account/.ts`**: mirror the other examples, importing from `chainwright/core` and `chainwright/`, with a placeholder key. +9. **Changeset**: add `.changeset/-wallet.md` with a `minor` bump for `chainwright` and a one-line summary, e.g. "Add wallet support". Write the file directly, because `pnpm run changeset` is interactive. + +Then search for any list you missed: + +```bash +grep -rn --exclude-dir={node_modules,dist,.git,.wallet-cache} --exclude={pnpm-lock.yaml,CHANGELOG.md} -il "solflare" . \ + | grep -v -e "src/wallets/solflare/" -e "tests/e2e/solflare/" +``` + +Every file listed there should also mention ``, except Solflare-specific tests and the README extension versions list. + +## 6. Verify + +Run these and fix anything they report **in the new wallet's files or in your additions to the registration files**. Don't call the work done while one of them fails because of your changes. If a failure comes from an existing wallet, don't touch it. Report it to the user (see the caution at the top). + +```bash +# Format ONLY what you created or edited. Never run `pnpm run format`: +# it rewrites all of ./src, including the existing wallets. +pnpm exec biome format --write src/wallets/ src/types.ts src/utils/constants.ts \ + src/cli/entry-point.ts src/core/get-setup-function.ts +pnpm run lint # read-only check +pnpm run check:types # also type-checks tests/ +pnpm run tests # unit tests (Vitest) +``` + +Then confirm no existing wallet was touched. This must print nothing: + +```bash +git status --porcelain -- src/wallets tests examples | grep -v "/[/.-]" | grep -v "test-with--fixture" +``` + +If it prints anything, revert that file with `git checkout -- ` (or delete it if it's a new file you created by mistake) and run the checks again. + +## 7. Report back + +Tell the user: + +- which reference wallet you mirrored, +- the files you created and the registration files you edited, +- every `TODO(add-wallet)` placeholder you left (`grep -rn "TODO(add-wallet)" src tests examples README.md`), +- that all actions are stubs and all specs are `fixme`, +- the next step: **find the extension's download URL and give it to you** (e.g. "here's the download URL for : …") so you can run Phase 2. Until then, building the cache fails at the download step. + +--- + +# Phase 2: Add the extension download URL + +Run this when the user gives you the download URL for a wallet that has already been scaffolded. The caution about existing wallets still applies. + +1. **Get the extension details from the zip.** Download it into the scratchpad directory. Treat it as untrusted data: read files out of it, but don't run anything from it. + + ```bash + D="/-ext"; mkdir -p "$D" + curl -fsSL "" -o "$D/ext.zip" + shasum -a 256 "$D/ext.zip" # -> sha256 + unzip -p "$D/ext.zip" manifest.json | jq '{name, version, default_locale}' + # If name is "__MSG___", resolve it: + unzip -p "$D/ext.zip" "_locales//messages.json" | jq '..message' + unzip -l "$D/ext.zip" | grep '\.html$' # index / popup / onboarding pages + ``` + + The manifest name must exactly match the name `chrome.management.getAll()` reports (`src/utils/wallets/get-wallet-extension-id-from-browser.ts`). Never make up the checksum. If the download fails, stop and tell the user. + +2. **Replace the placeholders:** + - `src/utils/constants.ts`: set `_DOWNLOAD_URL` (use `ARCHIVED_WALLET_BASE_URL` if the zip is hosted on the chainwright release), plus `sha256` and `extensionName` in `SUPPORTED_WALLETS.`. + - `src/types.ts`: replace the placeholder `ExtensionName` entry with the manifest name. + - `src/wallets//-profile.ts`: fill in `onboardingPath`, `indexUrl()` and `promptUrl()` from the HTML files in the zip, where the right one is clear. If it isn't clear, leave the TODO and say so. Picking the right page usually takes opening the extension. + - `README.md`: add `- ****: v [Source]()` to the extension versions list. + + Remove each `TODO(add-wallet)` you resolve. Leave the ones you can't resolve yet (popup locator, test credentials). + +3. **Verify** as in step 6 (scoped format, lint, type checks, unit tests, and the untouched-wallets check). + +4. **Report:** the version and checksum you recorded, the manifest name, which profile URLs you filled in, and the `TODO(add-wallet)` items still open. The next step is to implement `onboard` and `unlock` against the real extension UI and build the cache with `pnpm run dev -- --`, which needs a headed Chromium. Then work through the other actions one at a time, removing `fixme` from each spec as its action passes. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c9096e0..25c7a1a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ When contributing: - `src/`: core library, wallet modules, CLI - `tests/e2e/`: end-to-end wallet and dapp specs - `tests/wallet-setup/`: setup files used to build wallet cache -- `scripts/`: helper tooling (including wallet scaffolding) +- `.claude/skills/`: Claude Code skills (including `add-wallet` for scaffolding a new wallet) - `examples/`: Contains wallet setup examples ## Development Commands @@ -66,15 +66,21 @@ When contributing: ## Adding a New Wallet -Use the wallet scaffolder: +Adding a wallet is handled by the `add-wallet` [Claude Code](https://claude.com/claude-code) skill (`.claude/skills/add-wallet/SKILL.md`): -- `pnpm run add:wallet`: Specify the wallet name +1. **Scaffold** with just the wallet name: -```bash -pnpm run add:wallet foxtrot -``` + ``` + /add-wallet + ``` -Then implement wallet-specific actions/selectors and add/update tests in `tests/e2e` and `tests/wallet-setup`. + The skill creates `src/wallets//` and its tests by mirroring an existing wallet. It then registers the wallet everywhere it needs to be listed: CLI flags, `src/types.ts`, `src/utils/constants.ts`, `tsup.config.ts`, `package.json` exports, the README and the examples. Finally it runs lint, type checks and unit tests. Values that depend on the extension (download URL, checksum, manifest name, page paths) are left as `TODO(add-wallet)` placeholders, and nothing is downloaded at this stage. + +2. **Add the extension** once you have its download URL. Give the URL to Claude (e.g. `/add-wallet `) and it will fill in the placeholders. + +If you're not using Claude Code, follow `.claude/skills/add-wallet/SKILL.md` by hand. It's a step-by-step checklist. + +Then implement the wallet-specific actions and selectors, and remove `test.fixme` from each spec in `tests/e2e/` once its action works. ## Changesets (Required for User-Facing Changes) diff --git a/package.json b/package.json index 9240c11..61da629 100644 --- a/package.json +++ b/package.json @@ -91,8 +91,7 @@ "check:ci": "pnpm run lint && pnpm run check:types", "format": "biome format --write ./src", "tests:e2e:debug": "playwright test --config=tests/playwright.config.ts --debug", - "tests:e2e:ui": "playwright test --config=tests/playwright.config.ts --ui", - "add:wallet": "tsx scripts/add-wallet.ts" + "tests:e2e:ui": "playwright test --config=tests/playwright.config.ts --ui" }, "peerDependencies": { "@playwright/test": "1.62.1" diff --git a/scripts/add-wallet.ts b/scripts/add-wallet.ts deleted file mode 100644 index f1ceca7..0000000 --- a/scripts/add-wallet.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { spawn } from "node:child_process"; -import fs from "node:fs"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const projectRoot = path.resolve("./"); -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -const templateWalletDir = path.resolve(__dirname, "default-template", "wallet"); -const templateTestsDir = path.resolve(__dirname, "default-template", "tests"); - -const pascalCase = (str: string) => str.replace(/(^\w|-\w)/g, (m) => m.replace("-", "").toUpperCase()); - -type WriteToFile = { - baseDir: string; - templateDir: string; - walletName: string; - fileTemplate: string; -}; - -type FileAndFolderStructure = { - files: Array; - folders: Array; -}; - -function writeToFile({ fileTemplate, baseDir, walletName, templateDir }: WriteToFile) { - const WalletName = pascalCase(walletName); - - const fileName = fileTemplate.replaceAll("{{walletName}}", walletName); - const destPath = path.resolve(baseDir, fileName); - const templatePath = path.resolve(templateDir, `${fileTemplate}.tpl`); - - let content = fs.existsSync(templatePath) - ? fs.readFileSync(templatePath, "utf-8") !== "" - ? fs.readFileSync(templatePath, "utf-8") - : `// ${fileName}` - : `// ${fileName}`; - - // Keep original casing for walletName - content = content - // Replace PascalCase version - .replace(/\{\{\s*WalletName\s*\}\}/g, WalletName) - // Replace lowercase version - .replace(/\{\{\s*walletName\s*\}\}/g, walletName); - - fs.mkdirSync(path.dirname(destPath), { recursive: true }); - fs.writeFileSync(destPath, content); -} - -/** - * Run the Prettier format and linting - */ -async function biomeFormat() { - const bin = process.platform === "win32" ? "bun.cmd" : "bun"; - - return new Promise((resolve, reject) => { - const child = spawn(bin, ["run", "format"], { - stdio: "inherit", - env: process.env, - shell: false, - cwd: process.cwd(), - }); - - child.on("error", reject); - child.on("close", (code, signal) => { - if (code === 0) { - console.info("✅ Biome format successful"); - return resolve(void 0); - } - reject(new Error(`Child process exited with code ${code} and signal ${signal}`)); - }); - }); -} - -/** - * Create a new wallet - * @param walletName - The name of the wallet to create - */ -function createWallet(walletName: string) { - const walletDir = path.resolve(projectRoot, "src", "wallets", walletName); - - if (fs.existsSync(walletDir)) { - console.error(`❌ Wallet '${walletName}' already exists at: ${walletDir}`); - process.exit(1); - } - - fs.mkdirSync(walletDir, { recursive: true }); - - const structurePath = path.resolve(__filename, "..", "structure.json"); - const structure = JSON.parse(fs.readFileSync(structurePath, "utf8")) as FileAndFolderStructure; - - // Create folders - structure.folders.forEach((folder: string) => { - fs.mkdirSync(path.resolve(walletDir, folder), { recursive: true }); - }); - - // Create files - structure.files.forEach((fileTemplate: string) => { - writeToFile({ fileTemplate, baseDir: walletDir, walletName, templateDir: templateWalletDir }); - }); - - console.info(`✅ Wallet '${walletName}' created at: wallets/${walletName}`); -} - -function createTests(walletName: string) { - const testsDir = path.resolve(projectRoot, "tests"); - const testsStructurePath = path.resolve(__filename, "..", "tests-structure.json"); - const structure = JSON.parse(fs.readFileSync(testsStructurePath, "utf8")) as FileAndFolderStructure; - - // Create folders - structure.folders.forEach((folderTemplate) => { - let folderName = folderTemplate; - if (folderTemplate.includes("{{walletName}}")) { - folderName = folderTemplate.replaceAll("{{walletName}}", walletName); - } - fs.mkdirSync(path.resolve(testsDir, folderName), { recursive: true }); - }); - - // Create files - structure.files.forEach((fileTemplate: string) => { - writeToFile({ fileTemplate, baseDir: testsDir, walletName, templateDir: templateTestsDir }); - }); - - console.info(`✅ Tests for '${walletName}' added at: tests/e2e/${walletName}`); -} - -// CLI entry point -export function main() { - const [, , walletName] = process.argv; - if (!walletName) { - console.error("❌ Please provide a wallet name. E.g. `npm run create:wallet metamask`"); - process.exit(1); - } - - createWallet(walletName); - createTests(walletName); - biomeFormat().catch((err) => console.error(`⚠️ Error running prettier: ${err}`)); -} - -// Detect if script is run directly, then call main() -if (path.resolve(__filename) === path.resolve(process?.argv?.[1] ?? "")) { - main(); -} diff --git a/scripts/default-template/tests/e2e/{{walletName}}/add-account.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/add-account.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/confirm-transaction.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/confirm-transaction.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/connect-to-app.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/connect-to-app.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/get-account-address.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/get-account-address.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/lock-wallet.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/lock-wallet.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/reject-transaction.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/reject-transaction.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/rename-account.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/rename-account.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/switch-account.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/switch-account.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/switch-network.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/switch-network.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/e2e/{{walletName}}/unlock-wallet.{{walletName}}.spec.ts.tpl b/scripts/default-template/tests/e2e/{{walletName}}/unlock-wallet.{{walletName}}.spec.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/tests/fixture/test-with-{{walletName}}-fixture.ts.tpl b/scripts/default-template/tests/fixture/test-with-{{walletName}}-fixture.ts.tpl deleted file mode 100644 index 49caa22..0000000 --- a/scripts/default-template/tests/fixture/test-with-{{walletName}}-fixture.ts.tpl +++ /dev/null @@ -1,3 +0,0 @@ -import { {{walletName}}Fixture } from "@/wallets/{{walletName}}/{{walletName}}-fixture"; - -export const testWith{{walletName}}Fixture = {{walletName}}Fixture(); diff --git a/scripts/default-template/tests/wallet-setup/{{walletName}}.setup.ts.tpl b/scripts/default-template/tests/wallet-setup/{{walletName}}.setup.ts.tpl deleted file mode 100644 index 6c78324..0000000 --- a/scripts/default-template/tests/wallet-setup/{{walletName}}.setup.ts.tpl +++ /dev/null @@ -1,7 +0,0 @@ -import { defineWalletSetup } from "@/core/define-wallet-setup"; - -const PASSWORD = "test1234"; // Update this password as needed. - -export default defineWalletSetup(PASSWORD, async ({ walletPage }) => { - console.info("Not implemented"); -}); diff --git a/scripts/default-template/wallet/actions/add-account.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/add-account.{{walletName}}.ts.tpl deleted file mode 100644 index 1df654b..0000000 --- a/scripts/default-template/wallet/actions/add-account.{{walletName}}.ts.tpl +++ /dev/null @@ -1,6 +0,0 @@ - -import { type Page } from "@playwright/test" - -export async function addAccount(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/confirm-transaction.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/confirm-transaction.{{walletName}}.ts.tpl deleted file mode 100644 index 31af509..0000000 --- a/scripts/default-template/wallet/actions/confirm-transaction.{{walletName}}.ts.tpl +++ /dev/null @@ -1,6 +0,0 @@ - -import { type Page } from "@playwright/test" - -export async function confirmTransaction(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/connect-to-app.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/connect-to-app.{{walletName}}.ts.tpl deleted file mode 100644 index 157a2e9..0000000 --- a/scripts/default-template/wallet/actions/connect-to-app.{{walletName}}.ts.tpl +++ /dev/null @@ -1,6 +0,0 @@ - -import { type Page } from "@playwright/test" - -export async function connectToApp(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/get-account-address.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/get-account-address.{{walletName}}.ts.tpl deleted file mode 100644 index 6dacc93..0000000 --- a/scripts/default-template/wallet/actions/get-account-address.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test" - -export async function getAccountAddress(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/lock.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/lock.{{walletName}}.ts.tpl deleted file mode 100644 index c0ea0cf..0000000 --- a/scripts/default-template/wallet/actions/lock.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test" - -export async function lockWallet(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/onboard.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/onboard.{{walletName}}.ts.tpl deleted file mode 100644 index 6c422bc..0000000 --- a/scripts/default-template/wallet/actions/onboard.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test"; - -export async function onboard(page: Page) { - console.error("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/open-settings.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/open-settings.{{walletName}}.ts.tpl deleted file mode 100644 index 5b5e8f8..0000000 --- a/scripts/default-template/wallet/actions/open-settings.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test" - -export async function openSettings(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/reject-transaction.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/reject-transaction.{{walletName}}.ts.tpl deleted file mode 100644 index 89811dd..0000000 --- a/scripts/default-template/wallet/actions/reject-transaction.{{walletName}}.ts.tpl +++ /dev/null @@ -1,6 +0,0 @@ - -import { type Page } from "@playwright/test" - -export async function rejectTransaction(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/rename-account.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/rename-account.{{walletName}}.ts.tpl deleted file mode 100644 index 34c3ae4..0000000 --- a/scripts/default-template/wallet/actions/rename-account.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test" - -export async function renameAccount(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/switch-account.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/switch-account.{{walletName}}.ts.tpl deleted file mode 100644 index 15983cd..0000000 --- a/scripts/default-template/wallet/actions/switch-account.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test" - -export async function switchAccount(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/switch-network.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/switch-network.{{walletName}}.ts.tpl deleted file mode 100644 index 2575386..0000000 --- a/scripts/default-template/wallet/actions/switch-network.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test" - -export async function switchNetwork(page: Page) { - console.info("Not implemented") -} diff --git a/scripts/default-template/wallet/actions/unlock.{{walletName}}.ts.tpl b/scripts/default-template/wallet/actions/unlock.{{walletName}}.ts.tpl deleted file mode 100644 index 9212478..0000000 --- a/scripts/default-template/wallet/actions/unlock.{{walletName}}.ts.tpl +++ /dev/null @@ -1,5 +0,0 @@ -import { type Page } from "@playwright/test"; - -export async function unlock(page: Page) { - console.error("Not implemented") -} diff --git a/scripts/default-template/wallet/index.ts.tpl b/scripts/default-template/wallet/index.ts.tpl deleted file mode 100644 index 6f999df..0000000 --- a/scripts/default-template/wallet/index.ts.tpl +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./{{walletName}}"; -export * from "./{{walletName}}-fixture"; -export * from "./{{walletName}}-worker-scope-fixture"; diff --git a/scripts/default-template/wallet/selectors/homepage-selectors.{{walletName}}.ts.tpl b/scripts/default-template/wallet/selectors/homepage-selectors.{{walletName}}.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/wallet/selectors/onboard-selectors.{{walletName}}.ts.tpl b/scripts/default-template/wallet/selectors/onboard-selectors.{{walletName}}.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/wallet/types.ts.tpl b/scripts/default-template/wallet/types.ts.tpl deleted file mode 100644 index f9d31b2..0000000 --- a/scripts/default-template/wallet/types.ts.tpl +++ /dev/null @@ -1,8 +0,0 @@ -import type { Page } from "@playwright/test"; -import type { {{WalletName}} } from "./{{walletName}}"; - -export type {{WalletName}}Fixture = { - contextPath: string; - {{walletName}}: {{WalletName}}; - {{walletName}}Page: Page; -}; diff --git a/scripts/default-template/wallet/utils.ts.tpl b/scripts/default-template/wallet/utils.ts.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/default-template/wallet/{{walletName}}-fixture.ts.tpl b/scripts/default-template/wallet/{{walletName}}-fixture.ts.tpl deleted file mode 100644 index cdfcf8c..0000000 --- a/scripts/default-template/wallet/{{walletName}}-fixture.ts.tpl +++ /dev/null @@ -1,87 +0,0 @@ -import fs from "node:fs"; -import path from "node:path"; -import { test as base, chromium, type Page } from "@playwright/test"; -import createTempContextDirectory from "@/utils/create-temp-context-directory"; -import getCacheDirectory from "@/utils/get-cache-directory"; -import getPageFromContext from "@/utils/get-page-from-context"; -import persistLocalStorage from "@/utils/persist-local-storage"; -import waitForStablePage from "@/utils/wait-for-stable-page"; -import { teardownContext } from "@/utils/teardown-context"; -import { getWalletExtensionPathFromCache } from "@/utils/wallets/get-wallet-extension-path-from-cache"; -import { unlock } from "./actions/unlock.{{walletName}}"; -import { {{WalletName}} } from "./{{walletName}}"; -import { {{WalletName}}Profile } from "./{{walletName}}-profile"; -import type { {{WalletName}}Fixture } from "./types"; -import type { WalletProfileFixtureArgs } from "@/types"; - - -let _{{walletName}}Page: Page; - -export const {{walletName}}Fixture = ({ slowMo = 0, profileName }: WalletProfileFixtureArgs = {}) => { - return base.extend<{{WalletName}}Fixture>({ - contextPath: async ({ browserName }, use, testInfo) => { - const tempWalletDataDir = await createTempContextDirectory(`${browserName}-${testInfo.testId}`); - - await use(tempWalletDataDir); - }, - context: async ({ context: currentContext, contextPath: tempWalletDataDir }, use) => { - const wallet = new {{WalletName}}Profile(); - - const CACHE_DIR = getCacheDirectory(wallet.name); - const extensionPath = await getWalletExtensionPathFromCache(wallet.name); - const walletDataDir = path.resolve(CACHE_DIR, profileName ?? "wallet-data"); - - if (!fs.existsSync(walletDataDir)) { - throw new Error(`❌ Cache for {{WalletName}} wallet data not found. Create it first`); - } - - fs.cpSync(walletDataDir, tempWalletDataDir, { recursive: true, force: true }); - - const browserArgs = [`--disable-extensions-except=${extensionPath}`, `--load-extension=${extensionPath}`]; - if (process.env.HEADLESS) { - browserArgs.push("--headless=new"); - - if (slowMo > 0) { - console.warn("⚠️ Slow motion makes no sense in headless mode. It will be ignored!"); - } - } - - const walletPageContext = await chromium.launchPersistentContext(tempWalletDataDir, { - headless: false, - args: browserArgs, - slowMo: process.env.HEADLESS ? 0 : slowMo, - }); - - await walletPageContext.grantPermissions(["clipboard-read"]); - - const { cookies, origins } = await currentContext.storageState(); - if (cookies) await walletPageContext.addCookies(cookies); - if (origins && origins.length > 0) persistLocalStorage(origins, walletPageContext); - - const indexUrl = await wallet.indexUrl(); - const homePage = walletPageContext.pages().find((page) => page.url().startsWith(indexUrl)); - _{{walletName}}Page = homePage || (await getPageFromContext(walletPageContext, indexUrl)); - - await waitForStablePage(_{{walletName}}Page); - - for (const page of walletPageContext.pages()) { - const url = page.url(); - if (url.includes("about:blank") || url.includes(wallet.onboardingPath)) { - await page.close(); - } - } - - await _{{walletName}}Page.bringToFront(); - await unlock(_{{walletName}}Page); - await use(walletPageContext); - await teardownContext(walletPageContext, tempWalletDataDir); - }, - {{walletName}}Page: async ({ context: _ }, use) => { - await use(_{{walletName}}Page); - }, - {{walletName}}: async ({ context: _ }, use) => { - const {{walletName}}Instance = new {{WalletName}}(_{{walletName}}Page); - await use({{walletName}}Instance); - }, - }); -}; diff --git a/scripts/default-template/wallet/{{walletName}}-profile.ts.tpl b/scripts/default-template/wallet/{{walletName}}-profile.ts.tpl deleted file mode 100644 index fc1ffec..0000000 --- a/scripts/default-template/wallet/{{walletName}}-profile.ts.tpl +++ /dev/null @@ -1,32 +0,0 @@ -import type { BrowserContext } from "@playwright/test"; -import { getPopupPageFromContext } from "@/utils/wallets/get-popup-page-from-context"; -import { getWalletExtensionIdFromCache } from "@/utils/wallets/get-wallet-extension-id-from-cache"; - -export class {{WalletName}}Profile { - readonly name = "{{walletName}}" as const; - readonly onboardingPath = "" // Not implemented; - - async indexUrl() { - const extensionId = await this.extensionId(); - return `chrome-extension://${extensionId}/.html`; - } - - async promptUrl() { - const extensionId = await this.extensionId(); - return `chrome-extension://${extensionId}/.html`; - } - - async extensionId() { - return await getWalletExtensionIdFromCache(this.name); - } - - async promptPage(context: BrowserContext) { - const popupUrl = await this.promptUrl(); - const popupPage = await getPopupPageFromContext({ - context, - path: popupUrl, - locator: "Enter locator here", // Target the locator of the extension popup page that let's you know the popup page is ready for interaction. - }); - return popupPage; - } -} diff --git a/scripts/default-template/wallet/{{walletName}}-worker-scope-fixture.ts.tpl b/scripts/default-template/wallet/{{walletName}}-worker-scope-fixture.ts.tpl deleted file mode 100644 index db89f25..0000000 --- a/scripts/default-template/wallet/{{walletName}}-worker-scope-fixture.ts.tpl +++ /dev/null @@ -1,60 +0,0 @@ -import { test as base } from "@playwright/test"; -import type { WorkerScopeFixtureArgs } from "@/types"; -import { type WorkerScopeFixture, workerScopeContext } from "../utils/worker-scope-context"; -import { {{WalletName}} } from "./{{walletName}}"; -import { teardownContext } from "@/utils/teardown-context"; -import { {{WalletName}}Profile } from "./{{walletName}}-profile"; -import type { {{WalletName}}Fixture } from "./types"; - -export const {{walletName}}WorkerScopeFixture = ({ profileName, dappUrl, slowMo }: WorkerScopeFixtureArgs = {}) => { - return base.extend<{{WalletName}}Fixture, WorkerScopeFixture<{{WalletName}}>>({ - workerScopeContents: [ - async ({ browser: _ }, use, workerInfo) => { - const wallet = new {{WalletName}}Profile(); - const { - context, - contextPath, - walletPage: walletPageFromContext, - } = await workerScopeContext({ - wallet, - workerInfo, - profileName, - slowMo, - }); - await context.grantPermissions(["clipboard-read"]); - - for (const page of context.pages()) { - if (page.url().includes(wallet.onboardingPath)) { - await page.close(); - } - } - - const {{walletName}} = new {{WalletName}}(walletPageFromContext); - await {{walletName}}.unlock(); - - - await use({ wallet: {{walletName}}, walletPage: walletPageFromContext, context }); - await teardownContext(context, contextPath); - }, - { scope: "worker" }, - ], - dappPage: [ - async ({ workerScopeContents }, use) => { - const { context } = workerScopeContents; - const dappPage = await context.newPage(); - if (dappUrl) { - await dappPage.goto(dappUrl); - } - await use(dappPage); - }, - { scope: "worker" }, - ], - {{walletName}}Page: async ({ workerScopeContents }, use) => { - await use(workerScopeContents.walletPage); - }, - {{walletName}}: async ({ workerScopeContents }, use) => { - const {{walletName}}Instance = new {{WalletName}}(workerScopeContents.walletPage); - await use({{walletName}}Instance); - }, - }); -}; diff --git a/scripts/default-template/wallet/{{walletName}}.ts.tpl b/scripts/default-template/wallet/{{walletName}}.ts.tpl deleted file mode 100644 index 1f81146..0000000 --- a/scripts/default-template/wallet/{{walletName}}.ts.tpl +++ /dev/null @@ -1,150 +0,0 @@ -import type { Page } from "@playwright/test"; -import { addAccount } from "./actions/add-account.{{walletName}}"; -import { getAccountAddress } from "./actions/get-account-address.{{walletName}}"; -import { lockWallet } from "./actions/lock.{{walletName}}"; -import { onboard } from "./actions/onboard.{{walletName}}"; -import { renameAccount } from "./actions/rename-account.{{walletName}}"; -import { switchAccount } from "./actions/switch-account.{{walletName}}"; -import { switchNetwork } from "./actions/switch-network.{{walletName}}"; -import { unlock } from "./actions/unlock.{{walletName}}"; -import { confirmTransaction } from "./actions/confirm-transaction.{{walletName}}" -import { rejectTransaction } from "./actions/reject-transaction.{{walletName}}" -import { connectToApp } from "./actions/connect-to-app.{{walletName}}" -import { {{WalletName}}Profile } from "./{{walletName}}-profile"; - -export class {{WalletName}} extends {{WalletName}}Profile { - page: Page; - - constructor(page: Page) { - super(); - this.page = page; - } - - /** - * Onboards the wallet. - * This function onboards the wallet by entering the password and other required information. - * @param {OnboardingArgs} args - The arguments required for onboarding. - * @param args.mode - Create a new wallet or import via private key / mnemonic. - * @param args.password - The password for the wallet. - * @param args.secretRecoveryPhrase - The secret recovery phrase for the wallet when importing a wallet. - * @example - * const {{walletName}} = new {{WalletName}}(page); - * await {{walletName}}.onboard({ mode: "importPrivateKey", password: "password", privateKey: "private key" }); - */ - async onboard() { - await onboard(this.page) - } - - /** - * Unlocks the wallet by entering the password. - * @example - * const {{walletName}} = new {{WalletName}}(page); - * await {{walletName}}.unlock(); - */ - async unlock() { - await unlock(this.page); - } - - /** - * Locks the wallet by entering the password. - * This function locks the wallet by opening the settings page and then locking the wallet. - * @example - * const {{walletName}} = new {{WalletName}}(page); - * await {{walletName}}.lock(); - */ - async lock() { - await lockWallet(this.page) - } - - /** - * Renames an account in the wallet. - * @param {Omit} args - The arguments to rename the account. - * @param args.newAccountName - The new name of the account. - * @example - * const {{walletName}} = new {{WalletName}}(page); - * await {{walletName}}.renameAccount({ newAccountName: "New Account Name" }); - */ - async renameAccount() { - await renameAccount(this.page) - } - - /** - * Switches the current network to the given network. - * @param {SwitchNetwork} networkName - The name of the network to switch to. - * @example - * const {{walletName}} = new {{WalletName}}(page); - * await {{walletName}}.switchNetwork("network name"); - */ - async switchNetwork(networkName: SwitchNetwork) { - await switchNetwork(this.page) - } - - /** - * Switches the current account to the given account. - * @param {string} accountName - The name of the account to switch to. - * @example - * const {{walletName}} = new {{walletName}}(page); - * await {{walletName}}.switchAccount("Account 1"); - */ - async switchAccount(accountName: string) { - await switchAccount(this.page) - } - - /** - * Retrieves the current account's address. - * @returns A promise that resolves with the current account's address as a string. - * - * @example - * const {{walletName}} = new {{WalletName}}(page); - * const address = await {{walletName}}.getAccountAddress(); - */ - async getAccountAddress() { - return await getAccountAddress(this.page) - } - - /** - * Adds an account to the wallet via a private key or mnemonic phrase. - * @param {{ accountName, ...args }: AddAccount} - The arguments to add the account. - * @param {string} args.accountName - The name of the account to add. - * @param {string} args.privateKey - The private key of the account to add, if the mode is "privateKey". - * @param {string[]} args.mnemonicPhrase - The mnemonic phrase of the account to add, if the mode is "mnemonic". - * @example - * const {{walletName}} = new {{WalletName}}(page); - * await {{walletName}}.addAccount(TBD); - */ - async addAccount() { - await addAccount(this.page) - } - - /** - * Connects to an app by clicking on the "Connect to app" button. - * If an account is provided, it will be selected before connecting to the app. - * @param {string} [account] - The account to select before connecting to the app. - * @example - * const metamask = new Metamask(page); - * await metamask.connectToApp("Account 1"); - */ - async connectToApp(account?: string) { - await connectToApp(await this.promptPage(this.page.context()), account); - } - - /** - * Confirms a transaction in the wallet by clicking on the "Confirm" button. - * @example - * const metamask = new Metamask(page); - * await metamask.confirmTransaction(); - */ - async confirmTransaction() { - await confirmTransaction(await this.promptPage(this.page.context())); - } - - /** - * Cancels a transaction in the wallet by clicking on the "Cancel" button. - * @example - * const metamask = new Metamask(page); - * await metamask.cancelTransaction(); - */ - async rejectTransaction() { - await rejectTransaction(await this.promptPage(this.page.context())); - } -} diff --git a/scripts/structure.json b/scripts/structure.json deleted file mode 100644 index 00dcaa4..0000000 --- a/scripts/structure.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "folders": ["actions", "selectors"], - "files": [ - "{{walletName}}-fixture.ts", - "{{walletName}}-worker-scope-fixture.ts", - "{{walletName}}-profile.ts", - "{{walletName}}.ts", - "index.ts", - "types.ts", - "utils.ts", - "actions/unlock.{{walletName}}.ts", - "actions/lock.{{walletName}}.ts", - "actions/onboard.{{walletName}}.ts", - "actions/add-account.{{walletName}}.ts", - "actions/get-account-address.{{walletName}}.ts", - "actions/open-settings.{{walletName}}.ts", - "actions/rename-account.{{walletName}}.ts", - "actions/switch-account.{{walletName}}.ts", - "actions/switch-network.{{walletName}}.ts", - "actions/connect-to-app.{{walletName}}.ts", - "actions/confirm-transaction.{{walletName}}.ts", - "actions/reject-transaction.{{walletName}}.ts", - "selectors/homepage-selectors.{{walletName}}.ts", - "selectors/onboard-selectors.{{walletName}}.ts" - ] -} diff --git a/scripts/tests-structure.json b/scripts/tests-structure.json deleted file mode 100644 index 5ca9ec0..0000000 --- a/scripts/tests-structure.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "folders": ["fixture", "wallet-setup", "e2e/{{walletName}}"], - "files": [ - "wallet-setup/{{walletName}}.setup.ts", - "fixture/test-with-{{walletName}}-fixture.ts", - "e2e/{{walletName}}/add-account.{{walletName}}.spec.ts", - "e2e/{{walletName}}/get-account-address.{{walletName}}.spec.ts", - "e2e/{{walletName}}/lock-wallet.{{walletName}}.spec.ts", - "e2e/{{walletName}}/rename-account.{{walletName}}.spec.ts", - "e2e/{{walletName}}/switch-account.{{walletName}}.spec.ts", - "e2e/{{walletName}}/switch-network.{{walletName}}.spec.ts", - "e2e/{{walletName}}/unlock-wallet.{{walletName}}.spec.ts", - "e2e/{{walletName}}/connect-to-app.{{walletName}}.spec.ts", - "e2e/{{walletName}}/confirm-transaction.{{walletName}}.spec.ts", - "e2e/{{walletName}}/reject-transaction.{{walletName}}.spec.ts" - ] -}