@cowprotocol/sdk-flash-loans 1.5.2 → 1.5.3

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/index.d.mts CHANGED
@@ -146,9 +146,12 @@ type AaveCollateralSwapSdkConfig = {
146
146
  hookAdapterPerType?: Record<AaveFlashLoanType, Record<SupportedChainId, string>>;
147
147
  aaveAdapterFactory?: Record<SupportedChainId, string>;
148
148
  aavePoolAddress?: Record<SupportedChainId, string>;
149
+ hooksGasLimit?: {
150
+ pre: bigint;
151
+ post: bigint;
152
+ };
149
153
  };
150
154
  /**
151
- >>>>>>> Stashed changes
152
155
  * SDK for executing Aave flash loan operations, particularly collateral swaps.
153
156
  *
154
157
  * @remarks This SDK facilitates flash loan-based collateral swaps using Aave Protocol V3,
@@ -162,6 +165,7 @@ declare class AaveCollateralSwapSdk {
162
165
  private readonly hookAdapterPerType;
163
166
  private readonly aaveAdapterFactory;
164
167
  private readonly aavePoolAddress;
168
+ private readonly hooksGasLimit;
165
169
  /**
166
170
  * Creates an instance of AaveCollateralSwapSdk.
167
171
  *
package/dist/index.d.ts CHANGED
@@ -146,9 +146,12 @@ type AaveCollateralSwapSdkConfig = {
146
146
  hookAdapterPerType?: Record<AaveFlashLoanType, Record<SupportedChainId, string>>;
147
147
  aaveAdapterFactory?: Record<SupportedChainId, string>;
148
148
  aavePoolAddress?: Record<SupportedChainId, string>;
149
+ hooksGasLimit?: {
150
+ pre: bigint;
151
+ post: bigint;
152
+ };
149
153
  };
150
154
  /**
151
- >>>>>>> Stashed changes
152
155
  * SDK for executing Aave flash loan operations, particularly collateral swaps.
153
156
  *
154
157
  * @remarks This SDK facilitates flash loan-based collateral swaps using Aave Protocol V3,
@@ -162,6 +165,7 @@ declare class AaveCollateralSwapSdk {
162
165
  private readonly hookAdapterPerType;
163
166
  private readonly aaveAdapterFactory;
164
167
  private readonly aavePoolAddress;
168
+ private readonly hooksGasLimit;
165
169
  /**
166
170
  * Creates an instance of AaveCollateralSwapSdk.
167
171
  *
package/dist/index.js CHANGED
@@ -440,6 +440,7 @@ var AaveCollateralSwapSdk = class {
440
440
  hookAdapterPerType;
441
441
  aaveAdapterFactory;
442
442
  aavePoolAddress;
443
+ hooksGasLimit;
443
444
  /**
444
445
  * Creates an instance of AaveCollateralSwapSdk.
445
446
  *
@@ -458,6 +459,7 @@ var AaveCollateralSwapSdk = class {
458
459
  this.hookAdapterPerType = config?.hookAdapterPerType ?? AAVE_HOOK_ADAPTER_PER_TYPE;
459
460
  this.aaveAdapterFactory = config?.aaveAdapterFactory ?? AAVE_ADAPTER_FACTORY;
460
461
  this.aavePoolAddress = config?.aavePoolAddress ?? AAVE_POOL_ADDRESS;
462
+ this.hooksGasLimit = config?.hooksGasLimit ?? DEFAULT_HOOK_GAS_LIMIT;
461
463
  }
462
464
  /**
463
465
  * Executes a collateral swap using Aave flash loans.
@@ -804,7 +806,7 @@ var AaveCollateralSwapSdk = class {
804
806
  {
805
807
  target: this.aaveAdapterFactory[chainId],
806
808
  callData: preHookCallData,
807
- gasLimit: DEFAULT_HOOK_GAS_LIMIT.pre.toString(),
809
+ gasLimit: this.hooksGasLimit.pre.toString(),
808
810
  dappId
809
811
  }
810
812
  ],
@@ -812,7 +814,7 @@ var AaveCollateralSwapSdk = class {
812
814
  {
813
815
  target: expectedInstanceAddress,
814
816
  callData: postHookCallData,
815
- gasLimit: DEFAULT_HOOK_GAS_LIMIT.post.toString(),
817
+ gasLimit: this.hooksGasLimit.post.toString(),
816
818
  dappId
817
819
  }
818
820
  ]
package/dist/index.mjs CHANGED
@@ -403,6 +403,7 @@ var AaveCollateralSwapSdk = class {
403
403
  hookAdapterPerType;
404
404
  aaveAdapterFactory;
405
405
  aavePoolAddress;
406
+ hooksGasLimit;
406
407
  /**
407
408
  * Creates an instance of AaveCollateralSwapSdk.
408
409
  *
@@ -421,6 +422,7 @@ var AaveCollateralSwapSdk = class {
421
422
  this.hookAdapterPerType = config?.hookAdapterPerType ?? AAVE_HOOK_ADAPTER_PER_TYPE;
422
423
  this.aaveAdapterFactory = config?.aaveAdapterFactory ?? AAVE_ADAPTER_FACTORY;
423
424
  this.aavePoolAddress = config?.aavePoolAddress ?? AAVE_POOL_ADDRESS;
425
+ this.hooksGasLimit = config?.hooksGasLimit ?? DEFAULT_HOOK_GAS_LIMIT;
424
426
  }
425
427
  /**
426
428
  * Executes a collateral swap using Aave flash loans.
@@ -767,7 +769,7 @@ var AaveCollateralSwapSdk = class {
767
769
  {
768
770
  target: this.aaveAdapterFactory[chainId],
769
771
  callData: preHookCallData,
770
- gasLimit: DEFAULT_HOOK_GAS_LIMIT.pre.toString(),
772
+ gasLimit: this.hooksGasLimit.pre.toString(),
771
773
  dappId
772
774
  }
773
775
  ],
@@ -775,7 +777,7 @@ var AaveCollateralSwapSdk = class {
775
777
  {
776
778
  target: expectedInstanceAddress,
777
779
  callData: postHookCallData,
778
- gasLimit: DEFAULT_HOOK_GAS_LIMIT.post.toString(),
780
+ gasLimit: this.hooksGasLimit.post.toString(),
779
781
  dappId
780
782
  }
781
783
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-flash-loans",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "Flash loans for CoW Protocol",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -14,11 +14,11 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@cowprotocol/sdk-common": "0.3.0",
18
17
  "@cowprotocol/sdk-app-data": "4.1.6",
19
18
  "@cowprotocol/sdk-trading": "0.4.6",
20
- "@cowprotocol/sdk-order-signing": "0.1.11",
19
+ "@cowprotocol/sdk-common": "0.3.0",
21
20
  "@cowprotocol/sdk-order-book": "0.2.0",
21
+ "@cowprotocol/sdk-order-signing": "0.1.11",
22
22
  "@cowprotocol/sdk-config": "0.3.0"
23
23
  },
24
24
  "devDependencies": {
@@ -34,10 +34,10 @@
34
34
  "ts-jest": "^29.0.0",
35
35
  "ethers": "^5.7.2",
36
36
  "viem": "2.30.5",
37
- "@cowprotocol/sdk-ethers-v5-adapter": "0.2.0",
38
- "@cowprotocol/sdk-ethers-v6-adapter": "0.2.0",
39
37
  "@cow-sdk/typescript-config": "0.0.0-beta.0",
40
- "@cowprotocol/sdk-viem-adapter": "0.2.0"
38
+ "@cowprotocol/sdk-ethers-v5-adapter": "0.2.0",
39
+ "@cowprotocol/sdk-viem-adapter": "0.2.0",
40
+ "@cowprotocol/sdk-ethers-v6-adapter": "0.2.0"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "tsup src/index.ts --format esm,cjs --dts",