@strkfarm/sdk 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +38 -588
- package/dist/cli.mjs +37 -587
- package/dist/index.browser.global.js +962 -329
- package/dist/index.browser.mjs +962 -325
- package/dist/index.d.ts +28 -54
- package/dist/index.js +985 -322
- package/dist/index.mjs +990 -323
- package/package.json +3 -3
- package/src/dataTypes/_bignumber.ts +49 -47
- package/src/global.ts +1 -33
- package/src/interfaces/common.ts +112 -98
- package/src/interfaces/lending.ts +1 -2
- package/src/modules/avnu.ts +1 -1
- package/src/modules/erc20.ts +6 -0
- package/src/modules/harvests.ts +1 -1
- package/src/modules/pragma.ts +1 -1
- package/src/modules/pricer-from-api.ts +3 -3
- package/src/modules/pricer.ts +2 -1
- package/src/modules/zkLend.ts +2 -1
- package/src/node/pricer-redis.ts +2 -1
- package/src/notifs/telegram.ts +1 -1
- package/src/strategies/ekubo-cl-vault.tsx +1503 -920
- package/src/strategies/vesu-rebalance.tsx +943 -611
- package/src/utils/index.ts +2 -0
- package/src/utils/logger.browser.ts +20 -0
- package/src/utils/logger.node.ts +35 -0
- package/src/utils/logger.ts +1 -0
- package/src/utils/store.ts +1 -1
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
interface LeveledLogMethod {
|
|
3
|
+
(message: string, ...meta: any[]): void;
|
|
4
|
+
(message: any): void
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface MyLogger {
|
|
8
|
+
error: LeveledLogMethod;
|
|
9
|
+
warn: LeveledLogMethod;
|
|
10
|
+
info: LeveledLogMethod;
|
|
11
|
+
verbose: LeveledLogMethod;
|
|
12
|
+
debug: LeveledLogMethod;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const logger: MyLogger = {
|
|
16
|
+
...console,
|
|
17
|
+
verbose(message: string) {
|
|
18
|
+
console.log(`[VERBOSE] ${message}`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import winston, { format } from "winston";
|
|
2
|
+
|
|
3
|
+
const colors = {
|
|
4
|
+
error: "red",
|
|
5
|
+
warn: "yellow",
|
|
6
|
+
info: "blue",
|
|
7
|
+
verbose: "white",
|
|
8
|
+
debug: "white",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Add custom colors to Winston
|
|
12
|
+
winston.addColors(colors);
|
|
13
|
+
|
|
14
|
+
export const logger = winston.createLogger({
|
|
15
|
+
level: "verbose", // Set the minimum logging level
|
|
16
|
+
format: format.combine(
|
|
17
|
+
format.colorize({ all: true }), // Apply custom colors
|
|
18
|
+
format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), // Add timestamp to log messages
|
|
19
|
+
format.printf(({ timestamp, level, message, ...meta }) => {
|
|
20
|
+
let msg = `${timestamp} ${level}: ${message}`;
|
|
21
|
+
// Print stack trace if error is passed
|
|
22
|
+
if (meta && meta[Symbol.for("splat")]) {
|
|
23
|
+
for (const arg of meta[Symbol.for("splat")]) {
|
|
24
|
+
if (arg instanceof Error) {
|
|
25
|
+
msg += `\n${arg.stack}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return msg;
|
|
30
|
+
})
|
|
31
|
+
),
|
|
32
|
+
transports: [
|
|
33
|
+
new winston.transports.Console(), // Output logs to the console
|
|
34
|
+
],
|
|
35
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@/utils/logger.browser';
|
package/src/utils/store.ts
CHANGED
|
@@ -3,8 +3,8 @@ import fs, { readFileSync, writeFileSync } from 'fs';
|
|
|
3
3
|
import { Account, constants } from 'starknet';
|
|
4
4
|
import * as crypto from 'crypto';
|
|
5
5
|
import { PasswordJsonCryptoUtil } from './encrypt';
|
|
6
|
-
import { logger } from '..';
|
|
7
6
|
import { log } from 'winston';
|
|
7
|
+
import { logger } from "@/utils/logger";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @description Config to manage storage of files on disk
|