From 70c2021e272313203fe8f96f80901af5f58e7bd4 Mon Sep 17 00:00:00 2001 From: Wheatley from Portal <256330434+portal-wheatley@users.noreply.github.com> Date: Wed, 6 May 2026 15:43:45 +0000 Subject: [PATCH 1/3] refactor: remove verification endpoints and models from Java SDK --- README.MD | 15 ------ src/main/java/cc/getportal/PortalClient.java | 49 ------------------- .../getportal/model/VerificationSession.java | 20 -------- .../model/VerificationSessionResponse.java | 12 ----- 4 files changed, 96 deletions(-) delete mode 100644 src/main/java/cc/getportal/model/VerificationSession.java delete mode 100644 src/main/java/cc/getportal/model/VerificationSessionResponse.java diff --git a/README.MD b/README.MD index 0aa6709..0ecd10b 100644 --- a/README.MD +++ b/README.MD @@ -87,21 +87,6 @@ client.deliverWebhookPayload(rawBody, request.getHeader("X-Portal-Signature")); | `requestCashu(recipientKey, subkeys, mintUrl, unit, amount)` | `AsyncOperation` | | `authenticateKey(mainKey, subkeys)` | `AsyncOperation` | | `newKeyHandshakeUrl(staticToken, noRequest)` | `AsyncOperation` | -| `createVerificationSession(relayUrls)` | `VerificationSession` | -| `requestVerificationToken(recipientKey, subkeys)` | `AsyncOperation` | - -### Age Verification - -```java -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); -} -``` - ## Sync methods `health()`, `version()`, `info()`, `fetchProfile()`, `payInvoice()`, diff --git a/src/main/java/cc/getportal/PortalClient.java b/src/main/java/cc/getportal/PortalClient.java index e47d138..414ae6c 100644 --- a/src/main/java/cc/getportal/PortalClient.java +++ b/src/main/java/cc/getportal/PortalClient.java @@ -486,55 +486,6 @@ public WalletInfoResponse getWalletInfo() throws IOException, InterruptedExcepti return get("/wallet/info", WalletInfoResponse.class); } - // ------------------------------------------------------------------------- - // Verification - // ------------------------------------------------------------------------- - - /** - * Create an age verification session and automatically start listening for the - * verification token. Returns a {@link VerificationSession} containing session - * info and an {@link AsyncOperation} that resolves when the user completes - * verification. - * - *

Redirect the user to {@code session.session_url} in their browser. - * Poll or await {@code operation.done()} for the {@link CashuResponseStatus} result. - * - * @param relayUrls optional relay URLs; defaults to server's [nostr] config if null - */ - public VerificationSession createVerificationSession( - @Nullable List relayUrls - ) throws IOException, InterruptedException, PortalSDKException { - Map body = new java.util.HashMap<>(); - if (relayUrls != null) body.put("relays", relayUrls); - VerificationSessionResponse resp = post("/verification/sessions", body, VerificationSessionResponse.class); - AsyncOperation op = registerStream(resp.stream_id, - json -> gson.fromJson(json.getAsJsonObject("status"), CashuResponseStatus.class)); - return new VerificationSession(resp, op); - } - - /** Convenience overload with default relays. */ - public VerificationSession createVerificationSession() - throws IOException, InterruptedException, PortalSDKException { - return createVerificationSession(null); - } - - /** - * Request a verification token from a user who already holds one - * (e.g. verified through the mobile app). - * - * @param recipientKey hex-encoded public key of the token holder - * @param subkeys optional subkeys - */ - public AsyncOperation requestVerificationToken( - String recipientKey, List subkeys - ) throws IOException, InterruptedException, PortalSDKException { - Map body = Map.of("recipient_key", recipientKey, "subkeys", subkeys); - JsonObject resp = post("/verification/token", body, JsonObject.class); - String streamId = resp.get("stream_id").getAsString(); - return registerStream(streamId, - json -> gson.fromJson(json.getAsJsonObject("status"), CashuResponseStatus.class)); - } - // ------------------------------------------------------------------------- // Events (low-level) // ------------------------------------------------------------------------- diff --git a/src/main/java/cc/getportal/model/VerificationSession.java b/src/main/java/cc/getportal/model/VerificationSession.java deleted file mode 100644 index be1a808..0000000 --- a/src/main/java/cc/getportal/model/VerificationSession.java +++ /dev/null @@ -1,20 +0,0 @@ -package cc.getportal.model; - -import cc.getportal.AsyncOperation; - -/** - * Result of {@code createVerificationSession()} — contains the session info - * and an {@link AsyncOperation} for polling the verification token. - */ -public class VerificationSession { - public final VerificationSessionResponse session; - public final AsyncOperation operation; - - public VerificationSession( - VerificationSessionResponse session, - AsyncOperation operation - ) { - this.session = session; - this.operation = operation; - } -} diff --git a/src/main/java/cc/getportal/model/VerificationSessionResponse.java b/src/main/java/cc/getportal/model/VerificationSessionResponse.java deleted file mode 100644 index e4dc080..0000000 --- a/src/main/java/cc/getportal/model/VerificationSessionResponse.java +++ /dev/null @@ -1,12 +0,0 @@ -package cc.getportal.model; - -/** - * Response from {@code POST /verification/sessions}. - */ -public class VerificationSessionResponse { - public String session_id; - public String session_url; - public String ephemeral_npub; - public long expires_at; - public String stream_id; -} From de0f7b44a3f91c52e358d9db66d8edfda8fd6717 Mon Sep 17 00:00:00 2001 From: Wheatley from Portal <256330434+portal-wheatley@users.noreply.github.com> Date: Wed, 6 May 2026 16:15:26 +0000 Subject: [PATCH 2/3] release: bump Java SDK version to 0.4.2 --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3d92995..743dd76 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { } group = "cc.getportal" -version = "0.4.1" +version = "0.4.2" java { toolchain { @@ -23,7 +23,7 @@ publishing { groupId = "cc.getportal" artifactId = "portal-java-sdk" - version = "0.4.1" + version = "0.4.2" } } } From dc2ea6f5efec3307cf2f70c6c04319e71e517c0e Mon Sep 17 00:00:00 2001 From: Wheatley from Portal <256330434+portal-wheatley@users.noreply.github.com> Date: Wed, 6 May 2026 16:17:30 +0000 Subject: [PATCH 3/3] docs: update README dependency example to 0.4.2 --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 0ecd10b..4e4355d 100644 --- a/README.MD +++ b/README.MD @@ -12,7 +12,7 @@ dependencyResolutionManagement { // build.gradle.kts dependencies { - implementation("com.github.PortalTechnologiesInc:java-sdk:0.4.1") + implementation("com.github.PortalTechnologiesInc:java-sdk:0.4.2") } ```