import { createSidecarProxy } from '../../sidecar/create-proxy';

// /api/wallet/* — auth, then forward to officer-wallet. No routes of its own, and no wallet knowledge
// whatsoever: not a seed, not a node credential, not an xpub. The platform cannot spend and cannot read a
// balance except by asking the sidecar.
//
// The unlock passphrase DOES transit this proxy — the browser has to send it somewhere — but it is
// forwarded as an opaque body and never parsed, logged or retained. See sidecar/create-proxy.ts, which
// deliberately performs no body inspection; that restraint matters more for this sidecar than any other.

const proxy = createSidecarProxy({ name: 'wallet', prefix: '/api/wallet' });

export const walletRouter = proxy.router;

/** Base URL of the sidecar's HTTP server, or null if it hasn't reported in yet. */
export const getWalletServerUrl = proxy.getHttpUrl;
