@dripfi/drip-sdk 1.2.5-dev.1 → 1.2.5
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 +4 -12
- package/dist/DripApi.js +29 -87
- package/dist/DripConfig.d.ts +1 -0
- package/dist/DripConfig.js +6 -2
- package/dist/DripSdk.d.ts +8 -14
- package/dist/DripSdk.js +77 -136
- package/dist/contracts/DripSwapAndRecyclerContract.d.ts +7 -0
- package/dist/contracts/DripSwapAndRecyclerContract.js +40 -0
- package/dist/contracts/abi/DripSwapAndRecyclerAbi.json +516 -0
- package/dist/index.d.ts +2 -3
- package/dist/test.js +12 -42
- package/dist/types/BeanEntry.d.ts +12 -0
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -47
- package/package.json +1 -1
- package/dist/types/DeployedMetaVault.d.ts +0 -6
- package/dist/types/MetaVault.d.ts +0 -17
- package/dist/types/MetaVault.js +0 -2
- package/dist/types/UserMetaVaultBalance.d.ts +0 -6
- package/dist/types/UserMetaVaultBalance.js +0 -2
- /package/dist/types/{DeployedMetaVault.js → BeanEntry.js} +0 -0
@@ -0,0 +1,40 @@
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const ethers_1 = require("ethers");
|
16
|
+
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./abi/DripSwapAndRecyclerAbi.json"));
|
17
|
+
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
18
|
+
const DripConfig_1 = require("../DripConfig");
|
19
|
+
class DripSwapAndRecyclerContract extends BaseDripContract_1.default {
|
20
|
+
constructor(address, signer) {
|
21
|
+
super(address, new ethers_1.ethers.utils.Interface(DripSwapAndRecyclerAbi_json_1.default), signer);
|
22
|
+
}
|
23
|
+
swapAndRecycle() {
|
24
|
+
return __awaiter(this, arguments, void 0, function* (beneficiary = DripConfig_1.NULL_ADDRESS, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature) {
|
25
|
+
if (!this.contract.signer) {
|
26
|
+
throw Error('No signer provided');
|
27
|
+
}
|
28
|
+
return yield this.contract.swapAndRecycle(beneficiary, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
swapETHAndRecycle() {
|
32
|
+
return __awaiter(this, arguments, void 0, function* (beneficiary = DripConfig_1.NULL_ADDRESS, path, minAmountOutWithDecimals, price, deadline, signature) {
|
33
|
+
if (!this.contract.signer) {
|
34
|
+
throw Error('No signer provided');
|
35
|
+
}
|
36
|
+
return yield this.contract.swapETHAndRecycle(beneficiary, path, minAmountOutWithDecimals, price, deadline, signature);
|
37
|
+
});
|
38
|
+
}
|
39
|
+
}
|
40
|
+
exports.default = DripSwapAndRecyclerContract;
|
@@ -0,0 +1,516 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"inputs": [
|
4
|
+
{
|
5
|
+
"internalType": "contract IUniswapV2Router02",
|
6
|
+
"name": "swapRouter_",
|
7
|
+
"type": "address"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"internalType": "contract ITokenRecycler",
|
11
|
+
"name": "tokenRecycler_",
|
12
|
+
"type": "address"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"internalType": "address",
|
16
|
+
"name": "admin_",
|
17
|
+
"type": "address"
|
18
|
+
}
|
19
|
+
],
|
20
|
+
"stateMutability": "nonpayable",
|
21
|
+
"type": "constructor"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"inputs": [],
|
25
|
+
"name": "AccessControlBadConfirmation",
|
26
|
+
"type": "error"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"inputs": [
|
30
|
+
{
|
31
|
+
"internalType": "address",
|
32
|
+
"name": "account",
|
33
|
+
"type": "address"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"internalType": "bytes32",
|
37
|
+
"name": "neededRole",
|
38
|
+
"type": "bytes32"
|
39
|
+
}
|
40
|
+
],
|
41
|
+
"name": "AccessControlUnauthorizedAccount",
|
42
|
+
"type": "error"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"inputs": [
|
46
|
+
{
|
47
|
+
"internalType": "address",
|
48
|
+
"name": "target",
|
49
|
+
"type": "address"
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"name": "AddressEmptyCode",
|
53
|
+
"type": "error"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"inputs": [
|
57
|
+
{
|
58
|
+
"internalType": "address",
|
59
|
+
"name": "account",
|
60
|
+
"type": "address"
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"name": "AddressInsufficientBalance",
|
64
|
+
"type": "error"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"inputs": [],
|
68
|
+
"name": "FailedInnerCall",
|
69
|
+
"type": "error"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"inputs": [],
|
73
|
+
"name": "ReentrancyGuardReentrantCall",
|
74
|
+
"type": "error"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"inputs": [
|
78
|
+
{
|
79
|
+
"internalType": "address",
|
80
|
+
"name": "token",
|
81
|
+
"type": "address"
|
82
|
+
}
|
83
|
+
],
|
84
|
+
"name": "SafeERC20FailedOperation",
|
85
|
+
"type": "error"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"anonymous": false,
|
89
|
+
"inputs": [
|
90
|
+
{
|
91
|
+
"indexed": true,
|
92
|
+
"internalType": "bytes32",
|
93
|
+
"name": "role",
|
94
|
+
"type": "bytes32"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"indexed": true,
|
98
|
+
"internalType": "bytes32",
|
99
|
+
"name": "previousAdminRole",
|
100
|
+
"type": "bytes32"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"indexed": true,
|
104
|
+
"internalType": "bytes32",
|
105
|
+
"name": "newAdminRole",
|
106
|
+
"type": "bytes32"
|
107
|
+
}
|
108
|
+
],
|
109
|
+
"name": "RoleAdminChanged",
|
110
|
+
"type": "event"
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"anonymous": false,
|
114
|
+
"inputs": [
|
115
|
+
{
|
116
|
+
"indexed": true,
|
117
|
+
"internalType": "bytes32",
|
118
|
+
"name": "role",
|
119
|
+
"type": "bytes32"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"indexed": true,
|
123
|
+
"internalType": "address",
|
124
|
+
"name": "account",
|
125
|
+
"type": "address"
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"indexed": true,
|
129
|
+
"internalType": "address",
|
130
|
+
"name": "sender",
|
131
|
+
"type": "address"
|
132
|
+
}
|
133
|
+
],
|
134
|
+
"name": "RoleGranted",
|
135
|
+
"type": "event"
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"anonymous": false,
|
139
|
+
"inputs": [
|
140
|
+
{
|
141
|
+
"indexed": true,
|
142
|
+
"internalType": "bytes32",
|
143
|
+
"name": "role",
|
144
|
+
"type": "bytes32"
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"indexed": true,
|
148
|
+
"internalType": "address",
|
149
|
+
"name": "account",
|
150
|
+
"type": "address"
|
151
|
+
},
|
152
|
+
{
|
153
|
+
"indexed": true,
|
154
|
+
"internalType": "address",
|
155
|
+
"name": "sender",
|
156
|
+
"type": "address"
|
157
|
+
}
|
158
|
+
],
|
159
|
+
"name": "RoleRevoked",
|
160
|
+
"type": "event"
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"anonymous": false,
|
164
|
+
"inputs": [
|
165
|
+
{
|
166
|
+
"indexed": true,
|
167
|
+
"internalType": "address",
|
168
|
+
"name": "sender",
|
169
|
+
"type": "address"
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"indexed": true,
|
173
|
+
"internalType": "address",
|
174
|
+
"name": "rewardBeneficiary",
|
175
|
+
"type": "address"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"indexed": false,
|
179
|
+
"internalType": "address[]",
|
180
|
+
"name": "path",
|
181
|
+
"type": "address[]"
|
182
|
+
},
|
183
|
+
{
|
184
|
+
"indexed": false,
|
185
|
+
"internalType": "uint256[]",
|
186
|
+
"name": "swapAmounts",
|
187
|
+
"type": "uint256[]"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"indexed": false,
|
191
|
+
"internalType": "uint256",
|
192
|
+
"name": "minAmountOut",
|
193
|
+
"type": "uint256"
|
194
|
+
},
|
195
|
+
{
|
196
|
+
"indexed": false,
|
197
|
+
"internalType": "uint256",
|
198
|
+
"name": "deadline",
|
199
|
+
"type": "uint256"
|
200
|
+
},
|
201
|
+
{
|
202
|
+
"indexed": false,
|
203
|
+
"internalType": "uint256",
|
204
|
+
"name": "rewardAmount",
|
205
|
+
"type": "uint256"
|
206
|
+
}
|
207
|
+
],
|
208
|
+
"name": "SwappedAndRecycled",
|
209
|
+
"type": "event"
|
210
|
+
},
|
211
|
+
{
|
212
|
+
"inputs": [],
|
213
|
+
"name": "ADMIN_ROLE",
|
214
|
+
"outputs": [
|
215
|
+
{
|
216
|
+
"internalType": "bytes32",
|
217
|
+
"name": "",
|
218
|
+
"type": "bytes32"
|
219
|
+
}
|
220
|
+
],
|
221
|
+
"stateMutability": "view",
|
222
|
+
"type": "function"
|
223
|
+
},
|
224
|
+
{
|
225
|
+
"inputs": [],
|
226
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
227
|
+
"outputs": [
|
228
|
+
{
|
229
|
+
"internalType": "bytes32",
|
230
|
+
"name": "",
|
231
|
+
"type": "bytes32"
|
232
|
+
}
|
233
|
+
],
|
234
|
+
"stateMutability": "view",
|
235
|
+
"type": "function"
|
236
|
+
},
|
237
|
+
{
|
238
|
+
"inputs": [
|
239
|
+
{
|
240
|
+
"internalType": "bytes32",
|
241
|
+
"name": "role",
|
242
|
+
"type": "bytes32"
|
243
|
+
}
|
244
|
+
],
|
245
|
+
"name": "getRoleAdmin",
|
246
|
+
"outputs": [
|
247
|
+
{
|
248
|
+
"internalType": "bytes32",
|
249
|
+
"name": "",
|
250
|
+
"type": "bytes32"
|
251
|
+
}
|
252
|
+
],
|
253
|
+
"stateMutability": "view",
|
254
|
+
"type": "function"
|
255
|
+
},
|
256
|
+
{
|
257
|
+
"inputs": [
|
258
|
+
{
|
259
|
+
"internalType": "bytes32",
|
260
|
+
"name": "role",
|
261
|
+
"type": "bytes32"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"internalType": "address",
|
265
|
+
"name": "account",
|
266
|
+
"type": "address"
|
267
|
+
}
|
268
|
+
],
|
269
|
+
"name": "grantRole",
|
270
|
+
"outputs": [],
|
271
|
+
"stateMutability": "nonpayable",
|
272
|
+
"type": "function"
|
273
|
+
},
|
274
|
+
{
|
275
|
+
"inputs": [
|
276
|
+
{
|
277
|
+
"internalType": "bytes32",
|
278
|
+
"name": "role",
|
279
|
+
"type": "bytes32"
|
280
|
+
},
|
281
|
+
{
|
282
|
+
"internalType": "address",
|
283
|
+
"name": "account",
|
284
|
+
"type": "address"
|
285
|
+
}
|
286
|
+
],
|
287
|
+
"name": "hasRole",
|
288
|
+
"outputs": [
|
289
|
+
{
|
290
|
+
"internalType": "bool",
|
291
|
+
"name": "",
|
292
|
+
"type": "bool"
|
293
|
+
}
|
294
|
+
],
|
295
|
+
"stateMutability": "view",
|
296
|
+
"type": "function"
|
297
|
+
},
|
298
|
+
{
|
299
|
+
"inputs": [],
|
300
|
+
"name": "recycledToken",
|
301
|
+
"outputs": [
|
302
|
+
{
|
303
|
+
"internalType": "contract IERC20",
|
304
|
+
"name": "",
|
305
|
+
"type": "address"
|
306
|
+
}
|
307
|
+
],
|
308
|
+
"stateMutability": "view",
|
309
|
+
"type": "function"
|
310
|
+
},
|
311
|
+
{
|
312
|
+
"inputs": [
|
313
|
+
{
|
314
|
+
"internalType": "bytes32",
|
315
|
+
"name": "role",
|
316
|
+
"type": "bytes32"
|
317
|
+
},
|
318
|
+
{
|
319
|
+
"internalType": "address",
|
320
|
+
"name": "callerConfirmation",
|
321
|
+
"type": "address"
|
322
|
+
}
|
323
|
+
],
|
324
|
+
"name": "renounceRole",
|
325
|
+
"outputs": [],
|
326
|
+
"stateMutability": "nonpayable",
|
327
|
+
"type": "function"
|
328
|
+
},
|
329
|
+
{
|
330
|
+
"inputs": [
|
331
|
+
{
|
332
|
+
"internalType": "bytes32",
|
333
|
+
"name": "role",
|
334
|
+
"type": "bytes32"
|
335
|
+
},
|
336
|
+
{
|
337
|
+
"internalType": "address",
|
338
|
+
"name": "account",
|
339
|
+
"type": "address"
|
340
|
+
}
|
341
|
+
],
|
342
|
+
"name": "revokeRole",
|
343
|
+
"outputs": [],
|
344
|
+
"stateMutability": "nonpayable",
|
345
|
+
"type": "function"
|
346
|
+
},
|
347
|
+
{
|
348
|
+
"inputs": [
|
349
|
+
{
|
350
|
+
"internalType": "bytes4",
|
351
|
+
"name": "interfaceId",
|
352
|
+
"type": "bytes4"
|
353
|
+
}
|
354
|
+
],
|
355
|
+
"name": "supportsInterface",
|
356
|
+
"outputs": [
|
357
|
+
{
|
358
|
+
"internalType": "bool",
|
359
|
+
"name": "",
|
360
|
+
"type": "bool"
|
361
|
+
}
|
362
|
+
],
|
363
|
+
"stateMutability": "view",
|
364
|
+
"type": "function"
|
365
|
+
},
|
366
|
+
{
|
367
|
+
"inputs": [
|
368
|
+
{
|
369
|
+
"internalType": "address",
|
370
|
+
"name": "rewardBeneficiary_",
|
371
|
+
"type": "address"
|
372
|
+
},
|
373
|
+
{
|
374
|
+
"internalType": "address[]",
|
375
|
+
"name": "path_",
|
376
|
+
"type": "address[]"
|
377
|
+
},
|
378
|
+
{
|
379
|
+
"internalType": "uint256",
|
380
|
+
"name": "amountIn_",
|
381
|
+
"type": "uint256"
|
382
|
+
},
|
383
|
+
{
|
384
|
+
"internalType": "uint256",
|
385
|
+
"name": "minAmountOut_",
|
386
|
+
"type": "uint256"
|
387
|
+
},
|
388
|
+
{
|
389
|
+
"internalType": "uint256",
|
390
|
+
"name": "price_",
|
391
|
+
"type": "uint256"
|
392
|
+
},
|
393
|
+
{
|
394
|
+
"internalType": "uint256",
|
395
|
+
"name": "deadline_",
|
396
|
+
"type": "uint256"
|
397
|
+
},
|
398
|
+
{
|
399
|
+
"internalType": "bytes",
|
400
|
+
"name": "signature_",
|
401
|
+
"type": "bytes"
|
402
|
+
}
|
403
|
+
],
|
404
|
+
"name": "swapAndRecycle",
|
405
|
+
"outputs": [
|
406
|
+
{
|
407
|
+
"internalType": "uint256",
|
408
|
+
"name": "",
|
409
|
+
"type": "uint256"
|
410
|
+
}
|
411
|
+
],
|
412
|
+
"stateMutability": "nonpayable",
|
413
|
+
"type": "function"
|
414
|
+
},
|
415
|
+
{
|
416
|
+
"inputs": [
|
417
|
+
{
|
418
|
+
"internalType": "address",
|
419
|
+
"name": "rewardBeneficiary_",
|
420
|
+
"type": "address"
|
421
|
+
},
|
422
|
+
{
|
423
|
+
"internalType": "address[]",
|
424
|
+
"name": "path_",
|
425
|
+
"type": "address[]"
|
426
|
+
},
|
427
|
+
{
|
428
|
+
"internalType": "uint256",
|
429
|
+
"name": "minAmountOut_",
|
430
|
+
"type": "uint256"
|
431
|
+
},
|
432
|
+
{
|
433
|
+
"internalType": "uint256",
|
434
|
+
"name": "price_",
|
435
|
+
"type": "uint256"
|
436
|
+
},
|
437
|
+
{
|
438
|
+
"internalType": "uint256",
|
439
|
+
"name": "deadline_",
|
440
|
+
"type": "uint256"
|
441
|
+
},
|
442
|
+
{
|
443
|
+
"internalType": "bytes",
|
444
|
+
"name": "signature_",
|
445
|
+
"type": "bytes"
|
446
|
+
}
|
447
|
+
],
|
448
|
+
"name": "swapETHAndRecycle",
|
449
|
+
"outputs": [
|
450
|
+
{
|
451
|
+
"internalType": "uint256",
|
452
|
+
"name": "",
|
453
|
+
"type": "uint256"
|
454
|
+
}
|
455
|
+
],
|
456
|
+
"stateMutability": "payable",
|
457
|
+
"type": "function"
|
458
|
+
},
|
459
|
+
{
|
460
|
+
"inputs": [],
|
461
|
+
"name": "swapRouter",
|
462
|
+
"outputs": [
|
463
|
+
{
|
464
|
+
"internalType": "contract IUniswapV2Router02",
|
465
|
+
"name": "",
|
466
|
+
"type": "address"
|
467
|
+
}
|
468
|
+
],
|
469
|
+
"stateMutability": "view",
|
470
|
+
"type": "function"
|
471
|
+
},
|
472
|
+
{
|
473
|
+
"inputs": [],
|
474
|
+
"name": "tokenRecycler",
|
475
|
+
"outputs": [
|
476
|
+
{
|
477
|
+
"internalType": "contract ITokenRecycler",
|
478
|
+
"name": "",
|
479
|
+
"type": "address"
|
480
|
+
}
|
481
|
+
],
|
482
|
+
"stateMutability": "view",
|
483
|
+
"type": "function"
|
484
|
+
},
|
485
|
+
{
|
486
|
+
"inputs": [
|
487
|
+
{
|
488
|
+
"internalType": "uint256",
|
489
|
+
"name": "amount_",
|
490
|
+
"type": "uint256"
|
491
|
+
}
|
492
|
+
],
|
493
|
+
"name": "withdrawETH",
|
494
|
+
"outputs": [],
|
495
|
+
"stateMutability": "nonpayable",
|
496
|
+
"type": "function"
|
497
|
+
},
|
498
|
+
{
|
499
|
+
"inputs": [
|
500
|
+
{
|
501
|
+
"internalType": "contract IERC20",
|
502
|
+
"name": "token_",
|
503
|
+
"type": "address"
|
504
|
+
},
|
505
|
+
{
|
506
|
+
"internalType": "uint256",
|
507
|
+
"name": "amount_",
|
508
|
+
"type": "uint256"
|
509
|
+
}
|
510
|
+
],
|
511
|
+
"name": "withdrawToken",
|
512
|
+
"outputs": [],
|
513
|
+
"stateMutability": "nonpayable",
|
514
|
+
"type": "function"
|
515
|
+
}
|
516
|
+
]
|
package/dist/index.d.ts
CHANGED
@@ -9,11 +9,10 @@ import { SwapInfo } from './types/SwapInfo';
|
|
9
9
|
import { VaultDepositToken } from './types/VaultDepositToken';
|
10
10
|
import { VaultType } from './types/VaultType';
|
11
11
|
import { UserVaultBalance } from './types/UserVaultBalance';
|
12
|
-
import { UserMetaVaultBalance } from './types/UserMetaVaultBalance';
|
13
12
|
import { UserBalance } from './types/UserBalance';
|
14
13
|
import { VaultStats } from './types/VaultStats';
|
15
14
|
import { Chain } from './DripConfig';
|
16
15
|
import MyPerqData from './types/MyPerqData';
|
17
16
|
import ELoyaltyCardTier from './types/ELoyaltyCardTier';
|
18
|
-
import
|
19
|
-
export { Vault, VaultReward, DripSdk, UserVaultBalance, UserBalance, VaultStats, AuthenticationStatus, NFTBoost, Strategy, StretchGoal, SwapInfo, VaultDepositToken, VaultType,
|
17
|
+
import BeanEntry from './types/BeanEntry';
|
18
|
+
export { Vault, VaultReward, DripSdk, UserVaultBalance, UserBalance, VaultStats, AuthenticationStatus, NFTBoost, Strategy, StretchGoal, SwapInfo, VaultDepositToken, VaultType, MyPerqData, Chain, ELoyaltyCardTier, BeanEntry };
|
package/dist/test.js
CHANGED
@@ -16,11 +16,10 @@ exports.signer = void 0;
|
|
16
16
|
const ethers_1 = require("ethers");
|
17
17
|
const DripConfig_1 = require("./DripConfig");
|
18
18
|
const DripSdk_1 = __importDefault(require("./DripSdk"));
|
19
|
-
const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
|
20
19
|
// This is script to test locally the drip sdk methods
|
21
20
|
const account2 = '0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848'; // privKey 92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787
|
22
|
-
const privKey = '6ffc226f7b7769e27124317372c9dbb579a324e67e97bf07131bf2f59ec0f4fe';
|
23
|
-
|
21
|
+
// const privKey: string = '6ffc226f7b7769e27124317372c9dbb579a324e67e97bf07131bf2f59ec0f4fe';
|
22
|
+
const privKey = '92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787';
|
24
23
|
const testConfigParams = {
|
25
24
|
subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
|
26
25
|
priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
|
@@ -35,7 +34,6 @@ const testConfigParams = {
|
|
35
34
|
IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
|
36
35
|
IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
|
37
36
|
ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
|
38
|
-
IMetaVaultFactory: '0x28a3a4f4D469Fb33601639Db40a800ca6776A3d0',
|
39
37
|
}
|
40
38
|
},
|
41
39
|
dripContracts: {
|
@@ -43,7 +41,7 @@ const testConfigParams = {
|
|
43
41
|
DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78' // Sepolia contract address
|
44
42
|
}
|
45
43
|
};
|
46
|
-
const
|
44
|
+
const configParams = {
|
47
45
|
subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
|
48
46
|
priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
|
49
47
|
rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
|
@@ -57,7 +55,6 @@ const sepoliaConfigParams = {
|
|
57
55
|
IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
|
58
56
|
IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
|
59
57
|
ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
|
60
|
-
IMetaVaultFactory: '0xe07a896CFD8FEdFb6d7515480853c5D5ED30EBFE',
|
61
58
|
},
|
62
59
|
},
|
63
60
|
dripContracts: {
|
@@ -65,24 +62,6 @@ const sepoliaConfigParams = {
|
|
65
62
|
DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78' // Sepolia contract address
|
66
63
|
}
|
67
64
|
};
|
68
|
-
const mainnetConfigParams = {
|
69
|
-
subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2/api',
|
70
|
-
priceFeedApiUrl: 'https://pricefeed.v2.spool.fi/',
|
71
|
-
rewardsUrl: 'https://rewards.v2.spool.fi/',
|
72
|
-
fastRedeemApi: 'https://fastwithdraw.v2.spool.fi/',
|
73
|
-
contracts: {
|
74
|
-
1: {
|
75
|
-
ISmartVaultManager: '0x23Daf34e2b9Af02A74dC19cB52Af727B19403874',
|
76
|
-
IDepositSwap: '0xd8534197Bd587F8226d12E0C864ef2CaE6f82f5C',
|
77
|
-
ISmartVaultFactory: '0x362599Cdc123e3FFEB7c0812d769128D180667E8',
|
78
|
-
IDepositManager: '0x823Ba38992825FF37E72B6c3D669a09173B8F7bf',
|
79
|
-
IRewardManager: '0xd8d2C1C3C7982272e3e12dEC5aF681433fdcf003',
|
80
|
-
IStrategyRegistry: '0x554c6bCB54656390aca0a0af38CA954dbE653F15',
|
81
|
-
ISpoolLens: '0x8aa6174333F75421903b2B5c70DdF8DA5D84f74F',
|
82
|
-
IMetaVaultFactory: '0x28a3a4f4D469Fb33601639Db40a800ca6776A3d0'
|
83
|
-
},
|
84
|
-
}
|
85
|
-
};
|
86
65
|
const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider('https://rpc.ankr.com/eth_sepolia', 11155111);
|
87
66
|
exports.signer = new ethers_1.ethers.Wallet(privKey, provider);
|
88
67
|
// const random_address = '0x25dFcFB061956c6f33B1ee032cc33837d0b83257';
|
@@ -91,30 +70,21 @@ const daiVaultPerq = '0x1977efe478ba17da8be6e93fdfadbd3055d30111'; // DAI PERQ S
|
|
91
70
|
const usdcVaultPerq = '0xf9795bfbf7c40981c372d0fb25a87e0b694c4fcd'; // USDC PERQ SEPOLIA
|
92
71
|
const daiTokenAddress = '0x2a3a3872c242c35093a8fc48dac838c4b2d24a03'; // DAI TOKEN
|
93
72
|
const usdcTokenAddress = '0xa6b92fcd4ee124353c8a6acf1edb574f46f3f8df'; // USDC TOKEN
|
94
|
-
const dripConfig = new DripConfig_1.DripConfig(DripConfig_1.Chain.SEPOLIA, 'http://localhost:3000');
|
95
73
|
const dripSdk = new DripSdk_1.default(DripConfig_1.Chain.SEPOLIA, exports.signer, 'https://localhost:3000');
|
96
74
|
// 0x689Baa4821865Cb328F5E847fB6133DEB315A832
|
97
75
|
// 0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848
|
98
|
-
const usdcMetaVaultAddress = '0x89845afce65a62a4411c7ed9d0729e06147b47ca'.toLowerCase();
|
99
|
-
const wethMetaVautlAddress = '0xecf5325ccd0cf71b9d400ebbefd84f70b76a56f2';
|
100
76
|
function main() {
|
101
77
|
return __awaiter(this, void 0, void 0, function* () {
|
102
78
|
try {
|
103
|
-
//
|
104
|
-
const
|
105
|
-
//
|
106
|
-
//
|
107
|
-
//
|
108
|
-
const
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
const res = yield spoolSdk.metaVaultDeposit(usdcMetaVaultAddress, '10000000');
|
113
|
-
console.log(JSON.stringify(res, null, 2));
|
114
|
-
// const res = await dripSdk.getUserMetaVaultBalance('0x89845afce65a62a4411c7ed9d0729e06147b47ca');
|
115
|
-
// const res = await dripSdk.approveTokenForMetaVaultDeposit('0x88b25a14dae46c33ae3eef2b45a5ec758d9a5ec6', wethMetaVautlAddress, '0.002');
|
116
|
-
// const res = await dripSdk.depositMetaVault(wethMetaVautlAddress, '0.002');
|
117
|
-
// console.log(res);
|
79
|
+
// const res = await dripSdk.deposit(usdcTokenAddress,usdcVaultPerq, '1000');
|
80
|
+
// const res = await dripSdk.withdraw(usdcVaultPerq, '1');
|
81
|
+
// await dripSdk.authenticate()
|
82
|
+
// const res = await dripSdk.getDripTokenBalance(account2)
|
83
|
+
// const res = await dripSdk.getNextLoyaltyCard()
|
84
|
+
// const res = await dripSdk.getOwnedLoyaltyCards()
|
85
|
+
// const res = await dripSdk.getBeansBalance()
|
86
|
+
// const res = await dripSdk.recycleTokens()
|
87
|
+
// const res = await dripSdk.upgradeLoyaltyCard()
|
118
88
|
}
|
119
89
|
catch (error) {
|
120
90
|
console.log(`Main error: ${error}`);
|