From 8c349d2003268730303a5db094d814a3dad19e55 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Fri, 3 Apr 2026 01:59:15 +0000 Subject: [PATCH] fix(rflows): align Openfort wallet label with flow-service Use `user-${email}` instead of raw `email` as the Openfort player label, matching the flow-service convention. Openfort rejects colons in labels, and both codepaths must use the same format so users get the same wallet regardless of whether they on-ramp via rfunds.online or rspace.online. Co-Authored-By: Claude Opus 4.6 (1M context) --- modules/rflows/lib/openfort.ts | 2 +- modules/rflows/mod.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rflows/lib/openfort.ts b/modules/rflows/lib/openfort.ts index c69f97d..5aa68b5 100644 --- a/modules/rflows/lib/openfort.ts +++ b/modules/rflows/lib/openfort.ts @@ -33,7 +33,7 @@ export class OpenfortProvider { /** * Find an existing wallet by player name, or create a new one. - * Ensures one wallet per label (e.g. "user:alice@example.com"). + * Ensures one wallet per label (e.g. "user-alice@example.com"). */ async findOrCreateWallet(label: string, metadata?: Record): Promise { try { diff --git a/modules/rflows/mod.ts b/modules/rflows/mod.ts index b449aae..67d2d36 100644 --- a/modules/rflows/mod.ts +++ b/modules/rflows/mod.ts @@ -238,7 +238,7 @@ routes.post("/api/flows/user-onramp", async (c) => { if (!onramp) return c.json({ error: "No on-ramp provider available" }, 503); // 1. Find or create Openfort smart wallet for this user (one wallet per email) - const wallet = await _openfort.findOrCreateWallet(email, { + const wallet = await _openfort.findOrCreateWallet(`user-${email}`, { type: 'user-onramp', email, }); -- 2.40.1