@strkfarm/sdk 1.0.53 → 1.0.55

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/index.d.ts CHANGED
@@ -19,6 +19,8 @@ declare class _Web3Number<T extends _Web3Number<T>> extends BigNumber {
19
19
  valueOf(): string;
20
20
  private maxToFixedDecimals;
21
21
  private getStandardString;
22
+ minimum(value: string | number | T): T;
23
+ maximum(value: string | number | T): T;
22
24
  }
23
25
 
24
26
  declare class Web3Number extends _Web3Number<Web3Number> {
@@ -48,7 +50,8 @@ declare enum RiskType {
48
50
  SMART_CONTRACT_RISK = "Smart Contract Risk",
49
51
  ORACLE_RISK = "Oracle Risk",
50
52
  TECHNICAL_RISK = "Technical Risk",
51
- COUNTERPARTY_RISK = "Counterparty Risk"
53
+ COUNTERPARTY_RISK = "Counterparty Risk",// e.g. bad debt
54
+ DEPEG_RISK = "Depeg Risk"
52
55
  }
53
56
  interface RiskFactor {
54
57
  type: RiskType;
@@ -134,8 +137,8 @@ interface IInvestmentFlow {
134
137
  linkedFlows: IInvestmentFlow[];
135
138
  style?: any;
136
139
  }
137
- declare function getMainnetConfig(rpcUrl?: string, blockIdentifier?: BlockIdentifier): IConfig;
138
- declare const getRiskExplaination: (riskType: RiskType) => "The risk of the market moving against the position." | "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them." | "The risk of losing funds due to the position being liquidated." | "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position." | "The risk of the oracle being manipulated or incorrect." | "The risk of the smart contract being vulnerable to attacks." | "The risk of technical issues e.g. backend failure." | "The risk of the counterparty defaulting e.g. bad debt on lending platforms.";
140
+ declare function getMainnetConfig(rpcUrl: string, blockIdentifier?: BlockIdentifier): IConfig;
141
+ declare const getRiskExplaination: (riskType: RiskType) => "The risk of the market moving against the position." | "The temporary loss of value experienced by liquidity providers in AMMs when asset prices diverge compared to simply holding them." | "The risk of losing funds due to the position being liquidated." | "The risk of low liquidity in the pool, which can lead to high slippages or reduced in-abilities to quickly exit the position." | "The risk of the oracle being manipulated or incorrect." | "The risk of the smart contract being vulnerable to attacks." | "The risk of technical issues e.g. backend failure." | "The risk of the counterparty defaulting e.g. bad debt on lending platforms." | "The risk of a token losing its peg to the underlying asset, leading to potential losses for holders.";
139
142
  declare const getRiskColor: (risk: RiskFactor) => "light_green_2" | "yellow" | "red";
140
143
  declare const getNoRiskTags: (risks: RiskFactor[]) => RiskType[];
141
144
  interface HighlightLink {
@@ -370,13 +373,22 @@ interface DualTokenInfo {
370
373
  token0: SingleTokenInfo;
371
374
  token1: SingleTokenInfo;
372
375
  }
376
+ interface CacheData {
377
+ timestamp: number;
378
+ ttl: number;
379
+ data: any;
380
+ }
373
381
  declare class BaseStrategy<TVLInfo, ActionInfo> {
374
382
  readonly config: IConfig;
383
+ readonly cache: Map<string, CacheData>;
375
384
  constructor(config: IConfig);
376
385
  getUserTVL(user: ContractAddr): Promise<TVLInfo>;
377
386
  getTVL(): Promise<TVLInfo>;
378
387
  depositCall(amountInfo: ActionInfo, receiver: ContractAddr): Promise<Call[]>;
379
388
  withdrawCall(amountInfo: ActionInfo, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
389
+ setCache(key: string, data: any, ttl?: number): void;
390
+ getCache(key: string): any | null;
391
+ isCacheValid(key: string): boolean;
380
392
  }
381
393
 
382
394
  interface PoolProps {
@@ -774,6 +786,35 @@ declare class EkuboCLVault extends BaseStrategy<DualTokenInfo, DualActionAmount>
774
786
  */
775
787
  declare const EkuboCLVaultStrategies: IStrategyMetadata<CLVaultStrategySettings>[];
776
788
 
789
+ interface SenseiVaultSettings {
790
+ mainToken: TokenInfo;
791
+ secondaryToken: TokenInfo;
792
+ targetHfBps: number;
793
+ feeBps: number;
794
+ }
795
+ declare class SenseiVault extends BaseStrategy<SingleTokenInfo, SingleActionAmount> {
796
+ readonly address: ContractAddr;
797
+ readonly metadata: IStrategyMetadata<SenseiVaultSettings>;
798
+ readonly pricer: PricerBase;
799
+ readonly contract: Contract;
800
+ constructor(config: IConfig, pricer: PricerBase, metadata: IStrategyMetadata<SenseiVaultSettings>);
801
+ getUserTVL(user: ContractAddr): Promise<SingleTokenInfo>;
802
+ getTVL(): Promise<SingleTokenInfo>;
803
+ depositCall(amountInfo: SingleActionAmount, receiver: ContractAddr): Promise<Call[]>;
804
+ withdrawCall(amountInfo: SingleActionAmount, receiver: ContractAddr, owner: ContractAddr): Promise<Call[]>;
805
+ getPositionInfo(): Promise<{
806
+ collateralXSTRK: Web3Number;
807
+ collateralUSDValue: Web3Number;
808
+ debtSTRK: Web3Number;
809
+ debtUSDValue: Web3Number;
810
+ xSTRKPrice: number;
811
+ collateralInSTRK: number;
812
+ }>;
813
+ getSecondaryTokenPriceRelativeToMain(retry?: number): Promise<number>;
814
+ getSettings: () => Promise<starknet.Result>;
815
+ }
816
+ declare const SenseiStrategies: IStrategyMetadata<SenseiVaultSettings>[];
817
+
777
818
  declare class TelegramNotif {
778
819
  private subscribers;
779
820
  readonly bot: TelegramBot;
@@ -802,6 +843,7 @@ type RequiredKeys<T> = {
802
843
  [K in keyof T]-?: {} extends Pick<T, K> ? never : K;
803
844
  }[keyof T];
804
845
  declare function assert(condition: boolean, message: string): void;
846
+ declare function getTrovesEndpoint(): string;
805
847
 
806
848
  declare class PricerRedis extends Pricer {
807
849
  private redisClient;
@@ -896,4 +938,4 @@ declare class PasswordJsonCryptoUtil {
896
938
  decrypt(encryptedData: string, password: string): any;
897
939
  }
898
940
 
899
- export { type AccountInfo, type AllAccountsStore, AutoCompounderSTRK, AvnuWrapper, BaseStrategy, type CLVaultStrategySettings, ContractAddr, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type FAQ, FatalError, FlowChartColors, Global, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, Initializable, type LendingToken, MarginType, Network, PasswordJsonCryptoUtil, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerRedis, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type SingleActionAmount, type SingleTokenInfo, Store, type StoreConfig, type SwapInfo, TelegramNotif, type TokenInfo, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, getAPIUsingHeadlessBrowser, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, highlightTextWithLinks, logger };
941
+ export { type AccountInfo, type AllAccountsStore, AutoCompounderSTRK, AvnuWrapper, BaseStrategy, type CLVaultStrategySettings, ContractAddr, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type FAQ, FatalError, FlowChartColors, Global, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, Initializable, type LendingToken, MarginType, Network, PasswordJsonCryptoUtil, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerRedis, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, Store, type StoreConfig, type SwapInfo, TelegramNotif, type TokenInfo, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, getAPIUsingHeadlessBrowser, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, highlightTextWithLinks, logger };