@defisaver/sdk 1.0.32 → 1.0.34

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.
Files changed (67) hide show
  1. package/esm/src/actions/aave/AaveFinalizeUnstakeAction.d.ts +14 -0
  2. package/esm/src/actions/aave/AaveFinalizeUnstakeAction.js +22 -0
  3. package/esm/src/actions/aave/AaveStartUnstakeAction.d.ts +9 -0
  4. package/esm/src/actions/aave/AaveStartUnstakeAction.js +12 -0
  5. package/esm/src/actions/aave/index.d.ts +2 -0
  6. package/esm/src/actions/aave/index.js +2 -0
  7. package/esm/src/actions/flashloan/FLAction.js +1 -1
  8. package/esm/src/actions/flashloan/UniV3FlashLoanAction.d.ts +19 -0
  9. package/esm/src/actions/flashloan/UniV3FlashLoanAction.js +21 -0
  10. package/esm/src/actions/flashloan/UniV3FlashLoanPaybackAction.d.ts +16 -0
  11. package/esm/src/actions/flashloan/UniV3FlashLoanPaybackAction.js +18 -0
  12. package/esm/src/actions/flashloan/index.d.ts +2 -0
  13. package/esm/src/actions/flashloan/index.js +2 -0
  14. package/esm/src/actions/index.d.ts +1 -2
  15. package/esm/src/actions/index.js +1 -2
  16. package/esm/src/addresses.d.ts +6 -30
  17. package/esm/src/addresses.js +2 -11
  18. package/esm/src/index.d.ts +24 -120
  19. package/esm/src/types.d.ts +1 -3
  20. package/esm/src/utils/index.d.ts +1 -2
  21. package/esm/src/utils/index.js +1 -2
  22. package/package.json +1 -1
  23. package/src/actions/aave/AaveFinalizeUnstakeAction.ts +29 -0
  24. package/src/actions/aave/AaveStartUnstakeAction.ts +18 -0
  25. package/src/actions/aave/index.ts +3 -1
  26. package/src/actions/flashloan/FLAction.ts +1 -1
  27. package/src/actions/flashloan/UniV3FlashLoanAction.ts +28 -0
  28. package/src/actions/flashloan/UniV3FlashLoanPaybackAction.ts +20 -0
  29. package/src/actions/flashloan/index.ts +2 -0
  30. package/src/actions/index.ts +0 -2
  31. package/src/addresses.ts +2 -12
  32. package/src/types.ts +1 -3
  33. package/src/utils/index.ts +0 -2
  34. package/umd/index.js +532 -806
  35. package/esm/src/actions/curveusd/CurveUsdBorrowAction.d.ts +0 -15
  36. package/esm/src/actions/curveusd/CurveUsdBorrowAction.js +0 -22
  37. package/esm/src/actions/curveusd/CurveUsdCreateAction.d.ts +0 -22
  38. package/esm/src/actions/curveusd/CurveUsdCreateAction.js +0 -44
  39. package/esm/src/actions/curveusd/CurveUsdLevCreateAction.d.ts +0 -9
  40. package/esm/src/actions/curveusd/CurveUsdLevCreateAction.js +0 -16
  41. package/esm/src/actions/curveusd/CurveUsdPaybackAction.d.ts +0 -22
  42. package/esm/src/actions/curveusd/CurveUsdPaybackAction.js +0 -43
  43. package/esm/src/actions/curveusd/CurveUsdRepayAction.d.ts +0 -9
  44. package/esm/src/actions/curveusd/CurveUsdRepayAction.js +0 -14
  45. package/esm/src/actions/curveusd/CurveUsdSelfLiquidateAction.d.ts +0 -19
  46. package/esm/src/actions/curveusd/CurveUsdSelfLiquidateAction.js +0 -38
  47. package/esm/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.d.ts +0 -9
  48. package/esm/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.js +0 -16
  49. package/esm/src/actions/curveusd/CurveUsdSupplyAction.d.ts +0 -20
  50. package/esm/src/actions/curveusd/CurveUsdSupplyAction.js +0 -40
  51. package/esm/src/actions/curveusd/CurveUsdWithdrawAction.d.ts +0 -15
  52. package/esm/src/actions/curveusd/CurveUsdWithdrawAction.js +0 -22
  53. package/esm/src/actions/curveusd/index.d.ts +0 -9
  54. package/esm/src/actions/curveusd/index.js +0 -9
  55. package/esm/src/utils/curveusd-utils.d.ts +0 -20
  56. package/esm/src/utils/curveusd-utils.js +0 -12
  57. package/src/actions/curveusd/CurveUsdBorrowAction.ts +0 -34
  58. package/src/actions/curveusd/CurveUsdCreateAction.ts +0 -49
  59. package/src/actions/curveusd/CurveUsdLevCreateAction.ts +0 -40
  60. package/src/actions/curveusd/CurveUsdPaybackAction.ts +0 -48
  61. package/src/actions/curveusd/CurveUsdRepayAction.ts +0 -36
  62. package/src/actions/curveusd/CurveUsdSelfLiquidateAction.ts +0 -41
  63. package/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.ts +0 -40
  64. package/src/actions/curveusd/CurveUsdSupplyAction.ts +0 -44
  65. package/src/actions/curveusd/CurveUsdWithdrawAction.ts +0 -34
  66. package/src/actions/curveusd/index.ts +0 -10
  67. package/src/utils/curveusd-utils.ts +0 -15
@@ -0,0 +1,14 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * AaveFinalizeUnstakeAction - finalizes the unstaking AAVE process
5
+ *
6
+ * @category Aave
7
+ */
8
+ export declare class AaveFinalizeUnstakeAction extends Action {
9
+ /**
10
+ * @param amount - Amount to unstake (max.uint for whole balance)
11
+ * @param to - Address to receive AAVE tokens
12
+ */
13
+ constructor(amount: uint256, to: EthAddress);
14
+ }
@@ -0,0 +1,22 @@
1
+ import { Action } from '../../Action';
2
+ import { requireAddress } from '../../utils/general';
3
+ import { getAddr } from '../../addresses';
4
+ /**
5
+ * AaveFinalizeUnstakeAction - finalizes the unstaking AAVE process
6
+ *
7
+ * @category Aave
8
+ */
9
+ export class AaveFinalizeUnstakeAction extends Action {
10
+ /**
11
+ * @param amount - Amount to unstake (max.uint for whole balance)
12
+ * @param to - Address to receive AAVE tokens
13
+ */
14
+ constructor(amount, to) {
15
+ requireAddress(to);
16
+ super('AaveUnstake', getAddr('AaveUnstake'), ['uint256', 'address'], [amount, to]);
17
+ this.mappableArgs = [
18
+ this.args[1],
19
+ this.args[2],
20
+ ];
21
+ }
22
+ }
@@ -0,0 +1,9 @@
1
+ import { Action } from '../../Action';
2
+ /**
3
+ * AaveStartUnstakeAction - begins the process of unstaking AAVE tokens for a proxy
4
+ *
5
+ * @category Aave
6
+ */
7
+ export declare class AaveStartUnstakeAction extends Action {
8
+ constructor();
9
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * AaveStartUnstakeAction - begins the process of unstaking AAVE tokens for a proxy
5
+ *
6
+ * @category Aave
7
+ */
8
+ export class AaveStartUnstakeAction extends Action {
9
+ constructor() {
10
+ super('AaveUnstake', getAddr('AaveUnstake'), ['uint256', 'address'], [0, getAddr('Empty')]);
11
+ }
12
+ }
@@ -4,3 +4,5 @@ export * from './AavePaybackAction';
4
4
  export * from './AaveWithdrawAction';
5
5
  export * from './AaveClaimStkAaveAction';
6
6
  export * from './AaveCollateralSwitchAction';
7
+ export * from './AaveFinalizeUnstakeAction';
8
+ export * from './AaveStartUnstakeAction';
@@ -4,3 +4,5 @@ export * from './AavePaybackAction';
4
4
  export * from './AaveWithdrawAction';
5
5
  export * from './AaveClaimStkAaveAction';
6
6
  export * from './AaveCollateralSwitchAction';
7
+ export * from './AaveFinalizeUnstakeAction';
8
+ export * from './AaveStartUnstakeAction';
@@ -41,7 +41,7 @@ _FLAction_instances = new WeakSet(), _FLAction_handleArgs = function _FLAction_h
41
41
  if (specificFLAction.constructor.name === 'MakerFlashLoanAction') {
42
42
  argsToReturn[5] = [4];
43
43
  }
44
- if (specificFLAction.constructor.name === 'AaveV3FlashLoanAction') {
44
+ if (specificFLAction.constructor.name === 'AaveV3FlashLoanNoFeeAction') {
45
45
  argsToReturn[5] = [5];
46
46
  }
47
47
  return argsToReturn;
@@ -0,0 +1,19 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256, bytes } from '../../types';
3
+ /**
4
+ * Gets a flashloan from UniV3 pool
5
+ *
6
+ * @category Flashloans
7
+ */
8
+ export declare class UniV3FlashLoanAction extends Action {
9
+ /**
10
+ * @param token0
11
+ * @param token1
12
+ * @param pool
13
+ * @param amount0
14
+ * @param amount1
15
+ * @param flParamGetterAddr
16
+ * @param flParamGetterData
17
+ */
18
+ constructor(token0: EthAddress, token1: EthAddress, pool: EthAddress, amount0: uint256, amount1: uint256, flParamGetterAddr?: EthAddress, flParamGetterData?: bytes);
19
+ }
@@ -0,0 +1,21 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * Gets a flashloan from UniV3 pool
5
+ *
6
+ * @category Flashloans
7
+ */
8
+ export class UniV3FlashLoanAction extends Action {
9
+ /**
10
+ * @param token0
11
+ * @param token1
12
+ * @param pool
13
+ * @param amount0
14
+ * @param amount1
15
+ * @param flParamGetterAddr
16
+ * @param flParamGetterData
17
+ */
18
+ constructor(token0, token1, pool, amount0, amount1, flParamGetterAddr = getAddr('Empty'), flParamGetterData = []) {
19
+ super('FLUniV3', getAddr('FLUniV3'), ['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'], [[token0, token1, pool], [amount0, amount1], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]);
20
+ }
21
+ }
@@ -0,0 +1,16 @@
1
+ import { EthAddress, uint256 } from '../../types';
2
+ import { SendTokensAction } from '../basic';
3
+ /**
4
+ * Pays back a flashloan from UniV3
5
+ *
6
+ * @category Flashloans
7
+ */
8
+ export declare class UniV3FlashLoanPaybackAction extends SendTokensAction {
9
+ /**
10
+ * @param token0
11
+ * @param token1
12
+ * @param amount0
13
+ * @param amount1
14
+ */
15
+ constructor(token0: EthAddress, token1: EthAddress, amount0: uint256, amount1: uint256);
16
+ }
@@ -0,0 +1,18 @@
1
+ import { SendTokensAction } from '../basic';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * Pays back a flashloan from UniV3
5
+ *
6
+ * @category Flashloans
7
+ */
8
+ export class UniV3FlashLoanPaybackAction extends SendTokensAction {
9
+ /**
10
+ * @param token0
11
+ * @param token1
12
+ * @param amount0
13
+ * @param amount1
14
+ */
15
+ constructor(token0, token1, amount0, amount1) {
16
+ super([token0, token1], [getAddr('FLUniV3'), getAddr('FLUniV3')], [amount0, amount1]);
17
+ }
18
+ }
@@ -13,3 +13,5 @@ export * from './BalancerFlashLoanPaybackAction';
13
13
  export * from './EulerFlashLoanAction';
14
14
  export * from './EulerFlashLoanPaybackAction';
15
15
  export * from './FLAction';
16
+ export * from './UniV3FlashLoanAction';
17
+ export * from './UniV3FlashLoanPaybackAction';
@@ -13,3 +13,5 @@ export * from './BalancerFlashLoanPaybackAction';
13
13
  export * from './EulerFlashLoanAction';
14
14
  export * from './EulerFlashLoanPaybackAction';
15
15
  export * from './FLAction';
16
+ export * from './UniV3FlashLoanAction';
17
+ export * from './UniV3FlashLoanPaybackAction';
@@ -23,5 +23,4 @@ import * as chickenBonds from './chickenBonds';
23
23
  import * as compoundV3 from './compoundV3';
24
24
  import * as morpho from './morpho';
25
25
  import * as bprotocol from './bprotocol';
26
- import * as curveusd from './curveusd';
27
- export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, curveusd, };
26
+ export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, };
@@ -23,5 +23,4 @@ import * as chickenBonds from './chickenBonds';
23
23
  import * as compoundV3 from './compoundV3';
24
24
  import * as morpho from './morpho';
25
25
  import * as bprotocol from './bprotocol';
26
- import * as curveusd from './curveusd';
27
- export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, curveusd, };
26
+ export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, };
@@ -39,6 +39,7 @@ export declare const actionAddresses: {
39
39
  AaveSupply: string;
40
40
  AaveWithdraw: string;
41
41
  AaveCollateralSwitch: string;
42
+ AaveUnstake: string;
42
43
  AaveV3Withdraw: string;
43
44
  AaveV3SwapBorrowRateMode: string;
44
45
  AaveV3Supply: string;
@@ -72,6 +73,7 @@ export declare const actionAddresses: {
72
73
  FLMaker: string;
73
74
  FLBalancer: string;
74
75
  FLAction: string;
76
+ FLUniV3: string;
75
77
  UniSupply: string;
76
78
  UniWithdraw: string;
77
79
  UniCollectV3: string;
@@ -141,16 +143,6 @@ export declare const actionAddresses: {
141
143
  CompV3Supply: string;
142
144
  CompV3Transfer: string;
143
145
  CompV3Withdraw: string;
144
- CurveUsdBorrow: string;
145
- CurveUsdCreate: string;
146
- CurveUsdPayback: string;
147
- CurveUsdSupply: string;
148
- CurveUsdWithdraw: string;
149
- CurveUsdLevCreate: string;
150
- CurveUsdRepay: string;
151
- CurveUsdSwapper: string;
152
- CurveUsdSelfLiquidate: string;
153
- CurveUsdSelfLiquidateWithColl: string;
154
146
  AaveV3RatioTrigger?: undefined;
155
147
  GasFeeTakerL2?: undefined;
156
148
  AaveV3RatioCheck?: undefined;
@@ -214,6 +206,7 @@ export declare const actionAddresses: {
214
206
  AaveSupply?: undefined;
215
207
  AaveWithdraw?: undefined;
216
208
  AaveCollateralSwitch?: undefined;
209
+ AaveUnstake?: undefined;
217
210
  AaveV3View?: undefined;
218
211
  MorphoAaveV2Borrow?: undefined;
219
212
  MorphoAaveV2Payback?: undefined;
@@ -234,6 +227,7 @@ export declare const actionAddresses: {
234
227
  FLAaveV2?: undefined;
235
228
  FLDyDx?: undefined;
236
229
  FLMaker?: undefined;
230
+ FLUniV3?: undefined;
237
231
  UniSupply?: undefined;
238
232
  UniWithdraw?: undefined;
239
233
  DyDxWithdraw?: undefined;
@@ -298,16 +292,6 @@ export declare const actionAddresses: {
298
292
  CompV3Supply?: undefined;
299
293
  CompV3Transfer?: undefined;
300
294
  CompV3Withdraw?: undefined;
301
- CurveUsdBorrow?: undefined;
302
- CurveUsdCreate?: undefined;
303
- CurveUsdPayback?: undefined;
304
- CurveUsdSupply?: undefined;
305
- CurveUsdWithdraw?: undefined;
306
- CurveUsdLevCreate?: undefined;
307
- CurveUsdRepay?: undefined;
308
- CurveUsdSwapper?: undefined;
309
- CurveUsdSelfLiquidate?: undefined;
310
- CurveUsdSelfLiquidateWithColl?: undefined;
311
295
  } | {
312
296
  DFSSell: string;
313
297
  WrapEth: string;
@@ -366,6 +350,7 @@ export declare const actionAddresses: {
366
350
  AaveSupply?: undefined;
367
351
  AaveWithdraw?: undefined;
368
352
  AaveCollateralSwitch?: undefined;
353
+ AaveUnstake?: undefined;
369
354
  AaveV3ClaimRewards?: undefined;
370
355
  AaveV3View?: undefined;
371
356
  MorphoAaveV2Borrow?: undefined;
@@ -387,6 +372,7 @@ export declare const actionAddresses: {
387
372
  FLAaveV2?: undefined;
388
373
  FLDyDx?: undefined;
389
374
  FLMaker?: undefined;
375
+ FLUniV3?: undefined;
390
376
  UniSupply?: undefined;
391
377
  UniWithdraw?: undefined;
392
378
  DyDxWithdraw?: undefined;
@@ -451,16 +437,6 @@ export declare const actionAddresses: {
451
437
  CompV3Supply?: undefined;
452
438
  CompV3Transfer?: undefined;
453
439
  CompV3Withdraw?: undefined;
454
- CurveUsdBorrow?: undefined;
455
- CurveUsdCreate?: undefined;
456
- CurveUsdPayback?: undefined;
457
- CurveUsdSupply?: undefined;
458
- CurveUsdWithdraw?: undefined;
459
- CurveUsdLevCreate?: undefined;
460
- CurveUsdRepay?: undefined;
461
- CurveUsdSwapper?: undefined;
462
- CurveUsdSelfLiquidate?: undefined;
463
- CurveUsdSelfLiquidateWithColl?: undefined;
464
440
  AaveV3RatioTrigger?: undefined;
465
441
  };
466
442
  };
@@ -45,6 +45,7 @@ export const actionAddresses = {
45
45
  AaveSupply: '0xEbB200a529058B561B42Eab510DA157a63243CEc',
46
46
  AaveWithdraw: '0x754C58fA92246414a448c1ed44ea3D1AD446d482',
47
47
  AaveCollateralSwitch: '0xFf5dfF1B90bd5Aa6E12768AB497dB90cc9DE6F5d',
48
+ AaveUnstake: '0x2FE4024e350cD2c64D2fd0Db5d16F5cE54Ca0E09',
48
49
  // aave v3
49
50
  AaveV3Withdraw: '0x9D4e4b26A5E2e6Dad30C5d95F5cE78A8310F04C2',
50
51
  AaveV3SwapBorrowRateMode: '0x630F530Ac523C935cf2528E62D0A06F8900C5b1B',
@@ -83,6 +84,7 @@ export const actionAddresses = {
83
84
  FLMaker: '0x672DE08e36A1698fD5e9E34045F81558dB4c1AFE',
84
85
  FLBalancer: '0x540a83E36E5E6Aa916A6c591934d800e17115048',
85
86
  FLAction: '0x72915D41982DfCAf30b871290618E59C45Edba7F',
87
+ FLUniV3: '0x9CAdAC8Be718572F82B672b950c53F0b58483A35',
86
88
  // uniswap
87
89
  UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
88
90
  UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
@@ -168,17 +170,6 @@ export const actionAddresses = {
168
170
  CompV3Supply: '0xaF36Eca43bb26468078B8163fe5Bc1fCFc292095',
169
171
  CompV3Transfer: '0xeD7450e9C17146476137b77198DFfB17857906c4',
170
172
  CompV3Withdraw: '0x0b0F21EDE32DE4243D9145a899E97FC2366Aec46',
171
- // crvUSD
172
- CurveUsdBorrow: '0x51541b0628363BA7C89Ee87dF8ECab28C932cE6a',
173
- CurveUsdCreate: '0xf51922Dea3027B4278d1F3E2897c147a40DC8412',
174
- CurveUsdPayback: '0x14A9dab0BAF6f48e8ffaf612D0604fEa549e27Ff',
175
- CurveUsdSupply: '0xEf146C22be5A51F2D777c05623a781ED51c2702b',
176
- CurveUsdWithdraw: '0xD9c1Ae50138ad34C02973AA9E437d0A864c0F6D8',
177
- CurveUsdLevCreate: '0x16ff60eE7Fa1583397BE6fce3332e97eCC0c344F',
178
- CurveUsdRepay: '0x7DBd7F0DC5f68b6B0c097551EB0D5673317ab9Bd',
179
- CurveUsdSwapper: '0x6233F57401b2b82Ccc5f8bDD90D3598fbc80C1DB',
180
- CurveUsdSelfLiquidate: '0xB05a411734d05f0124d0Aea9Ebb932Bf25C06533',
181
- CurveUsdSelfLiquidateWithColl: '0x49342d76aC5004EAa15fE80CcCae240f39C5563c',
182
173
  },
183
174
  [NETWORKS.optimism.chainId]: {
184
175
  DFSSell: '0xC6c601fcAa870efd26C624F8c65fbc54cBe533b1',