@defisaver/sdk 1.0.65 → 1.0.66-dev-1

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 (63) hide show
  1. package/esm/src/actions/basic/ExecuteSafeTxAction.d.ts +23 -0
  2. package/esm/src/actions/basic/ExecuteSafeTxAction.js +60 -0
  3. package/esm/src/actions/basic/LimitSellAction.d.ts +24 -0
  4. package/esm/src/actions/basic/LimitSellAction.js +63 -0
  5. package/esm/src/actions/basic/RemoveTokenApprovalAction.d.ts +15 -0
  6. package/esm/src/actions/{llamalend/LlamaLendSelfLiquidateAction.js → basic/RemoveTokenApprovalAction.js} +19 -15
  7. package/esm/src/actions/basic/index.d.ts +3 -0
  8. package/esm/src/actions/basic/index.js +3 -0
  9. package/esm/src/actions/checkers/index.d.ts +0 -1
  10. package/esm/src/actions/checkers/index.js +0 -1
  11. package/esm/src/actions/index.d.ts +1 -2
  12. package/esm/src/actions/index.js +1 -2
  13. package/esm/src/actions/maker/MakerGiveAction.d.ts +1 -2
  14. package/esm/src/actions/maker/MakerGiveAction.js +2 -3
  15. package/esm/src/addresses.d.ts +3 -27
  16. package/esm/src/addresses.js +3 -13
  17. package/esm/src/index.d.ts +12 -108
  18. package/esm/src/triggers/OffchainPriceTrigger.d.ts +10 -0
  19. package/esm/src/triggers/OffchainPriceTrigger.js +12 -0
  20. package/esm/src/triggers/index.d.ts +1 -1
  21. package/esm/src/triggers/index.js +1 -1
  22. package/esm/src/utils/index.d.ts +1 -2
  23. package/esm/src/utils/index.js +1 -2
  24. package/package.json +1 -1
  25. package/src/actions/basic/ExecuteSafeTxAction.ts +85 -0
  26. package/src/actions/basic/LimitSellAction.ts +63 -0
  27. package/src/actions/basic/RemoveTokenApprovalAction.ts +39 -0
  28. package/src/actions/basic/WrapEthAction.ts +4 -3
  29. package/src/actions/basic/index.ts +3 -0
  30. package/src/actions/index.ts +0 -2
  31. package/src/actions/maker/MakerGiveAction.ts +2 -3
  32. package/src/addresses.ts +3 -11
  33. package/src/triggers/OffchainPriceTrigger.ts +14 -0
  34. package/src/triggers/index.ts +2 -0
  35. package/src/utils/index.ts +0 -2
  36. package/umd/index.js +631 -821
  37. package/esm/src/actions/checkers/MorphoBlueRatioCheckAction.d.ts +0 -20
  38. package/esm/src/actions/checkers/MorphoBlueRatioCheckAction.js +0 -32
  39. package/esm/src/actions/llamalend/LlamaLendBorrowAction.d.ts +0 -15
  40. package/esm/src/actions/llamalend/LlamaLendBorrowAction.js +0 -22
  41. package/esm/src/actions/llamalend/LlamaLendCreateAction.d.ts +0 -22
  42. package/esm/src/actions/llamalend/LlamaLendCreateAction.js +0 -44
  43. package/esm/src/actions/llamalend/LlamaLendPaybackAction.d.ts +0 -22
  44. package/esm/src/actions/llamalend/LlamaLendPaybackAction.js +0 -43
  45. package/esm/src/actions/llamalend/LlamaLendSelfLiquidateAction.d.ts +0 -19
  46. package/esm/src/actions/llamalend/LlamaLendSupplyAction.d.ts +0 -20
  47. package/esm/src/actions/llamalend/LlamaLendSupplyAction.js +0 -40
  48. package/esm/src/actions/llamalend/LlamaLendWithdrawAction.d.ts +0 -15
  49. package/esm/src/actions/llamalend/LlamaLendWithdrawAction.js +0 -22
  50. package/esm/src/actions/llamalend/index.d.ts +0 -6
  51. package/esm/src/actions/llamalend/index.js +0 -6
  52. package/esm/src/triggers/MorphoBlueRatioTrigger.d.ts +0 -10
  53. package/esm/src/triggers/MorphoBlueRatioTrigger.js +0 -12
  54. package/esm/src/utils/llamalend-utils.d.ts +0 -10
  55. package/esm/src/utils/llamalend-utils.js +0 -10
  56. package/src/actions/llamalend/LlamaLendBorrowAction.ts +0 -34
  57. package/src/actions/llamalend/LlamaLendCreateAction.ts +0 -49
  58. package/src/actions/llamalend/LlamaLendPaybackAction.ts +0 -48
  59. package/src/actions/llamalend/LlamaLendSelfLiquidateAction.ts +0 -41
  60. package/src/actions/llamalend/LlamaLendSupplyAction.ts +0 -44
  61. package/src/actions/llamalend/LlamaLendWithdrawAction.ts +0 -34
  62. package/src/actions/llamalend/index.ts +0 -6
  63. package/src/utils/llamalend-utils.ts +0 -11
@@ -1,20 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { uint8, uint256, EthAddress } from '../../types';
3
- /**
4
- * MorphoBlueRatioCheckAction - Checks MorphoBlue ratio for user position and reverts if faulty
5
- *
6
- * @category Checkers
7
- */
8
- export declare class MorphoBlueRatioCheckAction extends Action {
9
- /**
10
- * @param loanToken - MarketParams loanToken
11
- * @param collateralToken - MarketParams collateralToken
12
- * @param oracle - MarketParams oracle
13
- * @param irm - MarketParams irm
14
- * @param lltv - MarketParams lltv
15
- * @param user Address of the user we are checking the ratio for
16
- * @param ratioState If it should lower/higher
17
- * @param targetRatio The ratio user want to be at
18
- */
19
- constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, user: EthAddress, ratioState: uint8, targetRatio: uint256);
20
- }
@@ -1,32 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- /**
4
- * MorphoBlueRatioCheckAction - Checks MorphoBlue ratio for user position and reverts if faulty
5
- *
6
- * @category Checkers
7
- */
8
- export class MorphoBlueRatioCheckAction extends Action {
9
- /**
10
- * @param loanToken - MarketParams loanToken
11
- * @param collateralToken - MarketParams collateralToken
12
- * @param oracle - MarketParams oracle
13
- * @param irm - MarketParams irm
14
- * @param lltv - MarketParams lltv
15
- * @param user Address of the user we are checking the ratio for
16
- * @param ratioState If it should lower/higher
17
- * @param targetRatio The ratio user want to be at
18
- */
19
- constructor(loanToken, collateralToken, oracle, irm, lltv, user, ratioState, targetRatio) {
20
- super('MorphoBlueRatioCheck', getAddr('MorphoBlueRatioCheck'), [['address', 'address', 'address', 'address', 'uint256'], 'address', 'uint8', 'uint256'], [[loanToken, collateralToken, oracle, irm, lltv], user, ratioState, targetRatio]);
21
- this.mappableArgs = [
22
- this.args[0][0],
23
- this.args[0][1],
24
- this.args[0][2],
25
- this.args[0][3],
26
- this.args[0][4],
27
- this.args[1],
28
- this.args[2],
29
- this.args[3],
30
- ];
31
- }
32
- }
@@ -1,15 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, uint256 } from '../../types';
3
- /**
4
- * LlamaLendBorrowAction - Action that borrows debt asset from proxy llamalend position
5
- *
6
- * @category LlamaLend
7
- */
8
- export declare class LlamaLendBorrowAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address to - Address that will receive the borrowed debt asset, will default to proxy
12
- * uint256 debtAmount - Amount of debt asset to borrow
13
- */
14
- constructor(controllerAddress: EthAddress, to: EthAddress, debtAmount: uint256);
15
- }
@@ -1,22 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- /**
4
- * LlamaLendBorrowAction - Action that borrows debt asset from proxy llamalend position
5
- *
6
- * @category LlamaLend
7
- */
8
- export class LlamaLendBorrowAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address to - Address that will receive the borrowed debt asset, will default to proxy
12
- * uint256 debtAmount - Amount of debt asset to borrow
13
- */
14
- /// @dev debtAmount must be non-zero
15
- /// @dev if debtAmount == uintMax will borrow as much as the collateral will support
16
- constructor(controllerAddress, to, debtAmount) {
17
- super('LlamaLendBorrow', getAddr('LlamaLendBorrow'), ['address', 'address', 'uint256'], [controllerAddress, to, debtAmount]);
18
- this.mappableArgs = [
19
- ...this.args,
20
- ];
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, uint256 } from '../../types';
3
- /**
4
- * LlamaLendCreateAction - Action that creates a llamalend position on behalf of proxy
5
- *
6
- * @category LlamaLend
7
- */
8
- export declare class LlamaLendCreateAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address from - Address from which to pull collateral asset, will default to proxy
12
- * address to - Address that will receive the borrowed debt asset, will default to proxy
13
- * uint256 collateralAmount - Amount of collateral asset to supply
14
- * uint256 debtAmount - Amount of debt asset to borrow
15
- * uint256 nBands - Number of bands in which the collateral will be supplied
16
- */
17
- constructor(controllerAddress: EthAddress, from: EthAddress, to: EthAddress, collateralAmount: uint256, debtAmount: uint256, nBands: uint256);
18
- getAssetsToApprove(): Promise<{
19
- owner: any;
20
- asset: string;
21
- }[]>;
22
- }
@@ -1,44 +0,0 @@
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 { requireAddress } from '../../utils/general';
12
- import { getAddr } from '../../addresses';
13
- import { controllerToCollateralAssetMap } from '../../utils/llamalend-utils';
14
- /**
15
- * LlamaLendCreateAction - Action that creates a llamalend position on behalf of proxy
16
- *
17
- * @category LlamaLend
18
- */
19
- export class LlamaLendCreateAction extends Action {
20
- /**
21
- * address controllerAddress - Address of the llamalend market controller
22
- * address from - Address from which to pull collateral asset, will default to proxy
23
- * address to - Address that will receive the borrowed debt asset, will default to proxy
24
- * uint256 collateralAmount - Amount of collateral asset to supply
25
- * uint256 debtAmount - Amount of debt asset to borrow
26
- * uint256 nBands - Number of bands in which the collateral will be supplied
27
- */
28
- /// @dev both collateralAmount and debtAmount must be non-zero and can be maxUint
29
- constructor(controllerAddress, from, to, collateralAmount, debtAmount, nBands) {
30
- requireAddress(to);
31
- super('LlamaLendCreate', getAddr('LlamaLendCreate'), ['address', 'address', 'address', 'uint256', 'uint256', 'uint256'], [controllerAddress, from, to, collateralAmount, debtAmount, nBands]);
32
- this.mappableArgs = [
33
- ...this.args,
34
- ];
35
- }
36
- getAssetsToApprove() {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- return [{
39
- owner: this.args[1],
40
- asset: controllerToCollateralAssetMap[this.args[0]],
41
- }];
42
- });
43
- }
44
- }
@@ -1,22 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, uint256, int256 } from '../../types';
3
- /**
4
- * LlamaLendPaybackAction - Action that pays back debt asset to a llamalend position
5
- *
6
- * @category LlamaLend
7
- */
8
- export declare class LlamaLendPaybackAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address from - Address from which to pull debt asset, will default to proxy
12
- * address onBehalfOf - Address for which we are paying back debt, will default to proxy
13
- * address to - Address that will receive the debt asset and collateral asset if close, will default to proxy
14
- * uint256 debtAmount - Amount of debt asset to payback
15
- * int256 maxActiveBand - Don't allow active band to be higher than this (to prevent front-running the repay)
16
- */
17
- constructor(controllerAddress: EthAddress, from: EthAddress, onBehalfOf: EthAddress, to: EthAddress, debtAmount: uint256, maxActiveBand: int256);
18
- getAssetsToApprove(): Promise<{
19
- owner: any;
20
- asset: string;
21
- }[]>;
22
- }
@@ -1,43 +0,0 @@
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
- import { controllerToDebtAssetMap } from '../../utils/llamalend-utils';
13
- /**
14
- * LlamaLendPaybackAction - Action that pays back debt asset to a llamalend position
15
- *
16
- * @category LlamaLend
17
- */
18
- export class LlamaLendPaybackAction extends Action {
19
- /**
20
- * address controllerAddress - Address of the llamalend market controller
21
- * address from - Address from which to pull debt asset, will default to proxy
22
- * address onBehalfOf - Address for which we are paying back debt, will default to proxy
23
- * address to - Address that will receive the debt asset and collateral asset if close, will default to proxy
24
- * uint256 debtAmount - Amount of debt asset to payback
25
- * int256 maxActiveBand - Don't allow active band to be higher than this (to prevent front-running the repay)
26
- */
27
- /// @dev debtAmount must be non-zero
28
- /// @dev if debtAmount >= debt will repay whole debt and close the position, transfering collateral
29
- constructor(controllerAddress, from, onBehalfOf, to, debtAmount, maxActiveBand) {
30
- super('LlamaLendPayback', getAddr('LlamaLendPayback'), ['address', 'address', 'address', 'address', 'uint256', 'int256'], [controllerAddress, from, onBehalfOf, to, debtAmount, maxActiveBand]);
31
- this.mappableArgs = [
32
- ...this.args,
33
- ];
34
- }
35
- getAssetsToApprove() {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- return [{
38
- owner: this.args[1],
39
- asset: controllerToDebtAssetMap[this.args[0]],
40
- }];
41
- });
42
- }
43
- }
@@ -1,19 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, uint256 } from '../../types';
3
- /**
4
- *
5
- * @category LlamaLend
6
- */
7
- export declare class LlamaLendSelfLiquidateAction extends Action {
8
- /**
9
- @param controllerAddress Address of the llamalend market controller
10
- @param minDebtAssetExpected Minimum amount of debt asset as collateral for the user to have
11
- @param from Address from which to pull debt asset if needed
12
- @param to Address that will receive the debt asset and collateral asset
13
- */
14
- constructor(controllerAddress: EthAddress, minDebtAssetExpected: uint256, from: EthAddress, to: EthAddress);
15
- getAssetsToApprove(): Promise<{
16
- owner: any;
17
- asset: string;
18
- }[]>;
19
- }
@@ -1,20 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, uint256 } from '../../types';
3
- /**
4
- * LlamaLendSupplyAction - Action that supplies collateral to a llamalend position
5
- *
6
- * @category LlamaLend
7
- */
8
- export declare class LlamaLendSupplyAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address from - Address from which to pull collateral asset, will default to proxy
12
- * address onBehalfOf - Address for which we are supplying, will default to proxy
13
- * uint256 collateralAmount - Amount of collateral asset to supply
14
- */
15
- constructor(controllerAddress: EthAddress, from: EthAddress, onBehalfOf: EthAddress, collateralAmount: uint256);
16
- getAssetsToApprove(): Promise<{
17
- owner: any;
18
- asset: string;
19
- }[]>;
20
- }
@@ -1,40 +0,0 @@
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
- import { controllerToCollateralAssetMap } from '../../utils/llamalend-utils';
13
- /**
14
- * LlamaLendSupplyAction - Action that supplies collateral to a llamalend position
15
- *
16
- * @category LlamaLend
17
- */
18
- export class LlamaLendSupplyAction extends Action {
19
- /**
20
- * address controllerAddress - Address of the llamalend market controller
21
- * address from - Address from which to pull collateral asset, will default to proxy
22
- * address onBehalfOf - Address for which we are supplying, will default to proxy
23
- * uint256 collateralAmount - Amount of collateral asset to supply
24
- */
25
- /// @dev collateralAmount must be non-zero, can be maxUint
26
- constructor(controllerAddress, from, onBehalfOf, collateralAmount) {
27
- super('LlamaLendSupply', getAddr('LlamaLendSupply'), ['address', 'address', 'address', 'uint256'], [controllerAddress, from, onBehalfOf, collateralAmount]);
28
- this.mappableArgs = [
29
- ...this.args,
30
- ];
31
- }
32
- getAssetsToApprove() {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- return [{
35
- owner: this.args[1],
36
- asset: controllerToCollateralAssetMap[this.args[0]],
37
- }];
38
- });
39
- }
40
- }
@@ -1,15 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, uint256 } from '../../types';
3
- /**
4
- * LlamaLendWithdrawAction - Action that withdraws collateral from proxy llamalend position
5
- *
6
- * @category LlamaLend
7
- */
8
- export declare class LlamaLendWithdrawAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address to - Address that will receive the withdrawn collateral, will default to proxy
12
- * uint256 collateralAmount - Amount of collateral to withdraw
13
- */
14
- constructor(controllerAddress: EthAddress, to: EthAddress, collateralAmount: uint256);
15
- }
@@ -1,22 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- /**
4
- * LlamaLendWithdrawAction - Action that withdraws collateral from proxy llamalend position
5
- *
6
- * @category LlamaLend
7
- */
8
- export class LlamaLendWithdrawAction extends Action {
9
- /**
10
- * address controllerAddress - Address of the llamalend market controller
11
- * address to - Address that will receive the withdrawn collateral, will default to proxy
12
- * uint256 collateralAmount - Amount of collateral to withdraw
13
- */
14
- /// @dev collateralAmount must be non-zero
15
- /// @dev if collateralAmount == uintMax will withdraw as much as the debt will allow
16
- constructor(controllerAddress, to, collateralAmount) {
17
- super('LlamaLendWithdraw', getAddr('LlamaLendWithdraw'), ['address', 'address', 'uint256'], [controllerAddress, to, collateralAmount]);
18
- this.mappableArgs = [
19
- ...this.args,
20
- ];
21
- }
22
- }
@@ -1,6 +0,0 @@
1
- export * from './LlamaLendBorrowAction';
2
- export * from './LlamaLendWithdrawAction';
3
- export * from './LlamaLendSupplyAction';
4
- export * from './LlamaLendCreateAction';
5
- export * from './LlamaLendPaybackAction';
6
- export * from './LlamaLendSelfLiquidateAction';
@@ -1,6 +0,0 @@
1
- export * from './LlamaLendBorrowAction';
2
- export * from './LlamaLendWithdrawAction';
3
- export * from './LlamaLendSupplyAction';
4
- export * from './LlamaLendCreateAction';
5
- export * from './LlamaLendPaybackAction';
6
- export * from './LlamaLendSelfLiquidateAction';
@@ -1,10 +0,0 @@
1
- import { Action } from '../Action';
2
- import { EthAddress, bytes32, uint256, uint8 } from '../types';
3
- /**
4
- *
5
- *
6
- * @category Triggers
7
- */
8
- export declare class MorphoBlueRatioTrigger extends Action {
9
- constructor(marketId: bytes32, user: EthAddress, ratio: uint256, state: uint8);
10
- }
@@ -1,12 +0,0 @@
1
- import { Action } from '../Action';
2
- import { getAddr } from '../addresses';
3
- /**
4
- *
5
- *
6
- * @category Triggers
7
- */
8
- export class MorphoBlueRatioTrigger extends Action {
9
- constructor(marketId, user, ratio, state) {
10
- super('MorphoBlueRatioTrigger', getAddr('MorphoBlueRatioTrigger'), [['bytes32', 'address', 'uint256', 'uint8']], [[marketId, user, ratio, state]]);
11
- }
12
- }
@@ -1,10 +0,0 @@
1
- export declare const controllerToCollateralAssetMap: {
2
- '0x5E657c5227A596a860621C5551c9735d8f4A8BE3': string;
3
- '0x7443944962D04720f8c220C0D25f56F869d6EfD4': string;
4
- '0x43fc0f246F952ff12B757341A91cF4040711dDE9': string;
5
- };
6
- export declare const controllerToDebtAssetMap: {
7
- '0x5E657c5227A596a860621C5551c9735d8f4A8BE3': string;
8
- '0x7443944962D04720f8c220C0D25f56F869d6EfD4': string;
9
- '0x43fc0f246F952ff12B757341A91cF4040711dDE9': string;
10
- };
@@ -1,10 +0,0 @@
1
- export const controllerToCollateralAssetMap = {
2
- '0x5E657c5227A596a860621C5551c9735d8f4A8BE3': '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
3
- '0x7443944962D04720f8c220C0D25f56F869d6EfD4': '0xD533a949740bb3306d119CC777fa900bA034cd52',
4
- '0x43fc0f246F952ff12B757341A91cF4040711dDE9': '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
5
- };
6
- export const controllerToDebtAssetMap = {
7
- '0x5E657c5227A596a860621C5551c9735d8f4A8BE3': '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
8
- '0x7443944962D04720f8c220C0D25f56F869d6EfD4': '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
9
- '0x43fc0f246F952ff12B757341A91cF4040711dDE9': '0xD533a949740bb3306d119CC777fa900bA034cd52',
10
- };
@@ -1,34 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, uint256 } from '../../types';
4
-
5
- /**
6
- * LlamaLendBorrowAction - Action that borrows debt asset from proxy llamalend position
7
- *
8
- * @category LlamaLend
9
- */
10
- export class LlamaLendBorrowAction extends Action {
11
- /**
12
- * address controllerAddress - Address of the llamalend market controller
13
- * address to - Address that will receive the borrowed debt asset, will default to proxy
14
- * uint256 debtAmount - Amount of debt asset to borrow
15
- */
16
- /// @dev debtAmount must be non-zero
17
- /// @dev if debtAmount == uintMax will borrow as much as the collateral will support
18
- constructor(
19
- controllerAddress: EthAddress,
20
- to: EthAddress,
21
- debtAmount: uint256,
22
- ) {
23
- super(
24
- 'LlamaLendBorrow',
25
- getAddr('LlamaLendBorrow'),
26
- ['address', 'address', 'uint256'],
27
- [controllerAddress, to, debtAmount],
28
- );
29
-
30
- this.mappableArgs = [
31
- ...this.args,
32
- ];
33
- }
34
- }
@@ -1,49 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { requireAddress } from '../../utils/general';
3
- import { getAddr } from '../../addresses';
4
- import { EthAddress, uint256 } from '../../types';
5
- import { controllerToCollateralAssetMap } from '../../utils/llamalend-utils';
6
-
7
- /**
8
- * LlamaLendCreateAction - Action that creates a llamalend position on behalf of proxy
9
- *
10
- * @category LlamaLend
11
- */
12
- export class LlamaLendCreateAction extends Action {
13
- /**
14
- * address controllerAddress - Address of the llamalend market controller
15
- * address from - Address from which to pull collateral asset, will default to proxy
16
- * address to - Address that will receive the borrowed debt asset, will default to proxy
17
- * uint256 collateralAmount - Amount of collateral asset to supply
18
- * uint256 debtAmount - Amount of debt asset to borrow
19
- * uint256 nBands - Number of bands in which the collateral will be supplied
20
- */
21
- /// @dev both collateralAmount and debtAmount must be non-zero and can be maxUint
22
- constructor(
23
- controllerAddress: EthAddress,
24
- from: EthAddress,
25
- to: EthAddress,
26
- collateralAmount: uint256,
27
- debtAmount: uint256,
28
- nBands: uint256,
29
- ) {
30
- requireAddress(to);
31
- super(
32
- 'LlamaLendCreate',
33
- getAddr('LlamaLendCreate'),
34
- ['address', 'address', 'address', 'uint256', 'uint256', 'uint256'],
35
- [controllerAddress, from, to, collateralAmount, debtAmount, nBands],
36
- );
37
-
38
- this.mappableArgs = [
39
- ...this.args,
40
- ];
41
- }
42
-
43
- async getAssetsToApprove() {
44
- return [{
45
- owner: this.args[1],
46
- asset: controllerToCollateralAssetMap[this.args[0] as keyof typeof controllerToCollateralAssetMap],
47
- }];
48
- }
49
- }
@@ -1,48 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, uint256, int256 } from '../../types';
4
- import { controllerToDebtAssetMap } from '../../utils/llamalend-utils';
5
-
6
- /**
7
- * LlamaLendPaybackAction - Action that pays back debt asset to a llamalend position
8
- *
9
- * @category LlamaLend
10
- */
11
- export class LlamaLendPaybackAction extends Action {
12
- /**
13
- * address controllerAddress - Address of the llamalend market controller
14
- * address from - Address from which to pull debt asset, will default to proxy
15
- * address onBehalfOf - Address for which we are paying back debt, will default to proxy
16
- * address to - Address that will receive the debt asset and collateral asset if close, will default to proxy
17
- * uint256 debtAmount - Amount of debt asset to payback
18
- * int256 maxActiveBand - Don't allow active band to be higher than this (to prevent front-running the repay)
19
- */
20
- /// @dev debtAmount must be non-zero
21
- /// @dev if debtAmount >= debt will repay whole debt and close the position, transfering collateral
22
- constructor(
23
- controllerAddress: EthAddress,
24
- from: EthAddress,
25
- onBehalfOf: EthAddress,
26
- to: EthAddress,
27
- debtAmount: uint256,
28
- maxActiveBand: int256,
29
- ) {
30
- super(
31
- 'LlamaLendPayback',
32
- getAddr('LlamaLendPayback'),
33
- ['address', 'address', 'address', 'address', 'uint256', 'int256'],
34
- [controllerAddress, from, onBehalfOf, to, debtAmount, maxActiveBand],
35
- );
36
-
37
- this.mappableArgs = [
38
- ...this.args,
39
- ];
40
- }
41
-
42
- async getAssetsToApprove() {
43
- return [{
44
- owner: this.args[1],
45
- asset: controllerToDebtAssetMap[this.args[0] as keyof typeof controllerToDebtAssetMap],
46
- }];
47
- }
48
- }
@@ -1,41 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, uint256 } from '../../types';
4
- import { controllerToDebtAssetMap } from '../../utils/llamalend-utils';
5
-
6
- /**
7
- *
8
- * @category LlamaLend
9
- */
10
- export class LlamaLendSelfLiquidateAction extends Action {
11
- /**
12
- @param controllerAddress Address of the llamalend market controller
13
- @param minDebtAssetExpected Minimum amount of debt asset as collateral for the user to have
14
- @param from Address from which to pull debt asset if needed
15
- @param to Address that will receive the debt asset and collateral asset
16
- */
17
- constructor(
18
- controllerAddress: EthAddress,
19
- minDebtAssetExpected: uint256,
20
- from: EthAddress,
21
- to: EthAddress,
22
- ) {
23
- super(
24
- 'LlamaLendSelfLiquidate',
25
- getAddr('LlamaLendSelfLiquidate'),
26
- ['address', 'uint256', 'address', 'address'],
27
- [controllerAddress, minDebtAssetExpected, from, to],
28
- );
29
-
30
- this.mappableArgs = [
31
- ...this.args,
32
- ];
33
- }
34
-
35
- async getAssetsToApprove() {
36
- return [{
37
- owner: this.args[2],
38
- asset: controllerToDebtAssetMap[this.args[0] as keyof typeof controllerToDebtAssetMap],
39
- }];
40
- }
41
- }
@@ -1,44 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, uint256 } from '../../types';
4
- import { controllerToCollateralAssetMap } from '../../utils/llamalend-utils';
5
-
6
-
7
- /**
8
- * LlamaLendSupplyAction - Action that supplies collateral to a llamalend position
9
- *
10
- * @category LlamaLend
11
- */
12
- export class LlamaLendSupplyAction extends Action {
13
- /**
14
- * address controllerAddress - Address of the llamalend market controller
15
- * address from - Address from which to pull collateral asset, will default to proxy
16
- * address onBehalfOf - Address for which we are supplying, will default to proxy
17
- * uint256 collateralAmount - Amount of collateral asset to supply
18
- */
19
- /// @dev collateralAmount must be non-zero, can be maxUint
20
- constructor(
21
- controllerAddress: EthAddress,
22
- from: EthAddress,
23
- onBehalfOf: EthAddress,
24
- collateralAmount: uint256,
25
- ) {
26
- super(
27
- 'LlamaLendSupply',
28
- getAddr('LlamaLendSupply'),
29
- ['address', 'address', 'address', 'uint256'],
30
- [controllerAddress, from, onBehalfOf, collateralAmount],
31
- );
32
-
33
- this.mappableArgs = [
34
- ...this.args,
35
- ];
36
- }
37
-
38
- async getAssetsToApprove() {
39
- return [{
40
- owner: this.args[1],
41
- asset: controllerToCollateralAssetMap[this.args[0] as keyof typeof controllerToCollateralAssetMap],
42
- }];
43
- }
44
- }