@dripfi/drip-sdk 1.4.16 → 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
@@ -10,7 +10,6 @@ The Drip SDK is a TypeScript library designed to interact with the Perq protocol
10
10
  - [Usage](#usage)
11
11
  - [Modules](#modules)
12
12
  - [Core SDK](#core-sdk)
13
- - [V2 Vaults](#v2-vaults)
14
13
  - [Lite Vaults](#lite-vaults)
15
14
  - [Loyalty Cards](#loyalty-cards)
16
15
  - [Vesting](#vesting)
@@ -109,18 +108,18 @@ Access vesting methods through `sdk.vesting`:
109
108
 
110
109
  Access pools methods through `sdk.pools`:
111
110
 
112
- | Method | Description |
113
- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
114
- | `getUserPoolBalance(vaultAddress: string, onChainProjectId: number): Promise<UserVaultBalance>` | Fetches the user's balance in a specific pool. |
115
- | `getAllPools(): Promise<VaultData[]>` | Fetches all available pools. |
116
- | `getMyPerqBalance(): Promise<MyPerqData[]>` | Fetches the user's Perq balance. |
117
- | `getPoolDetails(vaultAddress: string, onChainProjectId: number): Promise<VaultData>` | Fetches the details of a specific pool. |
118
- | `getAllProjects(): Promise<ReducedProjectData[]>` | Fetches all available projects. |
119
- | `getProjectDetails(projectName: string): Promise<DetailedProjectData>` | Fetches the details of a specific project. |
120
- | `getPoolStats(): Promise<VaultStats>` | Fetches the statistics of a pool. |
121
- | `getRewardsPerHour(vaultAddress: string): Promise<number>` | Calculates the rewards per hour for a specific pool. |
122
- | `getUserBoostedNfts(vaultAddress: string): Promise<string[]>` | Fetches the user's boosted NFTs for a specific pool. |
123
- | `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. |
124
123
 
125
124
  ## User
126
125
 
@@ -395,13 +394,16 @@ type LoyaltyCard = {
395
394
  boost: number;
396
395
  };
397
396
 
398
- type MyPerqData = Vault & {
399
- claimable: number;
400
- pendingDeposits: number;
401
- pendingWithdraws: number;
397
+ type MyPerqBalance = {
402
398
  currentlyDeposited: number;
399
+ earnedRewards: number;
400
+ rewardsPerHour: number;
401
+ };
402
+
403
+ type MyPerqData = VaultData & MyPerqBalance {
403
404
  ethPrice: number;
404
- tokenRewards: { [token_address: string]: Asset & { amount: number; rewardsPerHour?: number } };
405
+ btcPrice: number;
406
+ distributionType: VaultType;
405
407
  };
406
408
 
407
409
  type NFTBoost = {
@@ -501,14 +503,6 @@ type UserRewards = {
501
503
  [vaultAddress: string]: { [rewardPointsName: string]: number };
502
504
  };
503
505
 
504
- type UserVaultBalance = {
505
- hasWithdrawsToClaim: boolean;
506
- userBalance: string;
507
- pendingUserBalance: string;
508
- pendingWithdrawalBalance: string;
509
- claimableBalance: string;
510
- };
511
-
512
506
  type VaultData = {
513
507
  depositToken: DepositToken;
514
508
  vaultAddress: string;
@@ -537,38 +531,32 @@ type VaultData = {
537
531
  stretchGoals: StretchGoal[];
538
532
  };
539
533
 
540
- type Vault = {
541
- vaultName: string;
542
- vaultAddress: string;
543
- apy: number;
544
- tvr: number;
545
- protocols: string[];
534
+ type VaultData = {
546
535
  depositToken: DepositToken;
547
- type: VaultType;
548
- rewards: VaultReward[];
549
- rewardType: RewardType;
550
- liveUntil: string;
536
+ vaultAddress: string;
537
+ projectName: string;
538
+ projectLogo: string;
539
+ projectType: string;
551
540
  liveFrom: string;
552
- liveUntilFormatted: string;
553
- hasPoolEnded: boolean;
554
- boosters: NFTBoost[];
555
- strategies: Strategy[];
556
- tgePrice?: number;
557
- maxAmountOfTokens?: number;
558
- project: DeployedProject;
559
- projectId: number;
560
- coingeckoId?: string;
561
- depositTokenId: string;
562
- expectedTge?: string;
541
+ liveUntil: string;
542
+ apy: number;
543
+ tvlUsd: number;
544
+ avgTvl: number;
563
545
  tokenPrice: number;
564
546
  change24h: number;
565
547
  volume24h: number;
566
- projectFeatured: boolean;
567
- avgTvl: string;
568
- peakTvl: string;
569
- amountOfDepositors: number;
570
- boostedTvl: number;
571
- 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;
572
560
  };
573
561
 
574
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
  };
@@ -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",
3
+ "version": "1.4.17",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 });