You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: add productionalize design spec
Covers tooling (ESLint, Prettier), dependency upgrades, Express migration
with security headers, env parser, Makefile, CI/CD, and documentation updates.
* docs: address spec review findings
- Renumber steps sequentially (no more 3.5)
- Reorder env parser before Express migration
- Pin packageManager to pnpm@10.33.0 (actual latest)
- Add engines field, .git-blame-ignore-revs, .gitignore updates
- Split dep upgrades into devDeps-first then runtime
- Clarify channel-open/close, parseCommaSeparatedList, COMMITMENT_PUBKEY
- Note ESLint override strategy and helmet behavior change
* docs: add implementation plan for productionalization
12 tasks covering ESLint, Prettier, dep upgrades, env parser, Express
migration, Makefile, .env.example files, CI/CD, README/CLAUDE.md updates,
and review gates.
* docs: fix trustProxy type to return string for Express compatibility
* chore: add ESLint 9, Prettier, tsconfig tweaks, packageManager
* style: format codebase with Prettier
* chore: add .git-blame-ignore-revs for Prettier formatting commit
* chore: upgrade all dependencies to latest
- typescript 5.8.0 → 5.9.3, vitest 3.1.0 → 4.1.2
- mppx 0.4.7 → 0.4.11, zod pinned → ^4.3.6
- Add express, helmet, express-rate-limit, cors for upcoming tasks
- Fix test mocks for vitest 4.x constructor validation
* feat: add Stellar-aware env parsing primitives
* feat: add per-example Env config classes using env primitives
* refactor: migrate charge server example to Express with security headers
* refactor: migrate channel server example to Express with security headers
* refactor: use Env classes and env primitives in all example scripts
* chore: add self-documenting Makefile for dev workflow
* docs: add .env.example files for all demo configurations
* ci: add GitHub Actions pipeline with quality gates
* docs: update README and CLAUDE.md for productionalization changes
* style: format README.md
* fix: use strict empty checks in env parsers, remove stack trace from error response
- parseRequired/parsePort/parseNumber now use `=== undefined || === ''`
instead of falsy check, so values like "0" are not treated as missing
- Remove stack trace from /demo/pay error response to avoid leaking
internal paths to clients
* docs: add code quality & restructure design spec
Covers directory restructure (charge/ folder), shared utilities extraction,
store key standardization, configurable parameters, robustness (polling
backoff, simulation timeouts, error classification), pino logging, and
version bump to 0.2.0.
* docs: address spec review findings for restructure design
- Add test file migration plan (6+ test files)
- Define new root index.ts exports explicitly
- Clarify resolveKeypair scope (no hex seed, stays Keypair | S...)
- Cover standalone close() function extraction
- Add test requirements for shared utilities
- Correct polling loop count to 6
- Rename shared/constants.ts to shared/defaults.ts
- Add shared/errors.ts for error base class consolidation
- Note store key migration is acceptable (pre-production)
- Add simulate timeout mechanism (Promise.race + AbortController)
- Show full channel server parameter signature
- Add concrete acceptance criteria for review gates
- Note Steps 3 and 5 touch overlapping files
* docs: fix minor inconsistencies in restructure spec
* docs: add implementation plan for code quality restructure
11 tasks: shared foundation, keypairs, validation, simulate, poll, fee-bump,
directory restructure, charge refactor, channel refactor, pino examples,
docs/version bump, review gates.
* feat: add shared foundation modules (defaults, logger, errors, units)
* feat: add shared keypairs and validation utilities
* feat: add wrapFeeBump utility with configurable max fee
* feat: add simulateCall with timeout and error classification
* feat: add pollTransaction with exponential backoff and jitter
* refactor: move charge code into charge/ folder, restructure shared utilities
- Move sdk/src/Methods.ts → sdk/src/charge/Methods.ts
- Move sdk/src/client/ → sdk/src/charge/client/
- Move sdk/src/server/ → sdk/src/charge/server/
- Move sdk/src/scval.ts → sdk/src/shared/scval.ts
- Remove sdk/src/signers.ts (replaced by shared/keypairs.ts)
- Create sdk/src/charge/index.ts
- Update package.json exports: ./client → ./charge/client, ./server → ./charge/server
- Bump version to 0.2.0
- Update all import paths in charge, channel, and example files
* refactor: charge server+client use shared utils, configurable params, new store keys
* refactor: channel server+client use shared utils, finalized→closed, configurable params
* feat: add pino logging to example servers
* docs: update README and CLAUDE.md for 0.2.0 restructure
* fix: wire simulateCall and validateAmount into production code, fix timer leak
* feat: add /e2e-check slash command for full end-to-end verification
Covers: make check, example script validation, charge E2E demo,
channel E2E demo. Channel settlement E2E left as TODO (requires WASM).
* feat: add /e2e-check skill with proper frontmatter
Structured as a Claude Code project skill with YAML frontmatter
for discovery. Covers: make check, example script validation,
charge E2E, channel E2E, and channel settlement E2E (TODO).
* fix: move e2e-check from commands/ to skills/ directory
* refactor: move e2e-check skill to subdirectory with SKILL.md convention
Moves .claude/skills/e2e-check.md to .claude/skills/e2e-check/SKILL.md
to follow the standard skill directory structure.
* fix: replace generic Error throws with typed StellarMppError subclasses
Use StellarMppError for client/shared errors, PaymentVerificationError
for charge server errors, and ChannelVerificationError for channel
server errors. Error messages are unchanged — this is a backward-
compatible change since all classes extend Error.
* refactor: extract magic numbers to named constants
Replace hardcoded fee '100', timeout 180, and timeout 30 with
DEFAULT_FEE, DEFAULT_TIMEOUT, and DEFAULT_SIM_TIMEOUT_SECS constants.
Values are numerically identical — this is a clarity improvement only.
* fix: replace remaining hardcoded fee '100' in close() function
Missed one location in the close() standalone export function.
* refactor: rename charge examples for naming consistency
Rename examples/server.ts → examples/charge-server.ts and
examples/client.ts → examples/charge-client.ts to match the
channel example naming convention (channel-server.ts, channel-client.ts).
Update all references in package.json scripts, demo scripts,
demo HTML, README.md, CLAUDE.md, and SKILL.md.
* test: add dedicated tests for scValToBigInt covering all 6 ScVal types
Tests all supported conversions (u32, i32, u64, i64, u128, i128),
a u128 zero edge case, and the error path for unsupported types.
* fix: add null safety to State.ts ledger data parsing
Add defensive null guards to readCloseEffectiveAtLedger for the
contractData/instance chain, providing clearer error attribution
when ledger entry structure is unexpected.
* ci: fix redundant Node setup and add test coverage reporting
Remove duplicate setup-node call. Add --coverage flag to test step
using @vitest/coverage-v8.
* style: fix prettier formatting after error standardization and constant extraction
* fix README docs to match codebase
* remove completed superpowers plans
* fix: escape dynamic HTML in demo page to prevent DOM XSS
* drop CORS middleware from example servers
description: Use when verifying the full solution works end-to-end — after refactoring, before PRs, or after dependency upgrades. Runs quality pipeline, validates example scripts, and executes live Stellar testnet demos for both charge and channel payment modes.
4
+
---
5
+
6
+
# E2E Check
7
+
8
+
Full end-to-end verification: quality pipeline, example script validation, and live Stellar testnet demos.
9
+
10
+
**Prerequisites:**`.env` file at project root with testnet keys (see `examples/.env.*.example`), funded Stellar testnet accounts, `pnpm` installed.
11
+
12
+
Run all checks in order. Stop on first failure and report.
|`sdk/src/channel/client/Channel.ts`| Signs cumulative commitment amounts off-chain via ed25519; handles `open` action (sends signed deploy tx XDR + initial commitment) |
115
-
|`sdk/src/channel/server/Channel.ts`| Verifies commitment signatures via contract simulation; `open` action broadcasts the deploy tx and initialises cumulative store |
116
-
|`sdk/src/channel/server/State.ts`| Queries on-chain channel state (balance, close status, refund period) |
117
-
|`sdk/src/channel/server/Watcher.ts`| Polls for contract events (close, refund, top_up) |
117
+
|`sdk/src/channel/server/Channel.ts`| Verifies commitment signatures via contract simulation; `open` action broadcasts the deploy tx and initialises cumulative store |
118
+
|`sdk/src/channel/server/State.ts`| Queries on-chain channel state (balance, close status, refund period) |
119
+
|`sdk/src/channel/server/Watcher.ts`| Polls for contract events (close, refund, top_up) |
-`stellar-mpp-sdk/channel/server` — channel server
145
+
-`stellar-mpp-sdk/env` — env parsing primitives
146
+
147
+
### Shared Utilities Convention
148
+
149
+
The `shared/` directory contains internal utility modules. These are **not** exported as a subpath from the package. Exceptions that are re-exported from the root `index.ts`:
All other `shared/` modules are strictly internal and consumed only by `charge/` and `channel/` code.
128
156
129
157
### Key Patterns
130
158
131
159
-**mppx integration**: Methods defined via `Method.from()`, adapted with `.toClient()` / `.toServer()`. Namespaced as `stellar.charge()` and `stellar.channel()`.
132
160
-**Serialization locks**: Both Charge and Channel servers use Promise-based locks (`let verifyLock: Promise<unknown> = Promise.resolve()`) to serialize verification and prevent race conditions on store get/put.
133
161
-**Contract simulation**: Uses Soroban RPC `simulateTransaction` for read-only verification — SAC transfer validation, `prepare_commitment` for commitment bytes, and channel state queries.
134
162
-**Zod validation**: All method schemas use Zod v4 with discriminated unions for credential/action types.
163
+
-**Shared utility extraction**: Common logic (polling, fee bumps, simulation, keypair resolution, validation, error types, logging) lives in `shared/` and is imported by both `charge/` and `channel/`.
164
+
-**Configurable defaults**: Server and client functions accept optional parameters (`pollMaxAttempts`, `pollDelayMs`, `pollTimeoutMs`, `simulationTimeoutMs`, `maxFeeBumpStroops`, `logger`) with defaults from `shared/defaults.ts`, applied via parameter destructuring.
165
+
-**Logger interface**: Matches pino's API (`debug`, `info`, `warn`, `error` methods). A `noopLogger` is used when no logger is provided.
166
+
-**Store key naming**: Keys follow the convention `stellar:{intent}:{type}:{id}` (e.g., `stellar:charge:nonce:abc123`).
167
+
-**Express + security headers**: Example servers use Express with helmet and rate limiting middleware. Env vars configure rate limits and trust proxy.
168
+
-**Env parsing**: Published as `stellar-mpp-sdk/env`. Core primitives read from `process.env` with validation. Per-example `Env` classes compose these into static getters.
135
169
136
170
### Test Setup
137
171
138
172
-**Vitest** with test files colocated alongside source (`*.test.ts` next to `*.ts`)
139
173
- Tests mock `@stellar/stellar-sdk` and `mppx` internals
140
174
- Integration test at `sdk/src/channel/integration.test.ts`
175
+
176
+
### Tooling
177
+
178
+
-**ESLint 9** flat config (`eslint.config.mjs`) with typescript-eslint recommended rules
179
+
-**Prettier** for formatting (`.prettierrc`), separate from ESLint
180
+
-**GitHub Actions** CI runs: format-check → lint → typecheck → test → build
181
+
-**Makefile** for dev workflow (`make help` for all targets, `make check` mirrors CI)
0 commit comments