@ichidao/ichi-vaults-sdk 0.1.36 → 0.1.37

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/README.md CHANGED
@@ -575,7 +575,7 @@ const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
575
575
  const dex = SupportedDex.UniswapV3
576
576
  const accountAddress = "0xaaaa...aaaaaa"
577
577
 
578
- const userBalancesInVaults: UserBalanceInVault[] = await getAllUserBalances(
578
+ const userBalancesInVaults: [UserBalanceInVault](#userbalanceinvault)[] = await getAllUserBalances(
579
579
  accountAddress,
580
580
  web3Provider,
581
581
  dex
@@ -583,7 +583,7 @@ const userBalancesInVaults: UserBalanceInVault[] = await getAllUserBalances(
583
583
 
584
584
  // - or -
585
585
 
586
- const userBalancesInVaultsBN: UserBalanceInVaultBN[] = await getAllUserBalances(
586
+ const userBalancesInVaultsBN: [UserBalanceInVaultBN](#userbalanceinvaultbn)[] = await getAllUserBalances(
587
587
  accountAddress,
588
588
  web3Provider,
589
589
  dex,
@@ -611,7 +611,7 @@ const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
611
611
  const dex = SupportedDex.UniswapV3
612
612
  const accountAddress = "0xaaaa...aaaaaa"
613
613
 
614
- const amounts: UserAmountsInVault[] = await getAllUserAmounts(
614
+ const amounts: [UserAmountsInVault](#useramountsinvault)[] = await getAllUserAmounts(
615
615
  accountAddress,
616
616
  web3Provider,
617
617
  dex,
@@ -619,7 +619,7 @@ const amounts: UserAmountsInVault[] = await getAllUserAmounts(
619
619
 
620
620
  // - or -
621
621
 
622
- const amountsBN: UserAmountsInVaultBN[] = await getAllUserAmounts(
622
+ const amountsBN: [UserAmountsInVaultBN](#useramountsinvaultbn)[] = await getAllUserAmounts(
623
623
  accountAddress,
624
624
  web3Provider,
625
625
  dex,
@@ -715,6 +715,9 @@ const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber}
715
715
  | days | number | undefined | false |
716
716
 
717
717
  <br/>
718
+
719
+ > **Note:** This function may take several seconds to execute as it processes historical data. It is best suited for report generation and batched backend processes rather than user-facing interfaces where immediate responses are expected. For real-time UI updates, consider using [`getFeeAprs()`](#20-getfeeaprs) instead.
720
+
718
721
  The getFeesCollected() function returns the number of fees collected for the specified number of days. If the 'days' parameter is not included, it returns the number of fees collected since the vault's inception.
719
722
 
720
723
  ```typescript
@@ -771,8 +774,11 @@ const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber}
771
774
  | forDays | number[] | undefined | false |
772
775
 
773
776
  <br/>
774
- The getFeesCollectedInfo() function returns an array of FeesInfo objects representing the number of fees collected for the periods of time specified by the 'forDays' parameter, along with the fee Annual Percentage Rate (APR) for those periods.
775
- If 'forDays' is not specified, it returns FeesInfo for time periods of 1, 7, and 30 days.
777
+
778
+ > **Note:** This function may take several seconds to execute as it processes historical data. It is best suited for report generation and batched backend processes rather than user-facing interfaces where immediate responses are expected. For real-time UI updates, consider using [`getFeeAprs()`](#20-getfeeaprs) instead.
779
+
780
+ The getFeesCollectedInfo() function returns an array of [FeesInfo](#feesinfo) objects representing the number of fees collected for the periods of time specified by the 'forDays' parameter, along with the fee Annual Percentage Rate (APR) for those periods.
781
+ If 'forDays' is not specified, it returns [FeesInfo](#feesinfo) for time periods of 1, 7, and 30 days.
776
782
  <br/>
777
783
 
778
784
  ```typescript
@@ -784,7 +790,7 @@ const vaultAddress = "0x3ac9...a5f132";
784
790
  const dex = SupportedDex.UniswapV3;
785
791
  const days = [2, 5, 14, 60];
786
792
 
787
- const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
793
+ const feesInfo: [FeesInfo](#feesinfo)[] = await getFeesCollectedInfo(
788
794
  vaultAddress,
789
795
  web3Provider,
790
796
  dex
@@ -792,7 +798,7 @@ const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
792
798
 
793
799
  // - or -
794
800
 
795
- const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
801
+ const feesInfo: [FeesInfo](#feesinfo)[] = await getFeesCollectedInfo(
796
802
  vaultAddress,
797
803
  web3Provider,
798
804
  dex,
@@ -809,7 +815,7 @@ const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
809
815
  | dex | SupportedDex | - | true
810
816
 
811
817
  <br/>
812
- The getFeeAprs() function calculates and returns fee Annual Percentage Rates (APRs) for the specified vault over different standard time periods. It returns an object of type FeeAprData containing APR values for 1 day, 3 days, 7 days, and 30 days.
818
+ The getFeeAprs() function calculates and returns fee Annual Percentage Rates (APRs) for the specified vault over different standard time periods. It returns an object of type [FeeAprData](#feeaprdata) containing APR values for 1 day, 3 days, 7 days, and 30 days.
813
819
 
814
820
  ```typescript
815
821
  import { Web3Provider } from '@ethersproject/providers';
@@ -833,8 +839,8 @@ console.log(`1-day Fee APR: ${feeAprs.feeApr_1d}%`);
833
839
  | timeIntervals | number[] | [1, 7, 30] | false |
834
840
 
835
841
  <br/>
836
- The getAverageDepositTokenRatios() function returns an array of DepositTokenRatio objects representing the average deposit token ratio for the periods of time specified by the 'timeIntervals' parameter.
837
- If 'timeIntervals' is not specified, it returns DepositTokenRatio objects for time periods of 1, 7, and 30 days.
842
+ The getAverageDepositTokenRatios() function returns an array of [AverageDepositTokenRatio](#averagedeposittokenratio) objects representing the average deposit token ratio for the periods of time specified by the 'timeIntervals' parameter.
843
+ If 'timeIntervals' is not specified, it returns [AverageDepositTokenRatio](#averagedeposittokenratio) objects for time periods of 1, 7, and 30 days.
838
844
 
839
845
  ```typescript
840
846
  import { Web3Provider } from '@ethersproject/providers';
@@ -845,7 +851,7 @@ const vaultAddress = "0x3ac9...a5f132";
845
851
  const dex = SupportedDex.UniswapV3;
846
852
  const days = [2, 5, 14, 60];
847
853
 
848
- const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatios(
854
+ const averageDtr: [AverageDepositTokenRatio](#averagedeposittokenratio)[] = await getAverageDepositTokenRatios(
849
855
  vaultAddress,
850
856
  web3Provider,
851
857
  dex
@@ -853,7 +859,7 @@ const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatio
853
859
 
854
860
  // - or -
855
861
 
856
- const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatios(
862
+ const averageDtr: [AverageDepositTokenRatio](#averagedeposittokenratio)[] = await getAverageDepositTokenRatios(
857
863
  vaultAddress,
858
864
  web3Provider,
859
865
  dex,
@@ -871,8 +877,11 @@ const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatio
871
877
  | timeIntervals | number[] | [1, 7, 30] | false |
872
878
 
873
879
  <br/>
874
- The getVaultMetrics() function returns an array of VaultMetrics objects for the periods of time specified by the 'timeIntervals' parameter.
875
- If 'timeIntervals' is not specified, it returns VaultMetrics objects for time periods of 1, 7, and 30 days.
880
+
881
+ > **Note:** This function may take several seconds to execute as it processes historical data. It is best suited for report generation and batched backend processes rather than user-facing interfaces where immediate responses are expected.
882
+
883
+ The getVaultMetrics() function returns an array of [VaultMetrics](#vaultmetrics) objects for the periods of time specified by the 'timeIntervals' parameter.
884
+ If 'timeIntervals' is not specified, it returns [VaultMetrics](#vaultmetrics) objects for time periods of 1, 7, and 30 days.
876
885
 
877
886
  ```typescript
878
887
  import { Web3Provider } from '@ethersproject/providers';
@@ -883,7 +892,7 @@ const vaultAddress = "0x3ac9...a5f132";
883
892
  const dex = SupportedDex.UniswapV3;
884
893
  const days = [2, 5, 14, 60];
885
894
 
886
- const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
895
+ const vaultMetrics: [VaultMetrics](#vaultmetrics)[] = await getVaultMetrics(
887
896
  vaultAddress,
888
897
  web3Provider,
889
898
  dex
@@ -891,7 +900,7 @@ const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
891
900
 
892
901
  // - or -
893
902
 
894
- const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
903
+ const vaultMetrics: [VaultMetrics](#vaultmetrics)[] = await getVaultMetrics(
895
904
  vaultAddress,
896
905
  web3Provider,
897
906
  dex,
@@ -909,7 +918,7 @@ const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
909
918
  | jsonProvider | JsonRpcProvider | - | false |
910
919
 
911
920
  <br/>
912
- This function returns IchiVault object.
921
+ This function returns [IchiVault](#ichivault) object.
913
922
 
914
923
  ```typescript
915
924
  import { Web3Provider } from '@ethersproject/providers';
@@ -935,7 +944,7 @@ if (vaultInfo) {
935
944
  | pairedTokenAddress | string | - | true |
936
945
 
937
946
  <br/>
938
- This function returns an array of all vaults (IchiVault[]) on the specified DEX that contain two tokens defined by the 'depositTokenAddress' and 'pairedTokenAddress' parameters.
947
+ This function returns an array of all vaults ([IchiVault](#ichivault)[]) on the specified DEX that contain two tokens defined by the 'depositTokenAddress' and 'pairedTokenAddress' parameters.
939
948
 
940
949
  ```typescript
941
950
  import { Web3Provider } from '@ethersproject/providers';
@@ -991,7 +1000,7 @@ if (vaults.length === 0) {
991
1000
  | dex | SupportedDex | - | true
992
1001
 
993
1002
  <br/>
994
- This function returns an object of type VaultPositionsInfo.
1003
+ This function returns an object of type [VaultPositionsInfo](#vaultpositionsinfo).
995
1004
 
996
1005
  ```typescript
997
1006
  import { Web3Provider } from '@ethersproject/providers';
@@ -1001,7 +1010,7 @@ const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
1001
1010
  const vaultAddress = "0x3ac9...a5f132";
1002
1011
  const dex = SupportedDex.UniswapV3;
1003
1012
 
1004
- const vaultPositions: VaultPositionsInfo = await getVaultPositions(
1013
+ const vaultPositions: [VaultPositionsInfo](#vaultpositionsinfo) = await getVaultPositions(
1005
1014
  vaultAddress,
1006
1015
  web3Provider,
1007
1016
  dex
@@ -1061,7 +1070,7 @@ const vaultAddress = "0x3e4...45a";
1061
1070
  const chainId = SupportedChainId.Ink;
1062
1071
  const dex = SupportedDex.Velodrome;
1063
1072
 
1064
- const rewardInfo: RewardInfo = getRewardInfo(chainId, dex, vaultAddress);
1073
+ const rewardInfo: [RewardInfo](#rewardinfo) = getRewardInfo(chainId, dex, vaultAddress);
1065
1074
  ```
1066
1075
 
1067
1076
  #### 30. `getAllRewardInfo()`
@@ -1080,7 +1089,7 @@ import { getAllRewardInfo, SupportedChainId, SupportedDex } from '@ichidao/ichi-
1080
1089
  const chainId = SupportedChainId.Ink;
1081
1090
  const dex = SupportedDex.Velodrome;
1082
1091
 
1083
- const chains: RewardInfo[] = getAllRewardInfo(chainId, dex);
1092
+ const chains: [RewardInfo](#rewardinfo)[] = getAllRewardInfo(chainId, dex);
1084
1093
  ```
1085
1094
 
1086
1095
  #### 31. `getAllUserRewards()`
@@ -1102,7 +1111,7 @@ const account = "0x123...890";
1102
1111
  const provider = new Web3Provider(YOUR_WEB3_PROVIDER);
1103
1112
  const dex = SupportedDex.Velodrome;
1104
1113
 
1105
- const rewards: UserRewards[] = await getAllUserRewards(account, provider, dex);
1114
+ const rewards: [UserRewards](#userrewards)[] = await getAllUserRewards(account, provider, dex);
1106
1115
  ```
1107
1116
 
1108
1117
  #### 32. `getUserRewards()`
@@ -1126,8 +1135,8 @@ const vaultAddress = "0x3e4...45a";
1126
1135
  const provider = new Web3Provider(YOUR_WEB3_PROVIDER);
1127
1136
  const dex = SupportedDex.Velodrome;
1128
1137
 
1129
- const rewards: UserRewardByToken[] = getUserRewards(account, vaultAddress, provider, dex);
1130
- const rewardsBN: UserRewardByTokenBN[] = getUserRewards(account, vaultAddress, provider, dex, true);
1138
+ const rewards: [UserRewardsByToken](#userrewardsbytoken)[] = getUserRewards(account, vaultAddress, provider, dex);
1139
+ const rewardsBN: [UserRewardsByTokenBN](#userrewardsbytokenbn)[] = getUserRewards(account, vaultAddress, provider, dex, true);
1131
1140
  ```
1132
1141
 
1133
1142
  #### 33. `claimRewards()`
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * @license
4
4
  * author: ICHI DAO <core@ichi.org>
5
- * ichi-vaults-sdk.js v0.1.36
5
+ * ichi-vaults-sdk.js v0.1.37
6
6
  * Released under the MIT license.
7
7
  */
8
8
 
@@ -30,3 +30,4 @@ tslib_1.__exportStar(require("./functions/userRewards"), exports);
30
30
  tslib_1.__exportStar(require("./functions/claimRewards"), exports);
31
31
  tslib_1.__exportStar(require("./types/index"), exports);
32
32
  tslib_1.__exportStar(require("./utils/getGraphUrls"), exports);
33
+ tslib_1.__exportStar(require("./utils/config/addresses"), exports);
@@ -17,3 +17,4 @@ export * from './functions/userRewards';
17
17
  export * from './functions/claimRewards';
18
18
  export * from './types/index';
19
19
  export * from './utils/getGraphUrls';
20
+ export * from './utils/config/addresses';
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * @license
4
4
  * author: ICHI DAO <core@ichi.org>
5
- * ichi-vaults-sdk.js v0.1.36
5
+ * ichi-vaults-sdk.js v0.1.37
6
6
  * Released under the MIT license.
7
7
  */
8
8
 
@@ -28,3 +28,4 @@ tslib_1.__exportStar(require("./functions/userRewards"), exports);
28
28
  tslib_1.__exportStar(require("./functions/claimRewards"), exports);
29
29
  tslib_1.__exportStar(require("./types/index"), exports);
30
30
  tslib_1.__exportStar(require("./utils/getGraphUrls"), exports);
31
+ tslib_1.__exportStar(require("./utils/config/addresses"), exports);
package/dist/src/index.js CHANGED
@@ -34,4 +34,5 @@ __exportStar(require("./functions/userRewards"), exports);
34
34
  __exportStar(require("./functions/claimRewards"), exports);
35
35
  __exportStar(require("./types/index"), exports);
36
36
  __exportStar(require("./utils/getGraphUrls"), exports);
37
+ __exportStar(require("./utils/config/addresses"), exports);
37
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,4DAA0C;AAC1C,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,2DAAyC;AACzC,2DAAyC;AACzC,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,qDAAmC;AACnC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,gDAA8B;AAC9B,uDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,4DAA0C;AAC1C,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,oDAAkC;AAClC,4DAA0C;AAC1C,2DAAyC;AACzC,2DAAyC;AACzC,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,qDAAmC;AACnC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,0DAAwC;AACxC,2DAAyC;AACzC,gDAA8B;AAC9B,uDAAqC;AACrC,2DAAyC"}
@@ -17,3 +17,4 @@ export * from './functions/userRewards';
17
17
  export * from './functions/claimRewards';
18
18
  export * from './types/index';
19
19
  export * from './utils/getGraphUrls';
20
+ export * from './utils/config/addresses';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichidao/ichi-vaults-sdk",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "The ICHI Vaults SDK",
5
5
  "main": "dist/src/index.cjs.js",
6
6
  "module": "dist/src/index.esm.js",