@dripfi/drip-sdk 1.3.7 → 1.3.8

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.
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.DripConfig = exports.Chain = exports.PERQ_TOKEN_DECIMALS = exports.NULL_ADDRESS = void 0;
13
4
  const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
@@ -31,6 +22,14 @@ const VESTING_ADDRESS_MAINNET = '0x5e19C155C30bDEB83FCFE20a3b6f6Eda34B746c5';
31
22
  const DRIP_TOKEN_ADDRESS_MAINNET = '0x2a414884a549ef5716bc1a4e648d3dc03f08b2cf';
32
23
  const PROD_BACKEND_ROUTE = 'https://perq.finance';
33
24
  class DripConfig {
25
+ internalConfig;
26
+ dripRoute;
27
+ swapAndDepositContractAddress;
28
+ smartVaultManagerAddress;
29
+ dripTokenAddress;
30
+ dripTokenRecyclerAddress;
31
+ dripSwapAndRecyclerAddress;
32
+ perqVestingAddress;
34
33
  constructor(chain, dripRoute) {
35
34
  switch (chain) {
36
35
  case Chain.MAINNET:
@@ -51,29 +50,25 @@ class DripConfig {
51
50
  break;
52
51
  }
53
52
  }
54
- getSwapAndDepositContractAddress(signer) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- if (!signer) {
57
- throw Error('No signer provided');
58
- }
59
- if (!this.swapAndDepositContractAddress) {
60
- const contract = yield this.internalConfig.getChainAddresses(signer);
61
- this.swapAndDepositContractAddress = contract.IDepositSwap;
62
- }
63
- return this.swapAndDepositContractAddress;
64
- });
53
+ async getSwapAndDepositContractAddress(signer) {
54
+ if (!signer) {
55
+ throw Error('No signer provided');
56
+ }
57
+ if (!this.swapAndDepositContractAddress) {
58
+ const contract = await this.internalConfig.getChainAddresses(signer);
59
+ this.swapAndDepositContractAddress = contract.IDepositSwap;
60
+ }
61
+ return this.swapAndDepositContractAddress;
65
62
  }
66
- getSmartVaultManagerAddress(signer) {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- if (!signer) {
69
- throw Error('No signer provided');
70
- }
71
- if (!this.smartVaultManagerAddress) {
72
- const contract = yield this.internalConfig.getChainAddresses(signer);
73
- this.smartVaultManagerAddress = contract.ISmartVaultManager;
74
- }
75
- return this.smartVaultManagerAddress;
76
- });
63
+ async getSmartVaultManagerAddress(signer) {
64
+ if (!signer) {
65
+ throw Error('No signer provided');
66
+ }
67
+ if (!this.smartVaultManagerAddress) {
68
+ const contract = await this.internalConfig.getChainAddresses(signer);
69
+ this.smartVaultManagerAddress = contract.ISmartVaultManager;
70
+ }
71
+ return this.smartVaultManagerAddress;
77
72
  }
78
73
  }
79
74
  exports.DripConfig = DripConfig;
package/dist/DripSdk.d.ts CHANGED
@@ -39,7 +39,7 @@ export default class DripSdk {
39
39
  getUserBoostedNfts(vaultAddress: string): Promise<string[]>;
40
40
  getRewardsPerHour(vaultAddress: string): Promise<number>;
41
41
  getRewards(): Promise<UserRewards>;
42
- getMyPerqBalance(): Promise<MyPerqData>;
42
+ getMyPerqBalance(): Promise<MyPerqData[]>;
43
43
  getUserVaultBalance(vaultAddress: string): Promise<UserVaultBalance>;
44
44
  fastWithdraw(vaultAddress: string, amountToWithdraw?: string): Promise<string>;
45
45
  swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>;