Real XMR pilot

This commit is contained in:
2026-10-22 14:40:00 -04:00
parent 52559f65d7
commit 3f04c3afa9
19 changed files with 408 additions and 50 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import { DatabaseSync } from 'node:sqlite';
import { createHash, randomUUID } from 'node:crypto';
import { mkdir, chmod } from 'node:fs/promises';
import { join } from 'node:path';
import { IS_MAINNET } from '../../shared/network.ts';
import { IS_MAINNET, PROFILE } from '../../shared/network.ts';
import { NETWORK } from '../../shared/testnet.ts';
import { ADDITIONAL_MARKET_FEE } from '../../shared/market.ts';
import { allocateXmrSale } from '../../shared/xmr-pricing.ts';
@@ -50,7 +50,7 @@ export class CustodyMarket {
if (IS_MAINNET) throw new Error('Custody sandbox cannot run on mainnet');
await validateMarketPolicy(options);
if (!Number.isSafeInteger(options.feeBps) || options.feeBps < 0 || options.feeBps > 5000) throw new Error('Invalid custody fee');
const folder = join(directory, 'testnet');
const folder = join(directory, PROFILE);
await mkdir(folder, { recursive: true, mode: 0o700 });
const file = join(folder, 'custody-sandbox.sqlite');
const db = new DatabaseSync(file);