@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
@@ -7,7 +7,7 @@ import { EthAddress, uint256 } from '../../types';
7
7
  */
8
8
  export declare class SendTokensAction extends Action {
9
9
  /**
10
- * @param tokens Token addressess
10
+ * @param tokens Token addresses
11
11
  * @param receivers Transfer recipients
12
12
  * @param amounts Transfer amounts (-1 for whole Recipe (DsProxy) balance)
13
13
  */
@@ -7,7 +7,7 @@ import { getAddr } from '../../addresses';
7
7
  */
8
8
  export class SendTokensAction extends Action {
9
9
  /**
10
- * @param tokens Token addressess
10
+ * @param tokens Token addresses
11
11
  * @param receivers Transfer recipients
12
12
  * @param amounts Transfer amounts (-1 for whole Recipe (DsProxy) balance)
13
13
  */
@@ -0,0 +1,15 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * Transfers specified tokens from user's wallet to specified addresses and unwraps for weth address
5
+ *
6
+ * @category BasicActions
7
+ */
8
+ export declare class SendTokensAndUnwrapAction extends Action {
9
+ /**
10
+ * @param tokens Token addresses
11
+ * @param receivers Transfer recipients
12
+ * @param amounts Transfer amounts
13
+ */
14
+ constructor(tokens: Array<EthAddress>, receivers: Array<EthAddress>, amounts: Array<uint256>);
15
+ }
@@ -0,0 +1,31 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * Transfers specified tokens from user's wallet to specified addresses and unwraps for weth address
5
+ *
6
+ * @category BasicActions
7
+ */
8
+ export class SendTokensAndUnwrapAction extends Action {
9
+ /**
10
+ * @param tokens Token addresses
11
+ * @param receivers Transfer recipients
12
+ * @param amounts Transfer amounts
13
+ */
14
+ constructor(tokens, receivers, amounts) {
15
+ super('SendTokensAndUnwrap', getAddr('Empty'), [
16
+ 'address[]',
17
+ 'address[]',
18
+ 'uint256[]',
19
+ ], [tokens, receivers, amounts]);
20
+ this.mappableArgs = [];
21
+ for (let i = 0; i < this.args[0].length; i++) {
22
+ this.mappableArgs.push(this.args[0][i]);
23
+ }
24
+ for (let i = 0; i < this.args[1].length; i++) {
25
+ this.mappableArgs.push(this.args[1][i]);
26
+ }
27
+ for (let i = 0; i < this.args[2].length; i++) {
28
+ this.mappableArgs.push(this.args[2][i]);
29
+ }
30
+ }
31
+ }
@@ -30,3 +30,4 @@ export * from './RemoveTokenApprovalAction';
30
30
  export * from './PermitTokenAction';
31
31
  export * from './StarknetClaimAction';
32
32
  export * from './HandleAuthAction';
33
+ export * from './SendTokensAndUnwrapAction';
@@ -30,3 +30,4 @@ export * from './RemoveTokenApprovalAction';
30
30
  export * from './PermitTokenAction';
31
31
  export * from './StarknetClaimAction';
32
32
  export * from './HandleAuthAction';
33
+ export * from './SendTokensAndUnwrapAction';
@@ -0,0 +1,16 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * AaveV3OpenRatioCheckAction - Checks aave V3 ratio for users proxy position and reverts if faulty.
5
+ *
6
+ * @dev This checker action is different from AaveV3RatioCheckAction in that it checks current ratio without checking previous ratio.
7
+ *
8
+ * @category Checkers
9
+ */
10
+ export declare class AaveV3OpenRatioCheckAction extends Action {
11
+ /**
12
+ * @param targetRatio The ratio user want to be at
13
+ * @param market Address provider for specific market
14
+ */
15
+ constructor(targetRatio: uint256, market: EthAddress);
16
+ }
@@ -0,0 +1,22 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * AaveV3OpenRatioCheckAction - Checks aave V3 ratio for users proxy position and reverts if faulty.
5
+ *
6
+ * @dev This checker action is different from AaveV3RatioCheckAction in that it checks current ratio without checking previous ratio.
7
+ *
8
+ * @category Checkers
9
+ */
10
+ export class AaveV3OpenRatioCheckAction extends Action {
11
+ /**
12
+ * @param targetRatio The ratio user want to be at
13
+ * @param market Address provider for specific market
14
+ */
15
+ constructor(targetRatio, market) {
16
+ super('AaveV3OpenRatioCheck', getAddr('Empty'), ['uint256', 'address'], [targetRatio, market]);
17
+ this.mappableArgs = [
18
+ this.args[0],
19
+ this.args[1],
20
+ ];
21
+ }
22
+ }
@@ -13,7 +13,7 @@ export class LiquityV2RatioCheckAction extends Action {
13
13
  * @param targetRatio The ratio user want to be at
14
14
  */
15
15
  constructor(market, troveId, ratioState, targetRatio) {
16
- super('LiquityV2RatioCheck', getAddr('LiquityV2RatioCheck'), ['address', 'uint256', 'uint8', 'uint256'], [market, troveId, ratioState, targetRatio]);
16
+ super('LiquityV2RatioCheck', getAddr('Empty'), ['address', 'uint256', 'uint8', 'uint256'], [market, troveId, ratioState, targetRatio]);
17
17
  this.mappableArgs = [
18
18
  this.args[0],
19
19
  this.args[1],
@@ -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 './AaveV3OpenRatioCheckAction';
12
13
  export * from './LiquityV2RatioCheckAction';
@@ -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 './AaveV3OpenRatioCheckAction';
12
13
  export * from './LiquityV2RatioCheckAction';
@@ -0,0 +1,16 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * EulerV2BorrowAction - Borrow assets from an Euler vault
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2BorrowAction extends Action {
9
+ /**
10
+ * @param vault The address of the Euler vault
11
+ * @param account The address of the Euler account, defaults to user's wallet
12
+ * @param receiver The address to receive the borrowed assets
13
+ * @param amount The amount of assets to borrow
14
+ */
15
+ constructor(vault: EthAddress, account: EthAddress, receiver: EthAddress, amount: uint256);
16
+ }
@@ -0,0 +1,24 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * EulerV2BorrowAction - Borrow assets from an Euler vault
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export class EulerV2BorrowAction extends Action {
9
+ /**
10
+ * @param vault The address of the Euler vault
11
+ * @param account The address of the Euler account, defaults to user's wallet
12
+ * @param receiver The address to receive the borrowed assets
13
+ * @param amount The amount of assets to borrow
14
+ */
15
+ constructor(vault, account, receiver, amount) {
16
+ super('EulerV2Borrow', getAddr('EulerV2Borrow'), ['address', 'address', 'address', 'uint256'], [vault, account, receiver, amount]);
17
+ this.mappableArgs = [
18
+ this.args[0],
19
+ this.args[1],
20
+ this.args[2],
21
+ this.args[3],
22
+ ];
23
+ }
24
+ }
@@ -0,0 +1,15 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress } from '../../types';
3
+ /**
4
+ * EulerV2CollateralSwitchAction - Switch if vault will be used as collateral or not
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2CollateralSwitchAction extends Action {
9
+ /**
10
+ * @param vault The address of the vault
11
+ * @param account The address of the Euler account, defaults to user's wallet
12
+ * @param enableAsColl Whether to enable or disable the vault as collateral
13
+ */
14
+ constructor(vault: EthAddress, account: EthAddress, enableAsColl: boolean);
15
+ }
@@ -0,0 +1,22 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * EulerV2CollateralSwitchAction - Switch if vault will be used as collateral or not
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export class EulerV2CollateralSwitchAction extends Action {
9
+ /**
10
+ * @param vault The address of the vault
11
+ * @param account The address of the Euler account, defaults to user's wallet
12
+ * @param enableAsColl Whether to enable or disable the vault as collateral
13
+ */
14
+ constructor(vault, account, enableAsColl) {
15
+ super('EulerV2CollateralSwitch', getAddr('EulerV2CollateralSwitch'), ['address', 'address', 'bool'], [vault, account, enableAsColl]);
16
+ this.mappableArgs = [
17
+ this.args[0],
18
+ this.args[1],
19
+ this.args[2],
20
+ ];
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * EulerV2PaybackAction - Payback debt assets to a Euler vault
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2PaybackAction extends Action {
9
+ tokenForApproval: EthAddress;
10
+ /**
11
+ * @param vault The address of the vault
12
+ * @param tokenAddress Underlying token address
13
+ * @param account The address of the Euler account, defaults to user's wallet
14
+ * @param from The address from which to pull tokens to be paid back
15
+ * @param amount The amount of assets to pay back (uint256.max for full debt repayment)
16
+ */
17
+ constructor(vault: EthAddress, tokenAddress: EthAddress, account: EthAddress, from: EthAddress, amount: uint256);
18
+ getAssetsToApprove(): Promise<{
19
+ asset: string;
20
+ owner: any;
21
+ }[]>;
22
+ }
@@ -0,0 +1,40 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Action } from '../../Action';
11
+ import { getAddr } from '../../addresses';
12
+ /**
13
+ * EulerV2PaybackAction - Payback debt assets to a Euler vault
14
+ *
15
+ * @category EulerV2
16
+ */
17
+ export class EulerV2PaybackAction extends Action {
18
+ /**
19
+ * @param vault The address of the vault
20
+ * @param tokenAddress Underlying token address
21
+ * @param account The address of the Euler account, defaults to user's wallet
22
+ * @param from The address from which to pull tokens to be paid back
23
+ * @param amount The amount of assets to pay back (uint256.max for full debt repayment)
24
+ */
25
+ constructor(vault, tokenAddress, account, from, amount) {
26
+ super('EulerV2Payback', getAddr('EulerV2Payback'), ['address', 'address', 'address', 'uint256'], [vault, account, from, amount]);
27
+ this.mappableArgs = [
28
+ this.args[0],
29
+ this.args[1],
30
+ this.args[2],
31
+ this.args[3],
32
+ ];
33
+ this.tokenForApproval = tokenAddress;
34
+ }
35
+ getAssetsToApprove() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ return [{ asset: this.tokenForApproval, owner: this.args[2] }];
38
+ });
39
+ }
40
+ }
@@ -0,0 +1,16 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * EulerV2PaybackWithSharesAction - Payback debt asset to a Euler vault using share tokens
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2PaybackWithSharesAction extends Action {
9
+ /**
10
+ * @param vault The address of the vault
11
+ * @param account The address of the Euler account for which debt is paid back, defaults to user's wallet
12
+ * @param from The address of the Euler account for which shares are burned to pay back debt for 'account', defaults to user's wallet
13
+ * @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)
14
+ */
15
+ constructor(vault: EthAddress, account: EthAddress, from: EthAddress, amount: uint256);
16
+ }
@@ -0,0 +1,24 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * EulerV2PaybackWithSharesAction - Payback debt asset to a Euler vault using share tokens
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export class EulerV2PaybackWithSharesAction extends Action {
9
+ /**
10
+ * @param vault The address of the vault
11
+ * @param account The address of the Euler account for which debt is paid back, defaults to user's wallet
12
+ * @param from The address of the Euler account for which shares are burned to pay back debt for 'account', defaults to user's wallet
13
+ * @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)
14
+ */
15
+ constructor(vault, account, from, amount) {
16
+ super('EulerV2PaybackWithShares', getAddr('Empty'), ['address', 'address', 'address', 'uint256'], [vault, account, from, amount]);
17
+ this.mappableArgs = [
18
+ this.args[0],
19
+ this.args[1],
20
+ this.args[2],
21
+ this.args[3],
22
+ ];
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * EulerV2PullDebtAction - Pull debt from one Euler account to another
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2PullDebtAction extends Action {
9
+ /**
10
+ * @param vault The address of the Euler vault
11
+ * @param account The address of the Euler account taking the debt, defaults to user's wallet
12
+ * @param from The address of the Euler account from which debt is pulled
13
+ * @param amount The amount of debt to be pulled (uint256.max for full debt pull)
14
+ */
15
+ constructor(vault: EthAddress, account: EthAddress, from: EthAddress, amount: uint256);
16
+ }
@@ -0,0 +1,24 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * EulerV2PullDebtAction - Pull debt from one Euler account to another
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export class EulerV2PullDebtAction extends Action {
9
+ /**
10
+ * @param vault The address of the Euler vault
11
+ * @param account The address of the Euler account taking the debt, defaults to user's wallet
12
+ * @param from The address of the Euler account from which debt is pulled
13
+ * @param amount The amount of debt to be pulled (uint256.max for full debt pull)
14
+ */
15
+ constructor(vault, account, from, amount) {
16
+ super('EulerV2PullDebt', getAddr('Empty'), ['address', 'address', 'address', 'uint256'], [vault, account, from, amount]);
17
+ this.mappableArgs = [
18
+ this.args[0],
19
+ this.args[1],
20
+ this.args[2],
21
+ this.args[3],
22
+ ];
23
+ }
24
+ }
@@ -0,0 +1,14 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint8 } from '../../types';
3
+ /**
4
+ * EulerV2ReorderCollateralsAction - Reorder account collaterals. Can be used to optimize gas costs when checking account health status
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2ReorderCollateralsAction extends Action {
9
+ /**
10
+ * @param account The address of the Euler account, defaults to user's wallet
11
+ * @param indexes The array of swap steps to reorder collaterals
12
+ */
13
+ constructor(account: EthAddress, indexes: Array<Array<uint8>>);
14
+ }
@@ -0,0 +1,20 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * EulerV2ReorderCollateralsAction - Reorder account collaterals. Can be used to optimize gas costs when checking account health status
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export class EulerV2ReorderCollateralsAction extends Action {
9
+ /**
10
+ * @param account The address of the Euler account, defaults to user's wallet
11
+ * @param indexes The array of swap steps to reorder collaterals
12
+ */
13
+ constructor(account, indexes) {
14
+ super('EulerV2ReorderCollaterals', getAddr('Empty'), ['address', 'uint8[][]'], [account, indexes]);
15
+ this.mappableArgs = [
16
+ this.args[0],
17
+ this.args[1],
18
+ ];
19
+ }
20
+ }
@@ -0,0 +1,23 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * EulerV2SupplyAction - Supply assets to a Euler vault and gets eTokens vault shares
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2SupplyAction extends Action {
9
+ tokenForApproval: EthAddress;
10
+ /**
11
+ * @param vault The address of the supply vault
12
+ * @param tokenAddress Underlying token address
13
+ * @param account The address of the Euler account, defaults to user's wallet
14
+ * @param from The address from which to pull tokens to be supplied
15
+ * @param amount The amount of assets to supply
16
+ * @param enableAsColl Whether to enable supply vault as collateral
17
+ */
18
+ constructor(vault: EthAddress, tokenAddress: EthAddress, account: EthAddress, from: EthAddress, amount: uint256, enableAsColl: boolean);
19
+ getAssetsToApprove(): Promise<{
20
+ asset: string;
21
+ owner: any;
22
+ }[]>;
23
+ }
@@ -0,0 +1,42 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Action } from '../../Action';
11
+ import { getAddr } from '../../addresses';
12
+ /**
13
+ * EulerV2SupplyAction - Supply assets to a Euler vault and gets eTokens vault shares
14
+ *
15
+ * @category EulerV2
16
+ */
17
+ export class EulerV2SupplyAction extends Action {
18
+ /**
19
+ * @param vault The address of the supply vault
20
+ * @param tokenAddress Underlying token address
21
+ * @param account The address of the Euler account, defaults to user's wallet
22
+ * @param from The address from which to pull tokens to be supplied
23
+ * @param amount The amount of assets to supply
24
+ * @param enableAsColl Whether to enable supply vault as collateral
25
+ */
26
+ constructor(vault, tokenAddress, account, from, amount, enableAsColl) {
27
+ super('EulerV2Supply', getAddr('EulerV2Supply'), ['address', 'address', 'address', 'uint256', 'bool'], [vault, account, from, amount, enableAsColl]);
28
+ this.mappableArgs = [
29
+ this.args[0],
30
+ this.args[1],
31
+ this.args[2],
32
+ this.args[3],
33
+ this.args[4],
34
+ ];
35
+ this.tokenForApproval = tokenAddress;
36
+ }
37
+ getAssetsToApprove() {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return [{ asset: this.tokenForApproval, owner: this.args[2] }];
40
+ });
41
+ }
42
+ }
@@ -0,0 +1,16 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * EulerV2WithdrawAction - Withdraws assets from Euler vault
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export declare class EulerV2WithdrawAction extends Action {
9
+ /**
10
+ * @param vault The address of the Euler vault
11
+ * @param account The address of the Euler account, defaults to user's wallet
12
+ * @param receiver The address to receive the withdrawn assets
13
+ * @param amount The amount of assets to withdraw (uint256.max for max withdrawal)
14
+ */
15
+ constructor(vault: EthAddress, account: EthAddress, receiver: EthAddress, amount: uint256);
16
+ }
@@ -0,0 +1,24 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * EulerV2WithdrawAction - Withdraws assets from Euler vault
5
+ *
6
+ * @category EulerV2
7
+ */
8
+ export class EulerV2WithdrawAction extends Action {
9
+ /**
10
+ * @param vault The address of the Euler vault
11
+ * @param account The address of the Euler account, defaults to user's wallet
12
+ * @param receiver The address to receive the withdrawn assets
13
+ * @param amount The amount of assets to withdraw (uint256.max for max withdrawal)
14
+ */
15
+ constructor(vault, account, receiver, amount) {
16
+ super('EulerV2Withdraw', getAddr('EulerV2Withdraw'), ['address', 'address', 'address', 'uint256'], [vault, account, receiver, amount]);
17
+ this.mappableArgs = [
18
+ this.args[0],
19
+ this.args[1],
20
+ this.args[2],
21
+ this.args[3],
22
+ ];
23
+ }
24
+ }
@@ -0,0 +1,8 @@
1
+ export * from './EulerV2SupplyAction';
2
+ export * from './EulerV2WithdrawAction';
3
+ export * from './EulerV2BorrowAction';
4
+ export * from './EulerV2PaybackAction';
5
+ export * from './EulerV2PaybackWithSharesAction';
6
+ export * from './EulerV2PullDebtAction';
7
+ export * from './EulerV2ReorderCollateralsAction';
8
+ export * from './EulerV2CollateralSwitchAction';
@@ -0,0 +1,8 @@
1
+ export * from './EulerV2SupplyAction';
2
+ export * from './EulerV2WithdrawAction';
3
+ export * from './EulerV2BorrowAction';
4
+ export * from './EulerV2PaybackAction';
5
+ export * from './EulerV2PaybackWithSharesAction';
6
+ export * from './EulerV2PullDebtAction';
7
+ export * from './EulerV2ReorderCollateralsAction';
8
+ export * from './EulerV2CollateralSwitchAction';
@@ -29,6 +29,7 @@ import * as spark from './spark';
29
29
  import * as morphoblue from './morpho-blue';
30
30
  import * as llamalend from './llamalend';
31
31
  import * as merkl from './merkl';
32
+ import * as eulerV2 from './eulerV2';
32
33
  import * as sky from './sky';
33
34
  import * as liquityV2 from './liquityV2';
34
- 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, lsv, spark, curveusd, morphoblue, llamalend, merkl, sky, liquityV2, };
35
+ 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, lsv, spark, curveusd, morphoblue, llamalend, merkl, eulerV2, sky, liquityV2, };
@@ -29,6 +29,7 @@ import * as spark from './spark';
29
29
  import * as morphoblue from './morpho-blue';
30
30
  import * as llamalend from './llamalend';
31
31
  import * as merkl from './merkl';
32
+ import * as eulerV2 from './eulerV2';
32
33
  import * as sky from './sky';
33
34
  import * as liquityV2 from './liquityV2';
34
- 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, lsv, spark, curveusd, morphoblue, llamalend, merkl, sky, liquityV2, };
35
+ 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, lsv, spark, curveusd, morphoblue, llamalend, merkl, eulerV2, sky, liquityV2, };
@@ -224,6 +224,12 @@ export declare const actionAddresses: {
224
224
  LlamaLendRepay: string;
225
225
  LlamaLendLevCreate: string;
226
226
  LlamaLendSelfLiquidateWithColl: string;
227
+ EulerV2Supply: string;
228
+ EulerV2Withdraw: string;
229
+ EulerV2Borrow: string;
230
+ EulerV2Payback: string;
231
+ EulerV2CollateralSwitch: string;
232
+ EulerV2View: string;
227
233
  MerklClaim: string;
228
234
  AaveV3DelegateCredit?: undefined;
229
235
  AaveV3RatioTrigger?: undefined;
@@ -458,6 +464,12 @@ export declare const actionAddresses: {
458
464
  LlamaLendRepay?: undefined;
459
465
  LlamaLendLevCreate?: undefined;
460
466
  LlamaLendSelfLiquidateWithColl?: undefined;
467
+ EulerV2Supply?: undefined;
468
+ EulerV2Withdraw?: undefined;
469
+ EulerV2Borrow?: undefined;
470
+ EulerV2Payback?: undefined;
471
+ EulerV2CollateralSwitch?: undefined;
472
+ EulerV2View?: undefined;
461
473
  MerklClaim?: undefined;
462
474
  MorphoBlueView?: undefined;
463
475
  } | {
@@ -686,6 +698,12 @@ export declare const actionAddresses: {
686
698
  MorphoBluePayback?: undefined;
687
699
  MorphoBlueSetAuth?: undefined;
688
700
  MorphoBlueSetAuthWithSig?: undefined;
701
+ EulerV2Supply?: undefined;
702
+ EulerV2Withdraw?: undefined;
703
+ EulerV2Borrow?: undefined;
704
+ EulerV2Payback?: undefined;
705
+ EulerV2CollateralSwitch?: undefined;
706
+ EulerV2View?: undefined;
689
707
  MerklClaim?: undefined;
690
708
  AaveV3DelegateCredit?: undefined;
691
709
  AaveV3RatioTrigger?: undefined;
@@ -915,6 +933,12 @@ export declare const actionAddresses: {
915
933
  LlamaLendRepay?: undefined;
916
934
  LlamaLendLevCreate?: undefined;
917
935
  LlamaLendSelfLiquidateWithColl?: undefined;
936
+ EulerV2Supply?: undefined;
937
+ EulerV2Withdraw?: undefined;
938
+ EulerV2Borrow?: undefined;
939
+ EulerV2Payback?: undefined;
940
+ EulerV2CollateralSwitch?: undefined;
941
+ EulerV2View?: undefined;
918
942
  MerklClaim?: undefined;
919
943
  AaveV3DelegateCredit?: undefined;
920
944
  AaveV3RatioTrigger?: undefined;