@dripfi/drip-sdk 1.3.10 → 1.3.12

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +312 -238
  3. package/dist/DripApi.d.ts +1 -16
  4. package/dist/DripApi.js +0 -20
  5. package/dist/DripConfig.d.ts +2 -2
  6. package/dist/DripConfig.js +3 -3
  7. package/dist/DripSdk.d.ts +1 -16
  8. package/dist/DripSdk.js +8 -19
  9. package/dist/abi/index.d.ts +2 -2
  10. package/dist/abi/index.js +4 -4
  11. package/dist/contracts/{DripSwapAndRecyclerContract.d.ts → PerqSwapAndRecyclerContract.d.ts} +2 -2
  12. package/dist/contracts/{DripSwapAndRecyclerContract.js → PerqSwapAndRecyclerContract.js} +5 -5
  13. package/dist/contracts/{DripTokenContract.d.ts → PerqTokenContract.d.ts} +2 -2
  14. package/dist/contracts/{DripTokenContract.js → PerqTokenContract.js} +5 -5
  15. package/dist/contracts/{DripTokenRecyclerContract.d.ts → PerqTokenRecyclerContract.d.ts} +1 -1
  16. package/dist/contracts/{DripTokenRecyclerContract.js → PerqTokenRecyclerContract.js} +2 -2
  17. package/dist/contracts/PerqVestingContract.d.ts +2 -2
  18. package/dist/contracts/PerqVestingContract.js +2 -2
  19. package/dist/contracts/index.d.ts +13 -0
  20. package/dist/contracts/index.js +17 -0
  21. package/dist/index.d.ts +4 -5
  22. package/dist/index.js +9 -31
  23. package/dist/perq/PerqConfig.d.ts +1 -1
  24. package/dist/perq/PerqConfig.js +3 -3
  25. package/dist/perq/PerqSdk.d.ts +1 -1
  26. package/dist/types/Chain.d.ts +2 -1
  27. package/dist/types/Chain.js +2 -2
  28. package/dist/types/DeployedProject.d.ts +3 -2
  29. package/dist/types/DeployedVault.d.ts +1 -3
  30. package/dist/types/LoyaltyCard.d.ts +1 -1
  31. package/dist/types/MyPerqData.d.ts +1 -2
  32. package/dist/types/Vault.d.ts +2 -7
  33. package/dist/types/YelayVersion.d.ts +2 -1
  34. package/dist/types/index.d.ts +10 -11
  35. package/dist/types/index.js +3 -1
  36. package/package.json +1 -1
  37. package/dist/types/CacheVaultRewards.d.ts +0 -14
  38. package/dist/types/CacheVaultRewards.js +0 -2
  39. package/dist/types/UserBalance.d.ts +0 -19
  40. package/dist/types/UserBalance.js +0 -2
  41. package/dist/types/VaultClaimData.d.ts +0 -7
  42. package/dist/types/VaultClaimData.js +0 -2
  43. package/dist/types/VaultDepositToken.d.ts +0 -8
  44. package/dist/types/VaultDepositToken.js +0 -2
  45. /package/dist/abi/{DripSwapAndRecyclerAbi.json → PerqSwapAndRecyclerAbi.json} +0 -0
  46. /package/dist/abi/{DripTokenAbi.json → PerqTokenAbi.json} +0 -0
  47. /package/dist/contracts/{BaseDripContract.d.ts → BasePerqContract.d.ts} +0 -0
  48. /package/dist/contracts/{BaseDripContract.js → BasePerqContract.js} +0 -0
package/README.md CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
- The Drip SDK is a TypeScript library designed to interact with the Drip protocol. It provides methods to retrieve information about Drip Vaults, manage user authentication, and fetch user balances.
5
+ The Drip SDK is a TypeScript library designed to interact with the Perq protocol. It provides methods to retrieve information about Perq Vaults, manage user authentication, and fetch user balances.
6
6
 
7
7
  ## Table of Contents
8
+
8
9
  - [Installation](#installation)
9
10
  - [Usage](#usage)
10
11
  - [Methods](#methods)
@@ -23,8 +24,8 @@ npm i @dripfi/drip-sdk
23
24
  # Usage
24
25
 
25
26
  ```typescript
26
- import DripSdk from '@drip/sdk'
27
- import { DripConfig, Chain } from '@dripfi/drip-sdk'
27
+ import DripSdk from '@drip/sdk';
28
+ import { DripConfig, Chain } from '@dripfi/drip-sdk';
28
29
  ```
29
30
 
30
31
  Initialize the SDK with your Drip configuration and an optional signer:
@@ -42,51 +43,51 @@ const dripSdk = new DripSdk(chain, signer);
42
43
 
43
44
  # Methods
44
45
 
45
- | Name | Requires authentication | Description |
46
- | ------ | ------ | ----------- |
47
- | `getAllVaults(): Promise<Vault[]>`| NO | Fetches details of all Drip Vaults. |
48
- | `getVaultDetails(vaultAddress: string): Promise<Vault>` | NO | Fetches details of a specific Drip Vault identified by its address. |
49
- | `getVaultStats(): Promise<VaultStats>`| NO | Returns some overall drip stats |
50
- | `getTokenPrice(tokenName: string): Promise<number>`| NO | Returns the price for the given token (only works for weth at the moment) |
51
- | `updateSigner(newSigner: Signer): Promise<void>`| NO | Updates the signer for the SDK instance. |
52
- | `deposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>` | NO | The deposit function allows you to deposit tokens into a specific vault. Returns txHash. |
53
- | `getExpectedSwapResult(fromTokenAddress: string, toTokenAddress: string, amount: string, decimals: number): Promise<string>`| NO | Returns the expected amount of tokens to get from a swap |
54
- | `getUserBalance(): Promise<UserBalance>` | YES | Returns overall user balance information |
55
- | `getRewardsPerHour(vaultAddress: string): Promise<string[]>` | YES | Returns an estimated amount of tokens the user will receive in 1 hour as reward. It considers boost nfts the user owns for the estimation. |
56
- | `getRewards(): Promise<UserRewards>` | YES | Fetches the current user's rewards points for each vault. |
57
- | `getUserVaultBalance(): Promise<UserVaultBalance>` | YES | Fetches the user's balance for a specific Drip Vault. |
58
- | `fastWithdraw(vault: Vault, amountToWithdraw?: string): Promise<string>` | YES | For users who prefer not to wait for withdrawals to be processed, there is a Fast Withdrawal method. While this approach is more gas-intensive, as users bear the cost of executing the withdrawal process themselves, it allows for instant access to the withdrawn tokens. When utilizing Fast Withdrawal, users immediately receive the tokens, eliminating the need to initiate the 'claimWithdrawal' process separately. Returns txHash. |
59
- | `swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>` | YES | The swapAndDeposit function allows you to deposit a different token or ether and it will take care of swapping to the correct token before making the deposit. Returns txHash. |
60
- | `withdraw(vault: Vault, amountToWithdraw?: string): Promise<string>` | YES | Withdraws tokens from a vault. After withdrawing, you must wait for the withdrawal to be processed by the 'DoHardWork' function, and then you can claim those tokens using claimWithdraws(). Returns txHash. |
61
- | `claimWithdraws(vaultAddress: string): Promise<string>` | YES | After the withdrawal has been processed by the 'DoHardWork' function, the 'claimWithdraws' function transfers the withdrawn tokens to their personal account. Returns txHash. |
62
- | `getTokenAllowanceForCurrency(tokenAddress: string): Promise<string>` | NO | This function retrieves the token allowance for a specific currency. |
63
- | `getTokenAllowanceForRecycler(tokenAddress: string): Promise<BigNumber>` | NO | This function retrieves the token allowance for the recycler contract. |
64
- | `getTokenAllowanceForSwapAndRecycler(tokenAddress: string): Promise<BigNumber>` | NO | This function retrieves the token allowance for the swap and recycler contract. |
65
- | `getUserBoostedNfts(vaultAddress: string): Promise<string[]>` | YES | This function retrieves an array of boosted NFT addresses owned by the user. |
66
- | `getRewardsPerHour(vaultAddress: string): Promise<number> ` | YES | This function returns an estimated amount of tokens the user will receive in one hour as a reward for the given vault |
67
- | `newDeposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>` | YES | This function allows for a new deposit without checking for allowance.
68
- | `newSwapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string> ` | YES | This function allows for a new swap and deposit without checking for allowance. |
69
- | `getAllVestingInfo(beneficiaryAddress: string): Promise<VestingInfo>` | YES | This function retrieves all vesting information for a specified beneficiary. |
70
- | `getVestingStart(): Promise<string>` | YES | This function retrieves the start time of the vesting period. |
71
- | `getVestingEnd(): Promise<string>` | YES | This function retrieves the end time of the vesting period.
72
- | `getBeansHistory(): Promise<BeanEntry[]> ` | YES | This function retrieves the user's beans history of tx
73
- | `getBeansBalance(): Promise<BeansBalance> ` | YES | This function retrieves the user's beans balance.
74
- | `getMyPerqBalance(): Promise<MyPerqData>` | YES | This function retrieves the user's Perq balance data.
75
- | `getVaultsClaimableData(): Promise<VaultClaimData> ` | YES | This function fetches claimable data for the user's vaults.
76
- | `upgradeLoyaltyCard(index: number): Promise<LoyaltyCard>` | YES | This function upgrades the user's loyalty card.
77
- | `getOwnedLoyaltyCard(): Promise<LoyaltyCard>` | YES | This function fetches the currently owned loyalty card of the connected wallet.
78
- | `getAllLoyaltyCards(): Promise<LoyaltyCard[]>` | YES | This function fetches all available loyalty cards.
46
+ | Name | Description |
47
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48
+ | `getAllVaults(): Promise<Vault[]>` | Fetches details of all Perq Vaults. |
49
+ | `getVaultDetails(vaultAddress: string): Promise<Vault>` | Fetches details of a specific Perq Vault identified by its address. |
50
+ | `getVaultStats(): Promise<VaultStats>` | Returns some overall Perq stats |
51
+ | `getTokenPrice(tokenName: string): Promise<number>` | Returns the price for the given token (only works for weth at the moment) |
52
+ | `updateSigner(newSigner: Signer): Promise<void>` | Updates the signer for the SDK instance. |
53
+ | `deposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>` | The deposit function allows you to deposit tokens into a specific vault. Returns txHash. |
54
+ | `getExpectedSwapResult(fromTokenAddress: string, toTokenAddress: string, amount: string, decimals: number): Promise<string>` | Returns the expected amount of tokens to get from a swap |
55
+ | `getRewardsPerHour(vaultAddress: string): Promise<string[]>` | Returns an estimated amount of tokens the user will receive in 1 hour as reward. It considers boost nfts the user owns for the estimation. |
56
+ | `getRewards(): Promise<UserRewards>` | Fetches the current user's rewards points for each vault. |
57
+ | `getUserVaultBalance(): Promise<UserVaultBalance>` | Fetches the user's balance for a specific Perq Vault. |
58
+ | `fastWithdraw(vault: Vault, amountToWithdraw?: string): Promise<string>` | For users who prefer not to wait for withdrawals to be processed, there is a Fast Withdrawal method. While this approach is more gas-intensive, as users bear the cost of executing the withdrawal process themselves, it allows for instant access to the withdrawn tokens. When utilizing Fast Withdrawal, users immediately receive the tokens, eliminating the need to initiate the 'claimWithdrawal' process separately. Returns txHash. |
59
+ | `swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>` | The swapAndDeposit function allows you to deposit a different token or ether and it will take care of swapping to the correct token before making the deposit. Returns txHash. |
60
+ | `withdraw(vault: Vault, amountToWithdraw?: string): Promise<string>` | Withdraws tokens from a vault. After withdrawing, you must wait for the withdrawal to be processed by the 'DoHardWork' function, and then you can claim those tokens using claimWithdraws(). Returns txHash. |
61
+ | `claimWithdraws(vaultAddress: string): Promise<string>` | After the withdrawal has been processed by the 'DoHardWork' function, the 'claimWithdraws' function transfers the withdrawn tokens to their personal account. Returns txHash. |
62
+ | `getTokenAllowanceForCurrency(tokenAddress: string): Promise<string>` | Retrieves the token allowance for a specific currency. |
63
+ | `getTokenAllowanceForRecycler(tokenAddress: string): Promise<BigNumber>` | Retrieves the token allowance for the recycler contract. |
64
+ | `getTokenAllowanceForSwapAndRecycler(tokenAddress: string): Promise<BigNumber>` | Retrieves the token allowance for the swap and recycler contract. |
65
+ | `getUserBoostedNfts(vaultAddress: string): Promise<string[]>` | Retrieves an array of boosted NFT addresses owned by the user. |
66
+ | `getRewardsPerHour(vaultAddress: string): Promise<number> ` | Returns an estimated amount of tokens the user will receive in one hour as a reward for the given vault |
67
+ | `newDeposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>` | Allows for a new deposit without checking for allowance. |
68
+ | `newSwapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string> ` | Allows for a new swap and deposit without checking for allowance. |
69
+ | `getAllVestingInfo(beneficiaryAddress: string): Promise<VestingInfo>` | Retrieves all vesting information for a specified beneficiary. |
70
+ | `getVestingStart(): Promise<string>` | Retrieves the start time of the vesting period. |
71
+ | `getVestingEnd(): Promise<string>` | Retrieves the end time of the vesting period. |
72
+ | `getBeansHistory(): Promise<BeanEntry[]> ` | Retrieves the user's beans history of tx |
73
+ | `getBeansBalance(): Promise<BeansBalance> ` | Retrieves the user's beans balance. |
74
+ | `getMyPerqBalance(): Promise<MyPerqData>` | Retrieves the user's Perq balance data. |
75
+ | `upgradeLoyaltyCard(index: number): Promise<LoyaltyCard>` | Upgrades the user's loyalty card. |
76
+ | `getOwnedLoyaltyCard(): Promise<LoyaltyCard>` | Fetches the currently owned loyalty card of the connected wallet. |
77
+ | `getAllLoyaltyCards(): Promise<LoyaltyCard[]>` | Fetches all available loyalty cards. |
79
78
 
80
79
  ---
81
80
 
82
81
  # Examples
83
82
 
84
- ### `deposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>`
83
+ ### `deposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>`
85
84
 
86
85
  I want to deposit 100 USDC in a USDC vault:
86
+
87
87
  ```typescript
88
88
  USDC_TOKEN_ADDRESS = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" --> USDC contract address in tenderly environment
89
89
  ```
90
+
90
91
  you can get vault token address from the vault.depositToken.tokenAddress
91
92
 
92
93
  ```typescript
@@ -108,7 +109,7 @@ const txHash = await deposit(USDC_TOKEN_ADDRESS, VAULT_ADDRESS, '100')
108
109
 
109
110
  ---
110
111
 
111
- ### `swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>`
112
+ ### `swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>`
112
113
 
113
114
  I want to deposit 1.5ETH in a WETH vault:
114
115
 
@@ -117,6 +118,7 @@ WETH_TOKEN_ADDRESS = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" --> WETH co
117
118
 
118
119
  const txHash = await swapAndDeposit(WETH_TOKEN_ADDRESS, WETH_TOKEN_ADDRESS, '0', vaultAddress, '1.5')
119
120
  ```
121
+
120
122
  you can get vault token address from the vault.depositToken.tokenAddress
121
123
 
122
124
  > [!IMPORTANT]
@@ -124,12 +126,13 @@ you can get vault token address from the vault.depositToken.tokenAddress
124
126
 
125
127
  ---
126
128
 
127
- ### `withdraw(vault: Vault, amountToWithdraw?: string): Promise<string>`
129
+ ### `withdraw(vault: Vault, amountToWithdraw?: string): Promise<string>`
128
130
 
129
131
  ```typescript
130
- const userBalanceObject = await getUserBalance()
131
- const balance = userBalanceObject.userbalance
132
+ const userBalanceObject = await getUserBalance();
133
+ const balance = userBalanceObject.userbalance;
132
134
  ```
135
+
133
136
  > [!NOTE]
134
137
  > If i check balance, that is the max amount I can withdraw
135
138
 
@@ -137,42 +140,45 @@ I want to withdraw 100 USDC from the 1st vault fetched. ---> Let's assume the fi
137
140
  Fetch vaults returned by getAllVault() and pass the vault you want to withdraw from, and the amount to withdraw (100 in this example)
138
141
 
139
142
  ```typescript
140
- const vaults = await getAllVaults()
141
- const vaultToWithdrawFrom = vaults[0]
143
+ const vaults = await getAllVaults();
144
+ const vaultToWithdrawFrom = vaults[0];
142
145
 
143
- const txHash = await withdraw(vaultToWithdrawFrom, '100')
146
+ const txHash = await withdraw(vaultToWithdrawFrom, '100');
144
147
  ```
145
148
 
146
149
  if you want to withdraw all funds in the vault, don't specify the amountToWithdraw:
147
150
 
148
151
  ```typescript
149
- const txHash = await withdraw(vaultToWithdrawFrom)
152
+ const txHash = await withdraw(vaultToWithdrawFrom);
150
153
  ```
154
+
151
155
  > [!IMPORTANT]
152
156
  > you will have to claim your withdraws after DHW is processed to transfer the withdrawn funds to your wallet
153
157
 
154
158
  ---
155
159
 
156
- ### `claimWithdraws(vaultAddress: string): Promise<string>`
160
+ ### `claimWithdraws(vaultAddress: string): Promise<string>`
157
161
 
158
162
  ```typescript
159
- const userBalanceObject = await getUserBalance()
160
- const hasWithdrawsToClaim = userBalanceObject.hasWithdrawsToClaim
163
+ const userBalanceObject = await getUserBalance();
164
+ const hasWithdrawsToClaim = userBalanceObject.hasWithdrawsToClaim;
161
165
  ```
162
- if hasWithdrawsToClaim is true you have available funds to transfer to your address
166
+
167
+ if hasWithdrawsToClaim is true you have available funds to transfer to your address
163
168
 
164
169
  ```typescript
165
- const txHash = await claimWithdraws()
170
+ const txHash = await claimWithdraws();
166
171
  ```
172
+
167
173
  It will transfer all available funds withdrawn with withdraw() function, to your address
168
174
 
169
175
  ---
170
176
 
171
- ### `fastWithdraw(vault: Vault, amountToWithdraw?: string): Promise<string>`
177
+ ### `fastWithdraw(vault: Vault, amountToWithdraw?: string): Promise<string>`
172
178
 
173
179
  ```typescript
174
- const userBalanceObject = await getUserBalance()
175
- const balance = userBalanceObject.userbalance
180
+ const userBalanceObject = await getUserBalance();
181
+ const balance = userBalanceObject.userbalance;
176
182
  ```
177
183
 
178
184
  > [!NOTE]
@@ -182,236 +188,304 @@ I want to withdraw 3.55 WETH from the 1st vault fetched. ---> Let's assume the f
182
188
  Fetch vaults returned by getAllVault() and pass the vault you want to withdraw from, and the amount to withdraw (3.55 in this example)
183
189
 
184
190
  ```typescript
185
- const vaults = await getAllVaults()
186
- const vaultToWithdrawFrom = vaults[0]
191
+ const vaults = await getAllVaults();
192
+ const vaultToWithdrawFrom = vaults[0];
187
193
 
188
- const txHash = await fastWithdraw(vaultToWithdrawFrom, '3.55')
194
+ const txHash = await fastWithdraw(vaultToWithdrawFrom, '3.55');
189
195
  ```
190
196
 
191
197
  if you want to withdraw all funds in the vault, don't specify the amountToWithdraw, like:
192
198
 
193
199
  ```typescript
194
- const txHash = await fastWithdraw(vaultToWithdrawFrom)
200
+ const txHash = await fastWithdraw(vaultToWithdrawFrom);
195
201
  ```
196
202
 
197
203
  # Types
198
204
 
199
205
  ```typescript
200
- type Vault = {
201
- vaultName: string
202
- vaultAddress: string
203
- apy: number
204
- tvr: number
205
- protocols: string[]
206
- depositToken: VaultDepositToken
207
- type: VaultType
208
- rewards: VaultReward[]
209
- rewardType: RewardType
210
- liveUntil: string
211
- liveFrom: string
212
- liveUntilFormatted: string
213
- hasPoolEnded: boolean
214
- boosters: NFTBoost[]
215
- strategies: Strategy[]
216
- tgePrice?: number
217
- maxAmountOfTokens?: number
218
- project: DeployedProject
219
- projectId: number
220
- coingeckoId?: string
221
- depositTokenId: string
222
- expectedTge?: string
223
- tokenPrice: number
224
- change24h: number
225
- volume24h: number
226
- projectFeatured: boolean
227
- avgTvl: string
228
- peakTvl: string
229
- amountOfDepositors: number
230
- boostedTvl: number
231
- projectVAPY?: number
206
+ type Asset = {
207
+ decimals: number;
208
+ symbol: string;
209
+ };
210
+
211
+ type BeanEntry = {
212
+ address: string;
213
+ reason: string;
214
+ recycledAmount: string;
215
+ beansAmount: string;
216
+ beansSum: string;
217
+ amountDepositedInUsd: string;
218
+ createdAt: string;
219
+ chainId: number;
220
+ nonce: number;
232
221
  };
233
222
 
234
- type VaultType = 'launch' | 'earn' | 'airdrop'
223
+ type BeansBalance = {
224
+ balance: string;
225
+ bonusesClaimed: string[];
226
+ };
235
227
 
236
- type VaultDepositToken = {
237
- name: string
238
- symbol: string
239
- roundingDecimals: number
240
- precisionDecimals: number
241
- tokenAddress: string
228
+ enum Chain {
229
+ MAINNET = 'mainnet',
230
+ SEPOLIA = 'sepolia',
242
231
  }
243
232
 
244
- type VaultReward = {
245
- type: 'token' | 'points';
246
- name: string;
247
- symbol: string;
248
- decimals: number;
249
- tokenAddress: string;
250
- monthlyEmissionRate: number;
251
- blockNumber: number;
252
- rewardRate: number;
253
- timestamp: number;
254
- endTime: number;
233
+ type DeployedProject = {
234
+ id: number | undefined;
235
+ projectName: string;
236
+ owners: string[];
237
+ logo: string;
238
+ telegramLink: string;
239
+ twitterLink: string;
240
+ mediumLink: string;
241
+ deckLink: string;
242
+ roadmapLink: string;
243
+ economicsLink: string;
244
+ discordLink: string;
245
+ docsLink: string;
246
+ whitepaperLink: string;
247
+ litepaperLink: string;
248
+ websiteLink: string;
249
+ supplyAtLaunch: number;
250
+ fdv: number;
251
+ latestRoundPriceInUsd: number;
252
+ totalSupply: number;
253
+ disabledTgePrice: boolean;
254
+ backers: ProjectBacker[];
255
+ networks: string[];
256
+ content: string;
257
+ tgeDate?: string;
258
+ tgePrice?: number;
259
+ vAPY?: number;
260
+ wikiLink: string;
261
+ youTubeLink: string;
262
+ tikTokLink: string;
263
+ stretchGoals: StretchGoal[];
264
+ projectInfoText: string;
265
+ projectRewardText: string;
266
+ coingeckoId?: string;
267
+ projectType: string;
268
+ isFeatured: boolean;
269
+ yelayVersion: YelayVersion;
270
+ bannerImage?: string;
271
+ rewardImage?: string;
255
272
  };
256
273
 
257
- type NFTBoost = {
258
- url: string
259
- tokenAddress: string
260
- multiplier: number
261
- nftAddress: string
262
- network: string
263
- initialBlock: number
264
- imagePath: string
265
- }
274
+ type DeployedVault = {
275
+ projectId: number;
276
+ vaultAddress: string;
277
+ liveUntil: string;
278
+ liveFrom: string;
279
+ type: VaultType;
280
+ depositTokenId: string;
281
+ rewards: VaultReward[];
282
+ project?: DeployedProject;
283
+ coingeckoId?: string;
284
+ expectedTge?: string;
285
+ };
266
286
 
267
- interface StretchGoal {
268
- threshhold: number
269
- threshholdDescription: string
270
- rewardTooltip: string
271
- rewardDescription: string
272
- amountOfTokens: number
273
- }
287
+ type DepositToken = {
288
+ name: string;
289
+ symbol: string;
290
+ roundingDecimals: number;
291
+ precisionDecimals: number;
292
+ tokenAddress: string;
293
+ };
274
294
 
275
- type Strategy = {
276
- address: string
277
- lastDoHardWorkTime: number | null
278
- lastDoHardWorkBlock: number | null
295
+ enum ELoyaltyCardTier {
296
+ White = 'White',
297
+ Ivory = 'Ivory',
298
+ Dune = 'Dune',
299
+ Amber = 'Amber',
300
+ Sienna = 'Sienna',
301
+ Umber = 'Umber',
302
+ Black = 'Black',
279
303
  }
280
304
 
281
- interface QLFastRedeem {
282
- assetsWithdrawn: {
283
- asset: {
284
- decimals: number
285
- id: string
286
- name: string
287
- symbol: string
288
- }
289
- claimed: string
290
- id: string
291
- }[]
292
- blockNumber: number
293
- id: string
294
- svtWithdrawn: string
295
- }
305
+ type LoyaltyCard = {
306
+ id: string;
307
+ tier: ELoyaltyCardTier;
308
+ level: number;
309
+ cost: number;
310
+ boost: number;
311
+ };
296
312
 
297
- type SwapInfo = {
298
- swapTarget: any
299
- token: string
300
- swapCallData: any
301
- }
313
+ type MyPerqData = Vault & {
314
+ claimable: number;
315
+ pendingDeposits: number;
316
+ pendingWithdraws: number;
317
+ currentlyDeposited: number;
318
+ ethPrice: number;
319
+ tokenRewards: { [token_address: string]: Asset & { amount: number; rewardsPerHour?: number } };
320
+ };
302
321
 
303
- type UserBalance = {
304
- assets: {
305
- asset: string,
306
- dripping: string,
307
- deposits: number,
308
- depositsUSD: number,
309
- tvr: number,
310
- apy: number,
311
- decimals: number,
312
- reward: number
313
- }[],
314
- available: { [symbol: string] : number},
315
- claimed: { [symbol: string] : number},
322
+ type NFTBoost = {
323
+ url: string;
324
+ tokenAddress: string;
325
+ multiplier: number;
326
+ nftAddress: string;
327
+ network: string;
328
+ initialBlock: number;
329
+ imagePath: string;
316
330
  };
317
331
 
332
+ export type BasePayload<T> = {
333
+ payload: T;
334
+ };
318
335
 
319
- type UserVaultBalance = {
320
- hasWithdrawsToClaim: boolean
321
- userBalance: string
322
- pendingUserBalance: string
323
- pendingWithdrawalBalance: string
324
- claimableBalance: string
336
+ export type NonceEnrichedPayload<T> = T & {
337
+ deadline: number;
338
+ signature: string;
339
+ };
340
+
341
+ export type NonceEnrichedSignedPayload<T> = {
342
+ signature: string;
343
+ signerAddress: string;
344
+ payload: NonceEnrichedPayload<T>;
345
+ };
346
+
347
+ type PerqToBeansSwapInfo = {
348
+ perqPrice: number;
349
+ price: number;
350
+ priceInFloat: number;
351
+ deadline: number;
352
+ signature: string;
353
+ };
354
+
355
+ type ProjectBacker = {
356
+ name: string;
357
+ image: string;
358
+ link: string;
359
+ };
360
+
361
+ type QLFastRedeem = {
362
+ assetsWithdrawn: {
363
+ asset: {
364
+ decimals: number;
365
+ id: string;
366
+ name: string;
367
+ symbol: string;
368
+ };
369
+ claimed: string;
370
+ id: string;
371
+ }[];
372
+ blockNumber: number;
373
+ id: string;
374
+ svtWithdrawn: string;
375
+ };
376
+
377
+ type Strategy = {
378
+ address: string;
379
+ lastDoHardWorkTime: number | null;
380
+ lastDoHardWorkBlock: number | null;
381
+ name: string;
382
+ assetGroupId: number;
383
+ apy: number;
384
+ };
385
+
386
+ interface StretchGoal {
387
+ threshhold: number;
388
+ amountOfTokens: number;
389
+ }
390
+
391
+ type SwapInfo = {
392
+ swapTarget: any;
393
+ token: string;
394
+ swapCallData: any;
325
395
  };
326
396
 
397
+ type UpgradeLoyaltyCardPayload = {
398
+ index: number;
399
+ };
327
400
 
328
401
  type UserRewards = {
329
- [vaultAddress: string]: { [rewardPointsName: string]: number }
402
+ // vaultAddress => pointsName => rewardsAmount
403
+ [vaultAddress: string]: { [rewardPointsName: string]: number };
330
404
  };
331
405
 
332
- type VaultStats = {
333
- totalTVL: number
334
- totalUsers: number
335
- activeVaults: number
336
- };
406
+ type UserVaultBalance = {
407
+ hasWithdrawsToClaim: boolean;
408
+ userBalance: string;
409
+ pendingUserBalance: string;
410
+ pendingWithdrawalBalance: string;
411
+ claimableBalance: string;
412
+ };
337
413
 
338
- type BeanEntry = {
339
- address: string
340
- reason: string
341
- recycledAmount: string
342
- beansAmount: string
343
- beansSum: string
344
- amountDepositedInUsd: string
345
- createdAt: string
346
- chainId: number
347
- nonce: number
414
+ type Vault = {
415
+ vaultName: string;
416
+ vaultAddress: string;
417
+ apy: number;
418
+ tvr: number;
419
+ protocols: string[];
420
+ depositToken: DepositToken;
421
+ type: VaultType;
422
+ rewards: VaultReward[];
423
+ rewardType: RewardType;
424
+ liveUntil: string;
425
+ liveFrom: string;
426
+ liveUntilFormatted: string;
427
+ hasPoolEnded: boolean;
428
+ boosters: NFTBoost[];
429
+ strategies: Strategy[];
430
+ tgePrice?: number;
431
+ maxAmountOfTokens?: number;
432
+ project: DeployedProject;
433
+ projectId: number;
434
+ coingeckoId?: string;
435
+ depositTokenId: string;
436
+ expectedTge?: string;
437
+ tokenPrice: number;
438
+ change24h: number;
439
+ volume24h: number;
440
+ projectFeatured: boolean;
441
+ avgTvl: string;
442
+ peakTvl: string;
443
+ amountOfDepositors: number;
444
+ boostedTvl: number;
445
+ projectVAPY?: number;
348
446
  };
349
447
 
350
- export type BeansBalance = {
351
- balance: string
352
- bonusesClaimed: string[]
448
+ type VaultReward = {
449
+ id: number | undefined;
450
+ type: RewardType;
451
+ name: string;
452
+ symbol: string;
453
+ decimals: number;
454
+ tokenAddress: string;
455
+ monthlyEmissionRate: number;
456
+ blockNumber: number;
457
+ rewardRate: number;
458
+ timestamp: number;
459
+ endTime: number;
353
460
  };
354
461
 
355
- enum Chain {
356
- MAINNET = 'mainnet',
357
- SEPOLIA = 'sepolia'
358
- }
462
+ type VaultStats = {
463
+ totalTVL: number;
464
+ totalUsers: number;
465
+ activeVaults: number;
466
+ };
359
467
 
360
- enum ELoyaltyCardTier {
361
- White = 'White',
362
- Ivory = 'Ivory',
363
- Dune = 'Dune',
364
- Amber = 'Amber',
365
- Sienna = 'Sienna',
366
- Umber = 'Umber',
367
- Black = 'Black'
368
- }
468
+ type VaultType = 'launch' | 'earn' | 'airdrop';
369
469
 
370
- export type MyPerqData = {
371
- [key: string]: {
372
- vaultAddress: string,
373
- projectName: string,
374
- projectType: string,
375
- projectFeatured: boolean,
376
- liveUntil: string,
377
- coingeckoId?: string,
378
- depositTokenId: 'WETH' | 'USDC' | 'DAI',
379
- type: 'earn' | 'launch' | 'airdrop',
380
- rewardType: 'points' | 'token' | 'pnode shards',
381
- amountOfTokens?: number
382
- vaultName: string,
383
- protocols: string[],
384
- apy: number,
385
- tvr: number,
386
- tokenPrice: number,
387
- change24h: number,
388
- volume24h: number,
389
- rewards: CacheVaultRewards[]
390
- strategies: Strategy[],
391
- boosters: NFTBoost[],
392
- depositToken: DepositToken
393
- avgTvl: string
394
- peakTvl: string
395
- pendingDeposits: number;
396
- currentlyDeposited: number;
397
- pendingWithdraws: number;
398
- claimable: number;
399
- ethPrice: number;
400
- tokenRewards: {[token_address: string]: Asset & { amount: number, rewardsPerHour: number }};
401
- }
470
+ type VestingInfo = {
471
+ startTimestamp: string;
472
+ endTimestamp: string;
473
+ vested: string;
474
+ releasable: string;
475
+ releasableTotal: string;
402
476
  };
477
+
478
+ type YelayVersion = 'v2' | 'lite';
403
479
  ```
404
480
 
405
481
  # Abis
406
482
 
407
- - DRIP_SWAP_AND_RECYCLER_ABI
408
-
409
- - WETH_TOKEN_ABI
410
-
411
- - DRIP_TOKEN_ABI
483
+ - DRIP_SWAP_AND_RECYCLER_ABI
412
484
 
413
- - TOKEN_RECYCLER_ABI
485
+ - WETH_TOKEN_ABI
414
486
 
415
- - PERQ_VESTING_ABI
487
+ - DRIP_TOKEN_ABI
416
488
 
489
+ - TOKEN_RECYCLER_ABI
417
490
 
491
+ - PERQ_VESTING_ABI