feat: add paykit module #57
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
paykitmodule and core functions0.1.32New Methods
Session Functions
createPubkyRingSessionRequest(callbackUrl, additionalParams?)- Generate URI to request session from Pubky RingparsePaykitDeeplink(url)- Parse a Paykit deeplink URLvalidatePaykitDeeplink(url)- Validate a Paykit deeplink URLcreateDeeplinkFromToken(baseUrl, action, token, additionalParams?)- Create deeplink from session tokencreateSessionTokenFromKeypair(publicKey, secretKey, homeserverUrl?, expiresInSeconds?)- Create session token from keypairserializeSessionToToken(sessionData)- Serialize session data to tokendeserializeTokenToSession(token)- Deserialize token to session dataStandalone Functions
setPaymentEndpoint(client, method, data)- Store/update a payment endpointremovePaymentEndpoint(client, method)- Remove a payment endpointgetPaymentList(reader, payee)- Get all payment methods for a usergetPaymentEndpoint(reader, payee, method)- Retrieve a specific payment endpointgetKnownContacts(reader, key)- Get user's known contactsPubkyAuthenticatedTransport
PubkyAuthenticatedTransport()- Constructor (returns error, use token-based creation)setPaymentEndpoint(method, data)- Store/update a payment endpointremovePaymentEndpoint(method)- Remove a payment endpointPubkyUnauthenticatedTransport
PubkyUnauthenticatedTransport()- Constructor for read operationsgetPaymentList(payee)- Get all payment methods for a usergetPaymentEndpoint(payee, method)- Retrieve a specific payment endpointgetKnownContacts(key)- Get user's known contactsScanner
Scanner.PaykitSessionvariant for scanning Paykit session QR codesNew 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 typesDocumentation
See
src/modules/paykit/README.mdfor Swift and Kotlin implementation examples.