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 -1
View File
@@ -16,6 +16,7 @@ import { RpcError } from '../resources.ts';
import type { CanonicalEvents, IndexedNft } from '../testnet/canonical-index.ts';
import { z } from 'zod';
import { operatorMarketPolicy, resolvedMarketPolicy, permitsMarketAction, validateMarketPolicy, type MarketPolicy } from './policy.ts';
import { PROFILE } from '../../shared/network.ts';
type Chain = { snapshot(): TestnetSnapshot; summary?(): { tip: string; revision: number; height?: number };
submitTransfer(raw: unknown): Promise<string>; nft?(token: string): IndexedNft | undefined;
@@ -112,7 +113,7 @@ export class Market {
static async open(directory: string, chain: Chain, config = marketConfig(), now = Date.now,
reconciliation: { worker?: boolean } = {}): Promise<Market> {
await validateMarketPolicy(config);
const folder = join(directory, NETWORK.includes('mainnet') ? 'mainnet' : 'testnet');
const folder = join(directory, PROFILE);
await mkdir(folder, { recursive: true, mode: 0o700 });
const file = join(folder, 'market.sqlite');
const db = new DatabaseSync(file);