Add membership mint transaction stage to wallet flow

This commit is contained in:
Joshua 2026-02-17 11:42:33 -08:00
parent 58591ab1f7
commit 83bfd1829d
13 changed files with 58 additions and 15 deletions

View File

@ -742,18 +742,57 @@ async function startWalletFlow() {
signature, 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 = { const ackState = {
code: verification.designation_code || intent.designation_code || null, code: confirmation.designation_code || verification.designation_code || intent.designation_code || null,
token: verification.display_token || intent.display_token || buildDisplayToken(verification.designation_code || intent.designation_code), token: confirmation.display_token || verification.display_token || intent.display_token || buildDisplayToken(confirmation.designation_code || verification.designation_code || intent.designation_code),
wallet: address, wallet: address,
chain_id: chainId, chain_id: chainId,
membership_tx_hash: txHash,
}; };
saveAcknowledgement(ackState); saveAcknowledgement(ackState);
renderAcknowledged(ackState); renderAcknowledged(ackState);
hideElement(continueAction); hideElement(continueAction);
hideElement(walletPanel); hideElement(walletPanel);
showElement(notifyPanel); showElement(notifyPanel);
setFlowStatus('wallet_success', 'Designation acknowledged.', false); setFlowStatus('membership_active', 'Membership active. Designation acknowledged.', false);
} catch (err) { } catch (err) {
const message = err && err.message ? err.message : 'Wallet flow failed.'; const message = err && err.message ? err.message : 'Wallet flow failed.';
setFlowStatus('wallet_failed', message, true); setFlowStatus('wallet_failed', message, true);

View File

@ -28,7 +28,7 @@
"note": "ملاحظة: هذه الصفحة بسيطة عن قصد. وهي تعكس فلسفة منتج ترى أن الحساب قد يكون معقدًا بينما تبقى الواجهات هادئة." "note": "ملاحظة: هذه الصفحة بسيطة عن قصد. وهي تعكس فلسفة منتج ترى أن الحساب قد يكون معقدًا بينما تبقى الواجهات هادئة."
}, },
"continue_label": "متابعة", "continue_label": "متابعة",
"wallet_intro": "استلم رمز التعيين الخاص بك", "wallet_intro": "قم بسك عضويتك",
"wallet_fact_no_tx": "لا توجد معاملة. فقط توقيع.", "wallet_fact_no_tx": "لا توجد معاملة. فقط توقيع.",
"wallet_fact_seed": "لا تشارك عبارة الاسترداد الخاصة بك أبدًا.", "wallet_fact_seed": "لا تشارك عبارة الاسترداد الخاصة بك أبدًا.",
"wallet_have": "لدي محفظة", "wallet_have": "لدي محفظة",

View File

@ -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." "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", "continue_label": "weiter",
"wallet_intro": "erhalte dein Designations-Token", "wallet_intro": "praege deine Mitgliedschaft",
"wallet_fact_no_tx": "Keine Transaktion. Nur Signatur.", "wallet_fact_no_tx": "Keine Transaktion. Nur Signatur.",
"wallet_fact_seed": "Teile niemals deine Seed-Phrase.", "wallet_fact_seed": "Teile niemals deine Seed-Phrase.",
"wallet_have": "Ich habe ein Wallet", "wallet_have": "Ich habe ein Wallet",

View File

@ -28,7 +28,7 @@
"note": "Note: This page is intentionally minimal. It reflects a product philosophy where computation is complex and interfaces remain quiet." "note": "Note: This page is intentionally minimal. It reflects a product philosophy where computation is complex and interfaces remain quiet."
}, },
"continue_label": "continue", "continue_label": "continue",
"wallet_intro": "receive your designation token", "wallet_intro": "mint your membership",
"wallet_fact_no_tx": "No transaction. Signature only.", "wallet_fact_no_tx": "No transaction. Signature only.",
"wallet_fact_seed": "Never share your seed phrase.", "wallet_fact_seed": "Never share your seed phrase.",
"wallet_have": "I have a wallet", "wallet_have": "I have a wallet",
@ -41,6 +41,10 @@
"wallet_signing": "Awaiting signature...", "wallet_signing": "Awaiting signature...",
"wallet_verifying": "Verifying signature...", "wallet_verifying": "Verifying signature...",
"wallet_success": "Designation acknowledged.", "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_failed": "Wallet flow failed.",
"wallet_missing": "No wallet detected on this device.", "wallet_missing": "No wallet detected on this device.",
"notify_me": "notify me", "notify_me": "notify me",

View File

@ -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." "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", "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_no_tx": "Sin transacción. Solo firma.",
"wallet_fact_seed": "Nunca compartas tu frase semilla.", "wallet_fact_seed": "Nunca compartas tu frase semilla.",
"wallet_have": "Tengo una wallet", "wallet_have": "Tengo una wallet",

View File

@ -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." "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", "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_no_tx": "Aucune transaction. Signature uniquement.",
"wallet_fact_seed": "Ne partagez jamais votre phrase secrete.", "wallet_fact_seed": "Ne partagez jamais votre phrase secrete.",
"wallet_have": "Je possede un wallet", "wallet_have": "Je possede un wallet",

View File

@ -28,7 +28,7 @@
"note": "הערה: דף זה מינימלי בכוונה. הוא משקף פילוסופיית מוצר שבה החישוב מורכב, אך הממשקים נשארים שקטים." "note": "הערה: דף זה מינימלי בכוונה. הוא משקף פילוסופיית מוצר שבה החישוב מורכב, אך הממשקים נשארים שקטים."
}, },
"continue_label": "המשך", "continue_label": "המשך",
"wallet_intro": "קבל את אסימון הייעוד שלך", "wallet_intro": "הנפק את החברות שלך",
"wallet_fact_no_tx": "אין עסקה. רק חתימה.", "wallet_fact_no_tx": "אין עסקה. רק חתימה.",
"wallet_fact_seed": "לעולם אל תשתף את ביטוי השחזור שלך.", "wallet_fact_seed": "לעולם אל תשתף את ביטוי השחזור שלך.",
"wallet_have": "יש לי ארנק", "wallet_have": "יש לי ארנק",

View File

@ -28,7 +28,7 @@
"note": "नोट: यह पृष्ठ जानबूझकर न्यूनतम रखा गया है। यह उस उत्पाद दर्शन को दर्शाता है जिसमें गणना जटिल हो सकती है, लेकिन इंटरफेस शांत रहते हैं।" "note": "नोट: यह पृष्ठ जानबूझकर न्यूनतम रखा गया है। यह उस उत्पाद दर्शन को दर्शाता है जिसमें गणना जटिल हो सकती है, लेकिन इंटरफेस शांत रहते हैं।"
}, },
"continue_label": "जारी रखें", "continue_label": "जारी रखें",
"wallet_intro": "अपना नामांकन टोकन प्राप्त करें", "wallet_intro": "अपनी सदस्यता मिंट करें",
"wallet_fact_no_tx": "कोई ट्रांज़ैक्शन नहीं। केवल सिग्नेचर।", "wallet_fact_no_tx": "कोई ट्रांज़ैक्शन नहीं। केवल सिग्नेचर।",
"wallet_fact_seed": "अपना सीड फ़्रेज़ कभी साझा न करें।", "wallet_fact_seed": "अपना सीड फ़्रेज़ कभी साझा न करें।",
"wallet_have": "मेरे पास वॉलेट है", "wallet_have": "मेरे पास वॉलेट है",

View File

@ -28,7 +28,7 @@
"note": "注記: このページは意図的にミニマルです。計算は複雑でも、インターフェースは静かであるべきという製品哲学を表しています。" "note": "注記: このページは意図的にミニマルです。計算は複雑でも、インターフェースは静かであるべきという製品哲学を表しています。"
}, },
"continue_label": "続行", "continue_label": "続行",
"wallet_intro": "指定トークンを受け取る", "wallet_intro": "メンバーシップをミントする",
"wallet_fact_no_tx": "取引は発生しません。署名のみです。", "wallet_fact_no_tx": "取引は発生しません。署名のみです。",
"wallet_fact_seed": "シードフレーズは絶対に共有しないでください。", "wallet_fact_seed": "シードフレーズは絶対に共有しないでください。",
"wallet_have": "ウォレットを持っています", "wallet_have": "ウォレットを持っています",

View File

@ -28,7 +28,7 @@
"note": "참고: 이 페이지는 의도적으로 미니멀합니다. 연산은 복잡하더라도 인터페이스는 조용해야 한다는 제품 철학을 반영합니다." "note": "참고: 이 페이지는 의도적으로 미니멀합니다. 연산은 복잡하더라도 인터페이스는 조용해야 한다는 제품 철학을 반영합니다."
}, },
"continue_label": "계속", "continue_label": "계속",
"wallet_intro": "지정 토큰 받기", "wallet_intro": "멤버십 민팅하기",
"wallet_fact_no_tx": "거래는 없습니다. 서명만 진행됩니다.", "wallet_fact_no_tx": "거래는 없습니다. 서명만 진행됩니다.",
"wallet_fact_seed": "시드 문구를 절대 공유하지 마세요.", "wallet_fact_seed": "시드 문구를 절대 공유하지 마세요.",
"wallet_have": "지갑이 있습니다", "wallet_have": "지갑이 있습니다",

View File

@ -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." "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", "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_no_tx": "Sem transação. Apenas assinatura.",
"wallet_fact_seed": "Nunca compartilhe sua frase-semente.", "wallet_fact_seed": "Nunca compartilhe sua frase-semente.",
"wallet_have": "Tenho uma wallet", "wallet_have": "Tenho uma wallet",

View File

@ -28,7 +28,7 @@
"note": "Примечание: эта страница намеренно минималистична. Она отражает философию продукта, где вычисления сложны, а интерфейсы остаются тихими." "note": "Примечание: эта страница намеренно минималистична. Она отражает философию продукта, где вычисления сложны, а интерфейсы остаются тихими."
}, },
"continue_label": "продолжить", "continue_label": "продолжить",
"wallet_intro": "получите свой токен назначения", "wallet_intro": "минтите свое членство",
"wallet_fact_no_tx": "Без транзакции. Только подпись.", "wallet_fact_no_tx": "Без транзакции. Только подпись.",
"wallet_fact_seed": "Никогда не делитесь seed-фразой.", "wallet_fact_seed": "Никогда не делитесь seed-фразой.",
"wallet_have": "У меня есть кошелек", "wallet_have": "У меня есть кошелек",

View File

@ -28,7 +28,7 @@
"note": "说明:本页面刻意保持极简,体现了“计算可以复杂,界面应保持安静”的产品哲学。" "note": "说明:本页面刻意保持极简,体现了“计算可以复杂,界面应保持安静”的产品哲学。"
}, },
"continue_label": "继续", "continue_label": "继续",
"wallet_intro": "接收你的指定令牌", "wallet_intro": "铸造你的会员资格",
"wallet_fact_no_tx": "无交易,仅签名。", "wallet_fact_no_tx": "无交易,仅签名。",
"wallet_fact_seed": "请勿分享你的助记词。", "wallet_fact_seed": "请勿分享你的助记词。",
"wallet_have": "我有钱包", "wallet_have": "我有钱包",