@dripfi/drip-sdk 1.4.16-test-tvl → 1.4.17

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
@@ -108,18 +108,18 @@ Access vesting methods through `sdk.vesting`:
108
108
 
109
109
  Access pools methods through `sdk.pools`:
110
110
 
111
- | Method | Description |
112
- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
113
- | `getUserPoolBalance(vaultAddress: string, onChainProjectId: number): Promise<UserVaultBalance>` | Fetches the user's balance in a specific pool. |
114
- | `getAllPools(): Promise<VaultData[]>` | Fetches all available pools. |
115
- | `getMyPerqBalance(): Promise<MyPerqData[]>` | Fetches the user's Perq balance. |
116
- | `getPoolDetails(vaultAddress: string, onChainProjectId: number): Promise<VaultData>` | Fetches the details of a specific pool. |
117
- | `getAllProjects(): Promise<ReducedProjectData[]>` | Fetches all available projects. |
118
- | `getProjectDetails(projectName: string): Promise<DetailedProjectData>` | Fetches the details of a specific project. |
119
- | `getPoolStats(): Promise<VaultStats>` | Fetches the statistics of a pool. |
120
- | `getRewardsPerHour(vaultAddress: string): Promise<number>` | Calculates the rewards per hour for a specific pool. |
121
- | `getUserBoostedNfts(vaultAddress: string): Promise<string[]>` | Fetches the user's boosted NFTs for a specific pool. |
122
- | `getRewards(): Promise<UserRewards>` | Fetches the user's rewards. |
111
+ | Method | Description |
112
+ | ------------------------------------------------------------------------------------- | ---------------------------------------------------- |
113
+ | `getUserPoolBalance(vaultAddress: string, onChainProjectId: number): Promise<string>` | Fetches the user's balance in a specific pool. |
114
+ | `getAllPools(): Promise<VaultData[]>` | Fetches all available pools. |
115
+ | `getMyPerqBalance(): Promise<MyPerqData[]>` | Fetches the user's Perq balance. |
116
+ | `getPoolDetails(vaultAddress: string, onChainProjectId: number): Promise<VaultData>` | Fetches the details of a specific pool. |
117
+ | `getAllProjects(): Promise<ReducedProjectData[]>` | Fetches all available projects. |
118
+ | `getProjectDetails(projectName: string): Promise<DetailedProjectData>` | Fetches the details of a specific project. |
119
+ | `getPoolStats(): Promise<VaultStats>` | Fetches the statistics of a pool. |
120
+ | `getRewardsPerHour(vaultAddress: string): Promise<number>` | Calculates the rewards per hour for a specific pool. |
121
+ | `getUserBoostedNfts(vaultAddress: string): Promise<string[]>` | Fetches the user's boosted NFTs for a specific pool. |
122
+ | `getRewards(): Promise<UserRewards>` | Fetches the user's rewards. |
123
123
 
124
124
  ## User
125
125
 
@@ -394,13 +394,16 @@ type LoyaltyCard = {
394
394
  boost: number;
395
395
  };
396
396
 
397
- type MyPerqData = Vault & {
398
- claimable: number;
399
- pendingDeposits: number;
400
- pendingWithdraws: number;
397
+ type MyPerqBalance = {
401
398
  currentlyDeposited: number;
399
+ earnedRewards: number;
400
+ rewardsPerHour: number;
401
+ };
402
+
403
+ type MyPerqData = VaultData & MyPerqBalance {
402
404
  ethPrice: number;
403
- tokenRewards: { [token_address: string]: Asset & { amount: number; rewardsPerHour?: number } };
405
+ btcPrice: number;
406
+ distributionType: VaultType;
404
407
  };
405
408
 
406
409
  type NFTBoost = {
@@ -500,14 +503,6 @@ type UserRewards = {
500
503
  [vaultAddress: string]: { [rewardPointsName: string]: number };
501
504
  };
502
505
 
503
- type UserVaultBalance = {
504
- hasWithdrawsToClaim: boolean;
505
- userBalance: string;
506
- pendingUserBalance: string;
507
- pendingWithdrawalBalance: string;
508
- claimableBalance: string;
509
- };
510
-
511
506
  type VaultData = {
512
507
  depositToken: DepositToken;
513
508
  vaultAddress: string;
@@ -536,38 +531,32 @@ type VaultData = {
536
531
  stretchGoals: StretchGoal[];
537
532
  };
538
533
 
539
- type Vault = {
540
- vaultName: string;
541
- vaultAddress: string;
542
- apy: number;
543
- tvr: number;
544
- protocols: string[];
534
+ type VaultData = {
545
535
  depositToken: DepositToken;
546
- type: VaultType;
547
- rewards: VaultReward[];
548
- rewardType: RewardType;
549
- liveUntil: string;
536
+ vaultAddress: string;
537
+ projectName: string;
538
+ projectLogo: string;
539
+ projectType: string;
550
540
  liveFrom: string;
551
- liveUntilFormatted: string;
552
- hasPoolEnded: boolean;
553
- boosters: NFTBoost[];
554
- strategies: Strategy[];
555
- tgePrice?: number;
556
- maxAmountOfTokens?: number;
557
- project: DeployedProject;
558
- projectId: number;
559
- coingeckoId?: string;
560
- depositTokenId: string;
561
- expectedTge?: string;
541
+ liveUntil: string;
542
+ apy: number;
543
+ tvlUsd: number;
544
+ avgTvl: number;
562
545
  tokenPrice: number;
563
546
  change24h: number;
564
547
  volume24h: number;
565
- projectFeatured: boolean;
566
- avgTvl: string;
567
- peakTvl: string;
568
- amountOfDepositors: number;
569
- boostedTvl: number;
570
- projectVAPY?: number;
548
+ peakTvl: number;
549
+ onChainProjectId: number;
550
+ combinedTvl: number;
551
+ isActive: boolean;
552
+ owners: string[];
553
+ coingeckoId?: string;
554
+ expectedTge?: string;
555
+ chainId: ChainId;
556
+ strategies: Strategy[];
557
+ stretchGoals: StretchGoal[];
558
+ rewards: VaultReward[];
559
+ rewardTooltipName: string;
571
560
  };
572
561
 
573
562
  type VaultReward = {
package/dist/PerqApi.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BigNumber } from 'ethers';
2
- import { SwapInfo, UserRewards, VaultStats, MyPerqData, LoyaltyCard, BeansBalance, PerqToBeansSwapInfo, BeanEntry, NonceEnrichedSignedPayload, NonceEnrichedPayload, UpgradeLoyaltyCardPayload, ReducedProjectData, DetailedProjectData, UserVaultBalance, Earnings, LinkedPodWallets, SuiWalletPayload, NearWalletPayload } from './types';
2
+ import { SwapInfo, UserRewards, VaultStats, MyPerqData, LoyaltyCard, BeansBalance, PerqToBeansSwapInfo, BeanEntry, NonceEnrichedSignedPayload, NonceEnrichedPayload, UpgradeLoyaltyCardPayload, ReducedProjectData, DetailedProjectData, Earnings, LinkedPodWallets, SuiWalletPayload, NearWalletPayload } from './types';
3
3
  import VaultData from './types/VaultData';
4
4
  import PerqSdk from './PerqSdk';
5
5
  import MigrationOption from './types/MigrationOption';
@@ -31,8 +31,7 @@ export default class PerqApi {
31
31
  linkNearWalletWithEthWallet(signedPayload: NonceEnrichedSignedPayload<NearWalletPayload>): Promise<boolean>;
32
32
  getPodWallets(walletAddress: string): Promise<LinkedPodWallets>;
33
33
  getNonceEnrichedPayload<T>(payload: T): Promise<NonceEnrichedPayload<T>>;
34
- fetchV2PoolUserBalance(userAddress: string, vaultAddress: string): Promise<UserVaultBalance>;
35
- fetchLitePoolUserBalance(userAddress: string, vaultAddress: string, onChainProjectId: number): Promise<UserVaultBalance>;
34
+ fetchLitePoolUserBalance(userAddress: string, vaultAddress: string, onChainProjectId: number): Promise<string>;
36
35
  fetchEarnings(userAddress: string, projectName: string): Promise<Earnings>;
37
36
  fetchMigrationOptions(vaultAddress: string, onChainProjectId: number): Promise<MigrationOption[]>;
38
37
  }
package/dist/PerqApi.js CHANGED
@@ -336,26 +336,11 @@ class PerqApi {
336
336
  // Return the enriched payload without the extra nesting
337
337
  return enrichedPayload.payload;
338
338
  }
339
- async fetchV2PoolUserBalance(userAddress, vaultAddress) {
340
- const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/user/v2/balance/${userAddress}/${vaultAddress}`);
341
- if (res.ok) {
342
- return await res.json();
343
- }
344
- else {
345
- throw Error(`${await res.text()}`);
346
- }
347
- }
348
339
  async fetchLitePoolUserBalance(userAddress, vaultAddress, onChainProjectId) {
349
340
  const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/user/lite/balance/${userAddress}/${vaultAddress}/${onChainProjectId}`);
350
341
  if (res.ok) {
351
342
  const data = await res.json();
352
- return {
353
- hasWithdrawsToClaim: false,
354
- userBalance: data.userBalance,
355
- pendingUserBalance: '0',
356
- pendingWithdrawalBalance: '0',
357
- claimableBalance: '0',
358
- };
343
+ return data.userBalance;
359
344
  }
360
345
  else {
361
346
  throw Error(`${await res.text()}`);
@@ -1,9 +1,9 @@
1
1
  import PerqSdk from '../PerqSdk';
2
- import { DetailedProjectData, MyPerqData, ReducedProjectData, UserRewards, UserVaultBalance, VaultData, VaultStats } from '../types';
2
+ import { DetailedProjectData, MyPerqData, ReducedProjectData, UserRewards, VaultData, VaultStats } from '../types';
3
3
  export default class PoolsPackage {
4
4
  private perqSdk;
5
5
  constructor(perqSdk: PerqSdk);
6
- getUserPoolBalance(vaultAddress: string, onChainProjectId: number): Promise<UserVaultBalance>;
6
+ getUserPoolBalance(vaultAddress: string, onChainProjectId: number): Promise<string>;
7
7
  getAllPools(): Promise<VaultData[]>;
8
8
  getMyPerqBalance(): Promise<MyPerqData[]>;
9
9
  getPoolDetails(vaultAddress: string, onChainProjectId: number): Promise<VaultData>;
@@ -1,10 +1,7 @@
1
1
  import VaultData from './VaultData';
2
2
  import VaultType from './VaultType';
3
3
  type MyPerqBalance = {
4
- pendingDeposits: number;
5
4
  currentlyDeposited: number;
6
- pendingWithdraws: number;
7
- claimable: number;
8
5
  earnedRewards: number;
9
6
  rewardsPerHour: number;
10
7
  };
@@ -1,8 +1,6 @@
1
1
  import DepositToken from './DepositToken';
2
- import ProjectTvl from './ProjectTvl';
3
2
  import VaultType from './VaultType';
4
3
  export type ReducedProjectData = {
5
- tvl?: ProjectTvl;
6
4
  projectName: string;
7
5
  logo: string;
8
6
  bannerImage: string;
@@ -13,7 +11,10 @@ export type ReducedProjectData = {
13
11
  distributionType: VaultType;
14
12
  liveUntil: string;
15
13
  liveFrom: string;
14
+ tvlUsd: number;
15
+ tvl: number;
16
16
  vAPY: number;
17
+ peakTVL: number;
17
18
  chainIds: number[];
18
19
  isFeatured: boolean;
19
20
  currencies: DepositToken[];
@@ -3,9 +3,7 @@ import DepositToken from './DepositToken';
3
3
  import Strategy from './Strategy';
4
4
  import StretchGoal from './StretchGoal';
5
5
  import VaultReward from './VaultReward';
6
- import VaultTvl from './VaultTvl';
7
6
  type VaultData = {
8
- tvl?: VaultTvl;
9
7
  depositToken: DepositToken;
10
8
  vaultAddress: string;
11
9
  projectName: string;
@@ -14,10 +12,14 @@ type VaultData = {
14
12
  liveFrom: string;
15
13
  liveUntil: string;
16
14
  apy: number;
15
+ tvlUsd: number;
16
+ avgTvl: number;
17
17
  tokenPrice: number;
18
18
  change24h: number;
19
19
  volume24h: number;
20
+ peakTvl: number;
20
21
  onChainProjectId: number;
22
+ combinedTvl: number;
21
23
  isActive: boolean;
22
24
  owners: string[];
23
25
  coingeckoId?: string;
@@ -20,7 +20,6 @@ import StretchGoal from './StretchGoal';
20
20
  import SwapInfo from './SwapInfo';
21
21
  import UpgradeLoyaltyCardPayload from './UpgradeLoyaltyCardPayload';
22
22
  import UserRewards from './UserRewards';
23
- import UserVaultBalance from './UserVaultBalance';
24
23
  import Vault from './Vault';
25
24
  import VaultData from './VaultData';
26
25
  import VaultReward, { RewardType } from './VaultReward';
@@ -31,4 +30,4 @@ import YelayVersion from './YelayVersion';
31
30
  import Earnings from './Earnings';
32
31
  import LinkedPodWallets from './LinkedPodWallets';
33
32
  import MigrationOption from './MigrationOption';
34
- export { Asset, BasePayload, BeanEntry, BeansBalance, DeployedProject, DeployedVault, DepositToken, DetailedProjectData, ELoyaltyCardTier, NearWalletPayload, SuiWalletPayload, LinkedPodWallets, LoyaltyCard, MigrationOption, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqConfig, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, ReducedProjectData, RewardType, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, UserVaultBalance, Vault, VaultData, VaultReward, VaultStats, VaultType, VestingInfo, YelayVersion, Earnings, };
33
+ export { Asset, BasePayload, BeanEntry, BeansBalance, DeployedProject, DeployedVault, DepositToken, DetailedProjectData, ELoyaltyCardTier, NearWalletPayload, SuiWalletPayload, LinkedPodWallets, LoyaltyCard, MigrationOption, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqConfig, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, ReducedProjectData, RewardType, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, Vault, VaultData, VaultReward, VaultStats, VaultType, VestingInfo, YelayVersion, Earnings, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.4.16-test-tvl",
3
+ "version": "1.4.17",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,9 +0,0 @@
1
- type ProjectTvl = {
2
- averageUsd: number;
3
- peakUsd: number;
4
- currentUsd: number;
5
- historical: {
6
- [timestamp: number]: number;
7
- };
8
- };
9
- export default ProjectTvl;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- type UserVaultBalance = {
2
- hasWithdrawsToClaim: boolean;
3
- userBalance: string;
4
- pendingUserBalance: string;
5
- pendingWithdrawalBalance: string;
6
- claimableBalance: string;
7
- };
8
- export default UserVaultBalance;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +0,0 @@
1
- type VaultTvl = {
2
- average: number;
3
- averageUsd: number;
4
- peak: number;
5
- peakUsd: number;
6
- current: number;
7
- currentUsd: number;
8
- historical: {
9
- [timestamp: number]: {
10
- amount: number;
11
- amountUsd: number;
12
- };
13
- };
14
- };
15
- export default VaultTvl;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });