@dripfi/drip-sdk 1.3.10 → 1.3.11
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 +12 -0
- package/README.md +310 -238
- package/dist/DripApi.d.ts +1 -16
- package/dist/DripApi.js +0 -20
- package/dist/DripConfig.d.ts +2 -2
- package/dist/DripConfig.js +3 -3
- package/dist/DripSdk.d.ts +1 -16
- package/dist/DripSdk.js +8 -19
- package/dist/abi/index.d.ts +2 -2
- package/dist/abi/index.js +4 -4
- package/dist/contracts/{DripSwapAndRecyclerContract.d.ts → PerqSwapAndRecyclerContract.d.ts} +2 -2
- package/dist/contracts/{DripSwapAndRecyclerContract.js → PerqSwapAndRecyclerContract.js} +5 -5
- package/dist/contracts/{DripTokenContract.d.ts → PerqTokenContract.d.ts} +2 -2
- package/dist/contracts/{DripTokenContract.js → PerqTokenContract.js} +5 -5
- package/dist/contracts/{DripTokenRecyclerContract.d.ts → PerqTokenRecyclerContract.d.ts} +1 -1
- package/dist/contracts/{DripTokenRecyclerContract.js → PerqTokenRecyclerContract.js} +2 -2
- package/dist/contracts/PerqVestingContract.d.ts +2 -2
- package/dist/contracts/PerqVestingContract.js +2 -2
- package/dist/contracts/index.d.ts +13 -0
- package/dist/contracts/index.js +17 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.js +9 -31
- package/dist/perq/PerqConfig.d.ts +1 -1
- package/dist/perq/PerqConfig.js +3 -3
- package/dist/perq/PerqSdk.d.ts +1 -1
- package/dist/types/Chain.d.ts +2 -1
- package/dist/types/Chain.js +2 -2
- package/dist/types/DeployedProject.d.ts +1 -2
- package/dist/types/DeployedVault.d.ts +1 -3
- package/dist/types/LoyaltyCard.d.ts +1 -1
- package/dist/types/MyPerqData.d.ts +1 -2
- package/dist/types/Vault.d.ts +2 -7
- package/dist/types/YelayVersion.d.ts +2 -1
- package/dist/types/index.d.ts +10 -11
- package/dist/types/index.js +3 -1
- package/package.json +1 -1
- package/dist/types/CacheVaultRewards.d.ts +0 -14
- package/dist/types/CacheVaultRewards.js +0 -2
- package/dist/types/UserBalance.d.ts +0 -19
- package/dist/types/UserBalance.js +0 -2
- package/dist/types/VaultClaimData.d.ts +0 -7
- package/dist/types/VaultClaimData.js +0 -2
- package/dist/types/VaultDepositToken.d.ts +0 -8
- package/dist/types/VaultDepositToken.js +0 -2
- /package/dist/abi/{DripSwapAndRecyclerAbi.json → PerqSwapAndRecyclerAbi.json} +0 -0
- /package/dist/abi/{DripTokenAbi.json → PerqTokenAbi.json} +0 -0
- /package/dist/contracts/{BaseDripContract.d.ts → BasePerqContract.d.ts} +0 -0
- /package/dist/contracts/{BaseDripContract.js → BasePerqContract.js} +0 -0
package/dist/DripApi.d.ts
CHANGED
@@ -1,25 +1,11 @@
|
|
1
1
|
import { BigNumber } from 'ethers';
|
2
|
-
import Vault from './types
|
3
|
-
import SwapInfo from './types/SwapInfo';
|
4
|
-
import QLFastRedeem from './types/QLFastRedeem';
|
5
|
-
import UserRewards from './types/UserRewards';
|
6
|
-
import VaultStats from './types/VaultStats';
|
7
|
-
import UserBalance from './types/UserBalance';
|
8
|
-
import VaultClaimData from './types/VaultClaimData';
|
9
|
-
import MyPerqData from './types/MyPerqData';
|
10
|
-
import LoyaltyCard from './types/LoyaltyCard';
|
11
|
-
import BeansBalance from './types/BeansBalance';
|
12
|
-
import PerqToBeansSwapInfo from './types/PerqToBeansSwapInfo';
|
13
|
-
import BeanEntry from './types/BeanEntry';
|
14
|
-
import { NonceEnrichedSignedPayload, NonceEnrichedPayload } from './types/SignedPayload';
|
15
|
-
import UpgradeLoyaltyCardPayload from './types/UpgradeLoyaltyCardPayload';
|
2
|
+
import { Vault, SwapInfo, QLFastRedeem, UserRewards, VaultStats, MyPerqData, LoyaltyCard, BeansBalance, PerqToBeansSwapInfo, BeanEntry, NonceEnrichedSignedPayload, NonceEnrichedPayload, UpgradeLoyaltyCardPayload } from './types';
|
16
3
|
export default class DripApi {
|
17
4
|
route: string;
|
18
5
|
constructor(route: string);
|
19
6
|
fetchAllVaults(): Promise<Vault[]>;
|
20
7
|
fetchTokenPrice(tokenName: string): Promise<number>;
|
21
8
|
getExpectedSwapResult(fromTokenAddress: string, toTokenAddress: string, amount: string, decimals: number): Promise<string>;
|
22
|
-
getUserBalance(walletAddress: string): Promise<UserBalance>;
|
23
9
|
getUserBoostedNfts(walletAddress: string, vaultAddress: string): Promise<string[]>;
|
24
10
|
fetchVaultStats(): Promise<VaultStats>;
|
25
11
|
fetchVaultDetails(vaultAddress: string): Promise<Vault>;
|
@@ -33,7 +19,6 @@ export default class DripApi {
|
|
33
19
|
fetchAssetPerSvtAtBlock(vaultAddress: string, blocknumber: number): Promise<BigNumber>;
|
34
20
|
fetchFastWithdrawNFTs(vaultAddress: string, walletAddress: string): Promise<QLFastRedeem[]>;
|
35
21
|
fetchUserRewards(walletAddress: string): Promise<UserRewards>;
|
36
|
-
fetchVaultsClaimableData(walletAddress: string): Promise<VaultClaimData>;
|
37
22
|
fetchAllLoyaltyCards(): Promise<LoyaltyCard[]>;
|
38
23
|
fetchOwnedLoyaltyCard(walletAddress: string): Promise<LoyaltyCard>;
|
39
24
|
fetchBeansBalance(walletAddress: string): Promise<BeansBalance>;
|
package/dist/DripApi.js
CHANGED
@@ -44,16 +44,6 @@ class DripApi {
|
|
44
44
|
throw Error(`${await res.text()}`);
|
45
45
|
}
|
46
46
|
}
|
47
|
-
async getUserBalance(walletAddress) {
|
48
|
-
const res = await fetch(`${this.route}/api-be/api/user/${walletAddress}/deposits`);
|
49
|
-
if (res.ok) {
|
50
|
-
const data = await res.json();
|
51
|
-
return data;
|
52
|
-
}
|
53
|
-
else {
|
54
|
-
throw Error(`${await res.text()}`);
|
55
|
-
}
|
56
|
-
}
|
57
47
|
async getUserBoostedNfts(walletAddress, vaultAddress) {
|
58
48
|
const res = await fetch(`${this.route}/api-be/api/user/${walletAddress}/nftBoost/${vaultAddress}`);
|
59
49
|
if (res.ok) {
|
@@ -194,16 +184,6 @@ class DripApi {
|
|
194
184
|
throw Error(`${await res.text()}`);
|
195
185
|
}
|
196
186
|
}
|
197
|
-
async fetchVaultsClaimableData(walletAddress) {
|
198
|
-
const res = await fetch(`${this.route}/api-be/api/user/${walletAddress}/claimableVaults`);
|
199
|
-
if (res.ok) {
|
200
|
-
const data = await res.json();
|
201
|
-
return data;
|
202
|
-
}
|
203
|
-
else {
|
204
|
-
throw Error(`${await res.text()}`);
|
205
|
-
}
|
206
|
-
}
|
207
187
|
async fetchAllLoyaltyCards() {
|
208
188
|
const res = await fetch(`${this.route}/api-be/api/loyaltyCards/all`);
|
209
189
|
if (res.ok) {
|
package/dist/DripConfig.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { SDKConfig } from '@spool.fi/spool-v2-sdk';
|
2
1
|
import { Signer } from 'ethers';
|
3
|
-
import {
|
2
|
+
import { SDKConfig } from '@spool.fi/spool-v2-sdk';
|
3
|
+
import { Chain } from './types';
|
4
4
|
export declare const NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
|
5
5
|
export declare const PERQ_TOKEN_DECIMALS = 18;
|
6
6
|
export declare class DripConfig {
|
package/dist/DripConfig.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.DripConfig = exports.PERQ_TOKEN_DECIMALS = exports.NULL_ADDRESS = void 0;
|
4
4
|
const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
|
5
|
-
const
|
5
|
+
const types_1 = require("./types");
|
6
6
|
exports.NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
|
7
7
|
exports.PERQ_TOKEN_DECIMALS = 18;
|
8
8
|
const SUBGRAPH_URL_SEPOLIA = 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api';
|
@@ -28,7 +28,7 @@ class DripConfig {
|
|
28
28
|
perqVestingAddress;
|
29
29
|
constructor(chain, dripRoute) {
|
30
30
|
switch (chain) {
|
31
|
-
case
|
31
|
+
case types_1.Chain.MAINNET:
|
32
32
|
this.internalConfig = (0, spool_v2_sdk_1.getMainnetConfig)(SUBGRAPH_URL_MAINNET);
|
33
33
|
this.dripRoute = dripRoute !== undefined ? dripRoute : PROD_BACKEND_ROUTE;
|
34
34
|
this.dripTokenAddress = DRIP_TOKEN_ADDRESS_MAINNET;
|
@@ -36,7 +36,7 @@ class DripConfig {
|
|
36
36
|
this.dripSwapAndRecyclerAddress = SWAP_AND_RECYCLER_ADDRESS_MAINNET;
|
37
37
|
this.perqVestingAddress = VESTING_ADDRESS_MAINNET;
|
38
38
|
break;
|
39
|
-
case
|
39
|
+
case types_1.Chain.SEPOLIA:
|
40
40
|
this.internalConfig = (0, spool_v2_sdk_1.getSepoliaConfig)(SUBGRAPH_URL_SEPOLIA);
|
41
41
|
this.dripRoute = dripRoute !== undefined ? dripRoute : DEV_BACKEND_ROUTE;
|
42
42
|
this.dripTokenAddress = DRIP_TOKEN_ADDRESS_SEPOLIA;
|
package/dist/DripSdk.d.ts
CHANGED
@@ -1,18 +1,5 @@
|
|
1
1
|
import { BigNumber, Signer } from 'ethers';
|
2
|
-
import UserRewards from './types
|
3
|
-
import VaultStats from './types/VaultStats';
|
4
|
-
import UserBalance from './types/UserBalance';
|
5
|
-
import UserVaultBalance from './types/UserVaultBalance';
|
6
|
-
import VaultClaimData from './types/VaultClaimData';
|
7
|
-
import Vault from './types/Vault';
|
8
|
-
import LoyaltyCard from './types/LoyaltyCard';
|
9
|
-
import MyPerqData from './types/MyPerqData';
|
10
|
-
import BeansBalance from './types/BeansBalance';
|
11
|
-
import PerqToBeansSwapInfo from './types/PerqToBeansSwapInfo';
|
12
|
-
import BeanEntry from './types/BeanEntry';
|
13
|
-
import VestingInfo from './types/VestingInfo';
|
14
|
-
import { NonceEnrichedSignedPayload } from './types/SignedPayload';
|
15
|
-
import { Chain } from './types/Chain';
|
2
|
+
import { Vault, Chain, UserRewards, VaultStats, UserVaultBalance, LoyaltyCard, NonceEnrichedSignedPayload, MyPerqData, BeansBalance, BeanEntry, PerqToBeansSwapInfo, VestingInfo } from './types';
|
16
3
|
export default class DripSdk {
|
17
4
|
private dripApi;
|
18
5
|
private dripTokenContract;
|
@@ -35,7 +22,6 @@ export default class DripSdk {
|
|
35
22
|
getTokenAllowanceForRecycler(tokenAddress: string): Promise<BigNumber>;
|
36
23
|
getTokenAllowanceForSwapAndRecycler(tokenAddress: string): Promise<BigNumber>;
|
37
24
|
getExpectedSwapResult(fromTokenAddress: string, toTokenAddress: string, amount: string, decimals: number): Promise<string>;
|
38
|
-
getUserBalance(): Promise<UserBalance>;
|
39
25
|
getUserBoostedNfts(vaultAddress: string): Promise<string[]>;
|
40
26
|
getRewardsPerHour(vaultAddress: string): Promise<number>;
|
41
27
|
getRewards(): Promise<UserRewards>;
|
@@ -47,7 +33,6 @@ export default class DripSdk {
|
|
47
33
|
private doSwapAndDeposit;
|
48
34
|
withdraw(vaultAddress: string, amountToWithdraw?: string): Promise<string>;
|
49
35
|
claimWithdraws(vaultAddress: string): Promise<string>;
|
50
|
-
getVaultsClaimableData(): Promise<VaultClaimData>;
|
51
36
|
getBeansBalance(): Promise<BeansBalance>;
|
52
37
|
getBeansHistory(): Promise<BeanEntry[]>;
|
53
38
|
recycleTokens(tokenAddress: string | undefined, amountToRecycle: string, beneficiary: string | undefined, price: string, deadline: string, signature: string): Promise<string>;
|
package/dist/DripSdk.js
CHANGED
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
|
7
6
|
const ethers_1 = require("ethers");
|
7
|
+
const utils_1 = require("ethers/lib/utils");
|
8
|
+
const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
|
8
9
|
const DripConfig_1 = require("./DripConfig");
|
9
10
|
const DripApi_1 = __importDefault(require("./DripApi"));
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
11
|
+
const PerqTokenContract_1 = __importDefault(require("./contracts/PerqTokenContract"));
|
12
|
+
const PerqTokenRecyclerContract_1 = __importDefault(require("./contracts/PerqTokenRecyclerContract"));
|
13
|
+
const PerqSwapAndRecyclerContract_1 = __importDefault(require("./contracts/PerqSwapAndRecyclerContract"));
|
13
14
|
const PerqVestingContract_1 = __importDefault(require("./contracts/PerqVestingContract"));
|
14
|
-
const utils_1 = require("ethers/lib/utils");
|
15
15
|
const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json"));
|
16
16
|
class DripSdk {
|
17
17
|
dripApi;
|
@@ -29,9 +29,9 @@ class DripSdk {
|
|
29
29
|
this.spoolSdk = new spool_v2_sdk_1.SpoolSdk(this.dripConfig.internalConfig, signer);
|
30
30
|
}
|
31
31
|
this.dripApi = new DripApi_1.default(this.dripConfig.dripRoute);
|
32
|
-
this.dripTokenContract = new
|
33
|
-
this.dripTokenRecyclerContract = new
|
34
|
-
this.dripSwapAndRecyclerContract = new
|
32
|
+
this.dripTokenContract = new PerqTokenContract_1.default(this.dripConfig.dripTokenAddress, signer);
|
33
|
+
this.dripTokenRecyclerContract = new PerqTokenRecyclerContract_1.default(this.dripConfig.dripTokenRecyclerAddress, signer);
|
34
|
+
this.dripSwapAndRecyclerContract = new PerqSwapAndRecyclerContract_1.default(this.dripConfig.dripSwapAndRecyclerAddress, signer);
|
35
35
|
this.perqVestingContract = new PerqVestingContract_1.default(this.dripConfig.perqVestingAddress, signer);
|
36
36
|
}
|
37
37
|
async getAllVaults() {
|
@@ -110,10 +110,6 @@ class DripSdk {
|
|
110
110
|
async getExpectedSwapResult(fromTokenAddress, toTokenAddress, amount, decimals) {
|
111
111
|
return this.dripApi.getExpectedSwapResult(fromTokenAddress, toTokenAddress, amount, decimals);
|
112
112
|
}
|
113
|
-
async getUserBalance() {
|
114
|
-
const userAddress = await this.signer.getAddress();
|
115
|
-
return this.dripApi.getUserBalance(userAddress);
|
116
|
-
}
|
117
113
|
async getUserBoostedNfts(vaultAddress) {
|
118
114
|
const userAddress = await this.signer.getAddress();
|
119
115
|
return this.dripApi.getUserBoostedNfts(userAddress, vaultAddress);
|
@@ -255,13 +251,6 @@ class DripSdk {
|
|
255
251
|
const txReceipt = await claimWithdrawTx.wait();
|
256
252
|
return txReceipt.transactionHash;
|
257
253
|
}
|
258
|
-
async getVaultsClaimableData() {
|
259
|
-
if (!this.signer) {
|
260
|
-
throw Error('No signer provided');
|
261
|
-
}
|
262
|
-
const userAddress = await this.signer.getAddress();
|
263
|
-
return await this.dripApi.fetchVaultsClaimableData(userAddress);
|
264
|
-
}
|
265
254
|
async getBeansBalance() {
|
266
255
|
const userAddress = await this.signer.getAddress();
|
267
256
|
return this.dripApi.fetchBeansBalance(userAddress);
|
package/dist/abi/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
declare const _default: {
|
2
|
-
readonly
|
2
|
+
readonly PERQ_SWAP_AND_RECYCLER_ABI: {
|
3
3
|
inputs: {
|
4
4
|
internalType: string;
|
5
5
|
name: string;
|
@@ -26,7 +26,7 @@ declare const _default: {
|
|
26
26
|
stateMutability: string;
|
27
27
|
type: string;
|
28
28
|
}[];
|
29
|
-
readonly
|
29
|
+
readonly PERQ_TOKEN_ABI: {
|
30
30
|
constant: boolean;
|
31
31
|
inputs: {
|
32
32
|
name: string;
|
package/dist/abi/index.js
CHANGED
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const
|
6
|
+
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("./PerqSwapAndRecyclerAbi.json"));
|
7
7
|
const WethTokenAbi_json_1 = __importDefault(require("./WethTokenAbi.json"));
|
8
|
-
const
|
8
|
+
const PerqTokenAbi_json_1 = __importDefault(require("./PerqTokenAbi.json"));
|
9
9
|
const TokenRecyclerAbi_json_1 = __importDefault(require("./TokenRecyclerAbi.json"));
|
10
10
|
const PerqVestingAbi_json_1 = __importDefault(require("./PerqVestingAbi.json"));
|
11
11
|
exports.default = {
|
12
|
-
|
12
|
+
PERQ_SWAP_AND_RECYCLER_ABI: PerqSwapAndRecyclerAbi_json_1.default,
|
13
13
|
WETH_TOKEN_ABI: WethTokenAbi_json_1.default,
|
14
|
-
|
14
|
+
PERQ_TOKEN_ABI: PerqTokenAbi_json_1.default,
|
15
15
|
TOKEN_RECYCLER_ABI: TokenRecyclerAbi_json_1.default,
|
16
16
|
PERQ_VESTING_ABI: PerqVestingAbi_json_1.default,
|
17
17
|
};
|
package/dist/contracts/{DripSwapAndRecyclerContract.d.ts → PerqSwapAndRecyclerContract.d.ts}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ContractTransaction, ethers } from 'ethers';
|
2
|
-
import
|
3
|
-
export default class
|
2
|
+
import BasePerqContract from './BasePerqContract';
|
3
|
+
export default class PerqSwapAndRecyclerContract extends BasePerqContract {
|
4
4
|
constructor(address: string, signer?: ethers.Signer);
|
5
5
|
swapAndRecycle(beneficiary: string | undefined, path: string[], amountInWithDecimals: string, minAmountOutWithDecimals: string, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
6
6
|
swapETHAndRecycle(beneficiary: string | undefined, path: string[], minAmountOutWithDecimals: string, amountInEth: string, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const
|
8
|
-
const
|
7
|
+
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("../abi/PerqSwapAndRecyclerAbi.json"));
|
8
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
9
|
const DripConfig_1 = require("../DripConfig");
|
10
|
-
class
|
10
|
+
class PerqSwapAndRecyclerContract extends BasePerqContract_1.default {
|
11
11
|
constructor(address, signer) {
|
12
|
-
super(address, new ethers_1.ethers.utils.Interface(
|
12
|
+
super(address, new ethers_1.ethers.utils.Interface(PerqSwapAndRecyclerAbi_json_1.default), signer);
|
13
13
|
}
|
14
14
|
async swapAndRecycle(beneficiary = DripConfig_1.NULL_ADDRESS, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature) {
|
15
15
|
if (!this.contract.signer) {
|
@@ -26,4 +26,4 @@ class DripSwapAndRecyclerContract extends BaseDripContract_1.default {
|
|
26
26
|
});
|
27
27
|
}
|
28
28
|
}
|
29
|
-
exports.default =
|
29
|
+
exports.default = PerqSwapAndRecyclerContract;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BigNumber, ContractTransaction, ethers } from 'ethers';
|
2
|
-
import
|
3
|
-
export default class
|
2
|
+
import BasePerqContract from './BasePerqContract';
|
3
|
+
export default class PerqTokenContract extends BasePerqContract {
|
4
4
|
constructor(address: string, signer?: ethers.Signer);
|
5
5
|
getAllowance(spender: string): Promise<BigNumber>;
|
6
6
|
approve(spender: string, amount: BigNumber): Promise<ContractTransaction>;
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const
|
8
|
-
const
|
9
|
-
class
|
7
|
+
const PerqTokenAbi_json_1 = __importDefault(require("../abi/PerqTokenAbi.json"));
|
8
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
|
+
class PerqTokenContract extends BasePerqContract_1.default {
|
10
10
|
constructor(address, signer) {
|
11
|
-
super(address, new ethers_1.ethers.utils.Interface(
|
11
|
+
super(address, new ethers_1.ethers.utils.Interface(PerqTokenAbi_json_1.default), signer);
|
12
12
|
}
|
13
13
|
async getAllowance(spender) {
|
14
14
|
if (!this.contract.signer) {
|
@@ -23,4 +23,4 @@ class DripTokenContract extends BaseDripContract_1.default {
|
|
23
23
|
return await this.contract.approve(spender, amount.toString());
|
24
24
|
}
|
25
25
|
}
|
26
|
-
exports.default =
|
26
|
+
exports.default = PerqTokenContract;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ContractTransaction, ethers } from 'ethers';
|
2
|
-
import BaseDripContract from './
|
2
|
+
import BaseDripContract from './BasePerqContract';
|
3
3
|
export default class DripTokenRecyclerContract extends BaseDripContract {
|
4
4
|
constructor(address: string, signer?: ethers.Signer);
|
5
5
|
recycle(amountToRecycle: string, beneficiary: string | undefined, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
7
|
const TokenRecyclerAbi_json_1 = __importDefault(require("../abi/TokenRecyclerAbi.json"));
|
8
|
-
const
|
8
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
9
|
const DripConfig_1 = require("../DripConfig");
|
10
|
-
class DripTokenRecyclerContract extends
|
10
|
+
class DripTokenRecyclerContract extends BasePerqContract_1.default {
|
11
11
|
constructor(address, signer) {
|
12
12
|
super(address, new ethers_1.ethers.utils.Interface(TokenRecyclerAbi_json_1.default), signer);
|
13
13
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { BigNumber, ContractTransaction, ethers } from 'ethers';
|
2
|
-
import
|
3
|
-
export default class PerqVestingContract extends
|
2
|
+
import BasePerqContract from './BasePerqContract';
|
3
|
+
export default class PerqVestingContract extends BasePerqContract {
|
4
4
|
constructor(address: string, signer?: ethers.Signer);
|
5
5
|
start(): Promise<BigNumber>;
|
6
6
|
end(): Promise<BigNumber>;
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
7
|
const PerqVestingAbi_json_1 = __importDefault(require("../abi/PerqVestingAbi.json"));
|
8
|
-
const
|
9
|
-
class PerqVestingContract extends
|
8
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
9
|
+
class PerqVestingContract extends BasePerqContract_1.default {
|
10
10
|
constructor(address, signer) {
|
11
11
|
super(address, new ethers_1.ethers.utils.Interface(PerqVestingAbi_json_1.default), signer);
|
12
12
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import BasePerqContract from './BasePerqContract';
|
2
|
+
import PerqSwapAndRecyclerContract from './PerqSwapAndRecyclerContract';
|
3
|
+
import PerqTokenRecyclerContract from './PerqTokenRecyclerContract';
|
4
|
+
import PerqTokenContract from './PerqTokenContract';
|
5
|
+
import PerqVestingContract from './PerqVestingContract';
|
6
|
+
declare const _default: {
|
7
|
+
BasePerqContract: typeof BasePerqContract;
|
8
|
+
PerqSwapAndRecyclerContract: typeof PerqSwapAndRecyclerContract;
|
9
|
+
PerqTokenRecyclerContract: typeof PerqTokenRecyclerContract;
|
10
|
+
PerqTokenContract: typeof PerqTokenContract;
|
11
|
+
PerqVestingContract: typeof PerqVestingContract;
|
12
|
+
};
|
13
|
+
export default _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const BasePerqContract_1 = __importDefault(require("./BasePerqContract"));
|
7
|
+
const PerqSwapAndRecyclerContract_1 = __importDefault(require("./PerqSwapAndRecyclerContract"));
|
8
|
+
const PerqTokenRecyclerContract_1 = __importDefault(require("./PerqTokenRecyclerContract"));
|
9
|
+
const PerqTokenContract_1 = __importDefault(require("./PerqTokenContract"));
|
10
|
+
const PerqVestingContract_1 = __importDefault(require("./PerqVestingContract"));
|
11
|
+
exports.default = {
|
12
|
+
BasePerqContract: BasePerqContract_1.default,
|
13
|
+
PerqSwapAndRecyclerContract: PerqSwapAndRecyclerContract_1.default,
|
14
|
+
PerqTokenRecyclerContract: PerqTokenRecyclerContract_1.default,
|
15
|
+
PerqTokenContract: PerqTokenContract_1.default,
|
16
|
+
PerqVestingContract: PerqVestingContract_1.default,
|
17
|
+
};
|
package/dist/index.d.ts
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
import DripSdk from './DripSdk';
|
2
|
-
import DRIP_SWAP_AND_RECYCLER_ABI from './abi/
|
2
|
+
import DRIP_SWAP_AND_RECYCLER_ABI from './abi/PerqSwapAndRecyclerAbi.json';
|
3
3
|
import WETH_TOKEN_ABI from './abi/WethTokenAbi.json';
|
4
|
-
import DRIP_TOKEN_ABI from './abi/
|
4
|
+
import DRIP_TOKEN_ABI from './abi/PerqTokenAbi.json';
|
5
5
|
import TOKEN_RECYCLER_ABI from './abi/TokenRecyclerAbi.json';
|
6
6
|
import PERQ_VESTING_ABI from './abi/PerqVestingAbi.json';
|
7
7
|
import abi from './abi';
|
8
|
-
|
9
|
-
import { Chain } from './types/Chain';
|
8
|
+
export * from './types';
|
10
9
|
export { DRIP_SWAP_AND_RECYCLER_ABI, // TODO REMOVE THIS LINE
|
11
10
|
WETH_TOKEN_ABI, // TODO REMOVE THIS LINE
|
12
11
|
DRIP_TOKEN_ABI, // TODO REMOVE THIS LINE
|
13
12
|
TOKEN_RECYCLER_ABI, // TODO REMOVE THIS LINE
|
14
13
|
PERQ_VESTING_ABI, // TODO REMOVE THIS LINE
|
15
|
-
DripSdk,
|
14
|
+
DripSdk, abi, };
|
package/dist/index.js
CHANGED
@@ -10,41 +10,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
11
11
|
o[k2] = m[k];
|
12
12
|
}));
|
13
|
-
var
|
14
|
-
|
15
|
-
}
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
19
|
-
var ownKeys = function(o) {
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
-
var ar = [];
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
-
return ar;
|
24
|
-
};
|
25
|
-
return ownKeys(o);
|
26
|
-
};
|
27
|
-
return function (mod) {
|
28
|
-
if (mod && mod.__esModule) return mod;
|
29
|
-
var result = {};
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
-
__setModuleDefault(result, mod);
|
32
|
-
return result;
|
33
|
-
};
|
34
|
-
})();
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
35
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
36
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
37
18
|
};
|
38
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
39
|
-
exports.
|
20
|
+
exports.abi = exports.DripSdk = exports.PERQ_VESTING_ABI = exports.TOKEN_RECYCLER_ABI = exports.DRIP_TOKEN_ABI = exports.WETH_TOKEN_ABI = exports.DRIP_SWAP_AND_RECYCLER_ABI = void 0;
|
40
21
|
const DripSdk_1 = __importDefault(require("./DripSdk"));
|
41
22
|
exports.DripSdk = DripSdk_1.default;
|
42
|
-
const
|
43
|
-
exports.DRIP_SWAP_AND_RECYCLER_ABI =
|
23
|
+
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("./abi/PerqSwapAndRecyclerAbi.json")); // TODO REMOVE THIS LINE
|
24
|
+
exports.DRIP_SWAP_AND_RECYCLER_ABI = PerqSwapAndRecyclerAbi_json_1.default;
|
44
25
|
const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json")); // TODO REMOVE THIS LINE
|
45
26
|
exports.WETH_TOKEN_ABI = WethTokenAbi_json_1.default;
|
46
|
-
const
|
47
|
-
exports.DRIP_TOKEN_ABI =
|
27
|
+
const PerqTokenAbi_json_1 = __importDefault(require("./abi/PerqTokenAbi.json")); // TODO REMOVE THIS LINE
|
28
|
+
exports.DRIP_TOKEN_ABI = PerqTokenAbi_json_1.default;
|
48
29
|
const TokenRecyclerAbi_json_1 = __importDefault(require("./abi/TokenRecyclerAbi.json")); // TODO REMOVE THIS LINE
|
49
30
|
exports.TOKEN_RECYCLER_ABI = TokenRecyclerAbi_json_1.default;
|
50
31
|
const PerqVestingAbi_json_1 = __importDefault(require("./abi/PerqVestingAbi.json")); // TODO REMOVE THIS LINE
|
@@ -52,7 +33,4 @@ exports.PERQ_VESTING_ABI = PerqVestingAbi_json_1.default;
|
|
52
33
|
// FROM NOW ON, THIS IS THE NEW STRUCTURE:
|
53
34
|
const abi_1 = __importDefault(require("./abi"));
|
54
35
|
exports.abi = abi_1.default;
|
55
|
-
|
56
|
-
exports.types = types;
|
57
|
-
const Chain_1 = require("./types/Chain");
|
58
|
-
Object.defineProperty(exports, "Chain", { enumerable: true, get: function () { return Chain_1.Chain; } });
|
36
|
+
__exportStar(require("./types"), exports);
|
package/dist/perq/PerqConfig.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.PerqConfig = void 0;
|
4
|
-
const
|
4
|
+
const index_1 = require("../index");
|
5
5
|
const PROD_BACKEND_ROUTE = 'https://perq.finance';
|
6
6
|
const DEV_BACKEND_ROUTE = 'https://dev.perq.finance';
|
7
7
|
class PerqConfig {
|
8
8
|
perqRoute;
|
9
9
|
constructor(chain, perqRoute) {
|
10
10
|
switch (chain) {
|
11
|
-
case
|
11
|
+
case index_1.Chain.MAINNET:
|
12
12
|
this.perqRoute = perqRoute !== undefined ? perqRoute : PROD_BACKEND_ROUTE;
|
13
13
|
break;
|
14
|
-
case
|
14
|
+
case index_1.Chain.SEPOLIA:
|
15
15
|
this.perqRoute = perqRoute !== undefined ? perqRoute : DEV_BACKEND_ROUTE;
|
16
16
|
break;
|
17
17
|
}
|
package/dist/perq/PerqSdk.d.ts
CHANGED
package/dist/types/Chain.d.ts
CHANGED
package/dist/types/Chain.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Chain = void 0;
|
4
3
|
var Chain;
|
5
4
|
(function (Chain) {
|
6
5
|
Chain["MAINNET"] = "mainnet";
|
7
6
|
Chain["SEPOLIA"] = "sepolia";
|
8
|
-
})(Chain || (
|
7
|
+
})(Chain || (Chain = {}));
|
8
|
+
exports.default = Chain;
|
@@ -1,6 +1,4 @@
|
|
1
|
-
import DeployedProject from './
|
2
|
-
import VaultReward from './VaultReward';
|
3
|
-
import VaultType from './VaultType';
|
1
|
+
import { DeployedProject, VaultReward, VaultType } from './index';
|
4
2
|
type DeployedVault = {
|
5
3
|
projectId: number;
|
6
4
|
vaultAddress: string;
|
package/dist/types/Vault.d.ts
CHANGED
@@ -1,16 +1,11 @@
|
|
1
|
-
import DeployedProject from './
|
2
|
-
import NFTBoost from './NFTBoost';
|
3
|
-
import Strategy from './Strategy';
|
4
|
-
import VaultDepositToken from './VaultDepositToken';
|
5
|
-
import VaultReward, { RewardType } from './VaultReward';
|
6
|
-
import VaultType from './VaultType';
|
1
|
+
import { DepositToken, VaultType, NFTBoost, Strategy, DeployedProject, VaultReward, RewardType } from './index';
|
7
2
|
type Vault = {
|
8
3
|
vaultName: string;
|
9
4
|
vaultAddress: string;
|
10
5
|
apy: number;
|
11
6
|
tvr: number;
|
12
7
|
protocols: string[];
|
13
|
-
depositToken:
|
8
|
+
depositToken: DepositToken;
|
14
9
|
type: VaultType;
|
15
10
|
rewards: VaultReward[];
|
16
11
|
rewardType: RewardType;
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
type YelayVersion = 'v2' | 'lite';
|
2
|
+
export default YelayVersion;
|
package/dist/types/index.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import Asset from './Asset';
|
2
2
|
import BeanEntry from './BeanEntry';
|
3
3
|
import BeansBalance from './BeansBalance';
|
4
|
-
import
|
5
|
-
import DeployedProject from './DeployedProject';
|
4
|
+
import Chain from './Chain';
|
5
|
+
import DeployedProject, { ProjectBacker } from './DeployedProject';
|
6
6
|
import DeployedVault from './DeployedVault';
|
7
|
+
import DepositToken from './DepositToken';
|
7
8
|
import ELoyaltyCardTier from './ELoyaltyCardTier';
|
8
9
|
import LoyaltyCard from './LoyaltyCard';
|
9
10
|
import MyPerqData from './MyPerqData';
|
@@ -14,15 +15,13 @@ import { BasePayload, NonceEnrichedPayload, NonceEnrichedSignedPayload } from '.
|
|
14
15
|
import Strategy from './Strategy';
|
15
16
|
import StretchGoal from './StretchGoal';
|
16
17
|
import SwapInfo from './SwapInfo';
|
17
|
-
import Vault from './Vault';
|
18
|
-
import VaultDepositToken from './VaultDepositToken';
|
19
|
-
import VaultReward from './VaultReward';
|
20
|
-
import VaultStats from './VaultStats';
|
21
|
-
import UserBalance from './UserBalance';
|
22
|
-
import UserVaultBalance from './UserVaultBalance';
|
23
18
|
import UpgradeLoyaltyCardPayload from './UpgradeLoyaltyCardPayload';
|
24
19
|
import UserRewards from './UserRewards';
|
25
|
-
import
|
26
|
-
import
|
20
|
+
import UserVaultBalance from './UserVaultBalance';
|
21
|
+
import Vault from './Vault';
|
22
|
+
import VaultReward, { RewardType } from './VaultReward';
|
23
|
+
import VaultStats from './VaultStats';
|
27
24
|
import VaultType from './VaultType';
|
28
|
-
|
25
|
+
import VestingInfo from './VestingInfo';
|
26
|
+
import YelayVersion from './YelayVersion';
|
27
|
+
export { Asset, BasePayload, BeanEntry, BeansBalance, Chain, DeployedProject, DeployedVault, DepositToken, ELoyaltyCardTier, LoyaltyCard, MyPerqData, NFTBoost, NonceEnrichedPayload, NonceEnrichedSignedPayload, PerqToBeansSwapInfo, ProjectBacker, QLFastRedeem, RewardType, Strategy, StretchGoal, SwapInfo, UpgradeLoyaltyCardPayload, UserRewards, UserVaultBalance, Vault, VaultReward, VaultStats, VaultType, VestingInfo, YelayVersion, };
|