mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 01:08:07 +00:00
init
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
Reference in New Issue
Block a user