@defisaver/sdk 1.0.62 → 1.0.64
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.
- package/esm/src/Action.d.ts +2 -2
- package/esm/src/actions/checkers/MorphoBlueRatioCheckAction.d.ts +20 -0
- package/esm/src/actions/checkers/MorphoBlueRatioCheckAction.js +32 -0
- package/esm/src/actions/checkers/index.d.ts +1 -0
- package/esm/src/actions/checkers/index.js +1 -0
- package/esm/src/actions/flashloan/FLAction.js +3 -0
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanAction.d.ts +16 -0
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanAction.js +18 -0
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanPaybackAction.d.ts +14 -0
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanPaybackAction.js +16 -0
- package/esm/src/actions/flashloan/index.d.ts +2 -0
- package/esm/src/actions/flashloan/index.js +2 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/morpho-blue/MorphoBlueBorrowAction.d.ts +21 -0
- package/esm/src/actions/morpho-blue/MorphoBlueBorrowAction.js +46 -0
- package/esm/src/actions/morpho-blue/MorphoBluePaybackAction.d.ts +24 -0
- package/esm/src/actions/morpho-blue/MorphoBluePaybackAction.js +46 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSetAuthAction.d.ts +12 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSetAuthAction.js +18 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSetAuthWithSigAction.d.ts +12 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSetAuthWithSigAction.js +21 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSupplyAction.d.ts +24 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSupplyAction.js +46 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSupplyCollateralAction.d.ts +24 -0
- package/esm/src/actions/morpho-blue/MorphoBlueSupplyCollateralAction.js +46 -0
- package/esm/src/actions/morpho-blue/MorphoBlueWithdrawAction.d.ts +21 -0
- package/esm/src/actions/morpho-blue/MorphoBlueWithdrawAction.js +46 -0
- package/esm/src/actions/morpho-blue/MorphoBlueWithdrawCollateralAction.d.ts +21 -0
- package/esm/src/actions/morpho-blue/MorphoBlueWithdrawCollateralAction.js +46 -0
- package/esm/src/actions/morpho-blue/index.d.ts +8 -0
- package/esm/src/actions/morpho-blue/index.js +8 -0
- package/esm/src/addresses.d.ts +39 -3
- package/esm/src/addresses.js +12 -0
- package/esm/src/index.d.ts +156 -12
- package/esm/src/triggers/MorphoBlueRatioTrigger.d.ts +10 -0
- package/esm/src/triggers/MorphoBlueRatioTrigger.js +12 -0
- package/esm/src/triggers/index.d.ts +1 -0
- package/esm/src/triggers/index.js +1 -0
- package/esm/src/types.d.ts +20 -20
- package/package.json +1 -1
- package/src/actions/checkers/MorphoBlueRatioCheckAction.ts +47 -0
- package/src/actions/checkers/index.ts +1 -0
- package/src/actions/flashloan/FLAction.ts +3 -0
- package/src/actions/flashloan/MorphoBlueFlashLoanAction.ts +25 -0
- package/src/actions/flashloan/MorphoBlueFlashLoanPaybackAction.ts +18 -0
- package/src/actions/flashloan/index.ts +3 -1
- package/src/actions/index.ts +2 -0
- package/src/actions/morpho-blue/MorphoBlueBorrowAction.ts +54 -0
- package/src/actions/morpho-blue/MorphoBluePaybackAction.ts +54 -0
- package/src/actions/morpho-blue/MorphoBlueSetAuthAction.ts +25 -0
- package/src/actions/morpho-blue/MorphoBlueSetAuthWithSigAction.ts +39 -0
- package/src/actions/morpho-blue/MorphoBlueSupplyAction.ts +54 -0
- package/src/actions/morpho-blue/MorphoBlueSupplyCollateralAction.ts +54 -0
- package/src/actions/morpho-blue/MorphoBlueWithdrawAction.ts +54 -0
- package/src/actions/morpho-blue/MorphoBlueWithdrawCollateralAction.ts +54 -0
- package/src/actions/morpho-blue/index.ts +8 -0
- package/src/addresses.ts +13 -0
- package/src/triggers/MorphoBlueRatioTrigger.ts +25 -0
- package/src/triggers/index.ts +1 -0
- package/umd/index.js +1528 -1028
- package/yarn-error.log +0 -3976
package/esm/src/Action.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AccessListItem, EthAddress } from './types';
|
|
2
|
-
type ParamTypes = Array<string | Array<any>>;
|
|
3
|
-
type Args = Array<any>;
|
|
2
|
+
declare type ParamTypes = Array<string | Array<any>>;
|
|
3
|
+
declare type Args = Array<any>;
|
|
4
4
|
/**
|
|
5
5
|
* Single action that can be executed directly, or combined into a set (ie. supply a vault)
|
|
6
6
|
*
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
@@ -50,5 +50,8 @@ _FLAction_instances = new WeakSet(), _FLAction_handleArgs = function _FLAction_h
|
|
|
50
50
|
if (specificFLAction.constructor.name === 'SparkFlashLoanAction') {
|
|
51
51
|
argsToReturn[5] = [7];
|
|
52
52
|
}
|
|
53
|
+
if (specificFLAction.constructor.name === 'MorphoBlueFlashLoanAction') {
|
|
54
|
+
argsToReturn[5] = [8];
|
|
55
|
+
}
|
|
53
56
|
return argsToReturn;
|
|
54
57
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Gets a flashloan from MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueFlashLoanAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param token
|
|
11
|
+
* @param amount
|
|
12
|
+
* @param flParamGetterAddr
|
|
13
|
+
* @param flParamGetterData
|
|
14
|
+
*/
|
|
15
|
+
constructor(token: EthAddress, amount: uint256, flParamGetterAddr?: EthAddress, flParamGetterData?: bytes);
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* Gets a flashloan from MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export class MorphoBlueFlashLoanAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param token
|
|
11
|
+
* @param amount
|
|
12
|
+
* @param flParamGetterAddr
|
|
13
|
+
* @param flParamGetterData
|
|
14
|
+
*/
|
|
15
|
+
constructor(token, amount, flParamGetterAddr = getAddr('Empty'), flParamGetterData = []) {
|
|
16
|
+
super('FLMorphoBlue', getAddr('FLMorphoBlue'), ['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'], [[token], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SendTokenAction } from '../basic';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Pays back a flashloan from MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueFlashLoanPaybackAction extends SendTokenAction {
|
|
9
|
+
/**
|
|
10
|
+
* @param loanAmount
|
|
11
|
+
* @param tokenAddr
|
|
12
|
+
*/
|
|
13
|
+
constructor(loanAmount: uint256, tokenAddr: EthAddress);
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SendTokenAction } from '../basic';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* Pays back a flashloan from MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export class MorphoBlueFlashLoanPaybackAction extends SendTokenAction {
|
|
9
|
+
/**
|
|
10
|
+
* @param loanAmount
|
|
11
|
+
* @param tokenAddr
|
|
12
|
+
*/
|
|
13
|
+
constructor(loanAmount, tokenAddr) {
|
|
14
|
+
super(tokenAddr, getAddr('FLMorphoBlue'), loanAmount);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -20,3 +20,5 @@ export * from './UniV3FlashLoanAction';
|
|
|
20
20
|
export * from './UniV3FlashLoanPaybackAction';
|
|
21
21
|
export * from './GhoFlashLoanAction';
|
|
22
22
|
export * from './GhoFlashLoanPaybackAction';
|
|
23
|
+
export * from './MorphoBlueFlashLoanAction';
|
|
24
|
+
export * from './MorphoBlueFlashLoanPaybackAction';
|
|
@@ -20,3 +20,5 @@ export * from './UniV3FlashLoanAction';
|
|
|
20
20
|
export * from './UniV3FlashLoanPaybackAction';
|
|
21
21
|
export * from './GhoFlashLoanAction';
|
|
22
22
|
export * from './GhoFlashLoanPaybackAction';
|
|
23
|
+
export * from './MorphoBlueFlashLoanAction';
|
|
24
|
+
export * from './MorphoBlueFlashLoanPaybackAction';
|
|
@@ -26,4 +26,5 @@ import * as bprotocol from './bprotocol';
|
|
|
26
26
|
import * as lsv from './lsv';
|
|
27
27
|
import * as curveusd from './curveusd';
|
|
28
28
|
import * as spark from './spark';
|
|
29
|
-
|
|
29
|
+
import * as morphoblue from './morpho-blue';
|
|
30
|
+
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, };
|
package/esm/src/actions/index.js
CHANGED
|
@@ -26,4 +26,5 @@ import * as bprotocol from './bprotocol';
|
|
|
26
26
|
import * as lsv from './lsv';
|
|
27
27
|
import * as curveusd from './curveusd';
|
|
28
28
|
import * as spark from './spark';
|
|
29
|
-
|
|
29
|
+
import * as morphoblue from './morpho-blue';
|
|
30
|
+
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, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoBlueBorrowAction - Borrow a token from MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category MorphoBlue
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueBorrowAction 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 borrowAmount - amount of loanToken to borrow
|
|
16
|
+
* @param onBehalf - onBehalf of whom to borrow
|
|
17
|
+
* @param to - address to receive borrowed tokens
|
|
18
|
+
*/
|
|
19
|
+
constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, borrowAmount: uint256, onBehalf: EthAddress, to: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<never[]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* MorphoBlueBorrowAction - Borrow a token from MorphoBlue
|
|
14
|
+
*
|
|
15
|
+
* @category MorphoBlue
|
|
16
|
+
*/
|
|
17
|
+
export class MorphoBlueBorrowAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param loanToken - MarketParams loanToken
|
|
20
|
+
* @param collateralToken - MarketParams collateralToken
|
|
21
|
+
* @param oracle - MarketParams oracle
|
|
22
|
+
* @param irm - MarketParams irm
|
|
23
|
+
* @param lltv - MarketParams lltv
|
|
24
|
+
* @param borrowAmount - amount of loanToken to borrow
|
|
25
|
+
* @param onBehalf - onBehalf of whom to borrow
|
|
26
|
+
* @param to - address to receive borrowed tokens
|
|
27
|
+
*/
|
|
28
|
+
constructor(loanToken, collateralToken, oracle, irm, lltv, borrowAmount, onBehalf, to) {
|
|
29
|
+
super('MorphoBlueBorrow', getAddr('MorphoBlueBorrow'), [['address', 'address', 'address', 'address', 'uint256'], 'uint256', 'address', 'address'], [[loanToken, collateralToken, oracle, irm, lltv], borrowAmount, onBehalf, to]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2],
|
|
34
|
+
this.args[0][3],
|
|
35
|
+
this.args[0][4],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
getAssetsToApprove() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoBluePaybackAction - Payback debt on MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category MorphoBlue
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBluePaybackAction 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 paybackAmount - Amount of debt to repay (uint.max for full debt repayment)
|
|
16
|
+
* @param from - Address from which to pull tokens with which to repay debt
|
|
17
|
+
* @param onBehalf - Position owner whose debt we are paying back
|
|
18
|
+
*/
|
|
19
|
+
constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, paybackAmount: uint256, from: EthAddress, onBehalf: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<{
|
|
21
|
+
asset: any;
|
|
22
|
+
owner: any;
|
|
23
|
+
}[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* MorphoBluePaybackAction - Payback debt on MorphoBlue
|
|
14
|
+
*
|
|
15
|
+
* @category MorphoBlue
|
|
16
|
+
*/
|
|
17
|
+
export class MorphoBluePaybackAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param loanToken - MarketParams loanToken
|
|
20
|
+
* @param collateralToken - MarketParams collateralToken
|
|
21
|
+
* @param oracle - MarketParams oracle
|
|
22
|
+
* @param irm - MarketParams irm
|
|
23
|
+
* @param lltv - MarketParams lltv
|
|
24
|
+
* @param paybackAmount - Amount of debt to repay (uint.max for full debt repayment)
|
|
25
|
+
* @param from - Address from which to pull tokens with which to repay debt
|
|
26
|
+
* @param onBehalf - Position owner whose debt we are paying back
|
|
27
|
+
*/
|
|
28
|
+
constructor(loanToken, collateralToken, oracle, irm, lltv, paybackAmount, from, onBehalf) {
|
|
29
|
+
super('MorphoBluePayback', getAddr('MorphoBluePayback'), [['address', 'address', 'address', 'address', 'uint256'], 'uint256', 'address', 'address'], [[loanToken, collateralToken, oracle, irm, lltv], paybackAmount, from, onBehalf]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2],
|
|
34
|
+
this.args[0][3],
|
|
35
|
+
this.args[0][4],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
getAssetsToApprove() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [{ asset: this.args[0][0], owner: this.args[2] }];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @category MorphoBlue
|
|
5
|
+
*/
|
|
6
|
+
export declare class MorphoBlueSetAuthAction extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param manager
|
|
9
|
+
* @param newIsAuthorized
|
|
10
|
+
*/
|
|
11
|
+
constructor(manager: EthAddress, newIsAuthorized: boolean);
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* @category MorphoBlue
|
|
5
|
+
*/
|
|
6
|
+
export class MorphoBlueSetAuthAction extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param manager
|
|
9
|
+
* @param newIsAuthorized
|
|
10
|
+
*/
|
|
11
|
+
constructor(manager, newIsAuthorized) {
|
|
12
|
+
super('MorphoBlueSetAuth', getAddr('MorphoBlueSetAuth'), [
|
|
13
|
+
'address',
|
|
14
|
+
'bool',
|
|
15
|
+
], [manager, newIsAuthorized]);
|
|
16
|
+
this.mappableArgs = [this.args[0], this.args[1]];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, bytes32, uint256, uint8 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @category MorphoBlue
|
|
5
|
+
*/
|
|
6
|
+
export declare class MorphoBlueSetAuthWithSigAction extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param manager
|
|
9
|
+
* @param newIsAuthorized
|
|
10
|
+
*/
|
|
11
|
+
constructor(authorizer: EthAddress, authorized: EthAddress, isAuthorized: boolean, nonce: uint256, deadline: uint256, v: uint8, r: bytes32, s: bytes32);
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* @category MorphoBlue
|
|
5
|
+
*/
|
|
6
|
+
export class MorphoBlueSetAuthWithSigAction extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param manager
|
|
9
|
+
* @param newIsAuthorized
|
|
10
|
+
*/
|
|
11
|
+
constructor(authorizer, authorized, isAuthorized, nonce, deadline, v, r, s) {
|
|
12
|
+
super('MorphoBlueSetAuthWithSig', getAddr('MorphoBlueSetAuthWithSig'), [
|
|
13
|
+
['address', 'address', 'bool', 'uint256', 'uint256'],
|
|
14
|
+
['uint8', 'bytes32', 'bytes32'],
|
|
15
|
+
], [
|
|
16
|
+
[authorizer, authorized, isAuthorized, nonce, deadline],
|
|
17
|
+
[v, r, s],
|
|
18
|
+
]);
|
|
19
|
+
this.mappableArgs = [];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoBlueSupplyAction - Supply token as a lender on MorphoBlue to earn interest
|
|
5
|
+
*
|
|
6
|
+
* @category MorphoBlue
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueSupplyAction 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 supplyAmount - Amount of loanToken to supply
|
|
16
|
+
* @param from - Address from which to pull tokens
|
|
17
|
+
* @param onBehalf - on whose behalf to supply the tokens
|
|
18
|
+
*/
|
|
19
|
+
constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, supplyAmount: uint256, from: EthAddress, onBehalf: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<{
|
|
21
|
+
asset: any;
|
|
22
|
+
owner: any;
|
|
23
|
+
}[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* MorphoBlueSupplyAction - Supply token as a lender on MorphoBlue to earn interest
|
|
14
|
+
*
|
|
15
|
+
* @category MorphoBlue
|
|
16
|
+
*/
|
|
17
|
+
export class MorphoBlueSupplyAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param loanToken - MarketParams loanToken
|
|
20
|
+
* @param collateralToken - MarketParams collateralToken
|
|
21
|
+
* @param oracle - MarketParams oracle
|
|
22
|
+
* @param irm - MarketParams irm
|
|
23
|
+
* @param lltv - MarketParams lltv
|
|
24
|
+
* @param supplyAmount - Amount of loanToken to supply
|
|
25
|
+
* @param from - Address from which to pull tokens
|
|
26
|
+
* @param onBehalf - on whose behalf to supply the tokens
|
|
27
|
+
*/
|
|
28
|
+
constructor(loanToken, collateralToken, oracle, irm, lltv, supplyAmount, from, onBehalf) {
|
|
29
|
+
super('MorphoBlueSupply', getAddr('MorphoBlueSupply'), [['address', 'address', 'address', 'address', 'uint256'], 'uint256', 'address', 'address'], [[loanToken, collateralToken, oracle, irm, lltv], supplyAmount, from, onBehalf]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2],
|
|
34
|
+
this.args[0][3],
|
|
35
|
+
this.args[0][4],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
getAssetsToApprove() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [{ asset: this.args[0][0], owner: this.args[2] }];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoBlueSupplyCollateralAction - Supply token to use as collateral on MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category MorphoBlue
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueSupplyCollateralAction 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 supplyAmount - Amount of collateral token to supply
|
|
16
|
+
* @param from - Address from which to pull tokens
|
|
17
|
+
* @param onBehalf - On whose behalf to supply tokens as collateral
|
|
18
|
+
*/
|
|
19
|
+
constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, supplyAmount: uint256, from: EthAddress, onBehalf: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<{
|
|
21
|
+
asset: any;
|
|
22
|
+
owner: any;
|
|
23
|
+
}[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* MorphoBlueSupplyCollateralAction - Supply token to use as collateral on MorphoBlue
|
|
14
|
+
*
|
|
15
|
+
* @category MorphoBlue
|
|
16
|
+
*/
|
|
17
|
+
export class MorphoBlueSupplyCollateralAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param loanToken - MarketParams loanToken
|
|
20
|
+
* @param collateralToken - MarketParams collateralToken
|
|
21
|
+
* @param oracle - MarketParams oracle
|
|
22
|
+
* @param irm - MarketParams irm
|
|
23
|
+
* @param lltv - MarketParams lltv
|
|
24
|
+
* @param supplyAmount - Amount of collateral token to supply
|
|
25
|
+
* @param from - Address from which to pull tokens
|
|
26
|
+
* @param onBehalf - On whose behalf to supply tokens as collateral
|
|
27
|
+
*/
|
|
28
|
+
constructor(loanToken, collateralToken, oracle, irm, lltv, supplyAmount, from, onBehalf) {
|
|
29
|
+
super('MorphoBlueSupplyCollateral', getAddr('MorphoBlueSupplyCollateral'), [['address', 'address', 'address', 'address', 'uint256'], 'uint256', 'address', 'address'], [[loanToken, collateralToken, oracle, irm, lltv], supplyAmount, from, onBehalf]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2],
|
|
34
|
+
this.args[0][3],
|
|
35
|
+
this.args[0][4],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
getAssetsToApprove() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [{ asset: this.args[0][1], owner: this.args[2] }];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoBlueWithdrawAction - Withdraw interest earning tokens from MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category MorphoBlue
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueWithdrawAction 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 withdrawAmount - Amount of tokens to withdraw (uint.max for full withdrawal)
|
|
16
|
+
* @param onBehalf - From whose position should we withdraw tokens
|
|
17
|
+
* @param to - address which will receive withdrawn tokens
|
|
18
|
+
*/
|
|
19
|
+
constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, withdrawAmount: uint256, onBehalf: EthAddress, to: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<never[]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* MorphoBlueWithdrawAction - Withdraw interest earning tokens from MorphoBlue
|
|
14
|
+
*
|
|
15
|
+
* @category MorphoBlue
|
|
16
|
+
*/
|
|
17
|
+
export class MorphoBlueWithdrawAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param loanToken - MarketParams loanToken
|
|
20
|
+
* @param collateralToken - MarketParams collateralToken
|
|
21
|
+
* @param oracle - MarketParams oracle
|
|
22
|
+
* @param irm - MarketParams irm
|
|
23
|
+
* @param lltv - MarketParams lltv
|
|
24
|
+
* @param withdrawAmount - Amount of tokens to withdraw (uint.max for full withdrawal)
|
|
25
|
+
* @param onBehalf - From whose position should we withdraw tokens
|
|
26
|
+
* @param to - address which will receive withdrawn tokens
|
|
27
|
+
*/
|
|
28
|
+
constructor(loanToken, collateralToken, oracle, irm, lltv, withdrawAmount, onBehalf, to) {
|
|
29
|
+
super('MorphoBlueWithdraw', getAddr('MorphoBlueWithdraw'), [['address', 'address', 'address', 'address', 'uint256'], 'uint256', 'address', 'address'], [[loanToken, collateralToken, oracle, irm, lltv], withdrawAmount, onBehalf, to]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2],
|
|
34
|
+
this.args[0][3],
|
|
35
|
+
this.args[0][4],
|
|
36
|
+
this.args[1],
|
|
37
|
+
this.args[2],
|
|
38
|
+
this.args[3],
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
getAssetsToApprove() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [];
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MorphoBlueWithdrawCollateralAction - Withdraw tokens that are used as collateral on MorphoBlue
|
|
5
|
+
*
|
|
6
|
+
* @category MorphoBlue
|
|
7
|
+
*/
|
|
8
|
+
export declare class MorphoBlueWithdrawCollateralAction 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 withdrawAmount - Amount of tokens to withdraw
|
|
16
|
+
* @param onBehalf - From whose position should we withdraw tokens
|
|
17
|
+
* @param to - address which will receive withdrawn tokens
|
|
18
|
+
*/
|
|
19
|
+
constructor(loanToken: EthAddress, collateralToken: EthAddress, oracle: EthAddress, irm: EthAddress, lltv: uint256, withdrawAmount: uint256, onBehalf: EthAddress, to: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<never[]>;
|
|
21
|
+
}
|