feat: 添加交易视图功能,集成 lightweight-charts 库,优化数据展示

This commit is contained in:
2025-12-18 02:48:34 +07:00
parent 8bf6c06889
commit 5cf5052a51
9 changed files with 212 additions and 33 deletions

View File

@@ -9,3 +9,8 @@ export function formatBalance(amount: MaybeRefOrGetter<number | string>, locale:
return value.toLocaleString(locale, { minimumFractionDigits: 0, maximumFractionDigits: 2 });
}
export function timeToLocal(originalTime: number) {
const d = new Date(originalTime * 1000);
return Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()) / 1000;
}

View File

@@ -1,2 +1,3 @@
export * from "./ionic-helper";
export * from "./is";
export * from "./pattern";

7
src/utils/is.ts Normal file
View File

@@ -0,0 +1,7 @@
export function isPromise<T = any>(val: unknown): val is Promise<T> {
return !!val && typeof (val as Promise<T>).then === "function";
}
export function isFunction<T = any>(val: unknown): val is (...args: any[]) => T {
return typeof val === "function";
}