@defisaver/sdk 1.1.0 → 1.1.2-dev

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 (48) hide show
  1. package/esm/src/actions/llamalend/LlamaLendBoostAction.d.ts +8 -0
  2. package/esm/src/actions/llamalend/LlamaLendBoostAction.js +18 -0
  3. package/esm/src/actions/llamalend/LlamaLendCreateAction.d.ts +2 -2
  4. package/esm/src/actions/llamalend/LlamaLendCreateAction.js +2 -3
  5. package/esm/src/actions/llamalend/LlamaLendGetDebtAction.d.ts +8 -0
  6. package/esm/src/actions/llamalend/LlamaLendGetDebtAction.js +13 -0
  7. package/esm/src/actions/llamalend/LlamaLendLevCreateAction.d.ts +12 -0
  8. package/esm/src/actions/llamalend/LlamaLendLevCreateAction.js +41 -0
  9. package/esm/src/actions/llamalend/LlamaLendPaybackAction.d.ts +2 -10
  10. package/esm/src/actions/llamalend/LlamaLendPaybackAction.js +2 -11
  11. package/esm/src/actions/llamalend/LlamaLendRepayAction.d.ts +8 -0
  12. package/esm/src/actions/llamalend/LlamaLendRepayAction.js +20 -0
  13. package/esm/src/actions/llamalend/LlamaLendSelfLiquidateAction.d.ts +2 -2
  14. package/esm/src/actions/llamalend/LlamaLendSelfLiquidateAction.js +2 -3
  15. package/esm/src/actions/llamalend/LlamaLendSelfLiquidateWithCollAction.d.ts +8 -0
  16. package/esm/src/actions/llamalend/LlamaLendSelfLiquidateWithCollAction.js +25 -0
  17. package/esm/src/actions/llamalend/LlamaLendSupplyAction.d.ts +2 -2
  18. package/esm/src/actions/llamalend/LlamaLendSupplyAction.js +2 -3
  19. package/esm/src/actions/llamalend/index.d.ts +5 -0
  20. package/esm/src/actions/llamalend/index.js +5 -0
  21. package/esm/src/actions/reflexer/ReflexerWithdrawStuckFunds.d.ts +14 -0
  22. package/esm/src/actions/reflexer/ReflexerWithdrawStuckFunds.js +18 -0
  23. package/esm/src/actions/reflexer/index.d.ts +1 -0
  24. package/esm/src/actions/reflexer/index.js +1 -0
  25. package/esm/src/addresses.d.ts +31 -7
  26. package/esm/src/addresses.js +20 -1
  27. package/esm/src/index.d.ts +124 -28
  28. package/esm/src/utils/index.d.ts +1 -2
  29. package/esm/src/utils/index.js +1 -2
  30. package/package.json +1 -1
  31. package/src/actions/llamalend/LlamaLendBoostAction.ts +26 -0
  32. package/src/actions/llamalend/LlamaLendCreateAction.ts +3 -2
  33. package/src/actions/llamalend/LlamaLendGetDebtAction.ts +21 -0
  34. package/src/actions/llamalend/LlamaLendLevCreateAction.ts +39 -0
  35. package/src/actions/llamalend/LlamaLendPaybackAction.ts +2 -10
  36. package/src/actions/llamalend/LlamaLendRepayAction.ts +28 -0
  37. package/src/actions/llamalend/LlamaLendSelfLiquidateAction.ts +3 -2
  38. package/src/actions/llamalend/LlamaLendSelfLiquidateWithCollAction.ts +33 -0
  39. package/src/actions/llamalend/LlamaLendSupplyAction.ts +2 -2
  40. package/src/actions/llamalend/index.ts +6 -1
  41. package/src/actions/reflexer/ReflexerWithdrawStuckFunds.ts +20 -0
  42. package/src/actions/reflexer/index.ts +2 -1
  43. package/src/addresses.ts +21 -1
  44. package/src/utils/index.ts +0 -2
  45. package/umd/index.js +594 -450
  46. package/esm/src/utils/llamalend-utils.d.ts +0 -10
  47. package/esm/src/utils/llamalend-utils.js +0 -10
  48. package/src/utils/llamalend-utils.ts +0 -11
@@ -0,0 +1,33 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256, uint32 } from '../../types';
4
+
5
+
6
+ /**
7
+ * @category LlamaLend
8
+ */
9
+ export class LlamaLendSelfLiquidateWithCollAction extends Action {
10
+ constructor(controller: EthAddress, controllerId: uint256, percentage: uint256, minCrvUsdExpected: uint256, exchangeOrder: Array<any>, to: EthAddress, sellAllCollateral: boolean, gasUsed: uint32) {
11
+ super(
12
+ 'LlamaLendSelfLiquidateWithColl',
13
+ getAddr('LlamaLendSelfLiquidateWithColl'),
14
+ [
15
+ 'address',
16
+ 'uint256',
17
+ 'uint256',
18
+ 'uint256',
19
+ ['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address', 'bytes', ['address', 'address', 'address', 'uint256', 'uint256', 'bytes']],
20
+ 'address',
21
+ 'bool',
22
+ 'uint32',
23
+ ],
24
+ [controller, controllerId, percentage, minCrvUsdExpected, exchangeOrder, to, sellAllCollateral, gasUsed],
25
+ );
26
+ this.mappableArgs = [
27
+ this.args[0],
28
+ this.args[1],
29
+ this.args[2],
30
+ this.args[4],
31
+ ];
32
+ }
33
+ }
@@ -1,7 +1,6 @@
1
1
  import { Action } from '../../Action';
2
2
  import { getAddr } from '../../addresses';
3
3
  import { EthAddress, uint256 } from '../../types';
4
- import { controllerToCollateralAssetMap } from '../../utils/llamalend-utils';
5
4
 
6
5
 
7
6
  /**
@@ -22,6 +21,7 @@ export class LlamaLendSupplyAction extends Action {
22
21
  from: EthAddress,
23
22
  onBehalfOf: EthAddress,
24
23
  collateralAmount: uint256,
24
+ collAsset: EthAddress,
25
25
  ) {
26
26
  super(
27
27
  'LlamaLendSupply',
@@ -38,7 +38,7 @@ export class LlamaLendSupplyAction extends Action {
38
38
  async getAssetsToApprove() {
39
39
  return [{
40
40
  owner: this.args[1],
41
- asset: controllerToCollateralAssetMap[this.args[0] as keyof typeof controllerToCollateralAssetMap],
41
+ asset: this.args[4],
42
42
  }];
43
43
  }
44
44
  }
@@ -3,4 +3,9 @@ export * from './LlamaLendWithdrawAction';
3
3
  export * from './LlamaLendSupplyAction';
4
4
  export * from './LlamaLendCreateAction';
5
5
  export * from './LlamaLendPaybackAction';
6
- export * from './LlamaLendSelfLiquidateAction';
6
+ export * from './LlamaLendSelfLiquidateAction';
7
+ export * from './LlamaLendGetDebtAction';
8
+ export * from './LlamaLendLevCreateAction';
9
+ export * from './LlamaLendBoostAction';
10
+ export * from './LlamaLendRepayAction';
11
+ export * from './LlamaLendSelfLiquidateWithCollAction';
@@ -0,0 +1,20 @@
1
+ import { Action } from '../../Action';
2
+ import { requireAddress } from '../../utils/general';
3
+ import { getAddr } from '../../addresses';
4
+ import { EthAddress, uint256 } from '../../types';
5
+
6
+ /**
7
+ * ReflexerWithdrawStuckFunds - Withdraw stuck funds from a reflexer safe
8
+ *
9
+ * @category Reflexer
10
+ */
11
+ export class ReflexerWithdrawStuckFunds extends Action {
12
+ /**
13
+ * @param safeId - The id of the reflexer safe
14
+ * @param to - address where RAI will be sent to
15
+ */
16
+ constructor(safeId:uint256, to:EthAddress) {
17
+ requireAddress(to);
18
+ super('ReflexerWithdrawStuckFunds', getAddr('ReflexerWithdrawStuckFunds'), ['uint256', 'address'], [safeId, to]);
19
+ }
20
+ }
@@ -5,4 +5,5 @@ export * from './ReflexerPaybackAction';
5
5
  export * from './ReflexerWithdrawAction';
6
6
  export * from './ReflexerNativeUniV2SaviourDepositAction';
7
7
  export * from './ReflexerNativeUniV2SaviourWithdrawAction';
8
- export * from './ReflexerNativeUniV2SaviourGetReservesAction';
8
+ export * from './ReflexerNativeUniV2SaviourGetReservesAction';
9
+ export * from './ReflexerWithdrawStuckFunds';
package/src/addresses.ts CHANGED
@@ -42,9 +42,10 @@ export const actionAddresses = {
42
42
  // reflexer
43
43
  ReflexerSupply: '0xd7a36CD4ce7CCc2F1376Dc5C48BaC84380A4f698',
44
44
  ReflexerWithdraw: '0xD8a14d447AB6789F3bf1Eb763b6306db3FC3d666',
45
- ReflexerPayback: '0xcC6838d8a61a4b29Ea565d39C38b830f1491cb29',
45
+ ReflexerPayback: '0xdAa3963798C2E3F5c16AAcc9114fc727C450d0cb',
46
46
  ReflexerGenerate: '0x8e8Fd178A5FAE3A29F9CB1A06aBBBCFd5B83beb7',
47
47
  ReflexerOpen: '0x4704a7cBd4d913d1233765B70531D601b4384011',
48
+ ReflexerWithdrawStuckFunds: '0x64759d064aaA1f9Ac7A458520Aad06128Da9b7b8',
48
49
 
49
50
  // not deployed as currently not used
50
51
  ReflexerNativeUniV2SaviourDeposit: '0x0000000000000000000000000000000000000000',
@@ -267,6 +268,11 @@ export const actionAddresses = {
267
268
  LlamaLendWithdraw: '0x2593Da3c4110C531541424e9e847cd7905894C52',
268
269
  LlamaLendPayback: '0x5b506b7a0117dbcd086632575da599bb603eb602',
269
270
  LlamaLendSelfLiquidate: '0xe4944e0e46177300fa4c351ef72b95b9655e8394',
271
+ LlamaLendGetDebt: '0x5625ea9fcd930d5f131b0261ec4dcaf279fea4ed',
272
+ LlamaLendBoost: '0xa21c1ce7318c6d38a10de44c2cd5d80514437d85',
273
+ LlamaLendRepay: '0x57693f72E628A3F7323D31De35Bd158493Aa9CC0',
274
+ LlamaLendLevCreate: '0x534b704a62385cfe5EEB8d9605419743d4fe105E',
275
+ LlamaLendSelfLiquidateWithColl: '0xc20460aabdb89e55c2d29067e031d170f2fb10e5',
270
276
 
271
277
  MerklClaim: '0xE88036F3F0D7e216D63726356cA2bC334e305fe5',
272
278
  },
@@ -345,6 +351,7 @@ export const actionAddresses = {
345
351
  AaveV3Supply: '0xF159c79077001E2a2C1a178BE68DB7F69a6Da486',
346
352
  AaveV3SwapBorrowRateMode: '0x738042389A8d6B0F6D6ab009c42dfF84ebB737C0',
347
353
  AaveV3Withdraw: '0xbf492F869DdB1A18BB4F41b6c3059D9f882Fe7ff',
354
+ AaveV3ClaimRewards: '0x3a4d72Ed2a47a409a82ba61f0fca1C749Ea8aB66',
348
355
 
349
356
  // CompV3
350
357
  CompV3Allow: '0x0380E8e13CdE0499c720999930CaA07A5744887c',
@@ -371,6 +378,19 @@ export const actionAddresses = {
371
378
  UniSupplyV3: '0x55675C6041A33EE9BDd796Edaa0f098AC7F3534f',
372
379
  UniWithdrawV3: '0xa004c22eFd0CD87847DE83Ce9ab92af5382c2efe',
373
380
  UniCreatePoolV3: '0x334Ab3C12a4c0315566fd9308880Dad71F838Dc5',
381
+
382
+ // llamalend
383
+ LlamaLendCreate: '0xaf14226ad0d782c71d3acf94ad02d6a39c89ec79',
384
+ LlamaLendSupply: '0x8f0814709d6d8b7c4b3021f7cb80e08476bc6959',
385
+ LlamaLendBorrow: '0x4948135f8b3a8f3b51fbd1050f5d0f755accb8e7',
386
+ LlamaLendWithdraw: '0xd7a80e7a2296d75cd1eebc2f0de0cebd14fbe117',
387
+ LlamaLendPayback: '0x21e05ffb9cf729630b5a9c2f01ff3b41f38be48c',
388
+ LlamaLendSelfLiquidate: '0xc9fd91f932d903023e887e4e4af0a298e10529a8',
389
+ LlamaLendGetDebt: '0x81c01f08b8fc4487501c88404ed17ebc17764f9c',
390
+ LlamaLendBoost: '0xc52a3af27696f8cf999463f3455e23440a376f8d',
391
+ LlamaLendRepay: '0x320fdfa922ee33c1cc8a042ada855c9dfe9bed06',
392
+ LlamaLendLevCreate: '0xe5cbdcbe494246c21851eea0642ff0791f95cc86',
393
+ LlamaLendSelfLiquidateWithColl: '0x4faef2cd1680ea00f9398a0525c536b2466a887b',
374
394
  },
375
395
  [NETWORKS.base.chainId]: {
376
396
  // Basic
@@ -6,7 +6,6 @@ import mstableAssetPairs from './mstableAssetPairs';
6
6
  import * as curveUtils from './curve-utils';
7
7
  import * as curveusdUtils from './curveusd-utils';
8
8
  import * as basicUtils from './basic-utils';
9
- import * as llamaLenUtils from './llamalend-utils';
10
9
 
11
10
  export {
12
11
  zeroExExchange,
@@ -17,5 +16,4 @@ export {
17
16
  curveUtils,
18
17
  curveusdUtils,
19
18
  basicUtils,
20
- llamaLenUtils,
21
19
  };