CI-only: chore/examples-network-pluggable (x4-yimonx)#5
Closed
ryanRfox wants to merge 1 commit into
Closed
Conversation
…_NETWORK Apply the canonical chain-pluggable pattern established in PR x402-foundation#2250 (e2e/src/networks/networks.ts) to the 11 Tier 1 teachable demos. Each demo now reads an EVM_NETWORK env var (CAIP-2, default `eip155:84532`) instead of hard-coding the Base Sepolia literal in route declarations and resource-server registrations. The 11 facilitator-and-server demos can now be retargeted to any EVM chain in `DEFAULT_STABLECOINS` without code changes — same demo, different chain. Two demos (`facilitator/basic`, `servers/self-facilitation`) inline a small `resolveViemChain` helper so their viem wallet clients track the configured chain, with `EVM_RPC_URL` overriding viem's default RPC. The helper falls back to `defineChain` for chains viem hasn't packaged yet (e.g. Mezo Testnet). Scope: 11 .ts files + 7 README updates. Companion clients (`clients/fetch`, `clients/axios`, `clients/custom`, `clients/advanced/*`) already use `eip155:*`/`solana:*` wildcards, so no client-side work was needed. Three intentional chain literals are preserved unchanged because they teach demo-specific semantics rather than the demo's chain selection: - `clients/advanced/builder-pattern.ts` — `eip155:1` / `solana:EtWT…` per-network overrides - `servers/advanced/custom-money-definition.ts:50` — `eip155:100` (Gnosis Chain) for the registerMoneyParser pattern - `servers/offer-receipt/index.ts:59` — `did:pkh:eip155:1` canonical DID:PKH identifier SVM accepts (`solana:EtWT…`) in the express/fastify/hono/facilitator-basic demos remain unchanged: Phase 2 scope is EVM-side only. SVM remains single-network at Solana Devnet. Documented in each modified demo's README: the new `EVM_NETWORK` env var, the default chain, the link to `DEFAULT_STABLECOINS` for the list of chains that "just work", and (for the two demos that need it) the `EVM_RPC_URL` override for chains viem doesn't ship.
b26e685 to
3d708c2
Compare
Owner
Author
|
CI-only PR closed: all 7 checks green on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI-trigger PR — to be closed after CI completion.
This PR exists solely to trigger GitHub Actions on commit
b26e6851for the x4-yimonx polecat-committed branch. Base is a clean snapshot of upstream/main HEAD (e35becff) on the fork.Scope: 11 Tier 1 TypeScript example demos made chain-pluggable via the canonical
EVM_NETWORKenv pattern from PR x402-foundation#2250 (ceb7126c).Local checks (already green per polecat evidence):
pnpm install --frozen-lockfile,pnpm -C examples/typescript -r typecheck,pnpm -C examples/typescript -r lint— all pass0x57f59775391ce22c4ee7c306fffcf0bf7bba8ad6fc426cf27c05f2b60589d66bverified status=0x1 on public RPCReview-quorum (Opus + MAX effort, 2 lanes) verdict: CLEAN.
This PR will be closed after CI green.