Skip to content

Paymaster proxy example#46

Open
bobo-k2 wants to merge 5 commits into
masterfrom
paymaster-proxy
Open

Paymaster proxy example#46
bobo-k2 wants to merge 5 commits into
masterfrom
paymaster-proxy

Conversation

@bobo-k2

@bobo-k2 bobo-k2 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR brings example on how to proxy paymaster and provide paymaster url to Startale app SDK

Proxying is important to hide paymaster secrets.
App developers still needs to set up a proper paymaster policy since the paymaster URL is visible to all app users.

How did you test your changes?

image

@impelcrypto impelcrypto added the e2e-test Trigger E2E tests label Jun 9, 2026
@bobo-k2 bobo-k2 self-assigned this Jun 18, 2026
@bobo-k2 bobo-k2 changed the title Startale proxy implementation Paymaster proxy example Jun 18, 2026
@bobo-k2 bobo-k2 marked this pull request as ready for review June 19, 2026 09:44
@bobo-k2 bobo-k2 requested a review from Copilot June 19, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Next.js API route in the testapp that proxies Startale Cloud Services (SCS) paymaster requests so paymaster secrets (API key / paymaster ID) remain server-side, and updates the example app + CI to use it (including Cloudflare tunnel exposure for e2e against prod SuperApp).

Changes:

  • Add /api/paymaster/[chainId] proxy route that injects paymasterId into ERC-7677 paymaster JSON-RPC calls and forwards to SCS using server-side env vars.
  • Update the testapp SDK setup to point paymasterOptions at the proxy route (with an optional public base URL override).
  • Adjust Next config to make output: 'export' opt-in, add env example, and update e2e workflow to support sponsored tests via a Cloudflare tunnel.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
examples/testapp/src/pages/api/paymaster/[chainId].page.ts Implements the server-side paymaster proxy and paymasterId injection.
examples/testapp/src/context/EIP1193ProviderContextProvider.tsx Switches the SDK paymaster URL to the same-origin/public proxy route.
examples/testapp/next.config.mjs Makes static export opt-in so API routes can run by default.
examples/testapp/.env.local.example Documents required env vars for the paymaster proxy setup.
.github/workflows/e2e-tests.yaml Adds tunnel + paymaster env wiring for sponsored e2e flows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/testapp/src/pages/api/paymaster/[chainId].page.ts
Comment thread examples/testapp/src/pages/api/paymaster/[chainId].page.ts
Comment thread examples/testapp/src/pages/api/paymaster/[chainId].page.ts Outdated
Comment thread .github/workflows/e2e-tests.yaml Outdated
Comment thread .github/workflows/e2e-tests.yaml
Comment thread examples/testapp/src/context/EIP1193ProviderContextProvider.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-test Trigger E2E tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants