File tree Expand file tree Collapse file tree 6 files changed +360
-361
lines changed
Expand file tree Collapse file tree 6 files changed +360
-361
lines changed Original file line number Diff line number Diff line change 11{
2- "$schema" : " https://biomejs.dev/schemas/2.3.11 /schema.json" ,
2+ "$schema" : " https://biomejs.dev/schemas/2.3.13 /schema.json" ,
33 "extends" : [" @gearbox-protocol/biome-config" ],
44 "vcs" : {
55 "enabled" : true ,
Original file line number Diff line number Diff line change 6363 "date-fns" : " ^4.1.0" ,
6464 "decimal.js-light" : " ^2.5.1" ,
6565 "viem" : " >=2.23.15 <3.0.0" ,
66- "zod" : " ^4.3.5 "
66+ "zod" : " ^4.3.6 "
6767 },
6868 "devDependencies" : {
69- "@biomejs/biome" : " ^2.3.11 " ,
70- "@commitlint/cli" : " ^20.3.0 " ,
71- "@commitlint/config-conventional" : " ^20.3.0 " ,
72- "@gearbox-protocol/biome-config" : " ^1.0.17 " ,
69+ "@biomejs/biome" : " ^2.3.13 " ,
70+ "@commitlint/cli" : " ^20.3.1 " ,
71+ "@commitlint/config-conventional" : " ^20.3.1 " ,
72+ "@gearbox-protocol/biome-config" : " ^1.0.19 " ,
7373 "@types/cross-spawn" : " ^6.0.6" ,
74- "axios" : " ^1.13.2 " ,
74+ "axios" : " ^1.13.3 " ,
7575 "cross-spawn" : " ^7.0.6" ,
7676 "husky" : " ^9.1.7" ,
7777 "lint-staged" : " ^16.2.7" ,
78- "pino" : " ^10.1 .0" ,
78+ "pino" : " ^10.3 .0" ,
7979 "pino-pretty" : " ^13.1.3" ,
8080 "tsup" : " ^8.5.1" ,
8181 "tsx" : " ^4.21.0" ,
8282 "typescript" : " ^5.9.3" ,
8383 "viem-deal" : " ^2.0.4" ,
84- "vitest" : " ^4.0.16 "
84+ "vitest" : " ^4.0.18 "
8585 },
8686 "peerDependencies" : {
8787 "axios" : " ^1.0.0" ,
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ import {
4343import { createRouter , type IRouterContract } from "./router/index.js" ;
4444import type { GearboxState , GearboxStateHuman } from "./types/index.js" ;
4545import type { PickSomeRequired } from "./utils/index.js" ;
46- import { TypedObjectUtils , toAddress } from "./utils/index.js" ;
46+ import { formatTimestamp , TypedObjectUtils , toAddress } from "./utils/index.js" ;
4747import { Hooks } from "./utils/internal/index.js" ;
4848import { getLogsSafe } from "./utils/viem/index.js" ;
4949
@@ -477,7 +477,7 @@ export class GearboxSDK<
477477 public stateHuman ( raw = true ) : GearboxStateHuman {
478478 return {
479479 block : Number ( this . currentBlock ) ,
480- timestamp : Number ( this . timestamp ) ,
480+ timestamp : formatTimestamp ( Number ( this . timestamp ) , raw ) ,
481481 core : {
482482 addressProviderV3 : this . addressProvider . stateHuman ( raw ) ,
483483 botList : this . botListContract ?. stateHuman ( raw ) ,
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ export interface MarketStateHuman {
240240
241241export interface GearboxStateHuman {
242242 block : number ;
243- timestamp : number ;
243+ timestamp : string ;
244244 core : CoreStateHuman ;
245245 markets : MarketStateHuman [ ] ;
246246 plugins : Record < string , unknown > ;
Original file line number Diff line number Diff line change @@ -127,9 +127,10 @@ export function formatNumberToString_(value: bigint | number): string {
127127 . replaceAll ( "," , "_" ) ;
128128}
129129
130- export function formatTimestamp ( timestamp : number ) {
131- return new Date ( timestamp * 1000 ) . toLocaleString ( "en-GB" , {
130+ export function formatTimestamp ( timestamp : number , raw = true ) : string {
131+ const result = new Date ( timestamp * 1000 ) . toLocaleString ( "en-GB" , {
132132 dateStyle : "short" ,
133133 timeStyle : "short" ,
134134 } ) ;
135+ return raw ? `${ result } [${ timestamp } ]` : result ;
135136}
You can’t perform that action at this time.
0 commit comments