@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/dist/test.js DELETED
@@ -1,92 +0,0 @@
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
- exports.signer = void 0;
16
- const ethers_1 = require("ethers");
17
- const DripConfig_1 = require("./DripConfig");
18
- const DripSdk_1 = __importDefault(require("./DripSdk"));
19
- // This is script to test locally the drip sdk methods
20
- const account2 = '0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848'; // privKey 92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787
21
- // const privKey: string = '6ffc226f7b7769e27124317372c9dbb579a324e67e97bf07131bf2f59ec0f4fe';
22
- const privKey = '92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787';
23
- const testConfigParams = {
24
- subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
25
- priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
26
- rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
27
- fastRedeemApi: 'https://fastwithdraw.dev.spool.fi/sepolia',
28
- spoolContracts: {
29
- 11155111: {
30
- ISmartVaultManager: '0x2638d6c0b4EF6Dee04050fA0B07CA62500435747',
31
- IDepositSwap: '0x5FB08e00DE169f041711206A0995410884080177',
32
- ISmartVaultFactory: '0x86BB0376929218ba1cb825cE2ebE801bFCcD8149',
33
- IDepositManager: '0xfA37dd47F3596681C39D3a1b55474595BB591dc9',
34
- IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
35
- IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
36
- ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
37
- }
38
- },
39
- dripContracts: {
40
- DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
41
- DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78' // Sepolia contract address
42
- }
43
- };
44
- const configParams = {
45
- subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
46
- priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
47
- rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
48
- fastRedeemApi: 'https://fastwithdraw.dev.spool.fi/sepolia',
49
- contracts: {
50
- 11155111: {
51
- ISmartVaultManager: '0x2638d6c0b4EF6Dee04050fA0B07CA62500435747',
52
- IDepositSwap: '0x5FB08e00DE169f041711206A0995410884080177',
53
- ISmartVaultFactory: '0x86BB0376929218ba1cb825cE2ebE801bFCcD8149',
54
- IDepositManager: '0xfA37dd47F3596681C39D3a1b55474595BB591dc9',
55
- IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
56
- IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
57
- ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
58
- },
59
- },
60
- dripContracts: {
61
- DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
62
- DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78' // Sepolia contract address
63
- }
64
- };
65
- const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider('https://rpc.ankr.com/eth_sepolia', 11155111);
66
- exports.signer = new ethers_1.ethers.Wallet(privKey, provider);
67
- // const random_address = '0x25dFcFB061956c6f33B1ee032cc33837d0b83257';
68
- const vaultAddress = '0x457d29df2449439a86521a1cea1561d24cc67a93'; // USDC AUKI
69
- const daiVaultPerq = '0x1977efe478ba17da8be6e93fdfadbd3055d30111'; // DAI PERQ SEPOLIA
70
- const usdcVaultPerq = '0xf9795bfbf7c40981c372d0fb25a87e0b694c4fcd'; // USDC PERQ SEPOLIA
71
- const daiTokenAddress = '0x2a3a3872c242c35093a8fc48dac838c4b2d24a03'; // DAI TOKEN
72
- const usdcTokenAddress = '0xa6b92fcd4ee124353c8a6acf1edb574f46f3f8df'; // USDC TOKEN
73
- const dripSdk = new DripSdk_1.default(DripConfig_1.Chain.SEPOLIA, exports.signer, 'https://localhost:3000');
74
- // 0x689Baa4821865Cb328F5E847fB6133DEB315A832
75
- // 0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848
76
- function main() {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- try {
79
- // const res = await dripSdk.deposit(usdcTokenAddress,usdcVaultPerq, '1000');
80
- // const res = await dripSdk.withdraw(usdcVaultPerq, '1');
81
- // const res = await dripSdk.getDripTokenBalance(account2)
82
- // const res = await dripSdk.getOwnedLoyaltyCard()
83
- // const res = await dripSdk.getBeansBalance()
84
- // const res = await dripSdk.recycleTokens()
85
- // const res = await dripSdk.upgradeLoyaltyCard()
86
- }
87
- catch (error) {
88
- console.log(`Main error: ${error}`);
89
- }
90
- });
91
- }
92
- main();
package/dist/utils.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function insertDot(numberString: string, decimals: number): string;
package/dist/utils.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insertDot = insertDot;
4
- function insertDot(numberString, decimals) {
5
- if (numberString.length < decimals + 1) {
6
- numberString = '0'.repeat(decimals + 1 - numberString.length) + numberString;
7
- }
8
- const indexToInsertDot = numberString.length - decimals;
9
- // Ensure there is a part before the dot, even if it's 0
10
- const beforeDecimal = indexToInsertDot > 0 ? numberString.slice(0, indexToInsertDot) : '0';
11
- const afterDecimal = numberString.slice(indexToInsertDot);
12
- return `${beforeDecimal}.${afterDecimal}`;
13
- }
File without changes
File without changes
File without changes