@strkfarm/sdk 2.0.0-staging.4 → 2.0.0-staging.41
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 +10 -6
- package/dist/cli.mjs +10 -6
- package/dist/index.browser.global.js +29277 -26655
- package/dist/index.browser.mjs +4037 -1224
- package/dist/index.d.ts +287 -45
- package/dist/index.js +4316 -1489
- package/dist/index.mjs +4256 -1437
- package/package.json +4 -4
- package/src/data/yoloVault.abi.json +1109 -0
- package/src/dataTypes/_bignumber.ts +5 -0
- package/src/dataTypes/bignumber.browser.ts +5 -0
- package/src/dataTypes/bignumber.node.ts +5 -0
- package/src/global.ts +27 -0
- package/src/interfaces/common.tsx +68 -25
- package/src/modules/avnu.ts +1 -1
- package/src/modules/erc20.ts +18 -2
- package/src/strategies/base-strategy.ts +216 -6
- package/src/strategies/constants.ts +2 -2
- package/src/strategies/ekubo-cl-vault.tsx +210 -105
- package/src/strategies/factory.ts +21 -1
- package/src/strategies/index.ts +2 -0
- package/src/strategies/registry.ts +15 -30
- package/src/strategies/sensei.ts +156 -11
- package/src/strategies/types.ts +4 -0
- package/src/strategies/universal-adapters/vesu-adapter.ts +48 -27
- package/src/strategies/universal-lst-muliplier-strategy.tsx +1473 -574
- package/src/strategies/universal-strategy.tsx +141 -69
- package/src/strategies/vesu-rebalance.tsx +27 -11
- package/src/strategies/yoloVault.ts +747 -0
- package/src/utils/logger.node.ts +11 -4
- package/src/utils/strategy-utils.ts +6 -2
package/src/utils/logger.node.ts
CHANGED
|
@@ -11,8 +11,12 @@ const colors = {
|
|
|
11
11
|
// Add custom colors to Winston
|
|
12
12
|
winston.addColors(colors);
|
|
13
13
|
|
|
14
|
+
// Get log level from environment variable, default to "warn" to only show warn and error
|
|
15
|
+
// Valid levels: error, warn, info, verbose, debug
|
|
16
|
+
const logLevel = (process.env.LOG_LEVEL || process.env.SDK_LOG_LEVEL || "debug").toLowerCase();
|
|
17
|
+
|
|
14
18
|
export const logger = winston.createLogger({
|
|
15
|
-
level:
|
|
19
|
+
level: logLevel, // Set the minimum logging level from environment variable
|
|
16
20
|
format: format.combine(
|
|
17
21
|
format.colorize({ all: true }), // Apply custom colors
|
|
18
22
|
format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), // Add timestamp to log messages
|
|
@@ -20,9 +24,12 @@ export const logger = winston.createLogger({
|
|
|
20
24
|
let msg = `${timestamp} ${level}: ${message}`;
|
|
21
25
|
// Print stack trace if error is passed
|
|
22
26
|
if (meta && meta[Symbol.for("splat")]) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
const splat = meta[Symbol.for("splat")] as unknown[];
|
|
28
|
+
if (Array.isArray(splat)) {
|
|
29
|
+
for (const arg of splat) {
|
|
30
|
+
if (arg instanceof Error) {
|
|
31
|
+
msg += `\n${arg.stack}`;
|
|
32
|
+
}
|
|
26
33
|
}
|
|
27
34
|
}
|
|
28
35
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { SingleTokenInfo, DualTokenInfo } from "../strategies/base-strategy";
|
|
2
2
|
import { BaseStrategy } from "../strategies/base-strategy";
|
|
3
3
|
import { AmountsInfo, StrategyCapabilities, TokenInfo } from "@/interfaces";
|
|
4
|
-
import { Web3Number } from "@/dataTypes";
|
|
4
|
+
import { ContractAddr, Web3Number } from "@/dataTypes";
|
|
5
|
+
import { gql } from "@apollo/client";
|
|
6
|
+
import apolloClient from "@/modules/apollo-client";
|
|
7
|
+
import { num } from "starknet";
|
|
8
|
+
import { logger } from "./logger";
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Convert SDK TVL info (SingleTokenInfo or DualTokenInfo) to client AmountsInfo format
|
|
@@ -54,4 +58,4 @@ export function detectCapabilities(
|
|
|
54
58
|
export function isDualTokenStrategy(strategy: BaseStrategy<any, any>): boolean {
|
|
55
59
|
// Check if strategy has matchInputAmounts (dual token strategies have this)
|
|
56
60
|
return typeof (strategy as any).matchInputAmounts === "function";
|
|
57
|
-
}
|
|
61
|
+
}
|