Skip to content

feat(payments): add CEP-8 payment primitives#102

Merged
ContextVM-org merged 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep8-payment-primitives
Jul 20, 2026
Merged

feat(payments): add CEP-8 payment primitives#102
ContextVM-org merged 1 commit into
ContextVM:mainfrom
harsh04044:feat/cep8-payment-primitives

Conversation

@harsh04044

Copy link
Copy Markdown

Part of #100

Adds the pure src/payments/ foundation for CEP-8 (capability pricing and payment over ContextVM). Types, tags, traits, and fakes only. No transport wiring, network, or negotiation; those come in follow-ups that build on this.

What's here

  • Tag builders and parsers for cap, pmi, and payment_interaction (matches the ts-sdk vectors).
  • Wire types for the transparent notifications (payment_required / accepted / rejected) and the explicit-gating error data (-32042 / -32043). Field order is pinned to the ts emitters and covered by exact-byte serde tests.
  • PaymentProcessor, PaymentHandler, and ResolvePrice traits (async, object-safe), plus FakePaymentProcessor / FakePaymentHandler behind test-utils.
  • PaymentError folded into the crate Error, with a dedicated CVM_PAYMENT = 8 FFI code (Rust enum, C header, and C test kept in lockstep).

Note

  • ttl / retry_after are u64 seconds, so a malformed negative or fractional value fails closed at deserialize rather than being silently coerced. Reject tests cover it.
  • No cap parser and no direct_payment / change producers, matching ts-sdk (both are optional or read-only on the client side).

@ContextVM-org
ContextVM-org merged commit b990e12 into ContextVM:main Jul 20, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants