@dripfi/drip-sdk 1.1.25 → 1.1.26
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/DripSdk.d.ts
CHANGED
@@ -45,7 +45,7 @@ export default class DripSdk {
|
|
45
45
|
getBeansBalance(headers?: Headers): Promise<{
|
46
46
|
balance: number;
|
47
47
|
}>;
|
48
|
-
recycleTokens(amount: string): Promise<string>;
|
48
|
+
recycleTokens(amount: string, beneficiary?: string): Promise<string>;
|
49
49
|
upgradeLoyaltyCard(): Promise<LoyaltyCard>;
|
50
50
|
getNextLoyaltyCard(headers?: Headers): Promise<LoyaltyCard>;
|
51
51
|
getOwnedLoyaltyCards(headers?: Headers): Promise<LoyaltyCard>;
|
package/dist/DripSdk.js
CHANGED
@@ -347,7 +347,7 @@ class DripSdk {
|
|
347
347
|
return this.dripApi.fetchBeansBalance(authData.token, headers);
|
348
348
|
});
|
349
349
|
}
|
350
|
-
recycleTokens(amount) {
|
350
|
+
recycleTokens(amount, beneficiary) {
|
351
351
|
return __awaiter(this, void 0, void 0, function* () {
|
352
352
|
const authData = yield this.isUserAuthenticated();
|
353
353
|
if (!authData.isAuthenticated) {
|
@@ -358,7 +358,7 @@ class DripSdk {
|
|
358
358
|
}
|
359
359
|
const decimals = yield this.getERC20Precission(this.dripConfig.dripTokenAddress);
|
360
360
|
const amountWithDecimals = parseFloat(parseFloat(amount).toFixed(decimals));
|
361
|
-
const recycleTx = yield this.dripTokenRecyclerContract.recycle(ethers_1.ethers.utils.parseUnits(amountWithDecimals.toString(), decimals).toString());
|
361
|
+
const recycleTx = yield this.dripTokenRecyclerContract.recycle(ethers_1.ethers.utils.parseUnits(amountWithDecimals.toString(), decimals).toString(), beneficiary);
|
362
362
|
const receipt = yield recycleTx.wait();
|
363
363
|
return receipt.transactionHash;
|
364
364
|
});
|
@@ -2,5 +2,5 @@ import { ContractTransaction, ethers } from 'ethers';
|
|
2
2
|
import BaseDripContract from './BaseDripContract';
|
3
3
|
export default class DripTokenRecyclerContract extends BaseDripContract {
|
4
4
|
constructor(address: string, signer?: ethers.Signer);
|
5
|
-
recycle(amount: string): Promise<ContractTransaction>;
|
5
|
+
recycle(amount: string, rewardBeneficiary?: string): Promise<ContractTransaction>;
|
6
6
|
}
|
@@ -15,16 +15,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const ethers_1 = require("ethers");
|
16
16
|
const TokenRecyclerAbi_json_1 = __importDefault(require("./abi/TokenRecyclerAbi.json"));
|
17
17
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
18
|
+
const DripConfig_1 = require("../DripConfig");
|
18
19
|
class DripTokenRecyclerContract extends BaseDripContract_1.default {
|
19
20
|
constructor(address, signer) {
|
20
21
|
super(address, new ethers_1.ethers.utils.Interface(TokenRecyclerAbi_json_1.default), signer);
|
21
22
|
}
|
22
|
-
recycle(amount) {
|
23
|
+
recycle(amount, rewardBeneficiary) {
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
24
25
|
if (!this.contract.signer) {
|
25
26
|
throw Error('No signer provided');
|
26
27
|
}
|
27
|
-
return yield this.contract.recycle(amount);
|
28
|
+
return yield this.contract.recycle(amount, rewardBeneficiary ? rewardBeneficiary : DripConfig_1.NULL_ADDRESS);
|
28
29
|
});
|
29
30
|
}
|
30
31
|
}
|
@@ -1 +1,531 @@
|
|
1
|
-
[
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"inputs": [
|
4
|
+
{
|
5
|
+
"internalType": "contract IERC20",
|
6
|
+
"name": "token",
|
7
|
+
"type": "address"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"internalType": "address",
|
11
|
+
"name": "admin",
|
12
|
+
"type": "address"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"internalType": "address",
|
16
|
+
"name": "beneficiaryAddress_",
|
17
|
+
"type": "address"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"internalType": "uint256",
|
21
|
+
"name": "beneficiaryShare_",
|
22
|
+
"type": "uint256"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"internalType": "uint256",
|
26
|
+
"name": "recycledTokenToRewardRatio_",
|
27
|
+
"type": "uint256"
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"stateMutability": "nonpayable",
|
31
|
+
"type": "constructor"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"inputs": [],
|
35
|
+
"name": "AccessControlBadConfirmation",
|
36
|
+
"type": "error"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"inputs": [
|
40
|
+
{
|
41
|
+
"internalType": "address",
|
42
|
+
"name": "account",
|
43
|
+
"type": "address"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"internalType": "bytes32",
|
47
|
+
"name": "neededRole",
|
48
|
+
"type": "bytes32"
|
49
|
+
}
|
50
|
+
],
|
51
|
+
"name": "AccessControlUnauthorizedAccount",
|
52
|
+
"type": "error"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"inputs": [
|
56
|
+
{
|
57
|
+
"internalType": "address",
|
58
|
+
"name": "target",
|
59
|
+
"type": "address"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"name": "AddressEmptyCode",
|
63
|
+
"type": "error"
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"inputs": [
|
67
|
+
{
|
68
|
+
"internalType": "address",
|
69
|
+
"name": "account",
|
70
|
+
"type": "address"
|
71
|
+
}
|
72
|
+
],
|
73
|
+
"name": "AddressInsufficientBalance",
|
74
|
+
"type": "error"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"inputs": [],
|
78
|
+
"name": "FailedInnerCall",
|
79
|
+
"type": "error"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"inputs": [
|
83
|
+
{
|
84
|
+
"internalType": "address",
|
85
|
+
"name": "token",
|
86
|
+
"type": "address"
|
87
|
+
}
|
88
|
+
],
|
89
|
+
"name": "SafeERC20FailedOperation",
|
90
|
+
"type": "error"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"anonymous": false,
|
94
|
+
"inputs": [
|
95
|
+
{
|
96
|
+
"indexed": true,
|
97
|
+
"internalType": "address",
|
98
|
+
"name": "sender",
|
99
|
+
"type": "address"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"indexed": true,
|
103
|
+
"internalType": "address",
|
104
|
+
"name": "rewardBeneficiary",
|
105
|
+
"type": "address"
|
106
|
+
},
|
107
|
+
{
|
108
|
+
"indexed": false,
|
109
|
+
"internalType": "uint256",
|
110
|
+
"name": "recycledAmount",
|
111
|
+
"type": "uint256"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"indexed": false,
|
115
|
+
"internalType": "uint256",
|
116
|
+
"name": "rewardAmount",
|
117
|
+
"type": "uint256"
|
118
|
+
}
|
119
|
+
],
|
120
|
+
"name": "Recycled",
|
121
|
+
"type": "event"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"anonymous": false,
|
125
|
+
"inputs": [
|
126
|
+
{
|
127
|
+
"indexed": true,
|
128
|
+
"internalType": "bytes32",
|
129
|
+
"name": "role",
|
130
|
+
"type": "bytes32"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"indexed": true,
|
134
|
+
"internalType": "bytes32",
|
135
|
+
"name": "previousAdminRole",
|
136
|
+
"type": "bytes32"
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"indexed": true,
|
140
|
+
"internalType": "bytes32",
|
141
|
+
"name": "newAdminRole",
|
142
|
+
"type": "bytes32"
|
143
|
+
}
|
144
|
+
],
|
145
|
+
"name": "RoleAdminChanged",
|
146
|
+
"type": "event"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"anonymous": false,
|
150
|
+
"inputs": [
|
151
|
+
{
|
152
|
+
"indexed": true,
|
153
|
+
"internalType": "bytes32",
|
154
|
+
"name": "role",
|
155
|
+
"type": "bytes32"
|
156
|
+
},
|
157
|
+
{
|
158
|
+
"indexed": true,
|
159
|
+
"internalType": "address",
|
160
|
+
"name": "account",
|
161
|
+
"type": "address"
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"indexed": true,
|
165
|
+
"internalType": "address",
|
166
|
+
"name": "sender",
|
167
|
+
"type": "address"
|
168
|
+
}
|
169
|
+
],
|
170
|
+
"name": "RoleGranted",
|
171
|
+
"type": "event"
|
172
|
+
},
|
173
|
+
{
|
174
|
+
"anonymous": false,
|
175
|
+
"inputs": [
|
176
|
+
{
|
177
|
+
"indexed": true,
|
178
|
+
"internalType": "bytes32",
|
179
|
+
"name": "role",
|
180
|
+
"type": "bytes32"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"indexed": true,
|
184
|
+
"internalType": "address",
|
185
|
+
"name": "account",
|
186
|
+
"type": "address"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
"indexed": true,
|
190
|
+
"internalType": "address",
|
191
|
+
"name": "sender",
|
192
|
+
"type": "address"
|
193
|
+
}
|
194
|
+
],
|
195
|
+
"name": "RoleRevoked",
|
196
|
+
"type": "event"
|
197
|
+
},
|
198
|
+
{
|
199
|
+
"inputs": [],
|
200
|
+
"name": "ADMIN_ROLE",
|
201
|
+
"outputs": [
|
202
|
+
{
|
203
|
+
"internalType": "bytes32",
|
204
|
+
"name": "",
|
205
|
+
"type": "bytes32"
|
206
|
+
}
|
207
|
+
],
|
208
|
+
"stateMutability": "view",
|
209
|
+
"type": "function"
|
210
|
+
},
|
211
|
+
{
|
212
|
+
"inputs": [],
|
213
|
+
"name": "BENEFICIARY_SHARE_PRECISION",
|
214
|
+
"outputs": [
|
215
|
+
{
|
216
|
+
"internalType": "uint16",
|
217
|
+
"name": "",
|
218
|
+
"type": "uint16"
|
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": "address",
|
241
|
+
"name": "",
|
242
|
+
"type": "address"
|
243
|
+
}
|
244
|
+
],
|
245
|
+
"name": "addressToReward",
|
246
|
+
"outputs": [
|
247
|
+
{
|
248
|
+
"internalType": "uint256",
|
249
|
+
"name": "",
|
250
|
+
"type": "uint256"
|
251
|
+
}
|
252
|
+
],
|
253
|
+
"stateMutability": "view",
|
254
|
+
"type": "function"
|
255
|
+
},
|
256
|
+
{
|
257
|
+
"inputs": [],
|
258
|
+
"name": "beneficiaryAddress",
|
259
|
+
"outputs": [
|
260
|
+
{
|
261
|
+
"internalType": "address",
|
262
|
+
"name": "",
|
263
|
+
"type": "address"
|
264
|
+
}
|
265
|
+
],
|
266
|
+
"stateMutability": "view",
|
267
|
+
"type": "function"
|
268
|
+
},
|
269
|
+
{
|
270
|
+
"inputs": [],
|
271
|
+
"name": "beneficiaryShare",
|
272
|
+
"outputs": [
|
273
|
+
{
|
274
|
+
"internalType": "uint256",
|
275
|
+
"name": "",
|
276
|
+
"type": "uint256"
|
277
|
+
}
|
278
|
+
],
|
279
|
+
"stateMutability": "view",
|
280
|
+
"type": "function"
|
281
|
+
},
|
282
|
+
{
|
283
|
+
"inputs": [
|
284
|
+
{
|
285
|
+
"internalType": "bytes32",
|
286
|
+
"name": "role",
|
287
|
+
"type": "bytes32"
|
288
|
+
}
|
289
|
+
],
|
290
|
+
"name": "getRoleAdmin",
|
291
|
+
"outputs": [
|
292
|
+
{
|
293
|
+
"internalType": "bytes32",
|
294
|
+
"name": "",
|
295
|
+
"type": "bytes32"
|
296
|
+
}
|
297
|
+
],
|
298
|
+
"stateMutability": "view",
|
299
|
+
"type": "function"
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"inputs": [
|
303
|
+
{
|
304
|
+
"internalType": "bytes32",
|
305
|
+
"name": "role",
|
306
|
+
"type": "bytes32"
|
307
|
+
},
|
308
|
+
{
|
309
|
+
"internalType": "address",
|
310
|
+
"name": "account",
|
311
|
+
"type": "address"
|
312
|
+
}
|
313
|
+
],
|
314
|
+
"name": "grantRole",
|
315
|
+
"outputs": [],
|
316
|
+
"stateMutability": "nonpayable",
|
317
|
+
"type": "function"
|
318
|
+
},
|
319
|
+
{
|
320
|
+
"inputs": [
|
321
|
+
{
|
322
|
+
"internalType": "bytes32",
|
323
|
+
"name": "role",
|
324
|
+
"type": "bytes32"
|
325
|
+
},
|
326
|
+
{
|
327
|
+
"internalType": "address",
|
328
|
+
"name": "account",
|
329
|
+
"type": "address"
|
330
|
+
}
|
331
|
+
],
|
332
|
+
"name": "hasRole",
|
333
|
+
"outputs": [
|
334
|
+
{
|
335
|
+
"internalType": "bool",
|
336
|
+
"name": "",
|
337
|
+
"type": "bool"
|
338
|
+
}
|
339
|
+
],
|
340
|
+
"stateMutability": "view",
|
341
|
+
"type": "function"
|
342
|
+
},
|
343
|
+
{
|
344
|
+
"inputs": [
|
345
|
+
{
|
346
|
+
"internalType": "uint256",
|
347
|
+
"name": "amount",
|
348
|
+
"type": "uint256"
|
349
|
+
},
|
350
|
+
{
|
351
|
+
"internalType": "address",
|
352
|
+
"name": "rewardBeneficiary",
|
353
|
+
"type": "address"
|
354
|
+
}
|
355
|
+
],
|
356
|
+
"name": "recycle",
|
357
|
+
"outputs": [
|
358
|
+
{
|
359
|
+
"internalType": "uint256",
|
360
|
+
"name": "",
|
361
|
+
"type": "uint256"
|
362
|
+
}
|
363
|
+
],
|
364
|
+
"stateMutability": "nonpayable",
|
365
|
+
"type": "function"
|
366
|
+
},
|
367
|
+
{
|
368
|
+
"inputs": [],
|
369
|
+
"name": "recycledToken",
|
370
|
+
"outputs": [
|
371
|
+
{
|
372
|
+
"internalType": "contract IERC20",
|
373
|
+
"name": "",
|
374
|
+
"type": "address"
|
375
|
+
}
|
376
|
+
],
|
377
|
+
"stateMutability": "view",
|
378
|
+
"type": "function"
|
379
|
+
},
|
380
|
+
{
|
381
|
+
"inputs": [],
|
382
|
+
"name": "recycledTokenToRewardRatio",
|
383
|
+
"outputs": [
|
384
|
+
{
|
385
|
+
"internalType": "uint256",
|
386
|
+
"name": "",
|
387
|
+
"type": "uint256"
|
388
|
+
}
|
389
|
+
],
|
390
|
+
"stateMutability": "view",
|
391
|
+
"type": "function"
|
392
|
+
},
|
393
|
+
{
|
394
|
+
"inputs": [
|
395
|
+
{
|
396
|
+
"internalType": "bytes32",
|
397
|
+
"name": "role",
|
398
|
+
"type": "bytes32"
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"internalType": "address",
|
402
|
+
"name": "callerConfirmation",
|
403
|
+
"type": "address"
|
404
|
+
}
|
405
|
+
],
|
406
|
+
"name": "renounceRole",
|
407
|
+
"outputs": [],
|
408
|
+
"stateMutability": "nonpayable",
|
409
|
+
"type": "function"
|
410
|
+
},
|
411
|
+
{
|
412
|
+
"inputs": [
|
413
|
+
{
|
414
|
+
"internalType": "bytes32",
|
415
|
+
"name": "role",
|
416
|
+
"type": "bytes32"
|
417
|
+
},
|
418
|
+
{
|
419
|
+
"internalType": "address",
|
420
|
+
"name": "account",
|
421
|
+
"type": "address"
|
422
|
+
}
|
423
|
+
],
|
424
|
+
"name": "revokeRole",
|
425
|
+
"outputs": [],
|
426
|
+
"stateMutability": "nonpayable",
|
427
|
+
"type": "function"
|
428
|
+
},
|
429
|
+
{
|
430
|
+
"inputs": [],
|
431
|
+
"name": "rewardDecimals",
|
432
|
+
"outputs": [
|
433
|
+
{
|
434
|
+
"internalType": "uint8",
|
435
|
+
"name": "",
|
436
|
+
"type": "uint8"
|
437
|
+
}
|
438
|
+
],
|
439
|
+
"stateMutability": "view",
|
440
|
+
"type": "function"
|
441
|
+
},
|
442
|
+
{
|
443
|
+
"inputs": [
|
444
|
+
{
|
445
|
+
"internalType": "address",
|
446
|
+
"name": "beneficiaryAddress_",
|
447
|
+
"type": "address"
|
448
|
+
}
|
449
|
+
],
|
450
|
+
"name": "setBeneficiaryAddress",
|
451
|
+
"outputs": [],
|
452
|
+
"stateMutability": "nonpayable",
|
453
|
+
"type": "function"
|
454
|
+
},
|
455
|
+
{
|
456
|
+
"inputs": [
|
457
|
+
{
|
458
|
+
"internalType": "uint256",
|
459
|
+
"name": "beneficiaryShare_",
|
460
|
+
"type": "uint256"
|
461
|
+
}
|
462
|
+
],
|
463
|
+
"name": "setBeneficiaryShare",
|
464
|
+
"outputs": [],
|
465
|
+
"stateMutability": "nonpayable",
|
466
|
+
"type": "function"
|
467
|
+
},
|
468
|
+
{
|
469
|
+
"inputs": [
|
470
|
+
{
|
471
|
+
"internalType": "uint256",
|
472
|
+
"name": "recycledTokenToRewardRatio_",
|
473
|
+
"type": "uint256"
|
474
|
+
}
|
475
|
+
],
|
476
|
+
"name": "setRecycledTokenToRewardRatio",
|
477
|
+
"outputs": [],
|
478
|
+
"stateMutability": "nonpayable",
|
479
|
+
"type": "function"
|
480
|
+
},
|
481
|
+
{
|
482
|
+
"inputs": [
|
483
|
+
{
|
484
|
+
"internalType": "bytes4",
|
485
|
+
"name": "interfaceId",
|
486
|
+
"type": "bytes4"
|
487
|
+
}
|
488
|
+
],
|
489
|
+
"name": "supportsInterface",
|
490
|
+
"outputs": [
|
491
|
+
{
|
492
|
+
"internalType": "bool",
|
493
|
+
"name": "",
|
494
|
+
"type": "bool"
|
495
|
+
}
|
496
|
+
],
|
497
|
+
"stateMutability": "view",
|
498
|
+
"type": "function"
|
499
|
+
},
|
500
|
+
{
|
501
|
+
"inputs": [
|
502
|
+
{
|
503
|
+
"internalType": "uint256",
|
504
|
+
"name": "amount",
|
505
|
+
"type": "uint256"
|
506
|
+
}
|
507
|
+
],
|
508
|
+
"name": "withdrawETH",
|
509
|
+
"outputs": [],
|
510
|
+
"stateMutability": "nonpayable",
|
511
|
+
"type": "function"
|
512
|
+
},
|
513
|
+
{
|
514
|
+
"inputs": [
|
515
|
+
{
|
516
|
+
"internalType": "contract IERC20",
|
517
|
+
"name": "token",
|
518
|
+
"type": "address"
|
519
|
+
},
|
520
|
+
{
|
521
|
+
"internalType": "uint256",
|
522
|
+
"name": "amount",
|
523
|
+
"type": "uint256"
|
524
|
+
}
|
525
|
+
],
|
526
|
+
"name": "withdrawToken",
|
527
|
+
"outputs": [],
|
528
|
+
"stateMutability": "nonpayable",
|
529
|
+
"type": "function"
|
530
|
+
}
|
531
|
+
]
|
package/dist/test.js
CHANGED
@@ -17,9 +17,17 @@ const ethers_1 = require("ethers");
|
|
17
17
|
const DripConfig_1 = require("./DripConfig");
|
18
18
|
const DripSdk_1 = __importDefault(require("./DripSdk"));
|
19
19
|
// This is script to test locally the drip sdk methods
|
20
|
+
// OLD RECYCLER ADDRESS
|
21
|
+
// RECYCLER_ADDRESS='0xe943A1320402fcf41cDc04275e842654165dAB78'
|
22
|
+
// DRIP_TOKEN_ADDRESS='0xc9C66052327523d6A7a2ee5D50CF07e4415e27c7'
|
23
|
+
// NEW RECYCLER ADDRESS:
|
24
|
+
// RECYCLER_ADDRESS=0x463aea273644AfF560da07c7c09f3142b87E12f1
|
25
|
+
// TOKEN_ADDRESS: 0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E
|
26
|
+
const RECYCLER_ADDRESS = '0x463aea273644AfF560da07c7c09f3142b87E12f1';
|
27
|
+
const DRIP_TOKEN_ADDRESS = '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E';
|
20
28
|
const account2 = '0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848'; // privKey 92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787
|
21
|
-
|
22
|
-
const privKey = '92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787';
|
29
|
+
const privKey = '6ffc226f7b7769e27124317372c9dbb579a324e67e97bf07131bf2f59ec0f4fe';
|
30
|
+
// const privKey: string = '92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787';
|
23
31
|
const testConfigParams = {
|
24
32
|
subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
|
25
33
|
priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
|
@@ -37,8 +45,8 @@ const testConfigParams = {
|
|
37
45
|
}
|
38
46
|
},
|
39
47
|
dripContracts: {
|
40
|
-
DripTokenAddress:
|
41
|
-
DripTokenRecyclerAddress:
|
48
|
+
DripTokenAddress: DRIP_TOKEN_ADDRESS, // Sepolia contract address
|
49
|
+
DripTokenRecyclerAddress: RECYCLER_ADDRESS // Sepolia contract address
|
42
50
|
}
|
43
51
|
};
|
44
52
|
const configParams = {
|
@@ -58,8 +66,8 @@ const configParams = {
|
|
58
66
|
},
|
59
67
|
},
|
60
68
|
dripContracts: {
|
61
|
-
DripTokenAddress: '
|
62
|
-
DripTokenRecyclerAddress: '
|
69
|
+
DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
|
70
|
+
DripTokenRecyclerAddress: '0x463aea273644AfF560da07c7c09f3142b87E12f1' // Sepolia contract address
|
63
71
|
}
|
64
72
|
};
|
65
73
|
const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider('https://rpc.ankr.com/eth_sepolia', 11155111);
|
@@ -76,6 +84,9 @@ const dripSdk = new DripSdk_1.default(new DripConfig_1.DripConfig(testConfigPara
|
|
76
84
|
function main() {
|
77
85
|
return __awaiter(this, void 0, void 0, function* () {
|
78
86
|
try {
|
87
|
+
// const res = await dripSdk.approveTokenForRecycler(DRIP_TOKEN_ADDRESS.toLowerCase(), '100000000000000000000');
|
88
|
+
const res = yield dripSdk.recycleTokens('100000000000000000000');
|
89
|
+
console.log(res);
|
79
90
|
// const res = await dripSdk.deposit(usdcTokenAddress,usdcVaultPerq, '1000');
|
80
91
|
// const res = await dripSdk.withdraw(usdcVaultPerq, '1');
|
81
92
|
// await dripSdk.authenticate()
|