@dripfi/drip-sdk 1.3.8 → 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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3
+ }
package/CHANGELOG.md CHANGED
@@ -1,12 +1,24 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to the Drip SDK will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7
 
7
8
  ## [1.3.7] - 2025-01-15
9
+
8
10
  ### Added
11
+
9
12
  - Changelog was added
10
13
 
11
14
  ### Changed
12
- - renamed the property `withdrawableBalance` to `claimableBalance` in the type `UserVaultBalance`
15
+
16
+ - renamed the property `withdrawableBalance` to `claimableBalance` in the type `UserVaultBalance`
17
+
18
+ ## [1.3.8] - 2025-01-22
19
+
20
+ ### Changed
21
+
22
+ - updated `MyPerqData` type structure to inherit from `Vault` type
23
+ - adjusted method return type of `getMyPerqBalance` in the `DripSdk` to return `MyPerqData[]` instead of `MyPerqData`
24
+ - adjusted method return types of `fetchMyPerqData` in the `DripApi` to return `MyPerqData[]` instead of `MyPerqData`
package/dist/DripSdk.js CHANGED
@@ -12,7 +12,7 @@ const DripTokenRecyclerContract_1 = __importDefault(require("./contracts/DripTok
12
12
  const DripSwapAndRecyclerContract_1 = __importDefault(require("./contracts/DripSwapAndRecyclerContract"));
13
13
  const PerqVestingContract_1 = __importDefault(require("./contracts/PerqVestingContract"));
14
14
  const utils_1 = require("ethers/lib/utils");
15
- const WethTokenAbi_json_1 = __importDefault(require("./contracts/abi/WethTokenAbi.json"));
15
+ const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json"));
16
16
  class DripSdk {
17
17
  dripApi;
18
18
  dripTokenContract;
@@ -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
+ };
@@ -4,7 +4,7 @@ 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 DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./abi/DripSwapAndRecyclerAbi.json"));
7
+ const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("../abi/DripSwapAndRecyclerAbi.json"));
8
8
  const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
9
9
  const DripConfig_1 = require("../DripConfig");
10
10
  class DripSwapAndRecyclerContract extends BaseDripContract_1.default {
@@ -4,7 +4,7 @@ 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 DripTokenAbi_json_1 = __importDefault(require("./abi/DripTokenAbi.json"));
7
+ const DripTokenAbi_json_1 = __importDefault(require("../abi/DripTokenAbi.json"));
8
8
  const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
9
9
  class DripTokenContract extends BaseDripContract_1.default {
10
10
  constructor(address, signer) {
@@ -4,7 +4,7 @@ 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 TokenRecyclerAbi_json_1 = __importDefault(require("./abi/TokenRecyclerAbi.json"));
7
+ const TokenRecyclerAbi_json_1 = __importDefault(require("../abi/TokenRecyclerAbi.json"));
8
8
  const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
9
9
  const DripConfig_1 = require("../DripConfig");
10
10
  class DripTokenRecyclerContract extends BaseDripContract_1.default {
@@ -4,7 +4,7 @@ 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 PerqVestingAbi_json_1 = __importDefault(require("./abi/PerqVestingAbi.json"));
7
+ const PerqVestingAbi_json_1 = __importDefault(require("../abi/PerqVestingAbi.json"));
8
8
  const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
9
9
  class PerqVestingContract extends BaseDripContract_1.default {
10
10
  constructor(address, signer) {
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 './contracts/abi/DripSwapAndRecyclerAbi.json';
18
- import WETH_TOKEN_ABI from './contracts/abi/WethTokenAbi.json';
19
- import DRIP_TOKEN_ABI from './contracts/abi/DripTokenAbi.json';
20
- import TOKEN_RECYCLER_ABI from './contracts/abi/TokenRecyclerAbi.json';
21
- import PERQ_VESTING_ABI from './contracts/abi/PerqVestingAbi.json';
22
- export { DRIP_SWAP_AND_RECYCLER_ABI, WETH_TOKEN_ABI, DRIP_TOKEN_ABI, TOKEN_RECYCLER_ABI, PERQ_VESTING_ABI, Vault, VaultReward, DripSdk, UserVaultBalance, UserBalance, VaultStats, NFTBoost, Strategy, StretchGoal, SwapInfo, VaultDepositToken, VaultType, MyPerqData, Chain, ELoyaltyCardTier, BeanEntry, };
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("./contracts/abi/DripSwapAndRecyclerAbi.json"));
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("./contracts/abi/WethTokenAbi.json"));
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("./contracts/abi/DripTokenAbi.json"));
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("./contracts/abi/TokenRecyclerAbi.json"));
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("./contracts/abi/PerqVestingAbi.json"));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "build": "tsc",
10
10
  "publish": "npm publish --access public",
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
- "lint": "eslint src/**/*.ts",
12
+ "lint": "eslint src",
13
13
  "pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
14
14
  },
15
15
  "dependencies": {
@@ -20,7 +20,7 @@
20
20
  "license": "ISC",
21
21
  "devDependencies": {
22
22
  "typescript-eslint": "^8.19.1",
23
- "eslint": "^8.57.0",
23
+ "eslint": "^9.17.0",
24
24
  "typescript": "^5.4.5",
25
25
  "prettier-eslint": "^16.3.0",
26
26
  "prettier": "^3.4.2",
package/dist/test.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { ethers } from 'ethers';
2
- export declare const signer: ethers.Wallet;
package/dist/test.js DELETED
@@ -1,81 +0,0 @@
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
- exports.signer = void 0;
7
- const ethers_1 = require("ethers");
8
- const DripConfig_1 = require("./DripConfig");
9
- const DripSdk_1 = __importDefault(require("./DripSdk"));
10
- // This is script to test locally the drip sdk methods
11
- const account2 = '0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848'; // privKey 92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787
12
- // const privKey: string = '6ffc226f7b7769e27124317372c9dbb579a324e67e97bf07131bf2f59ec0f4fe';
13
- const privKey = '92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787';
14
- const testConfigParams = {
15
- subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
16
- priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
17
- rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
18
- fastRedeemApi: 'https://fastwithdraw.dev.spool.fi/sepolia',
19
- spoolContracts: {
20
- 11155111: {
21
- ISmartVaultManager: '0x2638d6c0b4EF6Dee04050fA0B07CA62500435747',
22
- IDepositSwap: '0x5FB08e00DE169f041711206A0995410884080177',
23
- ISmartVaultFactory: '0x86BB0376929218ba1cb825cE2ebE801bFCcD8149',
24
- IDepositManager: '0xfA37dd47F3596681C39D3a1b55474595BB591dc9',
25
- IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
26
- IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
27
- ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
28
- },
29
- },
30
- dripContracts: {
31
- DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
32
- DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78', // Sepolia contract address
33
- },
34
- };
35
- const configParams = {
36
- subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
37
- priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
38
- rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
39
- fastRedeemApi: 'https://fastwithdraw.dev.spool.fi/sepolia',
40
- contracts: {
41
- 11155111: {
42
- ISmartVaultManager: '0x2638d6c0b4EF6Dee04050fA0B07CA62500435747',
43
- IDepositSwap: '0x5FB08e00DE169f041711206A0995410884080177',
44
- ISmartVaultFactory: '0x86BB0376929218ba1cb825cE2ebE801bFCcD8149',
45
- IDepositManager: '0xfA37dd47F3596681C39D3a1b55474595BB591dc9',
46
- IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
47
- IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
48
- ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
49
- },
50
- },
51
- dripContracts: {
52
- DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
53
- DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78', // Sepolia contract address
54
- },
55
- };
56
- const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider('https://rpc.ankr.com/eth_sepolia', 11155111);
57
- exports.signer = new ethers_1.ethers.Wallet(privKey, provider);
58
- // const random_address = '0x25dFcFB061956c6f33B1ee032cc33837d0b83257';
59
- const vaultAddress = '0x457d29df2449439a86521a1cea1561d24cc67a93'; // USDC AUKI
60
- const daiVaultPerq = '0x1977efe478ba17da8be6e93fdfadbd3055d30111'; // DAI PERQ SEPOLIA
61
- const usdcVaultPerq = '0xf9795bfbf7c40981c372d0fb25a87e0b694c4fcd'; // USDC PERQ SEPOLIA
62
- const daiTokenAddress = '0x2a3a3872c242c35093a8fc48dac838c4b2d24a03'; // DAI TOKEN
63
- const usdcTokenAddress = '0xa6b92fcd4ee124353c8a6acf1edb574f46f3f8df'; // USDC TOKEN
64
- const dripSdk = new DripSdk_1.default(DripConfig_1.Chain.SEPOLIA, exports.signer, 'https://localhost:3000');
65
- // 0x689Baa4821865Cb328F5E847fB6133DEB315A832
66
- // 0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848
67
- async function main() {
68
- try {
69
- // const res = await dripSdk.deposit(usdcTokenAddress,usdcVaultPerq, '1000');
70
- // const res = await dripSdk.withdraw(usdcVaultPerq, '1');
71
- // const res = await dripSdk.getDripTokenBalance(account2)
72
- // const res = await dripSdk.getOwnedLoyaltyCard()
73
- // const res = await dripSdk.getBeansBalance()
74
- // const res = await dripSdk.recycleTokens()
75
- // const res = await dripSdk.upgradeLoyaltyCard()
76
- }
77
- catch (error) {
78
- console.log(`Main error: ${error}`);
79
- }
80
- }
81
- 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