This commit is contained in:
discountry
2025-09-23 01:26:49 +08:00
commit 667ede7ca8
26 changed files with 7836 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
export interface TradeLogEntry {
time: string;
type: string;
detail: string;
}
export function createTradeLog(maxEntries: number) {
const entries: TradeLogEntry[] = [];
function push(type: string, detail: string) {
entries.push({ time: new Date().toLocaleString(), type, detail });
if (entries.length > maxEntries) {
entries.shift();
}
}
function all() {
return entries;
}
return { push, all };
}