@strkfarm/sdk 1.1.19 → 1.1.20

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.
@@ -28641,6 +28641,7 @@ ${r2}}` : "}", l2;
28641
28641
  var index_browser_exports = {};
28642
28642
  __export(index_browser_exports, {
28643
28643
  AUMTypes: () => AUMTypes,
28644
+ AVNU_MIDDLEWARE: () => AVNU_MIDDLEWARE,
28644
28645
  AutoCompounderSTRK: () => AutoCompounderSTRK,
28645
28646
  AvnuWrapper: () => AvnuWrapper,
28646
28647
  BaseAdapter: () => BaseAdapter,
@@ -28659,12 +28660,16 @@ ${r2}}` : "}", l2;
28659
28660
  Initializable: () => Initializable,
28660
28661
  MarginType: () => MarginType,
28661
28662
  Network: () => Network,
28663
+ PRICE_ROUTER: () => PRICE_ROUTER,
28662
28664
  Pragma: () => Pragma,
28663
28665
  Pricer: () => Pricer,
28664
28666
  PricerFromApi: () => PricerFromApi,
28665
28667
  PricerLST: () => PricerLST,
28666
28668
  Protocols: () => Protocols,
28667
28669
  RiskType: () => RiskType,
28670
+ SIMPLE_SANITIZER: () => SIMPLE_SANITIZER,
28671
+ SIMPLE_SANITIZER_V2: () => SIMPLE_SANITIZER_V2,
28672
+ SIMPLE_SANITIZER_VESU_V1_DELEGATIONS: () => SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
28668
28673
  SenseiStrategies: () => SenseiStrategies,
28669
28674
  SenseiVault: () => SenseiVault,
28670
28675
  UNIVERSAL_ADAPTERS: () => UNIVERSAL_ADAPTERS,
@@ -28672,6 +28677,7 @@ ${r2}}` : "}", l2;
28672
28677
  UniversalLstMultiplierStrategy: () => UniversalLstMultiplierStrategy,
28673
28678
  UniversalStrategies: () => UniversalStrategies,
28674
28679
  UniversalStrategy: () => UniversalStrategy,
28680
+ VESU_SINGLETON: () => VESU_SINGLETON,
28675
28681
  VesuAdapter: () => VesuAdapter,
28676
28682
  VesuAmountDenomination: () => VesuAmountDenomination,
28677
28683
  VesuAmountType: () => VesuAmountType,
@@ -28686,7 +28692,8 @@ ${r2}}` : "}", l2;
28686
28692
  getRiskColor: () => getRiskColor,
28687
28693
  getRiskExplaination: () => getRiskExplaination,
28688
28694
  getVesuSingletonAddress: () => getVesuSingletonAddress,
28689
- highlightTextWithLinks: () => highlightTextWithLinks
28695
+ highlightTextWithLinks: () => highlightTextWithLinks,
28696
+ toBigInt: () => toBigInt3
28690
28697
  });
28691
28698
 
28692
28699
  // node_modules/.pnpm/axios@1.11.0/node_modules/axios/lib/helpers/bind.js
@@ -70505,6 +70512,7 @@ ${JSON.stringify(data, null, 2)}`;
70505
70512
  // src/strategies/universal-adapters/adapter-utils.ts
70506
70513
  var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
70507
70514
  var SIMPLE_SANITIZER_V2 = ContractAddr.from("0x7b6f98311af8aa425278570e62abf523e6462eaa01a38c1feab9b2f416492e2");
70515
+ var SIMPLE_SANITIZER_VESU_V1_DELEGATIONS = ContractAddr.from("0x5643d54da70a471cd2b6fa37f52ea7a13cc3f3910689a839f8490a663d2208a");
70508
70516
  var PRICE_ROUTER = ContractAddr.from("0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837");
70509
70517
  var AVNU_MIDDLEWARE = ContractAddr.from("0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d");
70510
70518
  var VESU_SINGLETON = ContractAddr.from("0x000d8d6dfec4d33bfb6895de9f3852143a17c6f92fd2a21da3d6924d34870160");
@@ -75417,6 +75425,7 @@ ${JSON.stringify(data, null, 2)}`;
75417
75425
  var VesuAdapter = class _VesuAdapter extends BaseAdapter {
75418
75426
  constructor(config3) {
75419
75427
  super();
75428
+ this.VESU_MULTIPLY_V1 = ContractAddr.from("0x3630f1f8e5b8f5c4c4ae9b6620f8a570ae55cddebc0276c37550e7c118edf67");
75420
75429
  this.VESU_MULTIPLY = ContractAddr.from("0x027fef272d0a9a3844767c851a64b36fe4f0115141d81134baade95d2b27b781");
75421
75430
  this.getModifyPosition = () => {
75422
75431
  const positionData = [0n];
@@ -75499,9 +75508,10 @@ ${JSON.stringify(data, null, 2)}`;
75499
75508
  toBigInt3(this.config.vaultAllocator.toString())
75500
75509
  // vault allocator
75501
75510
  ];
75511
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
75502
75512
  const output = this.constructSimpleLeafData({
75503
75513
  id: this.config.id,
75504
- target: this.VESU_MULTIPLY,
75514
+ target: isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1,
75505
75515
  method: "modify_lever",
75506
75516
  packedArguments
75507
75517
  }, SIMPLE_SANITIZER_V2);
@@ -75513,7 +75523,9 @@ ${JSON.stringify(data, null, 2)}`;
75513
75523
  if (!multiplyParams) {
75514
75524
  throw new Error("Multiply params are not provided");
75515
75525
  }
75516
- const multiplyContract = new Contract({ abi: vesu_multiple_abi_default, address: this.VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider2({ nodeUrl: "" }) });
75526
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
75527
+ const VESU_MULTIPLY = isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1;
75528
+ const multiplyContract = new Contract({ abi: vesu_multiple_abi_default, address: VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider2({ nodeUrl: "" }) });
75517
75529
  const call = multiplyContract.populate("modify_lever", {
75518
75530
  modify_lever_params: getVesuMultiplyParams(isIncrease, {
75519
75531
  ...multiplyParams,
@@ -75527,7 +75539,7 @@ ${JSON.stringify(data, null, 2)}`;
75527
75539
  return {
75528
75540
  sanitizer: SIMPLE_SANITIZER_V2,
75529
75541
  call: {
75530
- contractAddress: this.VESU_MULTIPLY,
75542
+ contractAddress: VESU_MULTIPLY,
75531
75543
  selector: hash_exports.getSelectorFromName("modify_lever"),
75532
75544
  calldata: [
75533
75545
  ...call.calldata
@@ -75537,16 +75549,21 @@ ${JSON.stringify(data, null, 2)}`;
75537
75549
  };
75538
75550
  this.getVesuModifyDelegationAdapter = (id) => {
75539
75551
  return () => {
75540
- const packedArguments = [
75552
+ const { addr: VESU_SINGLETON2, isV2 } = getVesuSingletonAddress(this.config.poolId);
75553
+ const packedArguments = isV2 ? [
75541
75554
  toBigInt3(this.VESU_MULTIPLY.toString())
75542
- // vault allocator
75555
+ // v2
75556
+ ] : [
75557
+ this.config.poolId.toBigInt(),
75558
+ toBigInt3(this.VESU_MULTIPLY_V1.toString())
75559
+ // v1
75543
75560
  ];
75544
75561
  const output = this.constructSimpleLeafData({
75545
75562
  id,
75546
- target: getVesuSingletonAddress(this.config.poolId).addr,
75563
+ target: VESU_SINGLETON2,
75547
75564
  method: "modify_delegation",
75548
75565
  packedArguments
75549
- }, SIMPLE_SANITIZER_V2);
75566
+ }, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
75550
75567
  return { leaf: output, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
75551
75568
  };
75552
75569
  };
@@ -75558,11 +75575,11 @@ ${JSON.stringify(data, null, 2)}`;
75558
75575
  delegation: params.delegation
75559
75576
  } : {
75560
75577
  pool_id: this.config.poolId.toBigInt(),
75561
- delegatee: this.VESU_MULTIPLY.toBigInt(),
75578
+ delegatee: this.VESU_MULTIPLY_V1.toBigInt(),
75562
75579
  delegation: params.delegation
75563
75580
  });
75564
75581
  return {
75565
- sanitizer: SIMPLE_SANITIZER_V2,
75582
+ sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
75566
75583
  call: {
75567
75584
  contractAddress: VESU_SINGLETON2,
75568
75585
  selector: hash_exports.getSelectorFromName("modify_delegation"),
@@ -79229,7 +79246,9 @@ ${JSON.stringify(data, null, 2)}`;
79229
79246
  vaultAddress: vaultSettings.vaultAddress,
79230
79247
  vaultAllocator: vaultSettings.vaultAllocator
79231
79248
  });
79232
- vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vesuAdapterLST.VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
79249
+ const { isV2 } = getVesuSingletonAddress(pool1);
79250
+ const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
79251
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
79233
79252
  vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter.bind(vesuAdapterLST));
79234
79253
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_on" /* SWITCH_DELEGATION_ON */).bind(vesuAdapterLST));
79235
79254
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_off" /* SWITCH_DELEGATION_OFF */).bind(vesuAdapterLST));
@@ -18932,6 +18932,7 @@ import { hash, num as num6, shortString } from "starknet";
18932
18932
  // src/strategies/universal-adapters/adapter-utils.ts
18933
18933
  var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
18934
18934
  var SIMPLE_SANITIZER_V2 = ContractAddr.from("0x7b6f98311af8aa425278570e62abf523e6462eaa01a38c1feab9b2f416492e2");
18935
+ var SIMPLE_SANITIZER_VESU_V1_DELEGATIONS = ContractAddr.from("0x5643d54da70a471cd2b6fa37f52ea7a13cc3f3910689a839f8490a663d2208a");
18935
18936
  var PRICE_ROUTER = ContractAddr.from("0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837");
18936
18937
  var AVNU_MIDDLEWARE = ContractAddr.from("0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d");
18937
18938
  var VESU_SINGLETON = ContractAddr.from("0x000d8d6dfec4d33bfb6895de9f3852143a17c6f92fd2a21da3d6924d34870160");
@@ -23848,6 +23849,7 @@ function getVesuSingletonAddress(vesuPool) {
23848
23849
  var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23849
23850
  constructor(config) {
23850
23851
  super();
23852
+ this.VESU_MULTIPLY_V1 = ContractAddr.from("0x3630f1f8e5b8f5c4c4ae9b6620f8a570ae55cddebc0276c37550e7c118edf67");
23851
23853
  this.VESU_MULTIPLY = ContractAddr.from("0x027fef272d0a9a3844767c851a64b36fe4f0115141d81134baade95d2b27b781");
23852
23854
  this.getModifyPosition = () => {
23853
23855
  const positionData = [0n];
@@ -23930,9 +23932,10 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23930
23932
  toBigInt(this.config.vaultAllocator.toString())
23931
23933
  // vault allocator
23932
23934
  ];
23935
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
23933
23936
  const output = this.constructSimpleLeafData({
23934
23937
  id: this.config.id,
23935
- target: this.VESU_MULTIPLY,
23938
+ target: isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1,
23936
23939
  method: "modify_lever",
23937
23940
  packedArguments
23938
23941
  }, SIMPLE_SANITIZER_V2);
@@ -23944,7 +23947,9 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23944
23947
  if (!multiplyParams) {
23945
23948
  throw new Error("Multiply params are not provided");
23946
23949
  }
23947
- const multiplyContract = new Contract8({ abi: vesu_multiple_abi_default, address: this.VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider4({ nodeUrl: "" }) });
23950
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
23951
+ const VESU_MULTIPLY = isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1;
23952
+ const multiplyContract = new Contract8({ abi: vesu_multiple_abi_default, address: VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider4({ nodeUrl: "" }) });
23948
23953
  const call = multiplyContract.populate("modify_lever", {
23949
23954
  modify_lever_params: getVesuMultiplyParams(isIncrease, {
23950
23955
  ...multiplyParams,
@@ -23958,7 +23963,7 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23958
23963
  return {
23959
23964
  sanitizer: SIMPLE_SANITIZER_V2,
23960
23965
  call: {
23961
- contractAddress: this.VESU_MULTIPLY,
23966
+ contractAddress: VESU_MULTIPLY,
23962
23967
  selector: hash3.getSelectorFromName("modify_lever"),
23963
23968
  calldata: [
23964
23969
  ...call.calldata
@@ -23968,16 +23973,21 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23968
23973
  };
23969
23974
  this.getVesuModifyDelegationAdapter = (id) => {
23970
23975
  return () => {
23971
- const packedArguments = [
23976
+ const { addr: VESU_SINGLETON2, isV2 } = getVesuSingletonAddress(this.config.poolId);
23977
+ const packedArguments = isV2 ? [
23972
23978
  toBigInt(this.VESU_MULTIPLY.toString())
23973
- // vault allocator
23979
+ // v2
23980
+ ] : [
23981
+ this.config.poolId.toBigInt(),
23982
+ toBigInt(this.VESU_MULTIPLY_V1.toString())
23983
+ // v1
23974
23984
  ];
23975
23985
  const output = this.constructSimpleLeafData({
23976
23986
  id,
23977
- target: getVesuSingletonAddress(this.config.poolId).addr,
23987
+ target: VESU_SINGLETON2,
23978
23988
  method: "modify_delegation",
23979
23989
  packedArguments
23980
- }, SIMPLE_SANITIZER_V2);
23990
+ }, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
23981
23991
  return { leaf: output, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
23982
23992
  };
23983
23993
  };
@@ -23989,11 +23999,11 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23989
23999
  delegation: params.delegation
23990
24000
  } : {
23991
24001
  pool_id: this.config.poolId.toBigInt(),
23992
- delegatee: this.VESU_MULTIPLY.toBigInt(),
24002
+ delegatee: this.VESU_MULTIPLY_V1.toBigInt(),
23993
24003
  delegation: params.delegation
23994
24004
  });
23995
24005
  return {
23996
- sanitizer: SIMPLE_SANITIZER_V2,
24006
+ sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
23997
24007
  call: {
23998
24008
  contractAddress: VESU_SINGLETON2,
23999
24009
  selector: hash3.getSelectorFromName("modify_delegation"),
@@ -27664,7 +27674,9 @@ function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27664
27674
  vaultAddress: vaultSettings.vaultAddress,
27665
27675
  vaultAllocator: vaultSettings.vaultAllocator
27666
27676
  });
27667
- vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vesuAdapterLST.VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
27677
+ const { isV2 } = getVesuSingletonAddress(pool1);
27678
+ const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
27679
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
27668
27680
  vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter.bind(vesuAdapterLST));
27669
27681
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_on" /* SWITCH_DELEGATION_ON */).bind(vesuAdapterLST));
27670
27682
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_off" /* SWITCH_DELEGATION_OFF */).bind(vesuAdapterLST));
@@ -27830,6 +27842,7 @@ var HyperLSTStrategies = [
27830
27842
  ];
27831
27843
  export {
27832
27844
  AUMTypes,
27845
+ AVNU_MIDDLEWARE,
27833
27846
  AutoCompounderSTRK,
27834
27847
  AvnuWrapper,
27835
27848
  BaseAdapter,
@@ -27848,12 +27861,16 @@ export {
27848
27861
  Initializable,
27849
27862
  MarginType,
27850
27863
  Network,
27864
+ PRICE_ROUTER,
27851
27865
  Pragma,
27852
27866
  Pricer,
27853
27867
  PricerFromApi,
27854
27868
  PricerLST,
27855
27869
  Protocols,
27856
27870
  RiskType,
27871
+ SIMPLE_SANITIZER,
27872
+ SIMPLE_SANITIZER_V2,
27873
+ SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
27857
27874
  SenseiStrategies,
27858
27875
  SenseiVault,
27859
27876
  UNIVERSAL_ADAPTERS,
@@ -27861,6 +27878,7 @@ export {
27861
27878
  UniversalLstMultiplierStrategy,
27862
27879
  UniversalStrategies,
27863
27880
  UniversalStrategy,
27881
+ VESU_SINGLETON,
27864
27882
  VesuAdapter,
27865
27883
  VesuAmountDenomination,
27866
27884
  VesuAmountType,
@@ -27875,5 +27893,6 @@ export {
27875
27893
  getRiskColor,
27876
27894
  getRiskExplaination,
27877
27895
  getVesuSingletonAddress,
27878
- highlightTextWithLinks
27896
+ highlightTextWithLinks,
27897
+ toBigInt
27879
27898
  };
package/dist/index.d.ts CHANGED
@@ -1047,6 +1047,7 @@ declare function getVesuSingletonAddress(vesuPool: ContractAddr): {
1047
1047
  isV2: boolean;
1048
1048
  };
1049
1049
  declare class VesuAdapter extends BaseAdapter {
1050
+ VESU_MULTIPLY_V1: ContractAddr;
1050
1051
  VESU_MULTIPLY: ContractAddr;
1051
1052
  config: VesuAdapterConfig;
1052
1053
  networkConfig: IConfig | undefined;
@@ -1105,6 +1106,14 @@ declare class VesuAdapter extends BaseAdapter {
1105
1106
  static getVesuPools(retry?: number): Promise<VesuPoolsInfo>;
1106
1107
  }
1107
1108
 
1109
+ declare const SIMPLE_SANITIZER: ContractAddr;
1110
+ declare const SIMPLE_SANITIZER_V2: ContractAddr;
1111
+ declare const SIMPLE_SANITIZER_VESU_V1_DELEGATIONS: ContractAddr;
1112
+ declare const PRICE_ROUTER: ContractAddr;
1113
+ declare const AVNU_MIDDLEWARE: ContractAddr;
1114
+ declare const VESU_SINGLETON: ContractAddr;
1115
+ declare function toBigInt(value: string | number): bigint;
1116
+
1108
1117
  interface UniversalManageCall {
1109
1118
  proofs: string[];
1110
1119
  manageCall: ManageCall;
@@ -1497,4 +1506,4 @@ declare class PasswordJsonCryptoUtil {
1497
1506
  decrypt(encryptedData: string, password: string): any;
1498
1507
  }
1499
1508
 
1500
- export { AUMTypes, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type ApproveCallParams, AutoCompounderSTRK, type AvnuSwapCallParams, AvnuWrapper, BaseAdapter, BaseStrategy, type CLVaultStrategySettings, CommonAdapter, type CommonAdapterConfig, ContractAddr, type DecreaseLeverParams, Deployer, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type EkuboQuote, EkuboQuoter, type EkuboRouteNode, type EkuboSplit, type FAQ, FatalError, type FlashloanCallParams, FlowChartColors, type GenerateCallFn, Global, HyperLSTStrategies, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, type IncreaseLeverParams, Initializable, type LeafAdapterFn, type LeafData, type LendingToken, type ManageCall, MarginType, Network, PasswordJsonCryptoUtil, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerLST, PricerRedis, Protocols, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type RouteNode, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, StandardMerkleTree, type StandardMerkleTreeData, Store, type StoreConfig, type Swap, type SwapInfo, TelegramNotif, type TokenAmount, type TokenInfo, UNIVERSAL_ADAPTERS, UNIVERSAL_MANAGE_IDS, UniversalLstMultiplierStrategy, type UniversalManageCall, UniversalStrategies, UniversalStrategy, type UniversalStrategySettings, type VaultPosition, VesuAdapter, type VesuAdapterConfig, type VesuAmount, VesuAmountDenomination, VesuAmountType, type VesuDefiSpringRewardsCallParams, type VesuModifyDelegationCallParams, type VesuModifyPositionCallParams, type VesuMultiplyCallParams, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, getAPIUsingHeadlessBrowser, getContractDetails, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, logger };
1509
+ export { AUMTypes, AVNU_MIDDLEWARE, type AccountInfo, type AdapterLeafType, type AllAccountsStore, type ApproveCallParams, AutoCompounderSTRK, type AvnuSwapCallParams, AvnuWrapper, BaseAdapter, BaseStrategy, type CLVaultStrategySettings, CommonAdapter, type CommonAdapterConfig, ContractAddr, type DecreaseLeverParams, Deployer, type DualActionAmount, type DualTokenInfo, ERC20, type EkuboBounds, EkuboCLVault, EkuboCLVaultStrategies, type EkuboPoolKey, type EkuboQuote, EkuboQuoter, type EkuboRouteNode, type EkuboSplit, type FAQ, FatalError, type FlashloanCallParams, FlowChartColors, type GenerateCallFn, Global, HyperLSTStrategies, type IConfig, type IInvestmentFlow, ILending, type ILendingMetadata, type ILendingPosition, type IProtocol, type IStrategyMetadata, type IncreaseLeverParams, Initializable, type LeafAdapterFn, type LeafData, type LendingToken, type ManageCall, MarginType, Network, PRICE_ROUTER, PasswordJsonCryptoUtil, Pragma, type PriceInfo, Pricer, PricerFromApi, PricerLST, PricerRedis, Protocols, type RequiredFields, type RequiredKeys, type RequiredStoreConfig, type RiskFactor, RiskType, type Route, type RouteNode, SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, SIMPLE_SANITIZER_VESU_V1_DELEGATIONS, SenseiStrategies, SenseiVault, type SenseiVaultSettings, type SingleActionAmount, type SingleTokenInfo, StandardMerkleTree, type StandardMerkleTreeData, Store, type StoreConfig, type Swap, type SwapInfo, TelegramNotif, type TokenAmount, type TokenInfo, UNIVERSAL_ADAPTERS, UNIVERSAL_MANAGE_IDS, UniversalLstMultiplierStrategy, type UniversalManageCall, UniversalStrategies, UniversalStrategy, type UniversalStrategySettings, VESU_SINGLETON, type VaultPosition, VesuAdapter, type VesuAdapterConfig, type VesuAmount, VesuAmountDenomination, VesuAmountType, type VesuDefiSpringRewardsCallParams, type VesuModifyDelegationCallParams, type VesuModifyPositionCallParams, type VesuMultiplyCallParams, VesuPools, VesuRebalance, type VesuRebalanceSettings, VesuRebalanceStrategies, Web3Number, ZkLend, assert, getAPIUsingHeadlessBrowser, getContractDetails, getDefaultStoreConfig, getMainnetConfig, getNoRiskTags, getRiskColor, getRiskExplaination, getTrovesEndpoint, getVesuSingletonAddress, highlightTextWithLinks, type i257, logger, toBigInt };
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  AUMTypes: () => AUMTypes,
34
+ AVNU_MIDDLEWARE: () => AVNU_MIDDLEWARE,
34
35
  AutoCompounderSTRK: () => AutoCompounderSTRK,
35
36
  AvnuWrapper: () => AvnuWrapper,
36
37
  BaseAdapter: () => BaseAdapter,
@@ -50,6 +51,7 @@ __export(index_exports, {
50
51
  Initializable: () => Initializable,
51
52
  MarginType: () => MarginType,
52
53
  Network: () => Network,
54
+ PRICE_ROUTER: () => PRICE_ROUTER,
53
55
  PasswordJsonCryptoUtil: () => PasswordJsonCryptoUtil,
54
56
  Pragma: () => Pragma,
55
57
  Pricer: () => Pricer,
@@ -58,6 +60,9 @@ __export(index_exports, {
58
60
  PricerRedis: () => PricerRedis,
59
61
  Protocols: () => Protocols,
60
62
  RiskType: () => RiskType,
63
+ SIMPLE_SANITIZER: () => SIMPLE_SANITIZER,
64
+ SIMPLE_SANITIZER_V2: () => SIMPLE_SANITIZER_V2,
65
+ SIMPLE_SANITIZER_VESU_V1_DELEGATIONS: () => SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
61
66
  SenseiStrategies: () => SenseiStrategies,
62
67
  SenseiVault: () => SenseiVault,
63
68
  StandardMerkleTree: () => StandardMerkleTree,
@@ -68,6 +73,7 @@ __export(index_exports, {
68
73
  UniversalLstMultiplierStrategy: () => UniversalLstMultiplierStrategy,
69
74
  UniversalStrategies: () => UniversalStrategies,
70
75
  UniversalStrategy: () => UniversalStrategy,
76
+ VESU_SINGLETON: () => VESU_SINGLETON,
71
77
  VesuAdapter: () => VesuAdapter,
72
78
  VesuAmountDenomination: () => VesuAmountDenomination,
73
79
  VesuAmountType: () => VesuAmountType,
@@ -87,7 +93,8 @@ __export(index_exports, {
87
93
  getTrovesEndpoint: () => getTrovesEndpoint,
88
94
  getVesuSingletonAddress: () => getVesuSingletonAddress,
89
95
  highlightTextWithLinks: () => highlightTextWithLinks,
90
- logger: () => logger
96
+ logger: () => logger,
97
+ toBigInt: () => toBigInt
91
98
  });
92
99
  module.exports = __toCommonJS(index_exports);
93
100
 
@@ -19020,6 +19027,7 @@ var import_starknet13 = require("starknet");
19020
19027
  // src/strategies/universal-adapters/adapter-utils.ts
19021
19028
  var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
19022
19029
  var SIMPLE_SANITIZER_V2 = ContractAddr.from("0x7b6f98311af8aa425278570e62abf523e6462eaa01a38c1feab9b2f416492e2");
19030
+ var SIMPLE_SANITIZER_VESU_V1_DELEGATIONS = ContractAddr.from("0x5643d54da70a471cd2b6fa37f52ea7a13cc3f3910689a839f8490a663d2208a");
19023
19031
  var PRICE_ROUTER = ContractAddr.from("0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837");
19024
19032
  var AVNU_MIDDLEWARE = ContractAddr.from("0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d");
19025
19033
  var VESU_SINGLETON = ContractAddr.from("0x000d8d6dfec4d33bfb6895de9f3852143a17c6f92fd2a21da3d6924d34870160");
@@ -23936,6 +23944,7 @@ function getVesuSingletonAddress(vesuPool) {
23936
23944
  var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23937
23945
  constructor(config) {
23938
23946
  super();
23947
+ this.VESU_MULTIPLY_V1 = ContractAddr.from("0x3630f1f8e5b8f5c4c4ae9b6620f8a570ae55cddebc0276c37550e7c118edf67");
23939
23948
  this.VESU_MULTIPLY = ContractAddr.from("0x027fef272d0a9a3844767c851a64b36fe4f0115141d81134baade95d2b27b781");
23940
23949
  this.getModifyPosition = () => {
23941
23950
  const positionData = [0n];
@@ -24018,9 +24027,10 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24018
24027
  toBigInt(this.config.vaultAllocator.toString())
24019
24028
  // vault allocator
24020
24029
  ];
24030
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
24021
24031
  const output = this.constructSimpleLeafData({
24022
24032
  id: this.config.id,
24023
- target: this.VESU_MULTIPLY,
24033
+ target: isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1,
24024
24034
  method: "modify_lever",
24025
24035
  packedArguments
24026
24036
  }, SIMPLE_SANITIZER_V2);
@@ -24032,7 +24042,9 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24032
24042
  if (!multiplyParams) {
24033
24043
  throw new Error("Multiply params are not provided");
24034
24044
  }
24035
- const multiplyContract = new import_starknet15.Contract({ abi: vesu_multiple_abi_default, address: this.VESU_MULTIPLY.toString(), providerOrAccount: new import_starknet15.RpcProvider({ nodeUrl: "" }) });
24045
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
24046
+ const VESU_MULTIPLY = isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1;
24047
+ const multiplyContract = new import_starknet15.Contract({ abi: vesu_multiple_abi_default, address: VESU_MULTIPLY.toString(), providerOrAccount: new import_starknet15.RpcProvider({ nodeUrl: "" }) });
24036
24048
  const call = multiplyContract.populate("modify_lever", {
24037
24049
  modify_lever_params: getVesuMultiplyParams(isIncrease, {
24038
24050
  ...multiplyParams,
@@ -24046,7 +24058,7 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24046
24058
  return {
24047
24059
  sanitizer: SIMPLE_SANITIZER_V2,
24048
24060
  call: {
24049
- contractAddress: this.VESU_MULTIPLY,
24061
+ contractAddress: VESU_MULTIPLY,
24050
24062
  selector: import_starknet15.hash.getSelectorFromName("modify_lever"),
24051
24063
  calldata: [
24052
24064
  ...call.calldata
@@ -24056,16 +24068,21 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24056
24068
  };
24057
24069
  this.getVesuModifyDelegationAdapter = (id) => {
24058
24070
  return () => {
24059
- const packedArguments = [
24071
+ const { addr: VESU_SINGLETON2, isV2 } = getVesuSingletonAddress(this.config.poolId);
24072
+ const packedArguments = isV2 ? [
24060
24073
  toBigInt(this.VESU_MULTIPLY.toString())
24061
- // vault allocator
24074
+ // v2
24075
+ ] : [
24076
+ this.config.poolId.toBigInt(),
24077
+ toBigInt(this.VESU_MULTIPLY_V1.toString())
24078
+ // v1
24062
24079
  ];
24063
24080
  const output = this.constructSimpleLeafData({
24064
24081
  id,
24065
- target: getVesuSingletonAddress(this.config.poolId).addr,
24082
+ target: VESU_SINGLETON2,
24066
24083
  method: "modify_delegation",
24067
24084
  packedArguments
24068
- }, SIMPLE_SANITIZER_V2);
24085
+ }, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
24069
24086
  return { leaf: output, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
24070
24087
  };
24071
24088
  };
@@ -24077,11 +24094,11 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
24077
24094
  delegation: params.delegation
24078
24095
  } : {
24079
24096
  pool_id: this.config.poolId.toBigInt(),
24080
- delegatee: this.VESU_MULTIPLY.toBigInt(),
24097
+ delegatee: this.VESU_MULTIPLY_V1.toBigInt(),
24081
24098
  delegation: params.delegation
24082
24099
  });
24083
24100
  return {
24084
- sanitizer: SIMPLE_SANITIZER_V2,
24101
+ sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
24085
24102
  call: {
24086
24103
  contractAddress: VESU_SINGLETON2,
24087
24104
  selector: import_starknet15.hash.getSelectorFromName("modify_delegation"),
@@ -27752,7 +27769,9 @@ function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27752
27769
  vaultAddress: vaultSettings.vaultAddress,
27753
27770
  vaultAllocator: vaultSettings.vaultAllocator
27754
27771
  });
27755
- vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vesuAdapterLST.VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
27772
+ const { isV2 } = getVesuSingletonAddress(pool1);
27773
+ const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
27774
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
27756
27775
  vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter.bind(vesuAdapterLST));
27757
27776
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_on" /* SWITCH_DELEGATION_ON */).bind(vesuAdapterLST));
27758
27777
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_off" /* SWITCH_DELEGATION_OFF */).bind(vesuAdapterLST));
@@ -28391,6 +28410,7 @@ var deployer_default = Deployer;
28391
28410
  // Annotate the CommonJS export names for ESM import in node:
28392
28411
  0 && (module.exports = {
28393
28412
  AUMTypes,
28413
+ AVNU_MIDDLEWARE,
28394
28414
  AutoCompounderSTRK,
28395
28415
  AvnuWrapper,
28396
28416
  BaseAdapter,
@@ -28410,6 +28430,7 @@ var deployer_default = Deployer;
28410
28430
  Initializable,
28411
28431
  MarginType,
28412
28432
  Network,
28433
+ PRICE_ROUTER,
28413
28434
  PasswordJsonCryptoUtil,
28414
28435
  Pragma,
28415
28436
  Pricer,
@@ -28418,6 +28439,9 @@ var deployer_default = Deployer;
28418
28439
  PricerRedis,
28419
28440
  Protocols,
28420
28441
  RiskType,
28442
+ SIMPLE_SANITIZER,
28443
+ SIMPLE_SANITIZER_V2,
28444
+ SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
28421
28445
  SenseiStrategies,
28422
28446
  SenseiVault,
28423
28447
  StandardMerkleTree,
@@ -28428,6 +28452,7 @@ var deployer_default = Deployer;
28428
28452
  UniversalLstMultiplierStrategy,
28429
28453
  UniversalStrategies,
28430
28454
  UniversalStrategy,
28455
+ VESU_SINGLETON,
28431
28456
  VesuAdapter,
28432
28457
  VesuAmountDenomination,
28433
28458
  VesuAmountType,
@@ -28447,5 +28472,6 @@ var deployer_default = Deployer;
28447
28472
  getTrovesEndpoint,
28448
28473
  getVesuSingletonAddress,
28449
28474
  highlightTextWithLinks,
28450
- logger
28475
+ logger,
28476
+ toBigInt
28451
28477
  });
package/dist/index.mjs CHANGED
@@ -18931,6 +18931,7 @@ import { hash, num as num6, shortString } from "starknet";
18931
18931
  // src/strategies/universal-adapters/adapter-utils.ts
18932
18932
  var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
18933
18933
  var SIMPLE_SANITIZER_V2 = ContractAddr.from("0x7b6f98311af8aa425278570e62abf523e6462eaa01a38c1feab9b2f416492e2");
18934
+ var SIMPLE_SANITIZER_VESU_V1_DELEGATIONS = ContractAddr.from("0x5643d54da70a471cd2b6fa37f52ea7a13cc3f3910689a839f8490a663d2208a");
18934
18935
  var PRICE_ROUTER = ContractAddr.from("0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837");
18935
18936
  var AVNU_MIDDLEWARE = ContractAddr.from("0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d");
18936
18937
  var VESU_SINGLETON = ContractAddr.from("0x000d8d6dfec4d33bfb6895de9f3852143a17c6f92fd2a21da3d6924d34870160");
@@ -23847,6 +23848,7 @@ function getVesuSingletonAddress(vesuPool) {
23847
23848
  var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23848
23849
  constructor(config) {
23849
23850
  super();
23851
+ this.VESU_MULTIPLY_V1 = ContractAddr.from("0x3630f1f8e5b8f5c4c4ae9b6620f8a570ae55cddebc0276c37550e7c118edf67");
23850
23852
  this.VESU_MULTIPLY = ContractAddr.from("0x027fef272d0a9a3844767c851a64b36fe4f0115141d81134baade95d2b27b781");
23851
23853
  this.getModifyPosition = () => {
23852
23854
  const positionData = [0n];
@@ -23929,9 +23931,10 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23929
23931
  toBigInt(this.config.vaultAllocator.toString())
23930
23932
  // vault allocator
23931
23933
  ];
23934
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
23932
23935
  const output = this.constructSimpleLeafData({
23933
23936
  id: this.config.id,
23934
- target: this.VESU_MULTIPLY,
23937
+ target: isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1,
23935
23938
  method: "modify_lever",
23936
23939
  packedArguments
23937
23940
  }, SIMPLE_SANITIZER_V2);
@@ -23943,7 +23946,9 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23943
23946
  if (!multiplyParams) {
23944
23947
  throw new Error("Multiply params are not provided");
23945
23948
  }
23946
- const multiplyContract = new Contract8({ abi: vesu_multiple_abi_default, address: this.VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider4({ nodeUrl: "" }) });
23949
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
23950
+ const VESU_MULTIPLY = isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1;
23951
+ const multiplyContract = new Contract8({ abi: vesu_multiple_abi_default, address: VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider4({ nodeUrl: "" }) });
23947
23952
  const call = multiplyContract.populate("modify_lever", {
23948
23953
  modify_lever_params: getVesuMultiplyParams(isIncrease, {
23949
23954
  ...multiplyParams,
@@ -23957,7 +23962,7 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23957
23962
  return {
23958
23963
  sanitizer: SIMPLE_SANITIZER_V2,
23959
23964
  call: {
23960
- contractAddress: this.VESU_MULTIPLY,
23965
+ contractAddress: VESU_MULTIPLY,
23961
23966
  selector: hash3.getSelectorFromName("modify_lever"),
23962
23967
  calldata: [
23963
23968
  ...call.calldata
@@ -23967,16 +23972,21 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23967
23972
  };
23968
23973
  this.getVesuModifyDelegationAdapter = (id) => {
23969
23974
  return () => {
23970
- const packedArguments = [
23975
+ const { addr: VESU_SINGLETON2, isV2 } = getVesuSingletonAddress(this.config.poolId);
23976
+ const packedArguments = isV2 ? [
23971
23977
  toBigInt(this.VESU_MULTIPLY.toString())
23972
- // vault allocator
23978
+ // v2
23979
+ ] : [
23980
+ this.config.poolId.toBigInt(),
23981
+ toBigInt(this.VESU_MULTIPLY_V1.toString())
23982
+ // v1
23973
23983
  ];
23974
23984
  const output = this.constructSimpleLeafData({
23975
23985
  id,
23976
- target: getVesuSingletonAddress(this.config.poolId).addr,
23986
+ target: VESU_SINGLETON2,
23977
23987
  method: "modify_delegation",
23978
23988
  packedArguments
23979
- }, SIMPLE_SANITIZER_V2);
23989
+ }, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
23980
23990
  return { leaf: output, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
23981
23991
  };
23982
23992
  };
@@ -23988,11 +23998,11 @@ var VesuAdapter = class _VesuAdapter extends BaseAdapter {
23988
23998
  delegation: params.delegation
23989
23999
  } : {
23990
24000
  pool_id: this.config.poolId.toBigInt(),
23991
- delegatee: this.VESU_MULTIPLY.toBigInt(),
24001
+ delegatee: this.VESU_MULTIPLY_V1.toBigInt(),
23992
24002
  delegation: params.delegation
23993
24003
  });
23994
24004
  return {
23995
- sanitizer: SIMPLE_SANITIZER_V2,
24005
+ sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
23996
24006
  call: {
23997
24007
  contractAddress: VESU_SINGLETON2,
23998
24008
  selector: hash3.getSelectorFromName("modify_delegation"),
@@ -27663,7 +27673,9 @@ function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, pool1) {
27663
27673
  vaultAddress: vaultSettings.vaultAddress,
27664
27674
  vaultAllocator: vaultSettings.vaultAllocator
27665
27675
  });
27666
- vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vesuAdapterLST.VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
27676
+ const { isV2 } = getVesuSingletonAddress(pool1);
27677
+ const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
27678
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
27667
27679
  vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter.bind(vesuAdapterLST));
27668
27680
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_on" /* SWITCH_DELEGATION_ON */).bind(vesuAdapterLST));
27669
27681
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter("switch_delegation_off" /* SWITCH_DELEGATION_OFF */).bind(vesuAdapterLST));
@@ -28301,6 +28313,7 @@ var Deployer = {
28301
28313
  var deployer_default = Deployer;
28302
28314
  export {
28303
28315
  AUMTypes,
28316
+ AVNU_MIDDLEWARE,
28304
28317
  AutoCompounderSTRK,
28305
28318
  AvnuWrapper,
28306
28319
  BaseAdapter,
@@ -28320,6 +28333,7 @@ export {
28320
28333
  Initializable,
28321
28334
  MarginType,
28322
28335
  Network,
28336
+ PRICE_ROUTER,
28323
28337
  PasswordJsonCryptoUtil,
28324
28338
  Pragma,
28325
28339
  Pricer,
@@ -28328,6 +28342,9 @@ export {
28328
28342
  PricerRedis,
28329
28343
  Protocols,
28330
28344
  RiskType,
28345
+ SIMPLE_SANITIZER,
28346
+ SIMPLE_SANITIZER_V2,
28347
+ SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
28331
28348
  SenseiStrategies,
28332
28349
  SenseiVault,
28333
28350
  StandardMerkleTree,
@@ -28338,6 +28355,7 @@ export {
28338
28355
  UniversalLstMultiplierStrategy,
28339
28356
  UniversalStrategies,
28340
28357
  UniversalStrategy,
28358
+ VESU_SINGLETON,
28341
28359
  VesuAdapter,
28342
28360
  VesuAmountDenomination,
28343
28361
  VesuAmountType,
@@ -28357,5 +28375,6 @@ export {
28357
28375
  getTrovesEndpoint,
28358
28376
  getVesuSingletonAddress,
28359
28377
  highlightTextWithLinks,
28360
- logger
28378
+ logger,
28379
+ toBigInt
28361
28380
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.1.19",
3
+ "version": "1.1.20",
4
4
  "description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
5
5
  "typings": "dist/index.d.ts",
6
6
  "types": "dist/index.d.ts",
@@ -4,6 +4,7 @@ import { ContractAddr } from "@/dataTypes";
4
4
  export const SIMPLE_SANITIZER = ContractAddr.from('0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4');
5
5
  // Without flashloan options
6
6
  export const SIMPLE_SANITIZER_V2 = ContractAddr.from('0x7b6f98311af8aa425278570e62abf523e6462eaa01a38c1feab9b2f416492e2');
7
+ export const SIMPLE_SANITIZER_VESU_V1_DELEGATIONS = ContractAddr.from('0x5643d54da70a471cd2b6fa37f52ea7a13cc3f3910689a839f8490a663d2208a');
7
8
  export const PRICE_ROUTER = ContractAddr.from('0x05e83Fa38D791d2dba8E6f487758A9687FfEe191A6Cf8a6c5761ab0a110DB837');
8
9
  export const AVNU_MIDDLEWARE = ContractAddr.from('0x4a7972ed3f5d1e74a6d6c4a8f467666953d081c8f2270390cc169d50d17cb0d');
9
10
 
@@ -1,3 +1,4 @@
1
1
  export * from "./baseAdapter";
2
2
  export * from "./common-adapter";
3
3
  export * from "./vesu-adapter";
4
+ export * from "./adapter-utils";
@@ -1,6 +1,6 @@
1
1
  import { LeafData, logger } from "@/utils"
2
2
  import { CairoCustomEnum, Contract, hash, num, RpcProvider, shortString, uint256, Uint256 } from "starknet";
3
- import { SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, toBigInt, VESU_SINGLETON } from "./adapter-utils";
3
+ import { SIMPLE_SANITIZER, SIMPLE_SANITIZER_V2, SIMPLE_SANITIZER_VESU_V1_DELEGATIONS, toBigInt, VESU_SINGLETON } from "./adapter-utils";
4
4
  import { ContractAddr, Web3Number } from "@/dataTypes";
5
5
  import { AdapterLeafType, BaseAdapter, GenerateCallFn, LeafAdapterFn, ManageCall } from "./baseAdapter";
6
6
  import VesuSingletonAbi from '../../data/vesu-singleton.abi.json';
@@ -226,6 +226,7 @@ export function getVesuSingletonAddress(vesuPool: ContractAddr) {
226
226
  }
227
227
 
228
228
  export class VesuAdapter extends BaseAdapter {
229
+ VESU_MULTIPLY_V1 = ContractAddr.from('0x3630f1f8e5b8f5c4c4ae9b6620f8a570ae55cddebc0276c37550e7c118edf67');
229
230
  VESU_MULTIPLY = ContractAddr.from('0x027fef272d0a9a3844767c851a64b36fe4f0115141d81134baade95d2b27b781');
230
231
  config: VesuAdapterConfig;
231
232
  networkConfig: IConfig | undefined;
@@ -345,9 +346,10 @@ export class VesuAdapter extends BaseAdapter {
345
346
  toBigInt(this.config.debt.address.toString()), // debt
346
347
  toBigInt(this.config.vaultAllocator.toString()), // vault allocator
347
348
  ];
349
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
348
350
  const output = this.constructSimpleLeafData({
349
351
  id: this.config.id,
350
- target: this.VESU_MULTIPLY,
352
+ target: isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1,
351
353
  method: 'modify_lever',
352
354
  packedArguments
353
355
  }, SIMPLE_SANITIZER_V2);
@@ -361,7 +363,9 @@ export class VesuAdapter extends BaseAdapter {
361
363
  if (!multiplyParams) {
362
364
  throw new Error('Multiply params are not provided');
363
365
  }
364
- const multiplyContract = new Contract({abi: VesuMultiplyAbi, address: this.VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider({nodeUrl: ''})});
366
+ const { isV2 } = getVesuSingletonAddress(this.config.poolId);
367
+ const VESU_MULTIPLY = isV2 ? this.VESU_MULTIPLY : this.VESU_MULTIPLY_V1;
368
+ const multiplyContract = new Contract({abi: VesuMultiplyAbi, address: VESU_MULTIPLY.toString(), providerOrAccount: new RpcProvider({nodeUrl: ''})});
365
369
  const call = multiplyContract.populate('modify_lever', {
366
370
  modify_lever_params: getVesuMultiplyParams(isIncrease, {
367
371
  ...multiplyParams,
@@ -375,7 +379,7 @@ export class VesuAdapter extends BaseAdapter {
375
379
  return {
376
380
  sanitizer: SIMPLE_SANITIZER_V2,
377
381
  call: {
378
- contractAddress: this.VESU_MULTIPLY,
382
+ contractAddress: VESU_MULTIPLY,
379
383
  selector: hash.getSelectorFromName('modify_lever'),
380
384
  calldata: [
381
385
  ...call.calldata as bigint[]
@@ -386,15 +390,19 @@ export class VesuAdapter extends BaseAdapter {
386
390
 
387
391
  getVesuModifyDelegationAdapter = (id: string): LeafAdapterFn<VesuModifyDelegationCallParams> => {
388
392
  return () => {
389
- const packedArguments: bigint[] = [
390
- toBigInt(this.VESU_MULTIPLY.toString()), // vault allocator
393
+ const { addr: VESU_SINGLETON, isV2 } = getVesuSingletonAddress(this.config.poolId);
394
+ const packedArguments: bigint[] = isV2 ? [
395
+ toBigInt(this.VESU_MULTIPLY.toString()), // v2
396
+ ] : [
397
+ this.config.poolId.toBigInt(),
398
+ toBigInt(this.VESU_MULTIPLY_V1.toString()), // v1
391
399
  ];
392
400
  const output = this.constructSimpleLeafData({
393
401
  id: id,
394
- target: getVesuSingletonAddress(this.config.poolId).addr,
402
+ target: VESU_SINGLETON,
395
403
  method: 'modify_delegation',
396
404
  packedArguments
397
- }, SIMPLE_SANITIZER_V2);
405
+ }, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
398
406
 
399
407
  return { leaf: output, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
400
408
  }
@@ -408,11 +416,11 @@ export class VesuAdapter extends BaseAdapter {
408
416
  delegation: params.delegation,
409
417
  } : {
410
418
  pool_id: this.config.poolId.toBigInt(),
411
- delegatee: this.VESU_MULTIPLY.toBigInt(),
419
+ delegatee: this.VESU_MULTIPLY_V1.toBigInt(),
412
420
  delegation: params.delegation,
413
421
  });
414
422
  return {
415
- sanitizer: SIMPLE_SANITIZER_V2,
423
+ sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
416
424
  call: {
417
425
  contractAddress: VESU_SINGLETON,
418
426
  selector: hash.getSelectorFromName('modify_delegation'),
@@ -3,7 +3,7 @@ import { AUMTypes, getContractDetails, UNIVERSAL_ADAPTERS, UNIVERSAL_MANAGE_IDS,
3
3
  import { PricerBase } from "@/modules/pricerBase";
4
4
  import { ContractAddr, Web3Number } from "@/dataTypes";
5
5
  import { Global } from "@/global";
6
- import { ApproveCallParams, CommonAdapter, ManageCall, Swap, VesuAdapter, VesuModifyDelegationCallParams, VesuMultiplyCallParams, VesuPools } from "./universal-adapters";
6
+ import { ApproveCallParams, CommonAdapter, getVesuSingletonAddress, ManageCall, Swap, VesuAdapter, VesuModifyDelegationCallParams, VesuMultiplyCallParams, VesuPools } from "./universal-adapters";
7
7
  import { AVNU_MIDDLEWARE } from "./universal-adapters/adapter-utils";
8
8
  import { LiquidationRiskLevel, SmartContractRiskLevel, TechnicalRiskLevel } from "@/interfaces/risks";
9
9
  import { EkuboQuoter, ERC20, PricerLST } from "@/modules";
@@ -362,7 +362,9 @@ function getLooperSettings(
362
362
  })
363
363
 
364
364
  // vesu looping
365
- vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vesuAdapterLST.VESU_MULTIPLY, UNIVERSAL_MANAGE_IDS.APPROVE_TOKEN1).bind(commonAdapter));
365
+ const { isV2 } = getVesuSingletonAddress(pool1);
366
+ const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
367
+ vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, UNIVERSAL_MANAGE_IDS.APPROVE_TOKEN1).bind(commonAdapter));
366
368
  vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter.bind(vesuAdapterLST));
367
369
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(LST_MULTIPLIER_MANAGE_IDS.SWITCH_DELEGATION_ON).bind(vesuAdapterLST));
368
370
  vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(LST_MULTIPLIER_MANAGE_IDS.SWITCH_DELEGATION_OFF).bind(vesuAdapterLST));