Skip to content

Conversation

@coreyphillips
Copy link
Collaborator

This PR:

  • Adds the paykit module and core functions
  • Adds docs & tests as needed
  • Bumps version to 0.1.32
  • Update bindings accordingly

New Methods

Session Functions

  • createPubkyRingSessionRequest(callbackUrl, additionalParams?) - Generate URI to request session from Pubky Ring
  • parsePaykitDeeplink(url) - Parse a Paykit deeplink URL
  • validatePaykitDeeplink(url) - Validate a Paykit deeplink URL
  • createDeeplinkFromToken(baseUrl, action, token, additionalParams?) - Create deeplink from session token
  • createSessionTokenFromKeypair(publicKey, secretKey, homeserverUrl?, expiresInSeconds?) - Create session token from keypair
  • serializeSessionToToken(sessionData) - Serialize session data to token
  • deserializeTokenToSession(token) - Deserialize token to session data

Standalone Functions

  • setPaymentEndpoint(client, method, data) - Store/update a payment endpoint
  • removePaymentEndpoint(client, method) - Remove a payment endpoint
  • getPaymentList(reader, payee) - Get all payment methods for a user
  • getPaymentEndpoint(reader, payee, method) - Retrieve a specific payment endpoint
  • getKnownContacts(reader, key) - Get user's known contacts

PubkyAuthenticatedTransport

  • PubkyAuthenticatedTransport() - Constructor (returns error, use token-based creation)
  • setPaymentEndpoint(method, data) - Store/update a payment endpoint
  • removePaymentEndpoint(method) - Remove a payment endpoint

PubkyUnauthenticatedTransport

  • PubkyUnauthenticatedTransport() - Constructor for read operations
  • getPaymentList(payee) - Get all payment methods for a user
  • getPaymentEndpoint(payee, method) - Retrieve a specific payment endpoint
  • getKnownContacts(key) - Get user's known contacts

Scanner

  • New Scanner.PaykitSession variant for scanning Paykit session QR codes

New Types

  • SessionToken - Base64-encoded session token wrapper (token: String)
  • SessionData - Serializable session data (publicKey, secretKey, homeserverUrl?, expiresAt?, metadata?)
  • MethodId - Payment method identifier (id: String)
  • EndpointData - Payment endpoint data payload (data: String)
  • PublicKey - Pubky public key wrapper (key: String)
  • SupportedPayments - Map of method IDs to endpoint data (entries: Map<String, EndpointData>)
  • PaykitDeeplink - Parsed deeplink (action, sessionToken?, parameters)
  • ScannedPaykitSession - Scanned session from QR code (url, action, token, parameters)
  • PaykitException / PaykitError - Error types

Documentation

See src/modules/paykit/README.md for Swift and Kotlin implementation examples.

- Add paykit module and core functions
- Add docs & tests as needed
- Bump version to 0.1.32
- Update bindings
@coreyphillips coreyphillips self-assigned this Dec 9, 2025
- Update handle_decode_result to include paykit session
- Restore Cargo.toml
@coreyphillips coreyphillips requested a review from ovitrif December 9, 2025 02:19
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