Skip to content

feat: add age verification endpoints (0.4.1)#9

Merged
denmeh merged 2 commits intomainfrom
feat/age-verification
Apr 2, 2026
Merged

feat: add age verification endpoints (0.4.1)#9
denmeh merged 2 commits intomainfrom
feat/age-verification

Conversation

@portal-wheatley
Copy link
Copy Markdown
Contributor

@portal-wheatley portal-wheatley commented Apr 2, 2026

Changes

Adds age verification support to the Java SDK, matching the TypeScript SDK (portal-rest 0.4.1).

New

  • VerificationSessionResponse model — session_id, session_url, ephemeral_npub, expires_at, stream_id
  • VerificationSession wrapper — holds session info + AsyncOperation<CashuResponseStatus> (same pattern as other composite responses)
  • createVerificationSession(relayUrls?) — creates a session and automatically starts listening for the verification token. Returns VerificationSession
  • requestVerificationToken(recipientKey, subkeys) — requests a token from a user who already holds one (mobile app flow). Returns AsyncOperation<CashuResponseStatus>

Version bump

0.4.00.4.1

Usage

VerificationSession session = client.createVerificationSession();
System.out.println("Redirect user to: " + session.session.session_url);

CashuResponseStatus result = client.pollUntilComplete(
    session.operation, new PollOptions(1000, 300_000)
);
if (result.status.equals("success")) {
    System.out.println("Verified! Token: " + result.token);
}

Build

./gradlew compileJava — BUILD SUCCESSFUL

@denmeh denmeh merged commit 68cb85e into main Apr 2, 2026
2 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