@dripfi/drip-sdk 1.3.7 → 1.3.9
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/.prettierrc +10 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +11 -16
- package/CHANGELOG.md +13 -1
- package/dist/DripApi.d.ts +1 -1
- package/dist/DripApi.js +303 -365
- package/dist/DripConfig.js +26 -31
- package/dist/DripSdk.d.ts +1 -1
- package/dist/DripSdk.js +481 -594
- package/dist/abi/index.d.ts +75 -0
- package/dist/abi/index.js +17 -0
- package/dist/contracts/BaseDripContract.js +1 -0
- package/dist/contracts/DripSwapAndRecyclerContract.js +12 -25
- package/dist/contracts/DripTokenContract.js +11 -24
- package/dist/contracts/DripTokenRecyclerContract.js +6 -17
- package/dist/contracts/PerqVestingContract.js +42 -65
- package/dist/index.d.ts +12 -6
- package/dist/index.js +9 -6
- package/dist/types/MyPerqData.d.ts +11 -39
- package/eslint.config.mjs +43 -0
- package/package.json +27 -23
- package/.eslintrc.json +0 -38
- package/dist/test.d.ts +0 -2
- package/dist/test.js +0 -92
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -13
- /package/dist/{contracts/abi → abi}/DripSwapAndRecyclerAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/DripTokenAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/PerqVestingAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/TokenRecyclerAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/WethTokenAbi.json +0 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
readonly DRIP_SWAP_AND_RECYCLER_ABI: {
|
3
|
+
inputs: {
|
4
|
+
internalType: string;
|
5
|
+
name: string;
|
6
|
+
type: string;
|
7
|
+
}[];
|
8
|
+
name: string;
|
9
|
+
outputs: {
|
10
|
+
internalType: string;
|
11
|
+
name: string;
|
12
|
+
type: string;
|
13
|
+
}[];
|
14
|
+
stateMutability: string;
|
15
|
+
type: string;
|
16
|
+
}[];
|
17
|
+
readonly WETH_TOKEN_ABI: {
|
18
|
+
constant: boolean;
|
19
|
+
inputs: never[];
|
20
|
+
name: string;
|
21
|
+
outputs: {
|
22
|
+
name: string;
|
23
|
+
type: string;
|
24
|
+
}[];
|
25
|
+
payable: boolean;
|
26
|
+
stateMutability: string;
|
27
|
+
type: string;
|
28
|
+
}[];
|
29
|
+
readonly DRIP_TOKEN_ABI: {
|
30
|
+
constant: boolean;
|
31
|
+
inputs: {
|
32
|
+
name: string;
|
33
|
+
type: string;
|
34
|
+
}[];
|
35
|
+
name: string;
|
36
|
+
outputs: {
|
37
|
+
name: string;
|
38
|
+
type: string;
|
39
|
+
}[];
|
40
|
+
payable: boolean;
|
41
|
+
stateMutability: string;
|
42
|
+
type: string;
|
43
|
+
}[];
|
44
|
+
readonly TOKEN_RECYCLER_ABI: {
|
45
|
+
inputs: {
|
46
|
+
internalType: string;
|
47
|
+
name: string;
|
48
|
+
type: string;
|
49
|
+
}[];
|
50
|
+
name: string;
|
51
|
+
outputs: {
|
52
|
+
internalType: string;
|
53
|
+
name: string;
|
54
|
+
type: string;
|
55
|
+
}[];
|
56
|
+
stateMutability: string;
|
57
|
+
type: string;
|
58
|
+
}[];
|
59
|
+
readonly PERQ_VESTING_ABI: {
|
60
|
+
inputs: {
|
61
|
+
internalType: string;
|
62
|
+
name: string;
|
63
|
+
type: string;
|
64
|
+
}[];
|
65
|
+
name: string;
|
66
|
+
outputs: {
|
67
|
+
internalType: string;
|
68
|
+
name: string;
|
69
|
+
type: string;
|
70
|
+
}[];
|
71
|
+
stateMutability: string;
|
72
|
+
type: string;
|
73
|
+
}[];
|
74
|
+
};
|
75
|
+
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 DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./DripSwapAndRecyclerAbi.json"));
|
7
|
+
const WethTokenAbi_json_1 = __importDefault(require("./WethTokenAbi.json"));
|
8
|
+
const DripTokenAbi_json_1 = __importDefault(require("./DripTokenAbi.json"));
|
9
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("./TokenRecyclerAbi.json"));
|
10
|
+
const PerqVestingAbi_json_1 = __importDefault(require("./PerqVestingAbi.json"));
|
11
|
+
exports.default = {
|
12
|
+
DRIP_SWAP_AND_RECYCLER_ABI: DripSwapAndRecyclerAbi_json_1.default,
|
13
|
+
WETH_TOKEN_ABI: WethTokenAbi_json_1.default,
|
14
|
+
DRIP_TOKEN_ABI: DripTokenAbi_json_1.default,
|
15
|
+
TOKEN_RECYCLER_ABI: TokenRecyclerAbi_json_1.default,
|
16
|
+
PERQ_VESTING_ABI: PerqVestingAbi_json_1.default,
|
17
|
+
};
|
@@ -1,41 +1,28 @@
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
4
|
};
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
6
|
const ethers_1 = require("ethers");
|
16
|
-
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("
|
7
|
+
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("../abi/DripSwapAndRecyclerAbi.json"));
|
17
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
18
9
|
const DripConfig_1 = require("../DripConfig");
|
19
10
|
class DripSwapAndRecyclerContract extends BaseDripContract_1.default {
|
20
11
|
constructor(address, signer) {
|
21
12
|
super(address, new ethers_1.ethers.utils.Interface(DripSwapAndRecyclerAbi_json_1.default), signer);
|
22
13
|
}
|
23
|
-
swapAndRecycle() {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
return yield this.contract.swapAndRecycle(beneficiary, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature);
|
29
|
-
});
|
14
|
+
async swapAndRecycle(beneficiary = DripConfig_1.NULL_ADDRESS, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature) {
|
15
|
+
if (!this.contract.signer) {
|
16
|
+
throw Error('No signer provided');
|
17
|
+
}
|
18
|
+
return await this.contract.swapAndRecycle(beneficiary, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature);
|
30
19
|
}
|
31
|
-
swapETHAndRecycle() {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
value: amountInEth
|
38
|
-
});
|
20
|
+
async swapETHAndRecycle(beneficiary = DripConfig_1.NULL_ADDRESS, path, minAmountOutWithDecimals, amountInEth, price, deadline, signature) {
|
21
|
+
if (!this.contract.signer) {
|
22
|
+
throw Error('No signer provided');
|
23
|
+
}
|
24
|
+
return await this.contract.swapETHAndRecycle(beneficiary, path, minAmountOutWithDecimals, price, deadline, signature, {
|
25
|
+
value: amountInEth,
|
39
26
|
});
|
40
27
|
}
|
41
28
|
}
|
@@ -1,39 +1,26 @@
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
4
|
};
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
6
|
const ethers_1 = require("ethers");
|
16
|
-
const DripTokenAbi_json_1 = __importDefault(require("
|
7
|
+
const DripTokenAbi_json_1 = __importDefault(require("../abi/DripTokenAbi.json"));
|
17
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
18
9
|
class DripTokenContract extends BaseDripContract_1.default {
|
19
10
|
constructor(address, signer) {
|
20
11
|
super(address, new ethers_1.ethers.utils.Interface(DripTokenAbi_json_1.default), signer);
|
21
12
|
}
|
22
|
-
getAllowance(spender) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
return yield this.contract.allowance(yield this.contract.signer.getAddress(), spender);
|
28
|
-
});
|
13
|
+
async getAllowance(spender) {
|
14
|
+
if (!this.contract.signer) {
|
15
|
+
throw Error('No signer provided');
|
16
|
+
}
|
17
|
+
return await this.contract.allowance(await this.contract.signer.getAddress(), spender);
|
29
18
|
}
|
30
|
-
approve(spender, amount) {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
return yield this.contract.approve(spender, amount.toString());
|
36
|
-
});
|
19
|
+
async approve(spender, amount) {
|
20
|
+
if (!this.contract.signer) {
|
21
|
+
throw Error('No signer provided');
|
22
|
+
}
|
23
|
+
return await this.contract.approve(spender, amount.toString());
|
37
24
|
}
|
38
25
|
}
|
39
26
|
exports.default = DripTokenContract;
|
@@ -1,32 +1,21 @@
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
4
|
};
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
6
|
const ethers_1 = require("ethers");
|
16
|
-
const TokenRecyclerAbi_json_1 = __importDefault(require("
|
7
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("../abi/TokenRecyclerAbi.json"));
|
17
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
18
9
|
const DripConfig_1 = require("../DripConfig");
|
19
10
|
class DripTokenRecyclerContract extends BaseDripContract_1.default {
|
20
11
|
constructor(address, signer) {
|
21
12
|
super(address, new ethers_1.ethers.utils.Interface(TokenRecyclerAbi_json_1.default), signer);
|
22
13
|
}
|
23
|
-
recycle(
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
return yield this.contract.recycle(amountToRecycle, beneficiary, price, deadline, signature);
|
29
|
-
});
|
14
|
+
async recycle(amountToRecycle, beneficiary = DripConfig_1.NULL_ADDRESS, price, deadline, signature) {
|
15
|
+
if (!this.contract.signer) {
|
16
|
+
throw Error('No signer provided');
|
17
|
+
}
|
18
|
+
return await this.contract.recycle(amountToRecycle, beneficiary, price, deadline, signature);
|
30
19
|
}
|
31
20
|
}
|
32
21
|
exports.default = DripTokenRecyclerContract;
|
@@ -1,79 +1,56 @@
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
4
|
};
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
6
|
const ethers_1 = require("ethers");
|
16
|
-
const PerqVestingAbi_json_1 = __importDefault(require("
|
7
|
+
const PerqVestingAbi_json_1 = __importDefault(require("../abi/PerqVestingAbi.json"));
|
17
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
18
9
|
class PerqVestingContract extends BaseDripContract_1.default {
|
19
10
|
constructor(address, signer) {
|
20
11
|
super(address, new ethers_1.ethers.utils.Interface(PerqVestingAbi_json_1.default), signer);
|
21
12
|
}
|
22
|
-
start() {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
64
|
-
if (!this.contract.signer) {
|
65
|
-
throw Error('No signer provided');
|
66
|
-
}
|
67
|
-
return yield this.contract.claim(amount);
|
68
|
-
});
|
69
|
-
}
|
70
|
-
burn(amount, price, deadline, signature) {
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
72
|
-
if (!this.contract.signer) {
|
73
|
-
throw Error('No signer provided');
|
74
|
-
}
|
75
|
-
return yield this.contract.burn(amount, price, deadline, signature);
|
76
|
-
});
|
13
|
+
async start() {
|
14
|
+
if (!this.contract.signer) {
|
15
|
+
throw Error('No signer provided');
|
16
|
+
}
|
17
|
+
return await this.contract.start();
|
18
|
+
}
|
19
|
+
async end() {
|
20
|
+
if (!this.contract.signer) {
|
21
|
+
throw Error('No signer provided');
|
22
|
+
}
|
23
|
+
return await this.contract.end();
|
24
|
+
}
|
25
|
+
async vested(beneficiary) {
|
26
|
+
if (!this.contract.signer) {
|
27
|
+
throw Error('No signer provided');
|
28
|
+
}
|
29
|
+
return await this.contract.vested(beneficiary);
|
30
|
+
}
|
31
|
+
async releasable(beneficiary) {
|
32
|
+
if (!this.contract.signer) {
|
33
|
+
throw Error('No signer provided');
|
34
|
+
}
|
35
|
+
return await this.contract.releasable(beneficiary);
|
36
|
+
}
|
37
|
+
async releasableTotal(beneficiary) {
|
38
|
+
if (!this.contract.signer) {
|
39
|
+
throw Error('No signer provided');
|
40
|
+
}
|
41
|
+
return await this.contract.releasableTotal(beneficiary);
|
42
|
+
}
|
43
|
+
async claim(amount) {
|
44
|
+
if (!this.contract.signer) {
|
45
|
+
throw Error('No signer provided');
|
46
|
+
}
|
47
|
+
return await this.contract.claim(amount);
|
48
|
+
}
|
49
|
+
async burn(amount, price, deadline, signature) {
|
50
|
+
if (!this.contract.signer) {
|
51
|
+
throw Error('No signer provided');
|
52
|
+
}
|
53
|
+
return await this.contract.burn(amount, price, deadline, signature);
|
77
54
|
}
|
78
55
|
}
|
79
56
|
exports.default = PerqVestingContract;
|
package/dist/index.d.ts
CHANGED
@@ -14,9 +14,15 @@ import { Chain } from './DripConfig';
|
|
14
14
|
import MyPerqData from './types/MyPerqData';
|
15
15
|
import ELoyaltyCardTier from './types/ELoyaltyCardTier';
|
16
16
|
import BeanEntry from './types/BeanEntry';
|
17
|
-
import DRIP_SWAP_AND_RECYCLER_ABI from './
|
18
|
-
import WETH_TOKEN_ABI from './
|
19
|
-
import DRIP_TOKEN_ABI from './
|
20
|
-
import TOKEN_RECYCLER_ABI from './
|
21
|
-
import PERQ_VESTING_ABI from './
|
22
|
-
|
17
|
+
import DRIP_SWAP_AND_RECYCLER_ABI from './abi/DripSwapAndRecyclerAbi.json';
|
18
|
+
import WETH_TOKEN_ABI from './abi/WethTokenAbi.json';
|
19
|
+
import DRIP_TOKEN_ABI from './abi/DripTokenAbi.json';
|
20
|
+
import TOKEN_RECYCLER_ABI from './abi/TokenRecyclerAbi.json';
|
21
|
+
import PERQ_VESTING_ABI from './abi/PerqVestingAbi.json';
|
22
|
+
import abi from './abi';
|
23
|
+
export { DRIP_SWAP_AND_RECYCLER_ABI, // TODO REMOVE THIS LINE
|
24
|
+
WETH_TOKEN_ABI, // TODO REMOVE THIS LINE
|
25
|
+
DRIP_TOKEN_ABI, // TODO REMOVE THIS LINE
|
26
|
+
TOKEN_RECYCLER_ABI, // TODO REMOVE THIS LINE
|
27
|
+
PERQ_VESTING_ABI, // TODO REMOVE THIS LINE
|
28
|
+
Vault, VaultReward, DripSdk, UserVaultBalance, UserBalance, VaultStats, NFTBoost, Strategy, StretchGoal, SwapInfo, VaultDepositToken, VaultType, MyPerqData, Chain, ELoyaltyCardTier, BeanEntry, abi, };
|
package/dist/index.js
CHANGED
@@ -3,20 +3,23 @@ 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
|
-
exports.ELoyaltyCardTier = exports.Chain = 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;
|
6
|
+
exports.abi = exports.ELoyaltyCardTier = exports.Chain = 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;
|
7
7
|
const DripSdk_1 = __importDefault(require("./DripSdk"));
|
8
8
|
exports.DripSdk = DripSdk_1.default;
|
9
9
|
const DripConfig_1 = require("./DripConfig");
|
10
10
|
Object.defineProperty(exports, "Chain", { enumerable: true, get: function () { return DripConfig_1.Chain; } });
|
11
11
|
const ELoyaltyCardTier_1 = __importDefault(require("./types/ELoyaltyCardTier"));
|
12
12
|
exports.ELoyaltyCardTier = ELoyaltyCardTier_1.default;
|
13
|
-
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./
|
13
|
+
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./abi/DripSwapAndRecyclerAbi.json")); // TODO REMOVE THIS LINE
|
14
14
|
exports.DRIP_SWAP_AND_RECYCLER_ABI = DripSwapAndRecyclerAbi_json_1.default;
|
15
|
-
const WethTokenAbi_json_1 = __importDefault(require("./
|
15
|
+
const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json")); // TODO REMOVE THIS LINE
|
16
16
|
exports.WETH_TOKEN_ABI = WethTokenAbi_json_1.default;
|
17
|
-
const DripTokenAbi_json_1 = __importDefault(require("./
|
17
|
+
const DripTokenAbi_json_1 = __importDefault(require("./abi/DripTokenAbi.json")); // TODO REMOVE THIS LINE
|
18
18
|
exports.DRIP_TOKEN_ABI = DripTokenAbi_json_1.default;
|
19
|
-
const TokenRecyclerAbi_json_1 = __importDefault(require("./
|
19
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("./abi/TokenRecyclerAbi.json")); // TODO REMOVE THIS LINE
|
20
20
|
exports.TOKEN_RECYCLER_ABI = TokenRecyclerAbi_json_1.default;
|
21
|
-
const PerqVestingAbi_json_1 = __importDefault(require("./
|
21
|
+
const PerqVestingAbi_json_1 = __importDefault(require("./abi/PerqVestingAbi.json")); // TODO REMOVE THIS LINE
|
22
22
|
exports.PERQ_VESTING_ABI = PerqVestingAbi_json_1.default;
|
23
|
+
// FROM NOW ON, THIS IS THE NEW STRUCTURE:
|
24
|
+
const abi_1 = __importDefault(require("./abi"));
|
25
|
+
exports.abi = abi_1.default;
|
@@ -1,43 +1,15 @@
|
|
1
1
|
import Asset from './Asset';
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
coingeckoId?: string;
|
14
|
-
depositTokenId: 'WETH' | 'USDC' | 'DAI';
|
15
|
-
type: 'earn' | 'launch' | 'airdrop';
|
16
|
-
rewardType: 'points' | 'token' | 'pnode shards';
|
17
|
-
amountOfTokens?: number;
|
18
|
-
vaultName: string;
|
19
|
-
protocols: string[];
|
20
|
-
apy: number;
|
21
|
-
tvr: number;
|
22
|
-
tokenPrice: number;
|
23
|
-
change24h: number;
|
24
|
-
volume24h: number;
|
25
|
-
rewards: CacheVaultRewards[];
|
26
|
-
strategies: Strategy[];
|
27
|
-
boosters: NFTBoost[];
|
28
|
-
depositToken: DepositToken;
|
29
|
-
avgTvl: string;
|
30
|
-
peakTvl: string;
|
31
|
-
pendingDeposits: number;
|
32
|
-
currentlyDeposited: number;
|
33
|
-
pendingWithdraws: number;
|
34
|
-
claimable: number;
|
35
|
-
ethPrice: number;
|
36
|
-
tokenRewards: {
|
37
|
-
[token_address: string]: Asset & {
|
38
|
-
amount: number;
|
39
|
-
rewardsPerHour: number;
|
40
|
-
};
|
2
|
+
import { Vault } from './Vault';
|
3
|
+
type MyPerqData = Vault & {
|
4
|
+
claimable: number;
|
5
|
+
pendingDeposits: number;
|
6
|
+
pendingWithdraws: number;
|
7
|
+
currentlyDeposited: number;
|
8
|
+
ethPrice: number;
|
9
|
+
tokenRewards: {
|
10
|
+
[token_address: string]: Asset & {
|
11
|
+
amount: number;
|
12
|
+
rewardsPerHour?: number;
|
41
13
|
};
|
42
14
|
};
|
43
15
|
};
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import globals from 'globals';
|
2
|
+
import pluginJs from '@eslint/js';
|
3
|
+
import tseslint from 'typescript-eslint';
|
4
|
+
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
5
|
+
|
6
|
+
/** @type {import('eslint').Linter.Config[]} */
|
7
|
+
export default [
|
8
|
+
{ files: ['**/*.{js,mjs,cjs,ts}'] },
|
9
|
+
{
|
10
|
+
languageOptions: {
|
11
|
+
globals: globals.browser,
|
12
|
+
},
|
13
|
+
},
|
14
|
+
pluginJs.configs.recommended,
|
15
|
+
...tseslint.configs.recommended,
|
16
|
+
{
|
17
|
+
plugins: {
|
18
|
+
'@stylistic/ts': stylisticTs,
|
19
|
+
},
|
20
|
+
|
21
|
+
rules: {
|
22
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
23
|
+
'@typescript-eslint/no-unused-vars': [
|
24
|
+
'error',
|
25
|
+
{
|
26
|
+
caughtErrors: 'none',
|
27
|
+
},
|
28
|
+
],
|
29
|
+
'no-empty': [
|
30
|
+
'error',
|
31
|
+
{
|
32
|
+
allowEmptyCatch: true,
|
33
|
+
},
|
34
|
+
],
|
35
|
+
'@stylistic/ts/brace-style': 'error',
|
36
|
+
'@stylistic/ts/comma-spacing': 'error',
|
37
|
+
'@stylistic/ts/key-spacing': 'error',
|
38
|
+
'@stylistic/ts/keyword-spacing': 'error',
|
39
|
+
'@stylistic/ts/lines-around-comment': 'error',
|
40
|
+
'@stylistic/ts/semi': 'error',
|
41
|
+
},
|
42
|
+
},
|
43
|
+
];
|
package/package.json
CHANGED
@@ -1,25 +1,29 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
2
|
+
"name": "@dripfi/drip-sdk",
|
3
|
+
"version": "1.3.9",
|
4
|
+
"description": "Drip SDK",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"scripts": {
|
8
|
+
"prepublish": "npm run build",
|
9
|
+
"build": "tsc",
|
10
|
+
"publish": "npm publish --access public",
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
12
|
+
"lint": "eslint src",
|
13
|
+
"pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
|
14
|
+
},
|
15
|
+
"dependencies": {
|
16
|
+
"@spool.fi/spool-v2-sdk": "2.0.44",
|
17
|
+
"ethers": "^5.7.2"
|
18
|
+
},
|
19
|
+
"author": "",
|
20
|
+
"license": "ISC",
|
21
|
+
"devDependencies": {
|
22
|
+
"typescript-eslint": "^8.19.1",
|
23
|
+
"eslint": "^9.17.0",
|
24
|
+
"typescript": "^5.4.5",
|
25
|
+
"prettier-eslint": "^16.3.0",
|
26
|
+
"prettier": "^3.4.2",
|
27
|
+
"@stylistic/eslint-plugin-ts": "^2.12.1"
|
28
|
+
}
|
25
29
|
}
|
package/.eslintrc.json
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"env": {
|
3
|
-
"browser": true,
|
4
|
-
"es2021": true
|
5
|
-
},
|
6
|
-
"extends": [
|
7
|
-
"eslint:recommended",
|
8
|
-
"plugin:@typescript-eslint/recommended"
|
9
|
-
],
|
10
|
-
"parser": "@typescript-eslint/parser",
|
11
|
-
"parserOptions": {
|
12
|
-
"ecmaVersion": "latest",
|
13
|
-
"sourceType": "module"
|
14
|
-
},
|
15
|
-
"plugins": [
|
16
|
-
"@typescript-eslint"
|
17
|
-
],
|
18
|
-
"rules": {
|
19
|
-
"quotes": [
|
20
|
-
"error",
|
21
|
-
"single"
|
22
|
-
],
|
23
|
-
"semi": "off",
|
24
|
-
"@typescript-eslint/semi": "error",
|
25
|
-
"@typescript-eslint/no-explicit-any": "off",
|
26
|
-
"curly": "error"
|
27
|
-
},
|
28
|
-
"overrides": [
|
29
|
-
{
|
30
|
-
"files": [
|
31
|
-
"tests/**/*"
|
32
|
-
],
|
33
|
-
"env": {
|
34
|
-
"jest": true
|
35
|
-
}
|
36
|
-
}
|
37
|
-
]
|
38
|
-
}
|
package/dist/test.d.ts
DELETED