Environment variables

This commit is contained in:
2026-10-20 16:24:01 -04:00
parent 4cac26d84b
commit 7734d8ae90
29 changed files with 267 additions and 38 deletions
+16 -1
View File
@@ -65,7 +65,20 @@ export function CustodyPanel({ wallet, snapshot, rpcAvailable }: Props) {
return () => { generation.current++; };
}, [refresh, rpcAvailable]);
useEffect(() => { if (review) reviewElement.current?.focus(); }, [review]);
const prepare = (action: CustodyAction, description: string) => { setError(''); setNotice(''); setReview({ action, description }); };
const prepare = (action: CustodyAction, description: string) => {
if (['list','reserve','mock-credit'].includes(action.type) && (page?.info.marketEnabled === false || page?.info.tradingEnabled === false)) {
setError('This host is not accepting new trading or funding. Existing balances and cancellation/withdrawal requests remain accessible.'); return;
}
if (action.type === 'list' || action.type === 'reserve') {
const listingId = action.type === 'reserve' ? action.listingId : undefined;
const recipient = action.type === 'reserve'
? page?.listings.find(l => l.id === listingId)?.hostFeeAddress ?? ADDITIONAL_MARKET_FEE.address
: page?.info.hostFeeAddress ?? ADDITIONAL_MARKET_FEE.address;
action = { ...action, hostFeeAddress: recipient };
description += ` Host fee recipient: ${recipient}. The separate fixed author fee is unchanged.`;
}
setError(''); setNotice(''); setReview({ action, description });
};
const submit = async (again?: CustodyCommand) => {
if (!wallet || !page || pending.current || (!review && !again)) return;
pending.current = true; setBusy(true); setError('');
@@ -93,6 +106,8 @@ export function CustodyPanel({ wallet, snapshot, rpcAvailable }: Props) {
<h2>A balance for this market.</h2>
<p>A future custodian would hold pooled XMR and track what each customer is owed. Purchases would move ledger balances, not XMR between subaddresses. You would trust the operator with your deposits.</p>
{enabled === false && <p className="market-reserved">This host has not enabled the custody sandbox. Real custody is unavailable.</p>}
{page&&(page.info.marketEnabled===false||page.info.tradingEnabled===false)&&<p role="status">{page.info.marketEnabled===false?'Public market disabled on this host.':'New trading paused on this host.'} Existing balances, cancellations and withdrawal requests remain accessible.</p>}
{page?.info.hostFeeAddress&&<p className="custody-identity">Host fee wallet (not a deposit address): {page.info.hostFeeAddress}</p>}
{!rpcAvailable && <p className="market-error">Reconnect to the node to use this preview.</p>}
{!wallet && <p>Open your Wikideck wallet to view private balances and authorize sandbox commands.</p>}
{page && <p className="muted custody-identity">Sandbox custodian {page.info.custodianId} · {page.info.network} · host {page.info.feeBps / 100}% + author 1%. Fresh custody signatures are required; legacy mock authorizations do not debit balances.</p>}