From 83bfd1829d44dfaa68f111d724d2c98bbd92a86c Mon Sep 17 00:00:00 2001 From: Joshua Date: Tue, 17 Feb 2026 11:42:33 -0800 Subject: [PATCH] Add membership mint transaction stage to wallet flow --- public/index.html | 45 +++++++++++++++++++++++++++++++++++++++++--- translations/ar.json | 2 +- translations/de.json | 2 +- translations/en.json | 6 +++++- translations/es.json | 2 +- translations/fr.json | 2 +- translations/he.json | 2 +- translations/hi.json | 2 +- translations/ja.json | 2 +- translations/ko.json | 2 +- translations/pt.json | 2 +- translations/ru.json | 2 +- translations/zh.json | 2 +- 13 files changed, 58 insertions(+), 15 deletions(-) diff --git a/public/index.html b/public/index.html index cdb1b9d..6034c12 100644 --- a/public/index.html +++ b/public/index.html @@ -742,18 +742,57 @@ async function startWalletFlow() { signature, }); + setFlowStatus('membership_quoting', 'Preparing membership mint...', false); + const quote = await postJSON('/secret/membership/quote', { + designation_code: verification.designation_code || intent.designation_code || null, + address, + chain_id: chainId, + }); + + const txParams = quote.tx || { + from: address, + to: quote.contract_address, + data: quote.calldata || '0x', + value: quote.value || '0x0', + }; + + if (!txParams.from) txParams.from = address; + if (!txParams.to) { + throw new Error('Membership quote is missing destination contract.'); + } + + setFlowStatus('membership_minting', 'Confirm membership mint in your wallet...', false); + const txHash = await window.ethereum.request({ + method: 'eth_sendTransaction', + params: [txParams], + }); + + setFlowStatus('membership_confirming', 'Confirming membership on-chain...', false); + const confirmation = await postJSON('/secret/membership/confirm', { + designation_code: verification.designation_code || intent.designation_code || null, + quote_id: quote.quote_id || null, + tx_hash: txHash, + address, + chain_id: chainId, + }); + + if (confirmation.status !== 'membership_active') { + throw new Error('Membership transaction did not activate.'); + } + const ackState = { - code: verification.designation_code || intent.designation_code || null, - token: verification.display_token || intent.display_token || buildDisplayToken(verification.designation_code || intent.designation_code), + code: confirmation.designation_code || verification.designation_code || intent.designation_code || null, + token: confirmation.display_token || verification.display_token || intent.display_token || buildDisplayToken(confirmation.designation_code || verification.designation_code || intent.designation_code), wallet: address, chain_id: chainId, + membership_tx_hash: txHash, }; saveAcknowledgement(ackState); renderAcknowledged(ackState); hideElement(continueAction); hideElement(walletPanel); showElement(notifyPanel); - setFlowStatus('wallet_success', 'Designation acknowledged.', false); + setFlowStatus('membership_active', 'Membership active. Designation acknowledged.', false); } catch (err) { const message = err && err.message ? err.message : 'Wallet flow failed.'; setFlowStatus('wallet_failed', message, true); diff --git a/translations/ar.json b/translations/ar.json index f021130..5894c29 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -28,7 +28,7 @@ "note": "ملاحظة: هذه الصفحة بسيطة عن قصد. وهي تعكس فلسفة منتج ترى أن الحساب قد يكون معقدًا بينما تبقى الواجهات هادئة." }, "continue_label": "متابعة", - "wallet_intro": "استلم رمز التعيين الخاص بك", + "wallet_intro": "قم بسك عضويتك", "wallet_fact_no_tx": "لا توجد معاملة. فقط توقيع.", "wallet_fact_seed": "لا تشارك عبارة الاسترداد الخاصة بك أبدًا.", "wallet_have": "لدي محفظة", diff --git a/translations/de.json b/translations/de.json index a1ab175..0edc925 100644 --- a/translations/de.json +++ b/translations/de.json @@ -28,7 +28,7 @@ "note": "Hinweis: Diese Seite ist bewusst minimal. Sie spiegelt eine Produktphilosophie wider, bei der die Berechnung komplex und die Oberfläche ruhig bleibt." }, "continue_label": "weiter", - "wallet_intro": "erhalte dein Designations-Token", + "wallet_intro": "praege deine Mitgliedschaft", "wallet_fact_no_tx": "Keine Transaktion. Nur Signatur.", "wallet_fact_seed": "Teile niemals deine Seed-Phrase.", "wallet_have": "Ich habe ein Wallet", diff --git a/translations/en.json b/translations/en.json index f95aec4..d8e6933 100644 --- a/translations/en.json +++ b/translations/en.json @@ -28,7 +28,7 @@ "note": "Note: This page is intentionally minimal. It reflects a product philosophy where computation is complex and interfaces remain quiet." }, "continue_label": "continue", - "wallet_intro": "receive your designation token", + "wallet_intro": "mint your membership", "wallet_fact_no_tx": "No transaction. Signature only.", "wallet_fact_seed": "Never share your seed phrase.", "wallet_have": "I have a wallet", @@ -41,6 +41,10 @@ "wallet_signing": "Awaiting signature...", "wallet_verifying": "Verifying signature...", "wallet_success": "Designation acknowledged.", + "membership_quoting": "Preparing membership mint...", + "membership_minting": "Confirm membership mint in your wallet...", + "membership_confirming": "Confirming membership on-chain...", + "membership_active": "Membership active. Designation acknowledged.", "wallet_failed": "Wallet flow failed.", "wallet_missing": "No wallet detected on this device.", "notify_me": "notify me", diff --git a/translations/es.json b/translations/es.json index a8e2b43..72bfbf8 100644 --- a/translations/es.json +++ b/translations/es.json @@ -28,7 +28,7 @@ "note": "Nota: Esta página es intencionalmente mínima. Refleja una filosofía de producto donde el cómputo es complejo y las interfaces permanecen silenciosas." }, "continue_label": "continuar", - "wallet_intro": "recibe tu token de designación", + "wallet_intro": "acuña tu membresía", "wallet_fact_no_tx": "Sin transacción. Solo firma.", "wallet_fact_seed": "Nunca compartas tu frase semilla.", "wallet_have": "Tengo una wallet", diff --git a/translations/fr.json b/translations/fr.json index cfe793d..3996351 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -28,7 +28,7 @@ "note": "Note : Cette page est volontairement minimale. Elle reflète une philosophie produit où le calcul est complexe et les interfaces restent discrètes." }, "continue_label": "continuer", - "wallet_intro": "recevez votre jeton de designation", + "wallet_intro": "frappez votre adhesion", "wallet_fact_no_tx": "Aucune transaction. Signature uniquement.", "wallet_fact_seed": "Ne partagez jamais votre phrase secrete.", "wallet_have": "Je possede un wallet", diff --git a/translations/he.json b/translations/he.json index edc5082..cbfa86b 100644 --- a/translations/he.json +++ b/translations/he.json @@ -28,7 +28,7 @@ "note": "הערה: דף זה מינימלי בכוונה. הוא משקף פילוסופיית מוצר שבה החישוב מורכב, אך הממשקים נשארים שקטים." }, "continue_label": "המשך", - "wallet_intro": "קבל את אסימון הייעוד שלך", + "wallet_intro": "הנפק את החברות שלך", "wallet_fact_no_tx": "אין עסקה. רק חתימה.", "wallet_fact_seed": "לעולם אל תשתף את ביטוי השחזור שלך.", "wallet_have": "יש לי ארנק", diff --git a/translations/hi.json b/translations/hi.json index eecd823..1489bcc 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -28,7 +28,7 @@ "note": "नोट: यह पृष्ठ जानबूझकर न्यूनतम रखा गया है। यह उस उत्पाद दर्शन को दर्शाता है जिसमें गणना जटिल हो सकती है, लेकिन इंटरफेस शांत रहते हैं।" }, "continue_label": "जारी रखें", - "wallet_intro": "अपना नामांकन टोकन प्राप्त करें", + "wallet_intro": "अपनी सदस्यता मिंट करें", "wallet_fact_no_tx": "कोई ट्रांज़ैक्शन नहीं। केवल सिग्नेचर।", "wallet_fact_seed": "अपना सीड फ़्रेज़ कभी साझा न करें।", "wallet_have": "मेरे पास वॉलेट है", diff --git a/translations/ja.json b/translations/ja.json index 8bed6d6..5c8299b 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -28,7 +28,7 @@ "note": "注記: このページは意図的にミニマルです。計算は複雑でも、インターフェースは静かであるべきという製品哲学を表しています。" }, "continue_label": "続行", - "wallet_intro": "指定トークンを受け取る", + "wallet_intro": "メンバーシップをミントする", "wallet_fact_no_tx": "取引は発生しません。署名のみです。", "wallet_fact_seed": "シードフレーズは絶対に共有しないでください。", "wallet_have": "ウォレットを持っています", diff --git a/translations/ko.json b/translations/ko.json index 75a1cb8..8905a89 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -28,7 +28,7 @@ "note": "참고: 이 페이지는 의도적으로 미니멀합니다. 연산은 복잡하더라도 인터페이스는 조용해야 한다는 제품 철학을 반영합니다." }, "continue_label": "계속", - "wallet_intro": "지정 토큰 받기", + "wallet_intro": "멤버십 민팅하기", "wallet_fact_no_tx": "거래는 없습니다. 서명만 진행됩니다.", "wallet_fact_seed": "시드 문구를 절대 공유하지 마세요.", "wallet_have": "지갑이 있습니다", diff --git a/translations/pt.json b/translations/pt.json index 7234db0..efdfe17 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -28,7 +28,7 @@ "note": "Nota: Esta página é intencionalmente minimalista. Ela reflete uma filosofia de produto em que a computação é complexa e as interfaces permanecem discretas." }, "continue_label": "continuar", - "wallet_intro": "receba seu token de designação", + "wallet_intro": "cunhe sua associação", "wallet_fact_no_tx": "Sem transação. Apenas assinatura.", "wallet_fact_seed": "Nunca compartilhe sua frase-semente.", "wallet_have": "Tenho uma wallet", diff --git a/translations/ru.json b/translations/ru.json index bb22e95..fa4661c 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -28,7 +28,7 @@ "note": "Примечание: эта страница намеренно минималистична. Она отражает философию продукта, где вычисления сложны, а интерфейсы остаются тихими." }, "continue_label": "продолжить", - "wallet_intro": "получите свой токен назначения", + "wallet_intro": "минтите свое членство", "wallet_fact_no_tx": "Без транзакции. Только подпись.", "wallet_fact_seed": "Никогда не делитесь seed-фразой.", "wallet_have": "У меня есть кошелек", diff --git a/translations/zh.json b/translations/zh.json index f2a49de..ea1c16c 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -28,7 +28,7 @@ "note": "说明:本页面刻意保持极简,体现了“计算可以复杂,界面应保持安静”的产品哲学。" }, "continue_label": "继续", - "wallet_intro": "接收你的指定令牌", + "wallet_intro": "铸造你的会员资格", "wallet_fact_no_tx": "无交易,仅签名。", "wallet_fact_seed": "请勿分享你的助记词。", "wallet_have": "我有钱包",