@dripfi/drip-sdk 1.4.7 → 1.4.8

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/CHANGELOG.md CHANGED
@@ -96,3 +96,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
96
96
  ### Added
97
97
 
98
98
  - Added method `getSwapAndDepositTokenAllowanceForCurrency` to the `PerqSdk`
99
+
100
+ ## [1.4.8] - 2025-02-14
101
+
102
+ ### Changed
103
+
104
+ - Updated `PerqApi` to use the new 1inch API endpoint
package/dist/PerqApi.js CHANGED
@@ -88,14 +88,15 @@ class PerqApi {
88
88
  if (fromTokenAddress === toTokenAddress && fromTokenAddress === WETH_TOKEN_ADDRESS) {
89
89
  return [];
90
90
  }
91
- const url = `${this.route}/oneinch?getRequest=/swap/v5.2/1/swap?fromTokenAddress=${fromTokenAddress}%26toTokenAddress=${toTokenAddress}%26amount=${amount.toString()}%26fromAddress=${fromAddress}%26slippage=0.1%26disableEstimate=true%26allowPartialFill=false%26includeTokensInfo=true`;
91
+ //TODO: Replace the /1/ in this string with dynamic chainId
92
+ const url = `${this.route}/oneinch?getRequest=/swap/v6.0/1/swap?fromTokenAddress=${fromTokenAddress}%26toTokenAddress=${toTokenAddress}%26amount=${amount.toString()}%26fromAddress=${fromAddress}%26slippage=0.1%26disableEstimate=true%26allowPartialFill=false%26includeTokensInfo=true`;
92
93
  const res = await fetch(url);
93
94
  if (res.ok) {
94
95
  const data = (await res.json());
95
96
  return [
96
97
  {
97
98
  swapTarget: data.tx.to,
98
- token: data.fromToken.address,
99
+ token: data.srcToken.address,
99
100
  swapCallData: data.tx.data,
100
101
  },
101
102
  ];
package/dist/PerqSdk.js CHANGED
@@ -210,7 +210,7 @@ class PerqSdk {
210
210
  }
211
211
  }
212
212
  const fromToken = ethers_1.ethers.utils.parseUnits(amountWithDecimals.toString(), decimals);
213
- const swapInfo = await this.perqApi.getSwapInfo(fromTokenAddress, toTokenAddress, fromToken, userAddress);
213
+ const swapInfo = await this.perqApi.getSwapInfo(fromTokenAddress, toTokenAddress, fromToken, this.perqConfig.swapperAddress);
214
214
  const swapDepositBagStruct = {
215
215
  inTokens: [fromTokenAddress],
216
216
  inAmounts: [fromToken],
@@ -287,15 +287,6 @@ class PerqSdk {
287
287
  if (this.perqConfig.perqSwapAndRecyclerAddress === ethers_1.ethers.constants.AddressZero) {
288
288
  throw Error('Recycler contract address not defined');
289
289
  }
290
- console.log('swap and recycle ERC-20 with this: ', {
291
- beneficiary,
292
- path,
293
- amountInWithDecimals,
294
- minAmountOutWithDecimals,
295
- price,
296
- deadline,
297
- signature,
298
- });
299
290
  const swapAndRecycleTx = await this.perqSwapAndRecyclerContract.swapAndRecycle(beneficiary, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature);
300
291
  const receipt = await swapAndRecycleTx.wait();
301
292
  return receipt.transactionHash;
@@ -7,6 +7,7 @@ type PerqConfig = {
7
7
  perqSwapAndRecyclerAddress: string;
8
8
  perqVestingAddress: string;
9
9
  swapAndDepositContractAddress: string;
10
+ swapperAddress: string;
10
11
  smartVaultManagerContractAddress: string;
11
12
  };
12
13
  export default PerqConfig;
@@ -10,6 +10,7 @@ exports.PRODUCTION = {
10
10
  perqSwapAndRecyclerAddress: '0x15ED53964E6a5EcbEBAb80A0Fc68c2297b0eaA8D',
11
11
  perqVestingAddress: '0x5e19C155C30bDEB83FCFE20a3b6f6Eda34B746c5',
12
12
  swapAndDepositContractAddress: '0xd8534197bd587f8226d12e0c864ef2cae6f82f5c',
13
+ swapperAddress: '0x33e52c206d584550193e642c8982f2fff6339994',
13
14
  smartVaultManagerContractAddress: '0x23daf34e2b9af02a74dc19cb52af727b19403874',
14
15
  };
15
16
  exports.DEVELOPMENT = {
@@ -20,5 +21,6 @@ exports.DEVELOPMENT = {
20
21
  perqSwapAndRecyclerAddress: '0xA4ed357FF233731860Ec8D0446FD95756d564014',
21
22
  perqVestingAddress: '0x1d3B9E32a7139718f94BE32c797682fFf2D1bE60',
22
23
  swapAndDepositContractAddress: '0x5fb08e00de169f041711206a0995410884080177',
24
+ swapperAddress: '0xE411921ee9EeDfEFd7b9Ae15bF232bd36949Fcbc',
23
25
  smartVaultManagerContractAddress: '0x2638d6c0b4ef6dee04050fa0b07ca62500435747',
24
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",