@dripfi/drip-sdk 1.4.30 → 1.4.31
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 +8 -6
- package/dist/PerqApi.d.ts +2 -0
- package/dist/PerqApi.js +15 -0
- package/dist/subpackages/UserPackage.d.ts +1 -0
- package/dist/subpackages/UserPackage.js +7 -0
- package/dist/types/LinkWalletPayload.d.ts +3 -0
- package/dist/types/LinkedPodWallets.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,12 +160,13 @@ Access pools methods through `sdk.pools`:
|
|
|
160
160
|
|
|
161
161
|
Access user methods through `sdk.user`:
|
|
162
162
|
|
|
163
|
-
| Method
|
|
164
|
-
|
|
|
165
|
-
| `linkSuiWalletWithEthWallet(suiWalletAddress: string): Promise<boolean>`
|
|
166
|
-
| `linkNearWalletWithEthWallet(nearWalletAddress: string): Promise<boolean>`
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
163
|
+
| Method | Description |
|
|
164
|
+
| ------------------------------------------------------------------------------ | ----------------------------------------------------------- |
|
|
165
|
+
| `linkSuiWalletWithEthWallet(suiWalletAddress: string): Promise<boolean>` | Links a Sui wallet with an Ethereum wallet. |
|
|
166
|
+
| `linkNearWalletWithEthWallet(nearWalletAddress: string): Promise<boolean>` | Links a Near wallet with an Ethereum wallet. |
|
|
167
|
+
| `linkSolanaWalletWithEthWallet(solanaWalletAddress: string): Promise<boolean>` | Links a Solana wallet with an Ethereum wallet. |
|
|
168
|
+
| `getLinkedPodWallets(): Promise<LinkedPodWallets>` | Retrieves all wallets linked to the user's Ethereum wallet. |
|
|
169
|
+
| `getEarnings(projectName: string): Promise<Earnings>` | Retrieves the user earnings for each project's vaults |
|
|
169
170
|
|
|
170
171
|
### Recycler
|
|
171
172
|
|
|
@@ -505,6 +506,7 @@ type BasePayload<T> = {
|
|
|
505
506
|
type LinkedPodWallets = {
|
|
506
507
|
suiWalletAddr: string;
|
|
507
508
|
nearWalletAddr: string;
|
|
509
|
+
solanaWalletAddr: string;
|
|
508
510
|
};
|
|
509
511
|
|
|
510
512
|
type NonceEnrichedPayload<T> = T & {
|
package/dist/PerqApi.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import MigrationOption from './types/MigrationOption';
|
|
|
6
6
|
import ProjectHistoricalTvl from './types/ProjectHistoricalTvl';
|
|
7
7
|
import ClaimSpecialEditionLoyaltyCardPayload from './types/ClaimSpecialEditionLoyaltyCardPayload';
|
|
8
8
|
import OverallStats from './types/OverallStats';
|
|
9
|
+
import { SolanaWalletPayload } from './types/LinkWalletPayload';
|
|
9
10
|
export default class PerqApi {
|
|
10
11
|
private perqSdk;
|
|
11
12
|
constructor(perqSdk: PerqSdk);
|
|
@@ -37,6 +38,7 @@ export default class PerqApi {
|
|
|
37
38
|
fetchBeansHistory(walletAddress: string): Promise<BeanEntry[]>;
|
|
38
39
|
linkSuiWalletWithEthWallet(signedPayload: NonceEnrichedSignedPayload<SuiWalletPayload>): Promise<boolean>;
|
|
39
40
|
linkNearWalletWithEthWallet(signedPayload: NonceEnrichedSignedPayload<NearWalletPayload>): Promise<boolean>;
|
|
41
|
+
linkSolanaWalletWithEthWallet(signedPayload: NonceEnrichedSignedPayload<SolanaWalletPayload>): Promise<boolean>;
|
|
40
42
|
getPodWallets(walletAddress: string): Promise<LinkedPodWallets>;
|
|
41
43
|
getNonceEnrichedPayload<T>(payload: T): Promise<NonceEnrichedPayload<T>>;
|
|
42
44
|
fetchLitePoolUserBalance(userAddress: string, vaultAddress: string, onChainProjectId: number): Promise<string>;
|
package/dist/PerqApi.js
CHANGED
|
@@ -385,6 +385,21 @@ class PerqApi {
|
|
|
385
385
|
throw Error(`${await res.text()}`);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
+
async linkSolanaWalletWithEthWallet(signedPayload) {
|
|
389
|
+
const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/user/solanaWallet`, {
|
|
390
|
+
method: 'POST',
|
|
391
|
+
headers: {
|
|
392
|
+
'Content-Type': 'application/json',
|
|
393
|
+
},
|
|
394
|
+
body: JSON.stringify(signedPayload),
|
|
395
|
+
});
|
|
396
|
+
if (res.ok) {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
throw Error(`${await res.text()}`);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
388
403
|
async getPodWallets(walletAddress) {
|
|
389
404
|
const res = await fetch(`${this.perqSdk.perqConfig.route}/api-be/api/user/podWallets/${walletAddress}`);
|
|
390
405
|
if (res.ok) {
|
|
@@ -6,5 +6,6 @@ export default class UserPackage {
|
|
|
6
6
|
getEarnings(projectName: string): Promise<Earnings>;
|
|
7
7
|
linkSuiWalletWithEthWallet(suiWalletAddress: string): Promise<boolean>;
|
|
8
8
|
linkNearWalletWithEthWallet(nearWalletAddress: string): Promise<boolean>;
|
|
9
|
+
linkSolanaWalletWithEthWallet(solanaWalletAddress: string): Promise<boolean>;
|
|
9
10
|
getLinkedPodWallets(): Promise<LinkedPodWallets>;
|
|
10
11
|
}
|
|
@@ -25,6 +25,13 @@ class UserPackage {
|
|
|
25
25
|
const signedPayload = await this.perqSdk.signHandler.signPayload(payload);
|
|
26
26
|
return this.perqSdk.perqApi.linkNearWalletWithEthWallet(signedPayload);
|
|
27
27
|
}
|
|
28
|
+
async linkSolanaWalletWithEthWallet(solanaWalletAddress) {
|
|
29
|
+
const payload = {
|
|
30
|
+
solanaWalletAddr: solanaWalletAddress,
|
|
31
|
+
};
|
|
32
|
+
const signedPayload = await this.perqSdk.signHandler.signPayload(payload);
|
|
33
|
+
return this.perqSdk.perqApi.linkSolanaWalletWithEthWallet(signedPayload);
|
|
34
|
+
}
|
|
28
35
|
async getLinkedPodWallets() {
|
|
29
36
|
if (!this.perqSdk.signer) {
|
|
30
37
|
throw new Error('No signer provided');
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import DeployedProject, { ProjectBacker } from './DeployedProject';
|
|
|
6
6
|
import DeployedVault from './DeployedVault';
|
|
7
7
|
import DepositToken from './DepositToken';
|
|
8
8
|
import ELoyaltyCardTier from './ELoyaltyCardTier';
|
|
9
|
-
import { NearWalletPayload, SuiWalletPayload } from './LinkWalletPayload';
|
|
9
|
+
import { NearWalletPayload, SuiWalletPayload, SolanaWalletPayload } from './LinkWalletPayload';
|
|
10
10
|
import LoyaltyCard from './LoyaltyCard';
|
|
11
11
|
import MyPerqData from './MyPerqData';
|
|
12
12
|
import NFTBoost from './NFTBoost';
|
|
@@ -31,4 +31,4 @@ import YelayVersion from './YelayVersion';
|
|
|
31
31
|
import Earnings from './Earnings';
|
|
32
32
|
import LinkedPodWallets from './LinkedPodWallets';
|
|
33
33
|
import MigrationOption from './MigrationOption';
|
|
34
|
-
export { Asset, BasePayload, BeanEntry, BeansBalance, DeployedProject, DeployedVault, DepositToken, DetailedProjectData, ELoyaltyCardTier, NearWalletPayload, SuiWalletPayload, LinkedPodWallets, LoyaltyCard, MigrationOption, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqConfig, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, ReducedProjectData, RewardType, SpecialEditionLoyaltyCard, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, VaultData, VaultReward, VaultStats, VaultType, VaultOperationParams, DepositType, VestingInfo, YelayVersion, Earnings, };
|
|
34
|
+
export { Asset, BasePayload, BeanEntry, BeansBalance, DeployedProject, DeployedVault, DepositToken, DetailedProjectData, ELoyaltyCardTier, NearWalletPayload, SuiWalletPayload, SolanaWalletPayload, LinkedPodWallets, LoyaltyCard, MigrationOption, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqConfig, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, ReducedProjectData, RewardType, SpecialEditionLoyaltyCard, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, VaultData, VaultReward, VaultStats, VaultType, VaultOperationParams, DepositType, VestingInfo, YelayVersion, Earnings, };
|