@strkfarm/sdk 1.0.26 → 1.0.28

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.
@@ -3682,10 +3682,15 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
3682
3682
  logger.verbose(`pool: ${JSON.stringify(_pool)}`);
3683
3683
  logger.verbose(typeof _pool);
3684
3684
  logger.verbose(`name: ${_pool?.name}`);
3685
- if (!_pool) {
3686
- throw new Error(`Pool ${p.pool_id.address.toString()} not found`);
3687
- }
3685
+ const name = _pool?.name;
3686
+ logger.verbose(`name2: ${name}`);
3688
3687
  const assetInfo = _pool?.assets.find((d) => this.asset().address.eqString(d.address));
3688
+ if (!name) {
3689
+ throw new Error(`Pool name ${p.pool_id.address.toString()} not found`);
3690
+ }
3691
+ if (!assetInfo) {
3692
+ throw new Error(`Asset ${this.asset().address.toString()} not found in pool ${p.pool_id.address.toString()}`);
3693
+ }
3689
3694
  let vTokenContract = new Contract4(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
3690
3695
  const bal = await vTokenContract.balanceOf(this.address.address);
3691
3696
  const assets = await vTokenContract.convert_to_assets(uint2563.bnToUint256(bal.toString()));
@@ -3889,7 +3894,7 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
3889
3894
  const netYield = await this.netAPYGivenPools(pools);
3890
3895
  const baseFlow = {
3891
3896
  title: "Your Deposit",
3892
- subItems: [{ key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%` }],
3897
+ subItems: [{ key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%` }, { key: `Performance Fee`, value: `${(this.metadata.additionalInfo.feeBps / 100).toFixed(2)}%` }],
3893
3898
  linkedFlows: [],
3894
3899
  style: { backgroundColor: "#6e53dc" /* Purple */.valueOf() }
3895
3900
  };
@@ -3975,6 +3980,7 @@ var VesuRebalanceStrategies = [{
3975
3980
  address: ContractAddr.from("0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"),
3976
3981
  type: "ERC4626",
3977
3982
  depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDT")],
3983
+ auditUrl: AUDIT_URL,
3978
3984
  protocols: [_protocol],
3979
3985
  maxTVL: Web3Number.fromWei("0", 6),
3980
3986
  risk: {
@@ -3991,6 +3997,7 @@ var VesuRebalanceStrategies = [{
3991
3997
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
3992
3998
  // type: 'ERC4626',
3993
3999
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
4000
+ // auditUrl: AUDIT_URL,
3994
4001
  // protocols: [_protocol],
3995
4002
  // maxTVL: Web3Number.fromWei('0', 8),
3996
4003
  // risk: {
package/dist/index.js CHANGED
@@ -3770,10 +3770,15 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
3770
3770
  logger.verbose(`pool: ${JSON.stringify(_pool)}`);
3771
3771
  logger.verbose(typeof _pool);
3772
3772
  logger.verbose(`name: ${_pool?.name}`);
3773
- if (!_pool) {
3774
- throw new Error(`Pool ${p.pool_id.address.toString()} not found`);
3775
- }
3773
+ const name = _pool?.name;
3774
+ logger.verbose(`name2: ${name}`);
3776
3775
  const assetInfo = _pool?.assets.find((d) => this.asset().address.eqString(d.address));
3776
+ if (!name) {
3777
+ throw new Error(`Pool name ${p.pool_id.address.toString()} not found`);
3778
+ }
3779
+ if (!assetInfo) {
3780
+ throw new Error(`Asset ${this.asset().address.toString()} not found in pool ${p.pool_id.address.toString()}`);
3781
+ }
3777
3782
  let vTokenContract = new import_starknet7.Contract(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
3778
3783
  const bal = await vTokenContract.balanceOf(this.address.address);
3779
3784
  const assets = await vTokenContract.convert_to_assets(import_starknet7.uint256.bnToUint256(bal.toString()));
@@ -3977,7 +3982,7 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
3977
3982
  const netYield = await this.netAPYGivenPools(pools);
3978
3983
  const baseFlow = {
3979
3984
  title: "Your Deposit",
3980
- subItems: [{ key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%` }],
3985
+ subItems: [{ key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%` }, { key: `Performance Fee`, value: `${(this.metadata.additionalInfo.feeBps / 100).toFixed(2)}%` }],
3981
3986
  linkedFlows: [],
3982
3987
  style: { backgroundColor: "#6e53dc" /* Purple */.valueOf() }
3983
3988
  };
@@ -4063,6 +4068,7 @@ var VesuRebalanceStrategies = [{
4063
4068
  address: ContractAddr.from("0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"),
4064
4069
  type: "ERC4626",
4065
4070
  depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDT")],
4071
+ auditUrl: AUDIT_URL,
4066
4072
  protocols: [_protocol],
4067
4073
  maxTVL: Web3Number.fromWei("0", 6),
4068
4074
  risk: {
@@ -4079,6 +4085,7 @@ var VesuRebalanceStrategies = [{
4079
4085
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
4080
4086
  // type: 'ERC4626',
4081
4087
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
4088
+ // auditUrl: AUDIT_URL,
4082
4089
  // protocols: [_protocol],
4083
4090
  // maxTVL: Web3Number.fromWei('0', 8),
4084
4091
  // risk: {
package/dist/index.mjs CHANGED
@@ -3702,10 +3702,15 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
3702
3702
  logger.verbose(`pool: ${JSON.stringify(_pool)}`);
3703
3703
  logger.verbose(typeof _pool);
3704
3704
  logger.verbose(`name: ${_pool?.name}`);
3705
- if (!_pool) {
3706
- throw new Error(`Pool ${p.pool_id.address.toString()} not found`);
3707
- }
3705
+ const name = _pool?.name;
3706
+ logger.verbose(`name2: ${name}`);
3708
3707
  const assetInfo = _pool?.assets.find((d) => this.asset().address.eqString(d.address));
3708
+ if (!name) {
3709
+ throw new Error(`Pool name ${p.pool_id.address.toString()} not found`);
3710
+ }
3711
+ if (!assetInfo) {
3712
+ throw new Error(`Asset ${this.asset().address.toString()} not found in pool ${p.pool_id.address.toString()}`);
3713
+ }
3709
3714
  let vTokenContract = new Contract4(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
3710
3715
  const bal = await vTokenContract.balanceOf(this.address.address);
3711
3716
  const assets = await vTokenContract.convert_to_assets(uint2563.bnToUint256(bal.toString()));
@@ -3909,7 +3914,7 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
3909
3914
  const netYield = await this.netAPYGivenPools(pools);
3910
3915
  const baseFlow = {
3911
3916
  title: "Your Deposit",
3912
- subItems: [{ key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%` }],
3917
+ subItems: [{ key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%` }, { key: `Performance Fee`, value: `${(this.metadata.additionalInfo.feeBps / 100).toFixed(2)}%` }],
3913
3918
  linkedFlows: [],
3914
3919
  style: { backgroundColor: "#6e53dc" /* Purple */.valueOf() }
3915
3920
  };
@@ -3995,6 +4000,7 @@ var VesuRebalanceStrategies = [{
3995
4000
  address: ContractAddr.from("0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"),
3996
4001
  type: "ERC4626",
3997
4002
  depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDT")],
4003
+ auditUrl: AUDIT_URL,
3998
4004
  protocols: [_protocol],
3999
4005
  maxTVL: Web3Number.fromWei("0", 6),
4000
4006
  risk: {
@@ -4011,6 +4017,7 @@ var VesuRebalanceStrategies = [{
4011
4017
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
4012
4018
  // type: 'ERC4626',
4013
4019
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
4020
+ // auditUrl: AUDIT_URL,
4014
4021
  // protocols: [_protocol],
4015
4022
  // maxTVL: Web3Number.fromWei('0', 8),
4016
4023
  // risk: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strkfarm/sdk",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
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",
@@ -188,10 +188,15 @@ export class VesuRebalance extends BaseStrategy<SingleTokenInfo, SingleActionAmo
188
188
  logger.verbose(`pool: ${JSON.stringify(_pool)}`);
189
189
  logger.verbose(typeof _pool);
190
190
  logger.verbose(`name: ${_pool?.name}`);
191
- if (!_pool) {
192
- throw new Error(`Pool ${p.pool_id.address.toString()} not found`);
193
- }
191
+ const name = _pool?.name;
192
+ logger.verbose(`name2: ${name}`);
194
193
  const assetInfo = _pool?.assets.find((d: any) => this.asset().address.eqString(d.address));
194
+ if (!name) {
195
+ throw new Error(`Pool name ${p.pool_id.address.toString()} not found`);
196
+ }
197
+ if (!assetInfo) {
198
+ throw new Error(`Asset ${this.asset().address.toString()} not found in pool ${p.pool_id.address.toString()}`);
199
+ }
195
200
  let vTokenContract = new Contract(VesuRebalanceAbi, p.v_token.address, this.config.provider);
196
201
  const bal = await vTokenContract.balanceOf(this.address.address);
197
202
  const assets = await vTokenContract.convert_to_assets(uint256.bnToUint256(bal.toString()));
@@ -471,7 +476,7 @@ export class VesuRebalance extends BaseStrategy<SingleTokenInfo, SingleActionAmo
471
476
 
472
477
  const baseFlow: IInvestmentFlow = {
473
478
  title: "Your Deposit",
474
- subItems: [{key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%`}],
479
+ subItems: [{key: `Net yield`, value: `${(netYield * 100).toFixed(2)}%`}, {key: `Performance Fee`, value: `${(this.metadata.additionalInfo.feeBps / 100).toFixed(2)}%`}],
475
480
  linkedFlows: [],
476
481
  style: {backgroundColor: FlowChartColors.Purple.valueOf()},
477
482
  };
@@ -563,6 +568,7 @@ export const VesuRebalanceStrategies: IStrategyMetadata<VesuRebalanceSettings>[]
563
568
  address: ContractAddr.from('0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c'),
564
569
  type: 'ERC4626',
565
570
  depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'USDT')!],
571
+ auditUrl: AUDIT_URL,
566
572
  protocols: [_protocol],
567
573
  maxTVL: Web3Number.fromWei('0', 6),
568
574
  risk: {
@@ -579,6 +585,7 @@ export const VesuRebalanceStrategies: IStrategyMetadata<VesuRebalanceSettings>[]
579
585
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
580
586
  // type: 'ERC4626',
581
587
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
588
+ // auditUrl: AUDIT_URL,
582
589
  // protocols: [_protocol],
583
590
  // maxTVL: Web3Number.fromWei('0', 8),
584
591
  // risk: {