Skip to content

Repo Contracts

This page answers the operational question: which repo owns this behavior, and which repos must change together?

Ownership Map

RepoOwnsMust not own
vela-protocolOn-chain state, instruction accounts, account layouts, transfer-hook enforcement, events, IDLApp display labels, hosted UX, webhook retry policy
vela-sdkProtocol builders plus public Payment Intent, refund, Commerce error, and event typesMerchant database state, RPC verification policy, app-specific UI
vela-dashboardMerchant app, Commerce APIs/data, D1 schema, RPC verification, documents, audit, outbox/fan-out, keeper orchestrationProtocol account layouts not mediated by SDK; customer wallet signing
vela-webhookPublic HMAC verifier, event schemas, fixtures, retry/idempotency helpersEvent production, merchant routing, delivery persistence
vela-checkoutPublic /pay/:id, /session/:id, payment-link, and invoice experiences; wallet/QR interactionMerchant-authenticated writes, verification policy, canonical business state
vela-mailTyped invoice and receipt email presentation and transportPayment/refund state, PDF generation, or document persistence
vela-widgetEmbedded checkout loader and iframe UXBackend billing truth
vela-portalSubscriber self-service, cancellations, plan switching, invoice viewMerchant admin state
vela-adminProtocol ops, emergency controls, audit trail, token config admin UIMerchant-facing flows
vela-docsPublic developer explanationPrivate ops secrets or internal-only decisions
vela-webMarketing and conversionProtocol integration logic
internal-wikiInternal operations, architecture, decisions, release historyPublic API promises

Dependency Graph

text
vela-protocol
  -> vela-sdk
       -> vela-dashboard
       -> vela-webhook
       -> vela-checkout
       -> vela-widget
       -> vela-portal
       -> vela-admin
       -> vela-demo
  -> vela-docs
  -> internal-wiki

vela-web is mostly independent.

Contract Surfaces

Protocol to SDK

Owned by vela-protocol, consumed by vela-sdk.

SurfaceFiles/artifacts
Program IDsdeclare_id!(), Anchor.toml, config/program-ids.json, generated program IDs
IDLtarget/idl/*.json, SDK idl/*.json
Instruction accountsRust instruction contexts, SDK builders
Account layoutRust account structs, SDK deserializers/types
Event shapeRust event structs, SDK event schemas
Error codesRust errors, SDK error translation

Rule: SDK must be updated before runtime consumers move.

SDK to Runtime Apps

Owned by vela-sdk, consumed by app repos.

SurfaceConsumers
createVelaClientDemo, docs examples, apps
Raw buildersDashboard, checkout, widget, portal, admin
@velapay/sdk/browser / browser-safe exportsCheckout, widget
Event schemasWebhook package, dashboard worker
Token helpersDashboard, checkout, portal, docs
Generated program IDsDashboard, admin, docs

Rule: if apps need to duplicate SDK logic, consider moving that logic into the SDK first.

Dashboard to Admin

Owned by vela-dashboard, consumed by vela-admin.

SurfaceContract
Service binding routesAdmin uses internal dashboard Worker APIs
D1 schemaDashboard owns migrations and database model
Audit/event viewsAdmin displays operational data from dashboard paths

Rule: admin should not bypass dashboard-owned data access unless deliberately creating a new operational boundary.

Protocol Events to Webhook Consumers

Owned by protocol and SDK event schemas, delivered by dashboard/webhook.

FieldRule
mintCanonical token identity
token_symbolRequired string display metadata; may be empty
signature, slot, mandateRequired envelope fields
event discriminatorMust remain stable or ship a new schema version

Rule: consumers may enrich display labels but must preserve raw event truth.

Which Repo Do I Change?

NeedStart hereThen check
Add protocol instructionvela-protocolvela-sdk, dashboard/checkout/widget/admin/docs
Add account fieldvela-protocolvela-sdk deserializers, dashboard indexers, admin, docs
Change plan creationvela-protocol + vela-sdkdashboard, checkout, widget, demo, docs
Change subscription transactionvela-sdkcheckout, widget, portal, dashboard
Change event payloadvela-protocol + vela-sdk/eventsvela-webhook, dashboard worker, docs
Change webhook deliveryvela-dashboardvela-webhook, docs
Change hosted checkout UXvela-checkoutwidget if embedded flow mirrors it
Change Payment Intent or refund APIvela-dashboard + vela-sdkcheckout, webhook package, docs
Change commerce event payloadvela-sdk/events + vela-dashboardvela-webhook, merchant docs and fixtures
Change receipt or credit-note PDF pipelinevela-dashboardcheckout, exports, customer and auditor views; update vela-mail only when email presentation changes
Change portal cancellation/switchingvela-portalcheckout/session APIs, SDK
Change admin token configvela-adminprotocol token config, SDK builders
Change docs examplesvela-docsSDK README and demo
Change internal processinternal-wikiREADME links and nav

Search Recipes

Find program ID references:

sh
rg -n "CVM6UqbwKgHckZzm8R2qbN3BWhCTdk1PsSeEQLchkwKT|3agVoFp4NZFuKbVqCV8HbjSZn1xW4Utk4U1Wir3TKjZ9" \
  /Users/laitsky/Developments/vela-labs \
  -g '!node_modules' -g '!dist' -g '!build' -g '!target'

Find token assumption drift:

sh
rg -n "USDC-only|sUSDC|wrappedUsdcMint|billingMint|token_symbol|UNKNOWN" \
  /Users/laitsky/Developments/vela-labs/vela-* \
  -g '!node_modules' -g '!dist' -g '!build' -g '!target'

Find instruction-builder consumers:

sh
rg -n "build[A-Za-z]+Instruction|createPlan\\(|createSubscription\\(|wrapAndSubscribe|pullPayment" \
  /Users/laitsky/Developments/vela-labs/vela-* \
  -g '!node_modules' -g '!dist' -g '!build' -g '!target'

Compatibility Smells

Treat these as review triggers:

  • app code imports a generated IDL directly instead of SDK helpers
  • app code derives PDAs manually
  • event consumer overwrites mint or normalizes token_symbol
  • UI assumes every token is USDC
  • worker catches and hides protocol errors with generic fallback
  • docs show old account requirements
  • tests pass only because fixtures hardcode wrapped USDC

Internal knowledge base for the Vela Labs workspace.