Skip to content

Add Cloudflare Worker SDK server example#1

Open
JW-Rami wants to merge 8 commits into
mainfrom
rami/worker-sdk-example
Open

Add Cloudflare Worker SDK server example#1
JW-Rami wants to merge 8 commits into
mainfrom
rami/worker-sdk-example

Conversation

@JW-Rami

@JW-Rami JW-Rami commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Add a Cloudflare Worker server example with health, SDK status, private-transfer, and LP routes.
  • Add a server-side Invisible SDK adapter that uses only public package entrypoints when the package is available.
  • Add LP create, recover, DKG, funding, reconcile, refill, and withdrawal through SDK-owned LP actions.
  • Protect /private-transfer and /lp with bearer auth, streaming body limits, non-200 failure statuses, fail-closed attestation config, and explicit legacy preview DCAP collateral fallback.
  • Add Wrangler config, concise OSS docs, CI, simulation, SDK package verification hook, and security guidance.

Test

  • npm run prepare:sdk
  • npm run typecheck
  • npm run build
  • npm run check:contract
  • npm run simulate
  • npm run verify:sdk
  • npm run audit:high
  • npx wrangler deploy --dry-run
  • npx wrangler deploy
  • curl /health, /sdk, /private-transfer, and /lp

Notes

  • Cloudflare Workers support outbound WebSocket clients; this example keeps Invisible coordinator traffic server-side.
  • The SDK requires DCAP collateral by default. Production usage needs a coordinator that emits dcap_collateral or a compatible attestation manifest.
  • releasePin.allowMissingDcapCollateral is documented only as a temporary non-production preview escape hatch and is rejected in prod mode.
  • @invisible/sdk is installed as an alias to the currently published private GitHub Packages build @invisible-labs/sdk@0.1.0-dev.1.2.

@JW-Rami JW-Rami added the protocol Protocol, Solana, crypto, transport, and coordinator work. label Jun 19, 2026
@JW-Rami JW-Rami self-assigned this Jun 19, 2026
@JW-Rami JW-Rami added the infra Deployment, CI, cloud, runtime, environment, and operator infrastructure. label Jun 19, 2026
@JW-Rami

JW-Rami commented Jun 20, 2026

Copy link
Copy Markdown
Member Author

Compatibility note: the current live coordinator may still speak an older wire contract, while the SDK package used by this example expects the matching coordinator and wire-contract rollout. Once that rollout is live, the SDK and coordinator will use the same message names and payload shapes, so the example should work end-to-end. Until then, a compatibility error before transfer/deposit creation is expected and does not indicate an issue in this example integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Deployment, CI, cloud, runtime, environment, and operator infrastructure. protocol Protocol, Solana, crypto, transport, and coordinator work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant