@dripfi/drip-sdk 1.4.8 → 1.4.9-yelay-lite

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/CHANGELOG.md CHANGED
@@ -102,3 +102,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102
102
  ### Changed
103
103
 
104
104
  - Updated `PerqApi` to use the new 1inch API endpoint
105
+
106
+ ## [1.4.9] - 2025-02-14
107
+
108
+ ### Added
109
+
110
+ - Added method `linkSuiWalletWithEthWallet` to the `PerqSdk`
111
+ - Added method `getLinkedSuiWallet` to the `PerqSdk`
package/dist/PerqApi.d.ts CHANGED
@@ -1,14 +1,17 @@
1
1
  import { BigNumber } from 'ethers';
2
- import { Vault, SwapInfo, QLFastRedeem, UserRewards, VaultStats, MyPerqData, LoyaltyCard, BeansBalance, PerqToBeansSwapInfo, BeanEntry, NonceEnrichedSignedPayload, NonceEnrichedPayload, UpgradeLoyaltyCardPayload } from './types';
2
+ import { SwapInfo, QLFastRedeem, UserRewards, VaultStats, MyPerqData, LoyaltyCard, BeansBalance, PerqToBeansSwapInfo, BeanEntry, NonceEnrichedSignedPayload, NonceEnrichedPayload, UpgradeLoyaltyCardPayload, ReducedProjectData, DetailedProjectData, LinkWalletPayload } from './types';
3
+ import CachedVaultData from './types/VaultData';
3
4
  export default class PerqApi {
4
5
  route: string;
5
6
  constructor(route: string);
6
- fetchAllVaults(): Promise<Vault[]>;
7
+ fetchAllVaults(): Promise<CachedVaultData[]>;
8
+ fetchVaultDetails(vaultAddress: string, yliteProjectId: number): Promise<CachedVaultData>;
9
+ fetchAllProjects(): Promise<ReducedProjectData[]>;
10
+ fetchProjetctDetails(projectName: string): Promise<DetailedProjectData>;
7
11
  fetchTokenPrice(tokenName: string): Promise<number>;
8
12
  getExpectedSwapResult(fromTokenAddress: string, toTokenAddress: string, amount: string, decimals: number): Promise<string>;
9
13
  getUserBoostedNfts(walletAddress: string, vaultAddress: string): Promise<string[]>;
10
14
  fetchVaultStats(): Promise<VaultStats>;
11
- fetchVaultDetails(vaultAddress: string): Promise<Vault>;
12
15
  fetchRewardsPerHour(walletAddress: string, vaultAddress: string): Promise<number>;
13
16
  getSwapInfo(fromTokenAddress: string, toTokenAddress: string, amount: BigNumber, fromAddress: string): Promise<SwapInfo[]>;
14
17
  fetchUserSVTBalance(vaultAddress: string, walletAddress: string): Promise<BigNumber>;
@@ -26,6 +29,8 @@ export default class PerqApi {
26
29
  fetchMyPerqData(userAddress: string): Promise<MyPerqData[]>;
27
30
  getSwapPerqForBeansInfo(): Promise<PerqToBeansSwapInfo>;
28
31
  fetchBeansHistory(walletAddress: string): Promise<BeanEntry[]>;
32
+ linkSuiWalletWithEthWallet(signedPayload: NonceEnrichedSignedPayload<LinkWalletPayload>): Promise<boolean>;
33
+ getLinkedSuiWallet(walletAddress: string): Promise<string>;
29
34
  getNonceEnrichedPayload<T>(payload: T): Promise<NonceEnrichedPayload<T>>;
30
35
  fetchUserVaultDeposits(userAddress: string, vaultAddress: string): Promise<{
31
36
  pending: number;
package/dist/PerqApi.js CHANGED
@@ -9,7 +9,7 @@ class PerqApi {
9
9
  this.route = route;
10
10
  }
11
11
  async fetchAllVaults() {
12
- const res = await fetch(`${this.route}/api-be/api/vault`);
12
+ const res = await fetch(`${this.route}/api-be/api/vault/yelay-lite`);
13
13
  if (res.ok) {
14
14
  const data = (await res.json());
15
15
  return data;
@@ -18,6 +18,36 @@ class PerqApi {
18
18
  throw Error(`${await res.text()}`);
19
19
  }
20
20
  }
21
+ async fetchVaultDetails(vaultAddress, yliteProjectId) {
22
+ const res = await fetch(`${this.route}/api-be/api/vault/yelay-lite/${vaultAddress}/${yliteProjectId}`);
23
+ if (res.ok) {
24
+ const data = (await res.json());
25
+ return data;
26
+ }
27
+ else {
28
+ throw Error(`${await res.text()}`);
29
+ }
30
+ }
31
+ async fetchAllProjects() {
32
+ const res = await fetch(`${this.route}/api-be/api/projects`);
33
+ if (res.ok) {
34
+ const data = await res.json();
35
+ return data;
36
+ }
37
+ else {
38
+ throw Error(`${await res.text()}`);
39
+ }
40
+ }
41
+ async fetchProjetctDetails(projectName) {
42
+ const res = await fetch(`${this.route}/api-be/api/projects/${projectName}`);
43
+ if (res.ok) {
44
+ const data = await res.json();
45
+ return data;
46
+ }
47
+ else {
48
+ throw Error(`${await res.text()}`);
49
+ }
50
+ }
21
51
  async fetchTokenPrice(tokenName) {
22
52
  const res = await fetch(`${this.route}/api-be/api/tokenPrice?tokenName=${tokenName}`);
23
53
  if (res.ok) {
@@ -64,16 +94,6 @@ class PerqApi {
64
94
  throw Error(`${await res.text()}`);
65
95
  }
66
96
  }
67
- async fetchVaultDetails(vaultAddress) {
68
- const res = await fetch(`${this.route}/api-be/api/vault/${vaultAddress}`);
69
- if (res.ok) {
70
- const data = (await res.json());
71
- return data;
72
- }
73
- else {
74
- throw Error(`${await res.text()}`);
75
- }
76
- }
77
97
  async fetchRewardsPerHour(walletAddress, vaultAddress) {
78
98
  const res = await fetch(`${this.route}/api-be/api/user/${walletAddress}/rewardsPerHour/${vaultAddress}`);
79
99
  if (res.ok) {
@@ -301,6 +321,31 @@ class PerqApi {
301
321
  throw Error(`${await res.text()}`);
302
322
  }
303
323
  }
324
+ async linkSuiWalletWithEthWallet(signedPayload) {
325
+ const res = await fetch(`${this.route}/api-be/api/user/suiWallet`, {
326
+ method: 'POST',
327
+ headers: {
328
+ 'Content-Type': 'application/json',
329
+ },
330
+ body: JSON.stringify(signedPayload),
331
+ });
332
+ if (res.ok) {
333
+ return true;
334
+ }
335
+ else {
336
+ throw Error(`${await res.text()}`);
337
+ }
338
+ }
339
+ async getLinkedSuiWallet(walletAddress) {
340
+ const res = await fetch(`${this.route}/api-be/api/user/suiWallet/${walletAddress}`);
341
+ if (res.ok) {
342
+ const data = await res.json();
343
+ return data.suiWalletAddr;
344
+ }
345
+ else {
346
+ throw Error(`${await res.text()}`);
347
+ }
348
+ }
304
349
  async getNonceEnrichedPayload(payload) {
305
350
  const res = await fetch(`${this.route}/api-be/api/nonce`, {
306
351
  method: 'POST',
package/dist/PerqSdk.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { BigNumber, Signer } from 'ethers';
2
- import { Vault, UserRewards, VaultStats, UserVaultBalance, LoyaltyCard, NonceEnrichedSignedPayload, MyPerqData, BeansBalance, BeanEntry, PerqToBeansSwapInfo, VestingInfo } from './types';
3
- import { PerqConfig } from './types/index';
1
+ import { BigNumber, Signer, ethers } from 'ethers';
2
+ import { UserRewards, VaultStats, UserVaultBalance, LoyaltyCard, NonceEnrichedSignedPayload, MyPerqData, BeansBalance, BeanEntry, PerqToBeansSwapInfo, VestingInfo, PerqConfig, ReducedProjectData } from './types';
3
+ import DetailedProjectData from './types/DetailedProjectData';
4
+ import VaultData from './types/VaultData';
4
5
  export default class PerqSdk {
5
6
  private perqApi;
6
7
  private perqConfig;
@@ -10,12 +11,16 @@ export default class PerqSdk {
10
11
  private perqVestingContract;
11
12
  private spoolSdk?;
12
13
  private signer?;
13
- constructor(perqConfig: PerqConfig, signer?: Signer);
14
- getAllVaults(): Promise<Vault[]>;
15
- getVaultDetails(vaultAddress: string): Promise<Vault>;
14
+ private yelayLiteSdk?;
15
+ constructor(perqConfig: PerqConfig, provider?: ethers.providers.JsonRpcProvider);
16
+ getAllProjects(): Promise<ReducedProjectData[]>;
17
+ getProjectDetails(projectName: string): Promise<DetailedProjectData>;
18
+ getAllVaults(): Promise<VaultData[]>;
19
+ getVaultDetails(vaultAddress: string, yliteProjectId?: number): Promise<VaultData>;
16
20
  getVaultStats(): Promise<VaultStats>;
17
21
  getTokenPrice(tokenName: string): Promise<number>;
18
22
  updateSigner(newSigner: Signer): Promise<void>;
23
+ yelayLiteDeposit(tokenAddress: string, vaultAddress: string, yliteProjectId: number, amount: string): Promise<string>;
19
24
  newDeposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>;
20
25
  deposit(tokenAddress: string, vaultAddress: string, amount: string): Promise<string>;
21
26
  private doDeposit;
@@ -28,12 +33,14 @@ export default class PerqSdk {
28
33
  getRewardsPerHour(vaultAddress: string): Promise<number>;
29
34
  getRewards(): Promise<UserRewards>;
30
35
  getMyPerqBalance(): Promise<MyPerqData[]>;
36
+ getYelayLiteUserVaultBalance(vaultAddress: string, yliteProjectId: number): Promise<BigNumber>;
31
37
  getUserVaultBalance(vaultAddress: string): Promise<UserVaultBalance>;
32
38
  fastWithdraw(vaultAddress: string, amountToWithdraw?: string): Promise<string>;
33
39
  swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>;
34
40
  newSwapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>;
35
41
  private doSwapAndDeposit;
36
42
  withdraw(vaultAddress: string, amountToWithdraw?: string): Promise<string>;
43
+ yelayLiteWithdraw(tokenAddress: string, vaultAddress: string, yliteProjectId: number, amount: string): Promise<string>;
37
44
  claimWithdraws(vaultAddress: string): Promise<string>;
38
45
  getBeansBalance(): Promise<BeansBalance>;
39
46
  getBeansHistory(): Promise<BeanEntry[]>;
@@ -49,6 +56,8 @@ export default class PerqSdk {
49
56
  approveTokenForDeposit(tokenAddress: string, amount: string): Promise<string>;
50
57
  getPerqTokenContractAddress(): string;
51
58
  getSwapPerqForBeansInfo(): Promise<PerqToBeansSwapInfo>;
59
+ getAllowance(tokenAddress: string, spender: string): Promise<BigNumber>;
60
+ approveAllowance(tokenAddress: string, amount: string, spenderAddress: string): Promise<string>;
52
61
  transferErc20Token(tokenAddress: string, amount: string, receiver: string): Promise<string>;
53
62
  wrapEther(amount: string, tokenAddress: string): Promise<string>;
54
63
  getVestingStart(): Promise<string>;
@@ -59,12 +68,15 @@ export default class PerqSdk {
59
68
  getAllVestingInfo(beneficiaryAddress: string): Promise<VestingInfo>;
60
69
  claimVestedPerq(amount: string): Promise<string>;
61
70
  burnVestedPerq(amount: string, price: string, deadline: string, signature: string): Promise<string>;
71
+ linkSuiWalletWithEthWallet(suiWalletAddress: string): Promise<boolean>;
72
+ getLinkedSuiWallet(): Promise<string>;
62
73
  signPayload<T>(payload: T): Promise<NonceEnrichedSignedPayload<T>>;
63
74
  private getEnrichedPayload;
64
75
  private generateRedeemBagStruct;
65
76
  private getERC20Precission;
66
77
  private getTokenAllowanceForDeposit;
67
78
  private getTokenAllowanceForSwapAndDeposit;
68
- private getERC20TokenAllowance;
69
- private approveToken;
79
+ getERC20TokenAllowance(spender: string, tokenAddress: string): Promise<BigNumber>;
80
+ approveToken(tokenAddress: string, amount: string, spender: string): Promise<string>;
81
+ yelayLiteWrapAndDepositEth(vaultAddress: string, yliteProjectId: number, amount: string): Promise<any>;
70
82
  }
package/dist/PerqSdk.js CHANGED
@@ -9,6 +9,8 @@ const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
9
9
  const PerqApi_1 = __importDefault(require("./PerqApi"));
10
10
  const contracts_1 = require("./contracts");
11
11
  const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json"));
12
+ const sdk_1 = require("@yelay-lite/sdk");
13
+ const WETH_DECIMAL_PRECISION = 18;
12
14
  class PerqSdk {
13
15
  perqApi;
14
16
  perqConfig;
@@ -18,23 +20,35 @@ class PerqSdk {
18
20
  perqVestingContract;
19
21
  spoolSdk;
20
22
  signer;
21
- constructor(perqConfig, signer) {
22
- this.signer = signer;
23
- if (this.signer) {
24
- this.spoolSdk = new spool_v2_sdk_1.SpoolSdk(perqConfig.spoolSdkConfig, this.signer);
23
+ yelayLiteSdk;
24
+ constructor(perqConfig, provider) {
25
+ const newSigner = provider?.getSigner();
26
+ if (provider && newSigner) {
27
+ this.signer = newSigner;
28
+ this.yelayLiteSdk = new sdk_1.YelayLiteSdk({
29
+ backendUrl: perqConfig.yelayLiteBackendUrl,
30
+ provider: provider,
31
+ });
32
+ this.spoolSdk = new spool_v2_sdk_1.SpoolSdk(perqConfig.spoolSdkConfig, newSigner);
25
33
  }
26
34
  this.perqConfig = perqConfig;
27
35
  this.perqApi = new PerqApi_1.default(perqConfig.route);
28
- this.perqTokenContract = new contracts_1.PerqTokenContract(perqConfig.perqTokenAddress, signer);
29
- this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(perqConfig.perqTokenRecyclerAddress, signer);
30
- this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(perqConfig.perqSwapAndRecyclerAddress, signer);
31
- this.perqVestingContract = new contracts_1.PerqVestingContract(perqConfig.perqVestingAddress, signer);
36
+ this.perqTokenContract = new contracts_1.PerqTokenContract(perqConfig.perqTokenAddress, newSigner);
37
+ this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(perqConfig.perqTokenRecyclerAddress, newSigner);
38
+ this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(perqConfig.perqSwapAndRecyclerAddress, newSigner);
39
+ this.perqVestingContract = new contracts_1.PerqVestingContract(perqConfig.perqVestingAddress, newSigner);
40
+ }
41
+ async getAllProjects() {
42
+ return this.perqApi.fetchAllProjects();
43
+ }
44
+ async getProjectDetails(projectName) {
45
+ return this.perqApi.fetchProjetctDetails(projectName);
32
46
  }
33
47
  async getAllVaults() {
34
48
  return this.perqApi.fetchAllVaults();
35
49
  }
36
- async getVaultDetails(vaultAddress) {
37
- return this.perqApi.fetchVaultDetails(vaultAddress);
50
+ async getVaultDetails(vaultAddress, yliteProjectId) {
51
+ return this.perqApi.fetchVaultDetails(vaultAddress, yliteProjectId ?? -1);
38
52
  }
39
53
  async getVaultStats() {
40
54
  return this.perqApi.fetchVaultStats();
@@ -50,6 +64,18 @@ class PerqSdk {
50
64
  this.perqSwapAndRecyclerContract.updateSigner(newSigner);
51
65
  this.perqVestingContract.updateSigner(newSigner);
52
66
  }
67
+ async yelayLiteDeposit(tokenAddress, vaultAddress, yliteProjectId, amount) {
68
+ if (!this.signer) {
69
+ throw Error('No signer provided');
70
+ }
71
+ const decimals = await this.getERC20Precission(tokenAddress);
72
+ const parsedAmountToDeposit = ethers_1.ethers.utils.parseUnits(amount, decimals);
73
+ const res = await this.yelayLiteSdk.deposit(this.signer, vaultAddress, yliteProjectId, BigInt(parsedAmountToDeposit.toString()));
74
+ if (!res.success || !res.hash) {
75
+ throw Error(`Error depositing ${amount} into vault ${vaultAddress} and yliteProjectId: ${yliteProjectId}`);
76
+ }
77
+ return res.hash;
78
+ }
53
79
  async newDeposit(tokenAddress, vaultAddress, amount) {
54
80
  return this.doDeposit(tokenAddress, vaultAddress, amount, false);
55
81
  }
@@ -133,6 +159,14 @@ class PerqSdk {
133
159
  const myPerqBalance = this.perqApi.fetchMyPerqData(userAddress);
134
160
  return myPerqBalance;
135
161
  }
162
+ async getYelayLiteUserVaultBalance(vaultAddress, yliteProjectId) {
163
+ if (!this.signer) {
164
+ throw Error('No signer provided');
165
+ }
166
+ const userAddress = await this.signer.getAddress();
167
+ const balance = await this.yelayLiteSdk.balanceOf(vaultAddress, yliteProjectId, userAddress);
168
+ return balance;
169
+ }
136
170
  async getUserVaultBalance(vaultAddress) {
137
171
  if (!this.signer) {
138
172
  throw Error('No signer provided');
@@ -240,6 +274,18 @@ class PerqSdk {
240
274
  const redeemTxReceipt = await redeemTx.wait();
241
275
  return redeemTxReceipt.transactionHash;
242
276
  }
277
+ async yelayLiteWithdraw(tokenAddress, vaultAddress, yliteProjectId, amount) {
278
+ if (!this.signer) {
279
+ throw Error('No signer provided');
280
+ }
281
+ const decimals = await this.getERC20Precission(tokenAddress);
282
+ const parsedAmountToWithdraw = ethers_1.ethers.utils.parseUnits(amount, decimals);
283
+ const res = await this.yelayLiteSdk.redeem(this.signer, vaultAddress, yliteProjectId, BigInt(parsedAmountToWithdraw.toString()));
284
+ if (!res.success || !res.hash) {
285
+ throw Error('Error withdrawing from vault');
286
+ }
287
+ return res.hash;
288
+ }
243
289
  async claimWithdraws(vaultAddress) {
244
290
  const userAddress = await this.signer.getAddress();
245
291
  if (!this.signer) {
@@ -335,6 +381,15 @@ class PerqSdk {
335
381
  async getSwapPerqForBeansInfo() {
336
382
  return this.perqApi.getSwapPerqForBeansInfo();
337
383
  }
384
+ async getAllowance(tokenAddress, spender) {
385
+ const allowance = await this.getERC20TokenAllowance(spender, tokenAddress);
386
+ return allowance;
387
+ }
388
+ async approveAllowance(tokenAddress, amount, spenderAddress) {
389
+ const decimals = await this.getERC20Precission(tokenAddress);
390
+ const amountWithDecimals = parseFloat(parseFloat(amount).toFixed(decimals));
391
+ return await this.approveToken(tokenAddress, amountWithDecimals.toString(), spenderAddress);
392
+ }
338
393
  async transferErc20Token(tokenAddress, amount, receiver) {
339
394
  if (!this.signer) {
340
395
  throw Error('No signer provided');
@@ -458,6 +513,20 @@ class PerqSdk {
458
513
  throw new Error('Failed to get total releasable amount: Unknown error');
459
514
  }
460
515
  }
516
+ async linkSuiWalletWithEthWallet(suiWalletAddress) {
517
+ const payload = {
518
+ suiWalletAddr: suiWalletAddress,
519
+ };
520
+ const signedPayload = await this.signPayload(payload);
521
+ return this.perqApi.linkSuiWalletWithEthWallet(signedPayload);
522
+ }
523
+ async getLinkedSuiWallet() {
524
+ if (!this.signer) {
525
+ throw new Error('No signer provided');
526
+ }
527
+ const walletAddr = await this.signer.getAddress();
528
+ return this.perqApi.getLinkedSuiWallet(walletAddr);
529
+ }
461
530
  async signPayload(payload) {
462
531
  if (!this.signer) {
463
532
  throw new Error('No signer provided');
@@ -534,5 +603,15 @@ class PerqSdk {
534
603
  const receipt = await approveTx.wait();
535
604
  return receipt.transactionHash;
536
605
  }
606
+ async yelayLiteWrapAndDepositEth(vaultAddress, yliteProjectId, amount) {
607
+ if (!this.signer) {
608
+ throw Error('No signer provided');
609
+ }
610
+ const parsedAmount = ethers_1.ethers.utils.parseUnits(amount, WETH_DECIMAL_PRECISION);
611
+ const res = await this.yelayLiteSdk.depositEth(this.signer, vaultAddress, yliteProjectId, BigInt(parsedAmount.toString()));
612
+ if (!res.success || res.hash === undefined) {
613
+ throw Error(`Error wrapping and depositing ether to vault ${vaultAddress}`);
614
+ }
615
+ }
537
616
  }
538
617
  exports.default = PerqSdk;
@@ -39,6 +39,8 @@ type DeployedProject = {
39
39
  bannerImage?: string;
40
40
  rewardImage?: string;
41
41
  rewardTooltipName?: string;
42
+ liveUntil: string;
43
+ liveFrom: string;
42
44
  };
43
45
  export default DeployedProject;
44
46
  export type ProjectBacker = {
@@ -0,0 +1,33 @@
1
+ import { ProjectBacker } from './DeployedProject';
2
+ import { ReducedProjectData } from './ReducedProjectData';
3
+ import StretchGoal from './StretchGoal';
4
+ import VaultData from './VaultData';
5
+ type DetailedProjectData = ReducedProjectData & {
6
+ content: string;
7
+ telegramLink: string;
8
+ twitterLink: string;
9
+ mediumLink: string;
10
+ deckLink: string;
11
+ roadmapLink: string;
12
+ economicsLink: string;
13
+ discordLink: string;
14
+ docsLink: string;
15
+ whitepaperLink: string;
16
+ litepaperLink: string;
17
+ websiteLink: string;
18
+ networks: string[];
19
+ supplyAtLaunch: number;
20
+ fdv: number;
21
+ totalSupply: number;
22
+ projectType: string;
23
+ yelayVersion: string;
24
+ wikiLink: string;
25
+ youTubeLink: string;
26
+ tikTokLink: string;
27
+ stretchGoals: StretchGoal[];
28
+ projectRewardText: string;
29
+ backers: ProjectBacker[];
30
+ protocols: string[];
31
+ vaults: VaultData[];
32
+ };
33
+ export default DetailedProjectData;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ type LinkWalletPayload = {
2
+ suiWalletAddr: string;
3
+ };
4
+ export default LinkWalletPayload;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +1,10 @@
1
- import { Asset, Vault } from './index';
2
- type MyPerqData = Vault & {
3
- claimable: number;
1
+ import VaultData from './VaultData';
2
+ import { Asset } from './index';
3
+ type MyPerqBalance = {
4
4
  pendingDeposits: number;
5
- pendingWithdraws: number;
6
5
  currentlyDeposited: number;
7
- ethPrice: number;
8
- btcPrice: number;
6
+ pendingWithdraws: number;
7
+ claimable: number;
9
8
  tokenRewards: {
10
9
  [token_address: string]: Asset & {
11
10
  amount: number;
@@ -13,4 +12,9 @@ type MyPerqData = Vault & {
13
12
  };
14
13
  };
15
14
  };
15
+ type MyPerqData = VaultData & MyPerqBalance & {
16
+ ethPrice: number;
17
+ btcPrice: number;
18
+ combinedTvl: number;
19
+ };
16
20
  export default MyPerqData;
@@ -9,6 +9,7 @@ type PerqConfig = {
9
9
  swapAndDepositContractAddress: string;
10
10
  swapperAddress: string;
11
11
  smartVaultManagerContractAddress: string;
12
+ yelayLiteBackendUrl: string;
12
13
  };
13
14
  export default PerqConfig;
14
15
  export declare const PRODUCTION: PerqConfig;
@@ -12,6 +12,7 @@ exports.PRODUCTION = {
12
12
  swapAndDepositContractAddress: '0xd8534197bd587f8226d12e0c864ef2cae6f82f5c',
13
13
  swapperAddress: '0x33e52c206d584550193e642c8982f2fff6339994',
14
14
  smartVaultManagerContractAddress: '0x23daf34e2b9af02a74dc19cb52af727b19403874',
15
+ yelayLiteBackendUrl: '',
15
16
  };
16
17
  exports.DEVELOPMENT = {
17
18
  route: 'https://dev.perq.finance',
@@ -23,4 +24,5 @@ exports.DEVELOPMENT = {
23
24
  swapAndDepositContractAddress: '0x5fb08e00de169f041711206a0995410884080177',
24
25
  swapperAddress: '0xE411921ee9EeDfEFd7b9Ae15bF232bd36949Fcbc',
25
26
  smartVaultManagerContractAddress: '0x2638d6c0b4ef6dee04050fa0b07ca62500435747',
27
+ yelayLiteBackendUrl: 'https://lite.dev.yelay.io',
26
28
  };
@@ -0,0 +1,20 @@
1
+ import DepositToken from './DepositToken';
2
+ import VaultType from './VaultType';
3
+ export type ReducedProjectData = {
4
+ projectName: string;
5
+ logo: string;
6
+ bannerImage: string;
7
+ rewardImage: string;
8
+ rewardTooltipName: string;
9
+ projectInfoText: string;
10
+ projectType: string;
11
+ poolType: VaultType;
12
+ liveUntil: string;
13
+ liveFrom: string;
14
+ tvlUsd: number;
15
+ tvl: number;
16
+ vAPY: number;
17
+ peakTVL: number;
18
+ isFeatured: boolean;
19
+ currencies: DepositToken[];
20
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ import DepositToken from './DepositToken';
2
+ import Strategy from './Strategy';
3
+ import StretchGoal from './StretchGoal';
4
+ import VaultRewardData from './VaultRewardData';
5
+ import VaultType from './VaultType';
6
+ type VaultData = {
7
+ depositToken: DepositToken;
8
+ vaultAddress: string;
9
+ tvlUsd: number;
10
+ avgTvl: number;
11
+ tokenPrice: number;
12
+ change24h: number;
13
+ volume24h: number;
14
+ peakTvl: number;
15
+ onChainProjectId: number;
16
+ isActive: boolean;
17
+ rewards: VaultRewardData[];
18
+ projectName: string;
19
+ projectLogo: string;
20
+ projectType: string;
21
+ poolType: VaultType;
22
+ strategies: Strategy[];
23
+ liveFrom: string;
24
+ liveUntil: string;
25
+ isYelayLiteVault: boolean;
26
+ yelayLiteProjectId: number;
27
+ stretchGoals: StretchGoal[];
28
+ };
29
+ export default VaultData;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ type VaultRewardData = {
2
+ type: 'token' | 'points';
3
+ name: string;
4
+ symbol: string;
5
+ decimals: number;
6
+ tokenAddress: string;
7
+ id?: number;
8
+ };
9
+ export default VaultRewardData;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ type YelayLiteVault = {
2
+ id: number;
3
+ depositTokenAddress: string;
4
+ depositTokenSymbol: string;
5
+ decimals: number;
6
+ projectName: string;
7
+ projectLogo: string;
8
+ address: string;
9
+ apy: string;
10
+ };
11
+ export default YelayLiteVault;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,12 @@
1
1
  import Asset from './Asset';
2
2
  import BeanEntry from './BeanEntry';
3
3
  import BeansBalance from './BeansBalance';
4
+ import DetailedProjectData from './DetailedProjectData';
4
5
  import DeployedProject, { ProjectBacker } from './DeployedProject';
5
6
  import DeployedVault from './DeployedVault';
6
7
  import DepositToken from './DepositToken';
7
8
  import ELoyaltyCardTier from './ELoyaltyCardTier';
9
+ import LinkWalletPayload from './LinkWalletPayload';
8
10
  import LoyaltyCard from './LoyaltyCard';
9
11
  import MyPerqData from './MyPerqData';
10
12
  import NFTBoost from './NFTBoost';
@@ -12,6 +14,7 @@ import PerqConfig from './PerqConfig';
12
14
  import PerqToBeansSwapInfo from './PerqToBeansSwapInfo';
13
15
  import QLFastRedeem from './QLFastRedeem';
14
16
  import { BasePayload, NonceEnrichedPayload, NonceEnrichedSignedPayload } from './SignedPayload';
17
+ import { ReducedProjectData } from './ReducedProjectData';
15
18
  import Strategy from './Strategy';
16
19
  import StretchGoal from './StretchGoal';
17
20
  import SwapInfo from './SwapInfo';
@@ -19,9 +22,11 @@ import UpgradeLoyaltyCardPayload from './UpgradeLoyaltyCardPayload';
19
22
  import UserRewards from './UserRewards';
20
23
  import UserVaultBalance from './UserVaultBalance';
21
24
  import Vault from './Vault';
25
+ import VaultData from './VaultData';
22
26
  import VaultReward, { RewardType } from './VaultReward';
23
27
  import VaultStats from './VaultStats';
24
28
  import VaultType from './VaultType';
25
29
  import VestingInfo from './VestingInfo';
26
30
  import YelayVersion from './YelayVersion';
27
- export { Asset, BasePayload, BeanEntry, BeansBalance, DeployedProject, DeployedVault, DepositToken, ELoyaltyCardTier, LoyaltyCard, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqConfig, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, RewardType, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, UserVaultBalance, Vault, VaultReward, VaultStats, VaultType, VestingInfo, YelayVersion, };
31
+ import YelayLiteVault from './YelayLiteVault';
32
+ export { Asset, BasePayload, BeanEntry, BeansBalance, DeployedProject, DeployedVault, DepositToken, DetailedProjectData, ELoyaltyCardTier, LinkWalletPayload, LoyaltyCard, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqConfig, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, ReducedProjectData, RewardType, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, UserVaultBalance, Vault, VaultData, VaultReward, VaultStats, VaultType, VestingInfo, YelayVersion, YelayLiteVault, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.4.8",
3
+ "version": "1.4.9-yelay-lite",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,8 @@
13
13
  "pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
14
14
  },
15
15
  "dependencies": {
16
+ "@yelay-lite/sdk": "0.0.15",
16
17
  "@spool.fi/spool-v2-sdk": "2.0.53",
17
- "@yelay-lite/sdk": "0.0.11",
18
18
  "ethers": "^5.7.2"
19
19
  },
20
20
  "author": "",