@strkfarm/sdk 1.0.26 → 1.0.27

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 CHANGED
@@ -574,6 +574,7 @@ var VesuRebalanceStrategies = [{
574
574
  address: ContractAddr.from("0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"),
575
575
  type: "ERC4626",
576
576
  depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDT")],
577
+ auditUrl: AUDIT_URL,
577
578
  protocols: [_protocol],
578
579
  maxTVL: Web3Number.fromWei("0", 6),
579
580
  risk: {
@@ -590,6 +591,7 @@ var VesuRebalanceStrategies = [{
590
591
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
591
592
  // type: 'ERC4626',
592
593
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
594
+ // auditUrl: AUDIT_URL,
593
595
  // protocols: [_protocol],
594
596
  // maxTVL: Web3Number.fromWei('0', 8),
595
597
  // risk: {
package/dist/cli.mjs CHANGED
@@ -551,6 +551,7 @@ var VesuRebalanceStrategies = [{
551
551
  address: ContractAddr.from("0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"),
552
552
  type: "ERC4626",
553
553
  depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDT")],
554
+ auditUrl: AUDIT_URL,
554
555
  protocols: [_protocol],
555
556
  maxTVL: Web3Number.fromWei("0", 6),
556
557
  risk: {
@@ -567,6 +568,7 @@ var VesuRebalanceStrategies = [{
567
568
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
568
569
  // type: 'ERC4626',
569
570
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
571
+ // auditUrl: AUDIT_URL,
570
572
  // protocols: [_protocol],
571
573
  // maxTVL: Web3Number.fromWei('0', 8),
572
574
  // risk: {
@@ -38670,10 +38670,15 @@ var strkfarm_risk_engine = (() => {
38670
38670
  logger.verbose(`pool: ${JSON.stringify(_pool)}`);
38671
38671
  logger.verbose(typeof _pool);
38672
38672
  logger.verbose(`name: ${_pool?.name}`);
38673
- if (!_pool) {
38674
- throw new Error(`Pool ${p.pool_id.address.toString()} not found`);
38675
- }
38673
+ const name = _pool?.name;
38674
+ logger.verbose(`name2: ${name}`);
38676
38675
  const assetInfo = _pool?.assets.find((d) => this.asset().address.eqString(d.address));
38676
+ if (!name) {
38677
+ throw new Error(`Pool name ${p.pool_id.address.toString()} not found`);
38678
+ }
38679
+ if (!assetInfo) {
38680
+ throw new Error(`Asset ${this.asset().address.toString()} not found in pool ${p.pool_id.address.toString()}`);
38681
+ }
38677
38682
  let vTokenContract = new Contract(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
38678
38683
  const bal = await vTokenContract.balanceOf(this.address.address);
38679
38684
  const assets = await vTokenContract.convert_to_assets(uint256_exports.bnToUint256(bal.toString()));
@@ -38963,6 +38968,7 @@ var strkfarm_risk_engine = (() => {
38963
38968
  address: ContractAddr.from("0x115e94e722cfc4c77a2f15c4aefb0928c1c0029e5a57570df24c650cb7cec2c"),
38964
38969
  type: "ERC4626",
38965
38970
  depositTokens: [Global.getDefaultTokens().find((t) => t.symbol === "USDT")],
38971
+ auditUrl: AUDIT_URL,
38966
38972
  protocols: [_protocol],
38967
38973
  maxTVL: Web3Number.fromWei("0", 6),
38968
38974
  risk: {
@@ -38979,6 +38985,7 @@ var strkfarm_risk_engine = (() => {
38979
38985
  // address: ContractAddr.from('0x778007f8136a5b827325d21613803e796bda4d676fbe1e34aeab0b2a2ec027f'),
38980
38986
  // type: 'ERC4626',
38981
38987
  // depositTokens: [Global.getDefaultTokens().find(t => t.symbol === 'WBTC')!],
38988
+ // auditUrl: AUDIT_URL,
38982
38989
  // protocols: [_protocol],
38983
38990
  // maxTVL: Web3Number.fromWei('0', 8),
38984
38991
  // risk: {
@@ -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()));
@@ -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()));
@@ -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()));
@@ -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.27",
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()));
@@ -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: {