From d2363fc4ee8c36cb16c50f5c5bb2a717590ad064 Mon Sep 17 00:00:00 2001 From: gbengaeben Date: Thu, 27 Aug 2026 17:58:58 +0000 Subject: [PATCH] feat: add guided send flow to the interactive playground Extends the scan-only playground into a four-step derive, send, scan, and withdraw flow with fixture Horizon events, embeds each step in the relevant docs pages, and adds Playwright smoke tests that enforce the zero-external-requests gate. Fixes #134 --- .github/workflows/snippets.yml | 30 + .gitignore | 4 +- api-reference/fetch-announcements-stream.mdx | 19 + api-reference/stealth-keys.mdx | 23 +- guides/stellar/stellar-quickstart.mdx | 38 ++ package.json | 4 + pnpm-lock.yaml | 38 ++ scripts/playground/fixtures.json | 91 +++ scripts/playground/generate-fixtures.mjs | 444 ++++++++++----- scripts/playground/index.html | 352 ++++++++++-- scripts/playground/playground.js | 486 ++++++++++++++++ scripts/playground/scanner.js | 519 +++++++++--------- scripts/playground/tests/playground.spec.ts | 105 ++++ scripts/playground/tests/playwright.config.ts | 31 ++ scripts/playground/tests/serve.mjs | 48 ++ 15 files changed, 1770 insertions(+), 462 deletions(-) create mode 100644 scripts/playground/fixtures.json create mode 100644 scripts/playground/playground.js create mode 100644 scripts/playground/tests/playground.spec.ts create mode 100644 scripts/playground/tests/playwright.config.ts create mode 100644 scripts/playground/tests/serve.mjs diff --git a/.github/workflows/snippets.yml b/.github/workflows/snippets.yml index c6ee1ed..839ab78 100644 --- a/.github/workflows/snippets.yml +++ b/.github/workflows/snippets.yml @@ -59,3 +59,33 @@ jobs: - name: Validate Stellar testnet snippets run: pnpm run check:stellar-testnet + + playground-smoke: + name: Playground smoke test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Verify playground fixtures are in sync + run: pnpm run check:playground-fixtures + + - name: Install Playwright browser + run: pnpm exec playwright install --with-deps chromium + + - name: Run playground smoke tests + run: pnpm run test:playground diff --git a/.gitignore b/.gitignore index 506ae3f..5379ce5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules/ -.npm/ \ No newline at end of file +.npm/ +test-results/ +playwright-report/ diff --git a/api-reference/fetch-announcements-stream.mdx b/api-reference/fetch-announcements-stream.mdx index c434859..1624cc8 100644 --- a/api-reference/fetch-announcements-stream.mdx +++ b/api-reference/fetch-announcements-stream.mdx @@ -434,6 +434,25 @@ for await (const announcement of stream) { } ``` +--- + +## Try It: Scan Announcements in Your Browser + +The playground below parses a batch of Horizon-shaped fixture events — the same `topic`/`value` shape `fetchAnnouncementsStream` yields on Stellar — and scans them client-side with the view-tag fast filter and Ed25519 point math. No wallet, no network calls. + +