@defisaver/sdk 1.2.7-dev-liquity-v2 → 1.2.7-dev-2-liquity-v2

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 (70) hide show
  1. package/esm/src/actions/basic/SendTokensAction.d.ts +1 -1
  2. package/esm/src/actions/basic/SendTokensAction.js +1 -1
  3. package/esm/src/actions/basic/SendTokensAndUnwrapAction.d.ts +15 -0
  4. package/esm/src/actions/basic/SendTokensAndUnwrapAction.js +31 -0
  5. package/esm/src/actions/basic/index.d.ts +1 -0
  6. package/esm/src/actions/basic/index.js +1 -0
  7. package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.d.ts +16 -0
  8. package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.js +22 -0
  9. package/esm/src/actions/checkers/LiquityV2RatioCheckAction.js +1 -1
  10. package/esm/src/actions/checkers/index.d.ts +1 -0
  11. package/esm/src/actions/checkers/index.js +1 -0
  12. package/esm/src/actions/eulerV2/EulerV2BorrowAction.d.ts +16 -0
  13. package/esm/src/actions/eulerV2/EulerV2BorrowAction.js +24 -0
  14. package/esm/src/actions/eulerV2/EulerV2CollateralSwitchAction.d.ts +15 -0
  15. package/esm/src/actions/eulerV2/EulerV2CollateralSwitchAction.js +22 -0
  16. package/esm/src/actions/eulerV2/EulerV2PaybackAction.d.ts +22 -0
  17. package/esm/src/actions/eulerV2/EulerV2PaybackAction.js +40 -0
  18. package/esm/src/actions/eulerV2/EulerV2PaybackWithSharesAction.d.ts +16 -0
  19. package/esm/src/actions/eulerV2/EulerV2PaybackWithSharesAction.js +24 -0
  20. package/esm/src/actions/eulerV2/EulerV2PullDebtAction.d.ts +16 -0
  21. package/esm/src/actions/eulerV2/EulerV2PullDebtAction.js +24 -0
  22. package/esm/src/actions/eulerV2/EulerV2ReorderCollateralsAction.d.ts +14 -0
  23. package/esm/src/actions/eulerV2/EulerV2ReorderCollateralsAction.js +20 -0
  24. package/esm/src/actions/eulerV2/EulerV2SupplyAction.d.ts +23 -0
  25. package/esm/src/actions/eulerV2/EulerV2SupplyAction.js +42 -0
  26. package/esm/src/actions/eulerV2/EulerV2WithdrawAction.d.ts +16 -0
  27. package/esm/src/actions/eulerV2/EulerV2WithdrawAction.js +24 -0
  28. package/esm/src/actions/eulerV2/index.d.ts +8 -0
  29. package/esm/src/actions/eulerV2/index.js +8 -0
  30. package/esm/src/actions/index.d.ts +2 -1
  31. package/esm/src/actions/index.js +2 -1
  32. package/esm/src/addresses.d.ts +24 -0
  33. package/esm/src/addresses.js +19 -12
  34. package/esm/src/index.d.ts +96 -0
  35. package/esm/src/triggers/LiquityRatioTrigger.js +1 -1
  36. package/esm/src/triggers/LiquityV2RatioTrigger.js +1 -1
  37. package/esm/src/triggers/ShouldClosePriceTrigger.d.ts +10 -0
  38. package/esm/src/triggers/ShouldClosePriceTrigger.js +12 -0
  39. package/esm/src/triggers/index.d.ts +1 -0
  40. package/esm/src/triggers/index.js +1 -0
  41. package/package.json +1 -1
  42. package/src/actions/basic/SendTokensAction.ts +1 -1
  43. package/src/actions/basic/SendTokensAndUnwrapAction.ts +38 -0
  44. package/src/actions/basic/index.ts +2 -1
  45. package/src/actions/checkers/AaveV3OpenRatioCheckAction.ts +30 -0
  46. package/src/actions/checkers/LiquityV2RatioCheckAction.ts +1 -1
  47. package/src/actions/checkers/index.ts +2 -1
  48. package/src/actions/eulerV2/EulerV2BorrowAction.ts +37 -0
  49. package/src/actions/eulerV2/EulerV2CollateralSwitchAction.ts +34 -0
  50. package/src/actions/eulerV2/EulerV2PaybackAction.ts +47 -0
  51. package/src/actions/eulerV2/EulerV2PaybackWithSharesAction.ts +37 -0
  52. package/src/actions/eulerV2/EulerV2PullDebtAction.ts +37 -0
  53. package/src/actions/eulerV2/EulerV2ReorderCollateralsAction.ts +31 -0
  54. package/src/actions/eulerV2/EulerV2SupplyAction.ts +49 -0
  55. package/src/actions/eulerV2/EulerV2WithdrawAction.ts +37 -0
  56. package/src/actions/eulerV2/index.ts +8 -0
  57. package/src/actions/index.ts +2 -0
  58. package/src/addresses.ts +20 -12
  59. package/src/triggers/LiquityRatioTrigger.ts +1 -1
  60. package/src/triggers/LiquityV2RatioTrigger.ts +1 -1
  61. package/src/triggers/ShouldClosePriceTrigger.ts +19 -0
  62. package/src/triggers/index.ts +1 -0
  63. package/test/actions/basic/SendTokensAndUnwrapAction.js +73 -0
  64. package/test/actions/checkers/AaveV3OpenRatioCheckAction.js +22 -0
  65. package/test/actions/eulerV2/EulerV2BorrowAction.js +31 -0
  66. package/test/actions/eulerV2/EulerV2CollateralSwitchAction.js +28 -0
  67. package/test/actions/eulerV2/EulerV2PaybackAction.js +39 -0
  68. package/test/actions/eulerV2/EulerV2SupplyAction.js +42 -0
  69. package/test/actions/eulerV2/EulerV2WithdrawAction.js +31 -0
  70. package/umd/index.js +980 -566
@@ -154,18 +154,18 @@ export const actionAddresses = {
154
154
  LiquityRedeem: '0x20B78854658011394C931EF2BF3cEEA2Fe62E7f0',
155
155
  LiquityAdjust: '0x0A398f6B97677192A5d5e7Ea8A937383FFf9304c',
156
156
  // liquity v2
157
- LiquityV2Open: '0x270A0C7eBd1C0a98FdA613782b51419300AB6322',
158
- LiquityV2Close: '0xC6C627c63389D8bB7913b55CD62fa451703AD1E1',
159
- LiquityV2Supply: '0x6e31Dd331571209043c8CF997f86b4291F648537',
160
- LiquityV2Withdraw: '0x561013c605A17f5dC5b738C8a3fF9c5F33DbC3d8',
161
- LiquityV2Borrow: '0x26C39FE05466dBA72A98d095d019dC5e067F6b28',
162
- LiquityV2Payback: '0x3B1D0bD618fF8F8c51B11CD676c3384CB2A36C64',
163
- LiquityV2Claim: '0xb3d3dFf3d68539F6a1bb51e56B7dC8d515aE8978',
164
- LiquityV2Adjust: '0x57d6228b5EfC44174701704629A0F3EEa2c25E7f',
165
- LiquityV2AdjustInterestRate: '0x3EFf4EEC06bd75941025fb751407A5de5F456bC6',
166
- LiquityV2SPDeposit: '0x1e533364fE613AaD64B8D46F7A096Ae0c722239D',
167
- LiquityV2SPWithdraw: '0xb080DC160415Ffe1a4b80d75b0Be92EE38a0b426',
168
- LiquityV2SPClaimColl: '0xD50B0295C69e3F77BE7d99e7BdeAc442F37b373b',
157
+ LiquityV2Open: '0x57d6228b5EfC44174701704629A0F3EEa2c25E7f',
158
+ LiquityV2Close: '0x7200F99661a2a379D42dD98218359Df57552EFd9',
159
+ LiquityV2Supply: '0xb080DC160415Ffe1a4b80d75b0Be92EE38a0b426',
160
+ LiquityV2Withdraw: '0xB3b8D20711FF92686ce9F77a2A3bed74d780e78a',
161
+ LiquityV2Borrow: '0xBAc6dc3edB72Bc705Ab4e31F2a2151Fe06550D9B',
162
+ LiquityV2Payback: '0x612C0A45eC4916E7eaCEB475DfBFBd0b3053a63B',
163
+ LiquityV2Claim: '0xea4b417C89917d76727b1a60EE29F7EBA687760A',
164
+ LiquityV2Adjust: '0xFa1a1324b36F25b6b1200B5e62701652ecbdB5d6',
165
+ LiquityV2AdjustInterestRate: '0xBFB1DD9f9609CDeD2E2FdA78611512783A113079',
166
+ LiquityV2SPDeposit: '0xbbbf5e2246DcA33464482d784c97FB908988fcD6',
167
+ LiquityV2SPWithdraw: '0x7DC97868B4b2Fd31c1002E9bfFe9a4aF2b534c06',
168
+ LiquityV2SPClaimColl: '0x0a58710A67837E6d026B83c434519c5f0A0cD7a1',
169
169
  // b.protocol
170
170
  BprotocolLiquitySPDeposit: '0x5A0436c7559e37da8cD24B0f66C155a0a2fd6309',
171
171
  BprotocolLiquitySPWithdraw: '0x20Ece7CB4463bB1DbA4C4fA800E321A05dfB028B',
@@ -257,6 +257,13 @@ export const actionAddresses = {
257
257
  LlamaLendRepay: '0x57693f72E628A3F7323D31De35Bd158493Aa9CC0',
258
258
  LlamaLendLevCreate: '0x534b704a62385cfe5EEB8d9605419743d4fe105E',
259
259
  LlamaLendSelfLiquidateWithColl: '0xA99DD1D91141cA63C423DB763dE75078336803B2',
260
+ // eulerV2
261
+ EulerV2Supply: '0xa067787D086841437D112e0C847dDB3e5D95173f',
262
+ EulerV2Withdraw: '0x5bf1a54fe1e65B134E7920e53A5eB0D14b9e6aD1',
263
+ EulerV2Borrow: '0x38d66ecD38b7800D8FD0Bc29489c2306170a9Ede',
264
+ EulerV2Payback: '0x738b1df6b6962D8795Bda5bc5EFCd8b0B8c74d01',
265
+ EulerV2CollateralSwitch: '0x38950b50Fb38aC19D06e8CE5AAE632D6dF1EEb1a',
266
+ EulerV2View: '0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967',
260
267
  MerklClaim: '0xE88036F3F0D7e216D63726356cA2bC334e305fe5',
261
268
  },
262
269
  [NETWORKS.optimism.chainId]: {
@@ -235,6 +235,12 @@ declare const actionAddressesAllChains: {
235
235
  LlamaLendRepay: string;
236
236
  LlamaLendLevCreate: string;
237
237
  LlamaLendSelfLiquidateWithColl: string;
238
+ EulerV2Supply: string;
239
+ EulerV2Withdraw: string;
240
+ EulerV2Borrow: string;
241
+ EulerV2Payback: string;
242
+ EulerV2CollateralSwitch: string;
243
+ EulerV2View: string;
238
244
  MerklClaim: string;
239
245
  AaveV3DelegateCredit?: undefined;
240
246
  AaveV3RatioTrigger?: undefined;
@@ -469,6 +475,12 @@ declare const actionAddressesAllChains: {
469
475
  LlamaLendRepay?: undefined;
470
476
  LlamaLendLevCreate?: undefined;
471
477
  LlamaLendSelfLiquidateWithColl?: undefined;
478
+ EulerV2Supply?: undefined;
479
+ EulerV2Withdraw?: undefined;
480
+ EulerV2Borrow?: undefined;
481
+ EulerV2Payback?: undefined;
482
+ EulerV2CollateralSwitch?: undefined;
483
+ EulerV2View?: undefined;
472
484
  MerklClaim?: undefined;
473
485
  MorphoBlueView?: undefined;
474
486
  } | {
@@ -697,6 +709,12 @@ declare const actionAddressesAllChains: {
697
709
  MorphoBluePayback?: undefined;
698
710
  MorphoBlueSetAuth?: undefined;
699
711
  MorphoBlueSetAuthWithSig?: undefined;
712
+ EulerV2Supply?: undefined;
713
+ EulerV2Withdraw?: undefined;
714
+ EulerV2Borrow?: undefined;
715
+ EulerV2Payback?: undefined;
716
+ EulerV2CollateralSwitch?: undefined;
717
+ EulerV2View?: undefined;
700
718
  MerklClaim?: undefined;
701
719
  AaveV3DelegateCredit?: undefined;
702
720
  AaveV3RatioTrigger?: undefined;
@@ -926,6 +944,12 @@ declare const actionAddressesAllChains: {
926
944
  LlamaLendRepay?: undefined;
927
945
  LlamaLendLevCreate?: undefined;
928
946
  LlamaLendSelfLiquidateWithColl?: undefined;
947
+ EulerV2Supply?: undefined;
948
+ EulerV2Withdraw?: undefined;
949
+ EulerV2Borrow?: undefined;
950
+ EulerV2Payback?: undefined;
951
+ EulerV2CollateralSwitch?: undefined;
952
+ EulerV2View?: undefined;
929
953
  MerklClaim?: undefined;
930
954
  AaveV3DelegateCredit?: undefined;
931
955
  AaveV3RatioTrigger?: undefined;
@@ -1157,6 +1181,12 @@ declare const actionAddresses: (chainId?: null) => {
1157
1181
  LlamaLendRepay: string;
1158
1182
  LlamaLendLevCreate: string;
1159
1183
  LlamaLendSelfLiquidateWithColl: string;
1184
+ EulerV2Supply: string;
1185
+ EulerV2Withdraw: string;
1186
+ EulerV2Borrow: string;
1187
+ EulerV2Payback: string;
1188
+ EulerV2CollateralSwitch: string;
1189
+ EulerV2View: string;
1160
1190
  MerklClaim: string;
1161
1191
  AaveV3DelegateCredit?: undefined;
1162
1192
  AaveV3RatioTrigger?: undefined;
@@ -1391,6 +1421,12 @@ declare const actionAddresses: (chainId?: null) => {
1391
1421
  LlamaLendRepay?: undefined;
1392
1422
  LlamaLendLevCreate?: undefined;
1393
1423
  LlamaLendSelfLiquidateWithColl?: undefined;
1424
+ EulerV2Supply?: undefined;
1425
+ EulerV2Withdraw?: undefined;
1426
+ EulerV2Borrow?: undefined;
1427
+ EulerV2Payback?: undefined;
1428
+ EulerV2CollateralSwitch?: undefined;
1429
+ EulerV2View?: undefined;
1394
1430
  MerklClaim?: undefined;
1395
1431
  MorphoBlueView?: undefined;
1396
1432
  } | {
@@ -1619,6 +1655,12 @@ declare const actionAddresses: (chainId?: null) => {
1619
1655
  MorphoBluePayback?: undefined;
1620
1656
  MorphoBlueSetAuth?: undefined;
1621
1657
  MorphoBlueSetAuthWithSig?: undefined;
1658
+ EulerV2Supply?: undefined;
1659
+ EulerV2Withdraw?: undefined;
1660
+ EulerV2Borrow?: undefined;
1661
+ EulerV2Payback?: undefined;
1662
+ EulerV2CollateralSwitch?: undefined;
1663
+ EulerV2View?: undefined;
1622
1664
  MerklClaim?: undefined;
1623
1665
  AaveV3DelegateCredit?: undefined;
1624
1666
  AaveV3RatioTrigger?: undefined;
@@ -1848,6 +1890,12 @@ declare const actionAddresses: (chainId?: null) => {
1848
1890
  LlamaLendRepay?: undefined;
1849
1891
  LlamaLendLevCreate?: undefined;
1850
1892
  LlamaLendSelfLiquidateWithColl?: undefined;
1893
+ EulerV2Supply?: undefined;
1894
+ EulerV2Withdraw?: undefined;
1895
+ EulerV2Borrow?: undefined;
1896
+ EulerV2Payback?: undefined;
1897
+ EulerV2CollateralSwitch?: undefined;
1898
+ EulerV2View?: undefined;
1851
1899
  MerklClaim?: undefined;
1852
1900
  AaveV3DelegateCredit?: undefined;
1853
1901
  AaveV3RatioTrigger?: undefined;
@@ -2222,6 +2270,12 @@ declare const _default: {
2222
2270
  LlamaLendRepay: string;
2223
2271
  LlamaLendLevCreate: string;
2224
2272
  LlamaLendSelfLiquidateWithColl: string;
2273
+ EulerV2Supply: string;
2274
+ EulerV2Withdraw: string;
2275
+ EulerV2Borrow: string;
2276
+ EulerV2Payback: string;
2277
+ EulerV2CollateralSwitch: string;
2278
+ EulerV2View: string;
2225
2279
  MerklClaim: string;
2226
2280
  AaveV3DelegateCredit?: undefined;
2227
2281
  AaveV3RatioTrigger?: undefined;
@@ -2456,6 +2510,12 @@ declare const _default: {
2456
2510
  LlamaLendRepay?: undefined;
2457
2511
  LlamaLendLevCreate?: undefined;
2458
2512
  LlamaLendSelfLiquidateWithColl?: undefined;
2513
+ EulerV2Supply?: undefined;
2514
+ EulerV2Withdraw?: undefined;
2515
+ EulerV2Borrow?: undefined;
2516
+ EulerV2Payback?: undefined;
2517
+ EulerV2CollateralSwitch?: undefined;
2518
+ EulerV2View?: undefined;
2459
2519
  MerklClaim?: undefined;
2460
2520
  MorphoBlueView?: undefined;
2461
2521
  } | {
@@ -2684,6 +2744,12 @@ declare const _default: {
2684
2744
  MorphoBluePayback?: undefined;
2685
2745
  MorphoBlueSetAuth?: undefined;
2686
2746
  MorphoBlueSetAuthWithSig?: undefined;
2747
+ EulerV2Supply?: undefined;
2748
+ EulerV2Withdraw?: undefined;
2749
+ EulerV2Borrow?: undefined;
2750
+ EulerV2Payback?: undefined;
2751
+ EulerV2CollateralSwitch?: undefined;
2752
+ EulerV2View?: undefined;
2687
2753
  MerklClaim?: undefined;
2688
2754
  AaveV3DelegateCredit?: undefined;
2689
2755
  AaveV3RatioTrigger?: undefined;
@@ -2913,6 +2979,12 @@ declare const _default: {
2913
2979
  LlamaLendRepay?: undefined;
2914
2980
  LlamaLendLevCreate?: undefined;
2915
2981
  LlamaLendSelfLiquidateWithColl?: undefined;
2982
+ EulerV2Supply?: undefined;
2983
+ EulerV2Withdraw?: undefined;
2984
+ EulerV2Borrow?: undefined;
2985
+ EulerV2Payback?: undefined;
2986
+ EulerV2CollateralSwitch?: undefined;
2987
+ EulerV2View?: undefined;
2916
2988
  MerklClaim?: undefined;
2917
2989
  AaveV3DelegateCredit?: undefined;
2918
2990
  AaveV3RatioTrigger?: undefined;
@@ -3144,6 +3216,12 @@ declare const _default: {
3144
3216
  LlamaLendRepay: string;
3145
3217
  LlamaLendLevCreate: string;
3146
3218
  LlamaLendSelfLiquidateWithColl: string;
3219
+ EulerV2Supply: string;
3220
+ EulerV2Withdraw: string;
3221
+ EulerV2Borrow: string;
3222
+ EulerV2Payback: string;
3223
+ EulerV2CollateralSwitch: string;
3224
+ EulerV2View: string;
3147
3225
  MerklClaim: string;
3148
3226
  AaveV3DelegateCredit?: undefined;
3149
3227
  AaveV3RatioTrigger?: undefined;
@@ -3378,6 +3456,12 @@ declare const _default: {
3378
3456
  LlamaLendRepay?: undefined;
3379
3457
  LlamaLendLevCreate?: undefined;
3380
3458
  LlamaLendSelfLiquidateWithColl?: undefined;
3459
+ EulerV2Supply?: undefined;
3460
+ EulerV2Withdraw?: undefined;
3461
+ EulerV2Borrow?: undefined;
3462
+ EulerV2Payback?: undefined;
3463
+ EulerV2CollateralSwitch?: undefined;
3464
+ EulerV2View?: undefined;
3381
3465
  MerklClaim?: undefined;
3382
3466
  MorphoBlueView?: undefined;
3383
3467
  } | {
@@ -3606,6 +3690,12 @@ declare const _default: {
3606
3690
  MorphoBluePayback?: undefined;
3607
3691
  MorphoBlueSetAuth?: undefined;
3608
3692
  MorphoBlueSetAuthWithSig?: undefined;
3693
+ EulerV2Supply?: undefined;
3694
+ EulerV2Withdraw?: undefined;
3695
+ EulerV2Borrow?: undefined;
3696
+ EulerV2Payback?: undefined;
3697
+ EulerV2CollateralSwitch?: undefined;
3698
+ EulerV2View?: undefined;
3609
3699
  MerklClaim?: undefined;
3610
3700
  AaveV3DelegateCredit?: undefined;
3611
3701
  AaveV3RatioTrigger?: undefined;
@@ -3835,6 +3925,12 @@ declare const _default: {
3835
3925
  LlamaLendRepay?: undefined;
3836
3926
  LlamaLendLevCreate?: undefined;
3837
3927
  LlamaLendSelfLiquidateWithColl?: undefined;
3928
+ EulerV2Supply?: undefined;
3929
+ EulerV2Withdraw?: undefined;
3930
+ EulerV2Borrow?: undefined;
3931
+ EulerV2Payback?: undefined;
3932
+ EulerV2CollateralSwitch?: undefined;
3933
+ EulerV2View?: undefined;
3838
3934
  MerklClaim?: undefined;
3839
3935
  AaveV3DelegateCredit?: undefined;
3840
3936
  AaveV3RatioTrigger?: undefined;
@@ -7,6 +7,6 @@ import { getAddr } from '../addresses';
7
7
  */
8
8
  export class LiquityRatioTrigger extends Action {
9
9
  constructor(troveOwner, ratio, state) {
10
- super('LiquityRatioTrigger', getAddr('Empty'), ['addresss', 'uint256', 'uint8'], [troveOwner, ratio, state]);
10
+ super('LiquityRatioTrigger', getAddr('Empty'), ['address', 'uint256', 'uint8'], [troveOwner, ratio, state]);
11
11
  }
12
12
  }
@@ -5,6 +5,6 @@ import { getAddr } from '../addresses';
5
5
  */
6
6
  export class LiquityV2RatioTrigger extends Action {
7
7
  constructor(market, troveId, ratio, state) {
8
- super('LiquityV2RatioTrigger', getAddr('LiquityV2RatioTrigger'), ['address', 'uint256', 'uint256', 'uint8'], [market, troveId, ratio, state]);
8
+ super('LiquityV2RatioTrigger', getAddr('Empty'), ['address', 'uint256', 'uint256', 'uint8'], [market, troveId, ratio, state]);
9
9
  }
10
10
  }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256 } from '../types';
3
+ /**
4
+ *
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export declare class ShouldClosePriceTrigger extends Action {
9
+ constructor(token: EthAddress, lowerPrice: uint256, upperPrice: uint256);
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ *
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export class ShouldClosePriceTrigger extends Action {
9
+ constructor(token, lowerPrice, upperPrice) {
10
+ super('ShouldClosePriceTrigger', getAddr('Empty'), ['address', 'uint256', 'uint256'], [token, lowerPrice, upperPrice]);
11
+ }
12
+ }
@@ -21,3 +21,4 @@ export * from './CurveUsdHealthRatioTrigger';
21
21
  export * from './MorphoBlueRatioTrigger';
22
22
  export * from './OffchainPriceTrigger';
23
23
  export * from './LiquityV2RatioTrigger';
24
+ export * from './ShouldClosePriceTrigger';
@@ -21,3 +21,4 @@ export * from './CurveUsdHealthRatioTrigger';
21
21
  export * from './MorphoBlueRatioTrigger';
22
22
  export * from './OffchainPriceTrigger';
23
23
  export * from './LiquityV2RatioTrigger';
24
+ export * from './ShouldClosePriceTrigger';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.2.7-dev-liquity-v2",
3
+ "version": "1.2.7-dev-2-liquity-v2",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
@@ -10,7 +10,7 @@ import { EthAddress, uint256 } from '../../types';
10
10
  */
11
11
  export class SendTokensAction extends Action {
12
12
  /**
13
- * @param tokens Token addressess
13
+ * @param tokens Token addresses
14
14
  * @param receivers Transfer recipients
15
15
  * @param amounts Transfer amounts (-1 for whole Recipe (DsProxy) balance)
16
16
  */
@@ -0,0 +1,38 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * Transfers specified tokens from user's wallet to specified addresses and unwraps for weth address
7
+ *
8
+ * @category BasicActions
9
+ */
10
+ export class SendTokensAndUnwrapAction extends Action {
11
+ /**
12
+ * @param tokens Token addresses
13
+ * @param receivers Transfer recipients
14
+ * @param amounts Transfer amounts
15
+ */
16
+ constructor(tokens: Array<EthAddress>, receivers: Array<EthAddress>, amounts:Array<uint256>) {
17
+ super(
18
+ 'SendTokensAndUnwrap',
19
+ getAddr('Empty'),
20
+ [
21
+ 'address[]',
22
+ 'address[]',
23
+ 'uint256[]',
24
+ ],
25
+ [tokens, receivers, amounts],
26
+ );
27
+ this.mappableArgs = [];
28
+ for (let i = 0; i < this.args[0].length; i++) {
29
+ this.mappableArgs.push(this.args[0][i]);
30
+ }
31
+ for (let i = 0; i < this.args[1].length; i++) {
32
+ this.mappableArgs.push(this.args[1][i]);
33
+ }
34
+ for (let i = 0; i < this.args[2].length; i++) {
35
+ this.mappableArgs.push(this.args[2][i]);
36
+ }
37
+ }
38
+ }
@@ -29,4 +29,5 @@ export * from './ExecuteSafeTxAction';
29
29
  export * from './RemoveTokenApprovalAction';
30
30
  export * from './PermitTokenAction';
31
31
  export * from './StarknetClaimAction';
32
- export * from './HandleAuthAction';
32
+ export * from './HandleAuthAction';
33
+ export * from './SendTokensAndUnwrapAction';
@@ -0,0 +1,30 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * AaveV3OpenRatioCheckAction - Checks aave V3 ratio for users proxy position and reverts if faulty.
7
+ *
8
+ * @dev This checker action is different from AaveV3RatioCheckAction in that it checks current ratio without checking previous ratio.
9
+ *
10
+ * @category Checkers
11
+ */
12
+ export class AaveV3OpenRatioCheckAction extends Action {
13
+ /**
14
+ * @param targetRatio The ratio user want to be at
15
+ * @param market Address provider for specific market
16
+ */
17
+ constructor(targetRatio:uint256, market:EthAddress) {
18
+ super(
19
+ 'AaveV3OpenRatioCheck',
20
+ getAddr('Empty'),
21
+ ['uint256', 'address'],
22
+ [targetRatio, market],
23
+ );
24
+
25
+ this.mappableArgs = [
26
+ this.args[0],
27
+ this.args[1],
28
+ ];
29
+ }
30
+ }
@@ -17,7 +17,7 @@ export class LiquityV2RatioCheckAction extends Action {
17
17
  constructor(market: EthAddress, troveId: uint256, ratioState:uint8, targetRatio:uint256) {
18
18
  super(
19
19
  'LiquityV2RatioCheck',
20
- getAddr('LiquityV2RatioCheck'),
20
+ getAddr('Empty'),
21
21
  ['address', 'uint256', 'uint8', 'uint256'],
22
22
  [market, troveId, ratioState, targetRatio],
23
23
  );
@@ -9,4 +9,5 @@ export * from './SparkRatioCheckAction';
9
9
  export * from './LiquityRatioIncreaseCheckAction';
10
10
  export * from './CurveUsdCollRatioCheck';
11
11
  export * from './MorphoBlueRatioCheckAction';
12
- export * from './LiquityV2RatioCheckAction';
12
+ export * from './AaveV3OpenRatioCheckAction';
13
+ export * from './LiquityV2RatioCheckAction';
@@ -0,0 +1,37 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2BorrowAction - Borrow assets from an Euler vault
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2BorrowAction extends Action {
11
+ /**
12
+ * @param vault The address of the Euler vault
13
+ * @param account The address of the Euler account, defaults to user's wallet
14
+ * @param receiver The address to receive the borrowed assets
15
+ * @param amount The amount of assets to borrow
16
+ */
17
+ constructor(
18
+ vault: EthAddress,
19
+ account: EthAddress,
20
+ receiver: EthAddress,
21
+ amount: uint256,
22
+ ) {
23
+ super(
24
+ 'EulerV2Borrow',
25
+ getAddr('EulerV2Borrow'),
26
+ ['address', 'address', 'address', 'uint256'],
27
+ [vault, account, receiver, amount],
28
+ );
29
+
30
+ this.mappableArgs = [
31
+ this.args[0],
32
+ this.args[1],
33
+ this.args[2],
34
+ this.args[3],
35
+ ];
36
+ }
37
+ }
@@ -0,0 +1,34 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress } from '../../types';
4
+
5
+ /**
6
+ * EulerV2CollateralSwitchAction - Switch if vault will be used as collateral or not
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2CollateralSwitchAction extends Action {
11
+ /**
12
+ * @param vault The address of the vault
13
+ * @param account The address of the Euler account, defaults to user's wallet
14
+ * @param enableAsColl Whether to enable or disable the vault as collateral
15
+ */
16
+ constructor(
17
+ vault: EthAddress,
18
+ account: EthAddress,
19
+ enableAsColl: boolean,
20
+ ) {
21
+ super(
22
+ 'EulerV2CollateralSwitch',
23
+ getAddr('EulerV2CollateralSwitch'),
24
+ ['address', 'address', 'bool'],
25
+ [vault, account, enableAsColl],
26
+ );
27
+
28
+ this.mappableArgs = [
29
+ this.args[0],
30
+ this.args[1],
31
+ this.args[2],
32
+ ];
33
+ }
34
+ }
@@ -0,0 +1,47 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2PaybackAction - Payback debt assets to a Euler vault
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2PaybackAction extends Action {
11
+ tokenForApproval: EthAddress;
12
+
13
+ /**
14
+ * @param vault The address of the vault
15
+ * @param tokenAddress Underlying token address
16
+ * @param account The address of the Euler account, defaults to user's wallet
17
+ * @param from The address from which to pull tokens to be paid back
18
+ * @param amount The amount of assets to pay back (uint256.max for full debt repayment)
19
+ */
20
+ constructor(
21
+ vault: EthAddress,
22
+ tokenAddress: EthAddress,
23
+ account: EthAddress,
24
+ from: EthAddress,
25
+ amount: uint256,
26
+ ) {
27
+ super(
28
+ 'EulerV2Payback',
29
+ getAddr('EulerV2Payback'),
30
+ ['address', 'address', 'address', 'uint256'],
31
+ [vault, account, from, amount],
32
+ );
33
+
34
+ this.mappableArgs = [
35
+ this.args[0],
36
+ this.args[1],
37
+ this.args[2],
38
+ this.args[3],
39
+ ];
40
+
41
+ this.tokenForApproval = tokenAddress;
42
+ }
43
+
44
+ async getAssetsToApprove() {
45
+ return [{ asset: this.tokenForApproval, owner: this.args[2] }];
46
+ }
47
+ }
@@ -0,0 +1,37 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2PaybackWithSharesAction - Payback debt asset to a Euler vault using share tokens
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2PaybackWithSharesAction extends Action {
11
+ /**
12
+ * @param vault The address of the vault
13
+ * @param account The address of the Euler account for which debt is paid back, defaults to user's wallet
14
+ * @param from The address of the Euler account for which shares are burned to pay back debt for 'account', defaults to user's wallet
15
+ * @param amount The amount of asset tokens to be paid back (uint256.max for full debt repayment or up to the available deposit shares in 'from' account)
16
+ */
17
+ constructor(
18
+ vault: EthAddress,
19
+ account: EthAddress,
20
+ from: EthAddress,
21
+ amount: uint256,
22
+ ) {
23
+ super(
24
+ 'EulerV2PaybackWithShares',
25
+ getAddr('Empty'),
26
+ ['address', 'address', 'address', 'uint256'],
27
+ [vault, account, from, amount],
28
+ );
29
+
30
+ this.mappableArgs = [
31
+ this.args[0],
32
+ this.args[1],
33
+ this.args[2],
34
+ this.args[3],
35
+ ];
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2PullDebtAction - Pull debt from one Euler account to another
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2PullDebtAction extends Action {
11
+ /**
12
+ * @param vault The address of the Euler vault
13
+ * @param account The address of the Euler account taking the debt, defaults to user's wallet
14
+ * @param from The address of the Euler account from which debt is pulled
15
+ * @param amount The amount of debt to be pulled (uint256.max for full debt pull)
16
+ */
17
+ constructor(
18
+ vault: EthAddress,
19
+ account: EthAddress,
20
+ from: EthAddress,
21
+ amount: uint256,
22
+ ) {
23
+ super(
24
+ 'EulerV2PullDebt',
25
+ getAddr('Empty'),
26
+ ['address', 'address', 'address', 'uint256'],
27
+ [vault, account, from, amount],
28
+ );
29
+
30
+ this.mappableArgs = [
31
+ this.args[0],
32
+ this.args[1],
33
+ this.args[2],
34
+ this.args[3],
35
+ ];
36
+ }
37
+ }
@@ -0,0 +1,31 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint8 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2ReorderCollateralsAction - Reorder account collaterals. Can be used to optimize gas costs when checking account health status
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2ReorderCollateralsAction extends Action {
11
+ /**
12
+ * @param account The address of the Euler account, defaults to user's wallet
13
+ * @param indexes The array of swap steps to reorder collaterals
14
+ */
15
+ constructor(
16
+ account: EthAddress,
17
+ indexes: Array<Array<uint8>>,
18
+ ) {
19
+ super(
20
+ 'EulerV2ReorderCollaterals',
21
+ getAddr('Empty'),
22
+ ['address', 'uint8[][]'],
23
+ [account, indexes],
24
+ );
25
+
26
+ this.mappableArgs = [
27
+ this.args[0],
28
+ this.args[1],
29
+ ];
30
+ }
31
+ }