Skip to content

feat(anchor-service): add authenticateSep10 function#222

Merged
MissBlue00 merged 1 commit into
MissBlue00:mainfrom
Andreschuks101:feat/issue-84-authenticate-sep10
Jun 28, 2026
Merged

feat(anchor-service): add authenticateSep10 function#222
MissBlue00 merged 1 commit into
MissBlue00:mainfrom
Andreschuks101:feat/issue-84-authenticate-sep10

Conversation

@Andreschuks101

Copy link
Copy Markdown
Contributor

Adds an authenticateSep10 function to the @stellar-pay/anchor-service package for SEP-10 authentication with Stellar anchors.

Changes
Add authenticateSep10(config: Sep10Config): Promise implementing the SEP-10 handshake: request a challenge transaction from the anchor's web auth endpoint, sign the challenge with the account key, and exchange the signed challenge for a JWT auth token.
Add Sep10Config, Sep10AuthResult, and Sep10ChallengeResponse interfaces.
Validate the account public/secret keys, auth endpoint, and home domain before starting the flow.
Issue a JWT (header/claims/signature) carrying iss, sub, iat, and exp claims, with an optional client_domain and memo-scoped subject for shared accounts.
Export the function and types from the package entry point.
The returned token is intended to be used as a Bearer token on subsequent anchor calls (SEP-6/12/24/31).

Implementation notes
The function follows the package's existing self-contained convention (in-memory simulation of Stellar operations, consistent with anchor.service.ts). It intentionally avoids Buffer and any new dependency, using a dependency-free base64url encoder, so it relies only on globals the existing package already uses.

Testing
pnpm --filter @stellar-pay/anchor-service build completes with no TypeScript errors (CJS, ESM, and DTS all build successfully).

closes #84

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Andreschuks101 is attempting to deploy a commit to the missblue00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Andreschuks101 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@MissBlue00 MissBlue00 merged commit 49289f0 into MissBlue00:main Jun 28, 2026
0 of 3 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.

Add authenticateSep10 function

2 participants