@dripfi/drip-sdk 1.4.26 → 1.4.28-bridge-perq

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
@@ -120,6 +120,7 @@ Access pools methods through `sdk.pools`:
120
120
  | `getAllProjects(): Promise<ReducedProjectData[]>` | Fetches all available projects. |
121
121
  | `getProjectDetails(projectName: string): Promise<DetailedProjectData>` | Fetches the details of a specific project. |
122
122
  | `getPoolStats(): Promise<VaultStats>` | Fetches the statistics of a pool. |
123
+ | `getOverallStats(): Promise<OverallStats>` | Fetches different stats |
123
124
  | `getRewardsPerHour(vaultAddress: string): Promise<number>` | Calculates the rewards per hour for a specific pool. |
124
125
  | `getUserBoostedNfts(vaultAddress: string): Promise<string[]>` | Fetches the user's boosted NFTs for a specific pool. |
125
126
  | `getRewards(): Promise<UserRewards>` | Fetches the user's rewards. |
@@ -433,15 +434,15 @@ type NonceEnrichedSignedPayload<T> = {
433
434
 
434
435
  type PerqConfig = {
435
436
  route: string;
436
- yelayLiteSdkConfig: sdkConfig;
437
437
  perqTokenAddress: string;
438
438
  perqTokenRecyclerAddress: string;
439
439
  perqSwapAndRecyclerAddress: string;
440
440
  perqVestingAddress: string;
441
441
  swapAndDepositContractAddress: string;
442
- smartVaultManagerContractAddress: string;
443
442
  ethereumSwapperAddress: string;
444
- baseSwapperAddress: string;
443
+ smartVaultManagerContractAddress: string,
444
+ bridgeMainnetPerqToSonicAddress: string;
445
+ bridgeSonicPerqToMainnetAddress: string;
445
446
  };
446
447
 
447
448
  type PerqToBeansSwapInfo = {
@@ -683,16 +684,22 @@ type Earnings = {
683
684
  earningPerHour: string;
684
685
  };
685
686
  };
687
+
688
+ type OverallStats = {
689
+ activeProjects: number;
690
+ totalTvl: number;
691
+ totalYieldUsd: number;
692
+ totalUsers: number;
693
+ };
694
+
686
695
  ```
687
696
 
688
697
  ## Abis
689
698
 
690
699
  - PERQ_SWAP_AND_RECYCLER_ABI
691
-
692
700
  - WETH_TOKEN_ABI
693
-
694
701
  - PERQ_TOKEN_ABI
695
-
696
702
  - TOKEN_RECYCLER_ABI
697
-
698
703
  - PERQ_VESTING_ABI
704
+ - BRIDGE_SONIC_PERQ_TO_MAINNET_ABI
705
+ - BRIDGE_MAINNET_PERQ_TO_SONIC_ABI
package/dist/PerqApi.d.ts CHANGED
@@ -5,6 +5,7 @@ import PerqSdk from './PerqSdk';
5
5
  import MigrationOption from './types/MigrationOption';
6
6
  import ProjectHistoricalTvl from './types/ProjectHistoricalTvl';
7
7
  import ClaimSpecialEditionLoyaltyCardPayload from './types/ClaimSpecialEditionLoyaltyCardPayload';
8
+ import OverallStats from './types/OverallStats';
8
9
  export default class PerqApi {
9
10
  private perqSdk;
10
11
  constructor(perqSdk: PerqSdk);
@@ -17,6 +18,7 @@ export default class PerqApi {
17
18
  getExpectedSwapResult(fromTokenAddress: string, toTokenAddress: string, amount: string, decimals: number, chainId: string): Promise<string>;
18
19
  getUserBoostedNfts(walletAddress: string, vaultAddress: string): Promise<string[]>;
19
20
  fetchPoolStats(): Promise<VaultStats>;
21
+ fetchOverallStats(): Promise<OverallStats>;
20
22
  fetchRewardsPerHour(walletAddress: string, vaultAddress: string): Promise<number>;
21
23
  getSwapInfo(fromTokenAddress: string, toTokenAddress: string, amount: BigNumber, fromAddress: string, chainId: number): Promise<SwapInfo[]>;
22
24
  fetchEnrichedUserWNFTForPool(vaultAddress: string, walletAddress: string): Promise<any[]>;
package/dist/PerqApi.js CHANGED
@@ -105,6 +105,16 @@ class PerqApi {
105
105
  throw Error(`${await res.text()}`);
106
106
  }
107
107
  }
108
+ async fetchOverallStats() {
109
+ const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/overallStats`);
110
+ if (res.ok) {
111
+ const data = await res.json();
112
+ return data;
113
+ }
114
+ else {
115
+ throw Error(`${await res.text()}`);
116
+ }
117
+ }
108
118
  async fetchRewardsPerHour(walletAddress, vaultAddress) {
109
119
  const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/user/${walletAddress}/rewardsPerHour/${vaultAddress}`);
110
120
  if (res.ok) {
package/dist/PerqSdk.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { Signer, ethers } from 'ethers';
2
2
  import { PerqConfig } from './types';
3
3
  import PerqApi from './PerqApi';
4
- import { PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqVestingContract } from './contracts';
4
+ import { PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqVestingContract, BridgeMainnetPerqToSonicContract, BridgeSonicPerqToMainnetContract, PerqTokenContract } from './contracts';
5
5
  import VestingPackage from './subpackages/VestingPackage';
6
+ import BridgePerqPackage from './subpackages/BridgePerqPackage';
6
7
  import LitePackage from './subpackages/LitePackage';
7
8
  import RecyclerPackage from './subpackages/RecyclerPackage';
8
9
  import LoyaltyCardsPackage from './subpackages/LoyaltyCardsPackage';
@@ -17,6 +18,7 @@ export default class PerqSdk {
17
18
  signer?: Signer;
18
19
  lite: LitePackage;
19
20
  vesting: VestingPackage;
21
+ bridge: BridgePerqPackage;
20
22
  recycler: RecyclerPackage;
21
23
  loyaltyCards: LoyaltyCardsPackage;
22
24
  tokenUtils: TokenUtilsPackage;
@@ -28,6 +30,9 @@ export default class PerqSdk {
28
30
  perqVestingContract: PerqVestingContract;
29
31
  perqTokenRecyclerContract: PerqTokenRecyclerContract;
30
32
  perqSwapAndRecyclerContract: PerqSwapAndRecyclerContract;
33
+ bridgeMainnetPerqToSonicContract: BridgeMainnetPerqToSonicContract;
34
+ bridgeSonicPerqToMainnetContract: BridgeSonicPerqToMainnetContract;
35
+ perqTokenContract: PerqTokenContract;
31
36
  constructor(perqConfig: PerqConfig, chainId: PerqSupportedChainId, provider?: ethers.providers.JsonRpcProvider);
32
37
  updateSigner(newSigner: Signer, chainId: PerqSupportedChainId): Promise<void>;
33
38
  }
package/dist/PerqSdk.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const PerqApi_1 = __importDefault(require("./PerqApi"));
7
7
  const contracts_1 = require("./contracts");
8
8
  const VestingPackage_1 = __importDefault(require("./subpackages/VestingPackage"));
9
+ const BridgePerqPackage_1 = __importDefault(require("./subpackages/BridgePerqPackage"));
9
10
  const LitePackage_1 = __importDefault(require("./subpackages/LitePackage"));
10
11
  const RecyclerPackage_1 = __importDefault(require("./subpackages/RecyclerPackage"));
11
12
  const LoyaltyCardsPackage_1 = __importDefault(require("./subpackages/LoyaltyCardsPackage"));
@@ -19,6 +20,7 @@ class PerqSdk {
19
20
  signer;
20
21
  lite;
21
22
  vesting;
23
+ bridge;
22
24
  recycler;
23
25
  loyaltyCards;
24
26
  tokenUtils;
@@ -30,6 +32,9 @@ class PerqSdk {
30
32
  perqVestingContract;
31
33
  perqTokenRecyclerContract;
32
34
  perqSwapAndRecyclerContract;
35
+ bridgeMainnetPerqToSonicContract;
36
+ bridgeSonicPerqToMainnetContract;
37
+ perqTokenContract;
33
38
  constructor(perqConfig, chainId, provider) {
34
39
  this.perqConfig = perqConfig;
35
40
  const newSigner = provider?.getSigner();
@@ -38,6 +43,7 @@ class PerqSdk {
38
43
  this.yelayLiteSdk = new sdk_1.YelayLiteSdk(this.signer, chainId, false);
39
44
  }
40
45
  this.vesting = new VestingPackage_1.default(this);
46
+ this.bridge = new BridgePerqPackage_1.default(this);
41
47
  this.lite = new LitePackage_1.default(this);
42
48
  this.recycler = new RecyclerPackage_1.default(this);
43
49
  this.loyaltyCards = new LoyaltyCardsPackage_1.default(this);
@@ -49,6 +55,9 @@ class PerqSdk {
49
55
  this.perqVestingContract = new contracts_1.PerqVestingContract(this);
50
56
  this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(this);
51
57
  this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(this);
58
+ this.bridgeMainnetPerqToSonicContract = new contracts_1.BridgeMainnetPerqToSonicContract(this);
59
+ this.bridgeSonicPerqToMainnetContract = new contracts_1.BridgeSonicPerqToMainnetContract(this);
60
+ this.perqTokenContract = new contracts_1.PerqTokenContract(this.perqConfig.perqTokenAddress, this.signer);
52
61
  }
53
62
  async updateSigner(newSigner, chainId) {
54
63
  this.signer = newSigner;
@@ -56,6 +65,9 @@ class PerqSdk {
56
65
  this.perqVestingContract = new contracts_1.PerqVestingContract(this);
57
66
  this.perqTokenRecyclerContract = new contracts_1.PerqTokenRecyclerContract(this);
58
67
  this.perqSwapAndRecyclerContract = new contracts_1.PerqSwapAndRecyclerContract(this);
68
+ this.bridgeMainnetPerqToSonicContract = new contracts_1.BridgeMainnetPerqToSonicContract(this);
69
+ this.bridgeSonicPerqToMainnetContract = new contracts_1.BridgeSonicPerqToMainnetContract(this);
70
+ this.perqTokenContract = new contracts_1.PerqTokenContract(this.perqConfig.perqTokenAddress, this.signer);
59
71
  }
60
72
  }
61
73
  exports.default = PerqSdk;