@dripfi/drip-sdk 1.1.5 → 1.1.6

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/dist/DripApi.d.ts CHANGED
@@ -5,6 +5,7 @@ import { QLFastRedeem } from './types/QLFastRedeem';
5
5
  import { UserRewards } from './types/UserRewards';
6
6
  import { VaultStats } from './types/VaultStats';
7
7
  import { UserBalance } from './types/UserBalance';
8
+ import { VaultClaimData } from './types/VaultClaimData';
8
9
  export declare const IMPERSONATOR_HEADER = "impersonatorAddress";
9
10
  export default class DripApi {
10
11
  route: string;
@@ -28,4 +29,5 @@ export default class DripApi {
28
29
  fetchAssetPerSvtAtBlock(vaultAddress: string, blocknumber: number, token: string): Promise<BigNumber>;
29
30
  fetchFastWithdrawNFTs(vaultAddress: string, walletAddress: string, token: string, headers?: Headers): Promise<QLFastRedeem[]>;
30
31
  fetchUserRewards(walletAddress: string, token: string, headers?: Headers): Promise<UserRewards>;
32
+ fetchVaultsClaimableData(walletAddress: string, token: string, headers?: Headers): Promise<VaultClaimData>;
31
33
  }
package/dist/DripApi.js CHANGED
@@ -252,5 +252,19 @@ class DripApi {
252
252
  return data;
253
253
  });
254
254
  }
255
+ fetchVaultsClaimableData(walletAddress, token, headers) {
256
+ return __awaiter(this, void 0, void 0, function* () {
257
+ const reqHeaders = headers ? headers : new Headers();
258
+ reqHeaders.append(AUTHORIZATION_HEADER, token);
259
+ if (reqHeaders.has(exports.IMPERSONATOR_HEADER)) {
260
+ walletAddress = reqHeaders.get(exports.IMPERSONATOR_HEADER);
261
+ }
262
+ const res = yield fetch(`${this.route}/api-be/api/user/claimableVaults/${walletAddress}`, {
263
+ headers: reqHeaders,
264
+ });
265
+ const data = yield res.json();
266
+ return data;
267
+ });
268
+ }
255
269
  }
256
270
  exports.default = DripApi;
package/dist/DripSdk.d.ts CHANGED
@@ -5,6 +5,7 @@ import { UserRewards } from './types/UserRewards';
5
5
  import { VaultStats } from './types/VaultStats';
6
6
  import { UserBalance } from './types/UserBalance';
7
7
  import { UserVaultBalance } from './types/UserVaultBalance';
8
+ import { VaultClaimData } from './types/VaultClaimData';
8
9
  import { Vault } from './types/Vault';
9
10
  export default class DripSdk {
10
11
  private dripApi;
@@ -30,6 +31,7 @@ export default class DripSdk {
30
31
  swapAndDeposit(fromTokenAddress: string, toTokenAddress: string, fromTokenAmount: string, vaultAddress: string, ethAmount?: string): Promise<string>;
31
32
  withdraw(vaultAddress: string, amountToWithdraw?: string): Promise<string>;
32
33
  claimWithdraws(vaultAddress: string): Promise<string>;
34
+ getVaultsClaimableData(headers?: Headers): Promise<VaultClaimData>;
33
35
  private generateOldRedeemBagStruct;
34
36
  private generateNewRedeemBagStruct;
35
37
  private getAllSvts;
package/dist/DripSdk.js CHANGED
@@ -343,6 +343,18 @@ class DripSdk {
343
343
  return txReceipt.transactionHash;
344
344
  });
345
345
  }
346
+ getVaultsClaimableData(headers) {
347
+ return __awaiter(this, void 0, void 0, function* () {
348
+ const authData = yield this.isUserAuthenticated();
349
+ if (!authData.isAuthenticated) {
350
+ throw Error(`User not authenticated: ${authData.message}`);
351
+ }
352
+ if (!this.signer) {
353
+ throw Error('No signer provided');
354
+ }
355
+ return yield this.dripApi.fetchVaultsClaimableData(authData.address, authData.token, headers);
356
+ });
357
+ }
346
358
  generateOldRedeemBagStruct(token, vault, signerAddress, amountToWithdraw) {
347
359
  return __awaiter(this, void 0, void 0, function* () {
348
360
  const dnfts = yield this.dripApi.fetchEnrichedUserDNFTForVault(vault.vaultAddress, signerAddress, token);
@@ -0,0 +1,6 @@
1
+ export type VaultClaimData = {
2
+ vaultAddress: string;
3
+ asset: string;
4
+ dripping: string;
5
+ claimable: number;
6
+ }[];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",