@defisaver/sdk 1.3.38-semi-continuous-dev → 1.3.38
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/docs/DEV.md +37 -0
- package/esm/src/actions/flashloan/AaveV2FlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/AaveV2FlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/BalancerFlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/BalancerFlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/BalancerV3FlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/BalancerV3FlashLoanAction.js +7 -20
- package/esm/src/actions/flashloan/CurveUsdFlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/CurveUsdFlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/FLAction.d.ts +7 -5
- package/esm/src/actions/flashloan/FLAction.js +12 -20
- package/esm/src/actions/flashloan/FLSource.d.ts +18 -0
- package/esm/src/actions/flashloan/FLSource.js +42 -0
- package/esm/src/actions/flashloan/FlashLoanId.d.ts +2 -1
- package/esm/src/actions/flashloan/GhoFlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/GhoFlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/MakerFlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/MakerFlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/SparkFlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/SparkFlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/UniV3FlashLoanAction.d.ts +2 -4
- package/esm/src/actions/flashloan/UniV3FlashLoanAction.js +7 -4
- package/esm/src/actions/flashloan/index.d.ts +1 -14
- package/esm/src/actions/flashloan/index.js +1 -14
- package/esm/src/addresses.d.ts +1 -67
- package/esm/src/addresses.js +105 -87
- package/esm/src/index.d.ts +4 -268
- package/package.json +1 -1
- package/src/actions/flashloan/AaveV2FlashLoanAction.ts +7 -11
- package/src/actions/flashloan/AaveV3FlashLoanAction.ts +7 -11
- package/src/actions/flashloan/BalancerFlashLoanAction.ts +7 -11
- package/src/actions/flashloan/BalancerV3FlashLoanAction.ts +7 -27
- package/src/actions/flashloan/CurveUsdFlashLoanAction.ts +7 -11
- package/src/actions/flashloan/FLAction.ts +18 -21
- package/src/actions/flashloan/FLSource.ts +44 -0
- package/src/actions/flashloan/FlashLoanId.ts +3 -1
- package/src/actions/flashloan/GhoFlashLoanAction.ts +7 -11
- package/src/actions/flashloan/MakerFlashLoanAction.ts +7 -11
- package/src/actions/flashloan/MorphoBlueFlashLoanAction.ts +7 -11
- package/src/actions/flashloan/SparkFlashLoanAction.ts +7 -11
- package/src/actions/flashloan/UniV3FlashLoanAction.ts +7 -11
- package/src/actions/flashloan/index.ts +1 -14
- package/src/addresses.ts +127 -90
- package/test/accessLists/Recipe.js +1 -1
- package/test/accessLists/access-lists.js +1 -1
- package/test/actions/flashloan/FLAction.js +77 -0
- package/umd/index.js +1090 -1435
- package/esm/src/actions/flashloan/AaveV2FlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/AaveV2FlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.d.ts +0 -18
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.js +0 -20
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeePaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeePaybackAction.js +0 -16
- package/esm/src/actions/flashloan/AaveV3FlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/AaveV3FlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/BalancerFlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/BalancerFlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/DyDxFlashLoanAction.d.ts +0 -16
- package/esm/src/actions/flashloan/DyDxFlashLoanAction.js +0 -18
- package/esm/src/actions/flashloan/DyDxFlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/DyDxFlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/EulerFlashLoanAction.d.ts +0 -16
- package/esm/src/actions/flashloan/EulerFlashLoanAction.js +0 -18
- package/esm/src/actions/flashloan/EulerFlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/EulerFlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/GhoFlashLoanPaybackAction.d.ts +0 -13
- package/esm/src/actions/flashloan/GhoFlashLoanPaybackAction.js +0 -15
- package/esm/src/actions/flashloan/MakerFlashLoanPaybackAction.d.ts +0 -13
- package/esm/src/actions/flashloan/MakerFlashLoanPaybackAction.js +0 -15
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/MorphoBlueFlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/SparkFlashLoanPaybackAction.d.ts +0 -14
- package/esm/src/actions/flashloan/SparkFlashLoanPaybackAction.js +0 -16
- package/esm/src/actions/flashloan/UniV3FlashLoanPaybackAction.d.ts +0 -16
- package/esm/src/actions/flashloan/UniV3FlashLoanPaybackAction.js +0 -18
- package/src/actions/flashloan/AaveV2FlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.ts +0 -27
- package/src/actions/flashloan/AaveV3FlashLoanNoFeePaybackAction.ts +0 -18
- package/src/actions/flashloan/AaveV3FlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/BalancerFlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/DyDxFlashLoanAction.ts +0 -24
- package/src/actions/flashloan/DyDxFlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/EulerFlashLoanAction.ts +0 -25
- package/src/actions/flashloan/EulerFlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/GhoFlashLoanPaybackAction.ts +0 -17
- package/src/actions/flashloan/MakerFlashLoanPaybackAction.ts +0 -17
- package/src/actions/flashloan/MorphoBlueFlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/SparkFlashLoanPaybackAction.ts +0 -18
- package/src/actions/flashloan/UniV3FlashLoanPaybackAction.ts +0 -20
- package/test/actions/flashloan/DyDxFlashLoanAction.js +0 -84
package/package.json
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from Aave v2
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class AaveV2FlashLoanAction extends
|
|
12
|
-
public flashLoanId = 1;
|
|
13
|
-
|
|
11
|
+
export class AaveV2FlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param loanAmounts
|
|
16
14
|
* @param tokens
|
|
@@ -20,11 +18,9 @@ export class AaveV2FlashLoanAction extends Action implements FlashLoanId {
|
|
|
20
18
|
* @param flParamGetterData
|
|
21
19
|
*/
|
|
22
20
|
constructor(tokens: Array<EthAddress>, loanAmounts: Array<uint256>, modes: Array<uint256>, loanPayer: EthAddress, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
23
|
-
super(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []],
|
|
28
|
-
);
|
|
21
|
+
super({
|
|
22
|
+
flashLoanId: FLSource.AAVEV2,
|
|
23
|
+
args: [tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []],
|
|
24
|
+
});
|
|
29
25
|
}
|
|
30
26
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from Aave v3 with fee enabled
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class AaveV3FlashLoanAction extends
|
|
12
|
-
public flashLoanId = 5;
|
|
13
|
-
|
|
11
|
+
export class AaveV3FlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param tokens
|
|
16
14
|
* @param loanAmounts
|
|
@@ -20,11 +18,9 @@ export class AaveV3FlashLoanAction extends ActionWithL2 implements FlashLoanId {
|
|
|
20
18
|
* @param flParamGetterData
|
|
21
19
|
*/
|
|
22
20
|
constructor(tokens: Array<EthAddress>, loanAmounts: Array<uint256>, modes: Array<uint256>, loanPayer: EthAddress, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
23
|
-
super(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []],
|
|
28
|
-
);
|
|
21
|
+
super({
|
|
22
|
+
flashLoanId: FLSource.AAVEV3,
|
|
23
|
+
args: [tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []],
|
|
24
|
+
});
|
|
29
25
|
}
|
|
30
26
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from Balancer
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class BalancerFlashLoanAction extends
|
|
12
|
-
public flashLoanId = 2;
|
|
13
|
-
|
|
11
|
+
export class BalancerFlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param tokens
|
|
16
14
|
* @param amounts
|
|
@@ -18,11 +16,9 @@ export class BalancerFlashLoanAction extends Action implements FlashLoanId {
|
|
|
18
16
|
* @param flParamGetterData
|
|
19
17
|
*/
|
|
20
18
|
constructor(tokens: Array<EthAddress>, amounts: Array<uint256>, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
21
|
-
super(
|
|
22
|
-
|
|
23
|
-
getAddr('
|
|
24
|
-
|
|
25
|
-
[tokens, amounts, [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
26
|
-
);
|
|
19
|
+
super({
|
|
20
|
+
flashLoanId: FLSource.BALANCER,
|
|
21
|
+
args: [tokens, amounts, [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
22
|
+
});
|
|
27
23
|
}
|
|
28
24
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from BalancerV3
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class BalancerV3FlashLoanAction extends
|
|
12
|
-
public flashLoanId = 10;
|
|
13
|
-
|
|
11
|
+
export class BalancerV3FlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param tokens
|
|
16
14
|
* @param loanAmounts
|
|
@@ -23,27 +21,9 @@ export class BalancerV3FlashLoanAction extends Action implements FlashLoanId {
|
|
|
23
21
|
flParamGetterAddr: EthAddress = getAddr('Empty'),
|
|
24
22
|
flParamGetterData: bytes = [],
|
|
25
23
|
) {
|
|
26
|
-
super(
|
|
27
|
-
|
|
28
|
-
getAddr('
|
|
29
|
-
|
|
30
|
-
'address[]',
|
|
31
|
-
'uint256[]',
|
|
32
|
-
'uint256[]',
|
|
33
|
-
'address',
|
|
34
|
-
'address',
|
|
35
|
-
'bytes',
|
|
36
|
-
'bytes',
|
|
37
|
-
],
|
|
38
|
-
[
|
|
39
|
-
tokens,
|
|
40
|
-
loanAmounts,
|
|
41
|
-
[],
|
|
42
|
-
getAddr('Empty'),
|
|
43
|
-
flParamGetterAddr,
|
|
44
|
-
flParamGetterData,
|
|
45
|
-
[],
|
|
46
|
-
],
|
|
47
|
-
);
|
|
24
|
+
super({
|
|
25
|
+
flashLoanId: FLSource.BALANCER_V3,
|
|
26
|
+
args: [tokens, loanAmounts, [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
27
|
+
});
|
|
48
28
|
}
|
|
49
29
|
}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a crvUSD flashloan from CurveUsd Flash Minter
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class CurveUsdFlashLoanAction extends
|
|
12
|
-
public flashLoanId = 9;
|
|
13
|
-
|
|
11
|
+
export class CurveUsdFlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param amount
|
|
16
14
|
* @param flParamGetterAddr
|
|
17
15
|
* @param flParamGetterData
|
|
18
16
|
*/
|
|
19
17
|
constructor(amount: uint256, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
20
|
-
super(
|
|
21
|
-
|
|
22
|
-
getAddr('
|
|
23
|
-
|
|
24
|
-
[[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
25
|
-
);
|
|
18
|
+
super({
|
|
19
|
+
flashLoanId: FLSource.CURVEUSD,
|
|
20
|
+
args: [[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
21
|
+
});
|
|
26
22
|
}
|
|
27
23
|
}
|
|
@@ -1,33 +1,21 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { FlashLoanId } from './FlashLoanId';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource, assertFlashLoanSourceSupported } from './FLSource';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Executes a supported provider through the unified FLAction contract.
|
|
7
|
+
* The inner action's arguments and flashLoanId are used.
|
|
8
|
+
* Repay with FLPaybackAction or send tokens to FLAction.
|
|
7
9
|
*
|
|
8
10
|
* @category Flashloans
|
|
9
11
|
*/
|
|
10
|
-
type SpecificFlashLoanAction =
|
|
12
|
+
type SpecificFlashLoanAction = FlashLoanId & Pick<Action, 'args'>;
|
|
11
13
|
|
|
12
|
-
export class FLAction extends Action {
|
|
13
|
-
|
|
14
|
-
* @param specificFLAction - FL Action to be used
|
|
15
|
-
*/
|
|
16
|
-
#handleArgs(specificFLAction: SpecificFlashLoanAction) {
|
|
17
|
-
const argsToReturn = [
|
|
18
|
-
specificFLAction.args[0],
|
|
19
|
-
specificFLAction.args[1],
|
|
20
|
-
specificFLAction.args[2],
|
|
21
|
-
specificFLAction.args[3],
|
|
22
|
-
getAddr('Empty'),
|
|
23
|
-
[specificFLAction.flashLoanId],
|
|
24
|
-
specificFLAction.args[6],
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
return argsToReturn;
|
|
28
|
-
}
|
|
14
|
+
export class FLAction extends Action implements FlashLoanId {
|
|
15
|
+
public flashLoanId: FLSource;
|
|
29
16
|
|
|
30
17
|
constructor(specificFLAction: SpecificFlashLoanAction) {
|
|
18
|
+
assertFlashLoanSourceSupported(specificFLAction?.flashLoanId);
|
|
31
19
|
super(
|
|
32
20
|
'FLAction',
|
|
33
21
|
getAddr('FLAction'),
|
|
@@ -35,6 +23,15 @@ export class FLAction extends Action {
|
|
|
35
23
|
[],
|
|
36
24
|
);
|
|
37
25
|
this.paramTypes = ['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'];
|
|
38
|
-
this.
|
|
26
|
+
this.flashLoanId = specificFLAction.flashLoanId;
|
|
27
|
+
this.args = [
|
|
28
|
+
specificFLAction.args[0],
|
|
29
|
+
specificFLAction.args[1],
|
|
30
|
+
specificFLAction.args[2],
|
|
31
|
+
specificFLAction.args[3],
|
|
32
|
+
getAddr('Empty'),
|
|
33
|
+
[this.flashLoanId],
|
|
34
|
+
specificFLAction.args[6],
|
|
35
|
+
];
|
|
39
36
|
}
|
|
40
37
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CONFIG, NETWORKS } from '../../config';
|
|
2
|
+
|
|
3
|
+
/** Must match the unified FLAction contract's FLSource enum. */
|
|
4
|
+
export enum FLSource {
|
|
5
|
+
EMPTY,
|
|
6
|
+
AAVEV2,
|
|
7
|
+
BALANCER,
|
|
8
|
+
GHO,
|
|
9
|
+
MAKER,
|
|
10
|
+
AAVEV3,
|
|
11
|
+
UNIV3,
|
|
12
|
+
SPARK,
|
|
13
|
+
MORPHO_BLUE,
|
|
14
|
+
CURVEUSD,
|
|
15
|
+
BALANCER_V3,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Provider support in the current unified deployments. */
|
|
19
|
+
export const supportedFlashLoanSources: Readonly<Record<number, readonly FLSource[]>> = {
|
|
20
|
+
[NETWORKS.ethereum.chainId]: [
|
|
21
|
+
FLSource.AAVEV2, FLSource.BALANCER, FLSource.GHO, FLSource.MAKER,
|
|
22
|
+
FLSource.AAVEV3, FLSource.UNIV3, FLSource.SPARK, FLSource.MORPHO_BLUE,
|
|
23
|
+
FLSource.CURVEUSD, FLSource.BALANCER_V3,
|
|
24
|
+
],
|
|
25
|
+
[NETWORKS.arbitrum.chainId]: [
|
|
26
|
+
FLSource.BALANCER, FLSource.AAVEV3, FLSource.UNIV3, FLSource.MORPHO_BLUE, FLSource.BALANCER_V3,
|
|
27
|
+
],
|
|
28
|
+
[NETWORKS.base.chainId]: [
|
|
29
|
+
FLSource.BALANCER, FLSource.AAVEV3, FLSource.UNIV3, FLSource.MORPHO_BLUE, FLSource.BALANCER_V3,
|
|
30
|
+
],
|
|
31
|
+
[NETWORKS.optimism.chainId]: [
|
|
32
|
+
FLSource.BALANCER, FLSource.AAVEV3, FLSource.UNIV3, FLSource.BALANCER_V3,
|
|
33
|
+
],
|
|
34
|
+
[NETWORKS.linea.chainId]: [FLSource.AAVEV3],
|
|
35
|
+
[NETWORKS.plasma.chainId]: [FLSource.AAVEV3, FLSource.BALANCER_V3],
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const isFlashLoanSourceSupported = (source: FLSource, chainId: number = CONFIG.chainId): boolean => supportedFlashLoanSources[chainId]?.includes(source) ?? false;
|
|
39
|
+
|
|
40
|
+
export const assertFlashLoanSourceSupported = (source: FLSource, chainId: number = CONFIG.chainId): void => {
|
|
41
|
+
if (!isFlashLoanSourceSupported(source, chainId)) {
|
|
42
|
+
throw new Error(`Flashloan source ${FLSource[source] ?? String(source)} is not supported by FLAction on chainId: ${chainId}.`);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a GHO flashloan from GHO Flash Minter
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class GhoFlashLoanAction extends
|
|
12
|
-
public flashLoanId = 3;
|
|
13
|
-
|
|
11
|
+
export class GhoFlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param amount
|
|
16
14
|
* @param flParamGetterAddr
|
|
17
15
|
* @param flParamGetterData
|
|
18
16
|
*/
|
|
19
17
|
constructor(amount: uint256, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
20
|
-
super(
|
|
21
|
-
|
|
22
|
-
getAddr('
|
|
23
|
-
|
|
24
|
-
[[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
25
|
-
);
|
|
18
|
+
super({
|
|
19
|
+
flashLoanId: FLSource.GHO,
|
|
20
|
+
args: [[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
21
|
+
});
|
|
26
22
|
}
|
|
27
23
|
}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from Maker
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class MakerFlashLoanAction extends
|
|
12
|
-
public flashLoanId = 4;
|
|
13
|
-
|
|
11
|
+
export class MakerFlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param amount
|
|
16
14
|
* @param flParamGetterAddr
|
|
17
15
|
* @param flParamGetterData
|
|
18
16
|
*/
|
|
19
17
|
constructor(amount: uint256, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
20
|
-
super(
|
|
21
|
-
|
|
22
|
-
getAddr('
|
|
23
|
-
|
|
24
|
-
[[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
25
|
-
);
|
|
18
|
+
super({
|
|
19
|
+
flashLoanId: FLSource.MAKER,
|
|
20
|
+
args: [[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
21
|
+
});
|
|
26
22
|
}
|
|
27
23
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from MorphoBlue
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class MorphoBlueFlashLoanAction extends
|
|
12
|
-
public flashLoanId = 8;
|
|
13
|
-
|
|
11
|
+
export class MorphoBlueFlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param token
|
|
16
14
|
* @param amount
|
|
@@ -18,11 +16,9 @@ export class MorphoBlueFlashLoanAction extends Action implements FlashLoanId {
|
|
|
18
16
|
* @param flParamGetterData
|
|
19
17
|
*/
|
|
20
18
|
constructor(token: EthAddress, amount: uint256, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
21
|
-
super(
|
|
22
|
-
|
|
23
|
-
getAddr('
|
|
24
|
-
|
|
25
|
-
[[token], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
26
|
-
);
|
|
19
|
+
super({
|
|
20
|
+
flashLoanId: FLSource.MORPHO_BLUE,
|
|
21
|
+
args: [[token], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
22
|
+
});
|
|
27
23
|
}
|
|
28
24
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from Spark with fee enabled
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class SparkFlashLoanAction extends
|
|
12
|
-
public flashLoanId = 7;
|
|
13
|
-
|
|
11
|
+
export class SparkFlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param tokens
|
|
16
14
|
* @param loanAmounts
|
|
@@ -20,11 +18,9 @@ export class SparkFlashLoanAction extends ActionWithL2 implements FlashLoanId {
|
|
|
20
18
|
* @param flParamGetterData
|
|
21
19
|
*/
|
|
22
20
|
constructor(tokens: Array<EthAddress>, loanAmounts: Array<uint256>, modes: Array<uint256>, loanPayer: EthAddress, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
23
|
-
super(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
[tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []],
|
|
28
|
-
);
|
|
21
|
+
super({
|
|
22
|
+
flashLoanId: FLSource.SPARK,
|
|
23
|
+
args: [tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []],
|
|
24
|
+
});
|
|
29
25
|
}
|
|
30
26
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FLAction } from './FLAction';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, bytes } from '../../types';
|
|
4
|
-
import {
|
|
4
|
+
import { FLSource } from './FLSource';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets a flashloan from UniV3 pool
|
|
8
8
|
*
|
|
9
9
|
* @category Flashloans
|
|
10
10
|
*/
|
|
11
|
-
export class UniV3FlashLoanAction extends
|
|
12
|
-
public flashLoanId = 6;
|
|
13
|
-
|
|
11
|
+
export class UniV3FlashLoanAction extends FLAction {
|
|
14
12
|
/**
|
|
15
13
|
* @param token0
|
|
16
14
|
* @param token1
|
|
@@ -21,11 +19,9 @@ export class UniV3FlashLoanAction extends Action implements FlashLoanId {
|
|
|
21
19
|
* @param flParamGetterData
|
|
22
20
|
*/
|
|
23
21
|
constructor(token0: EthAddress, token1: EthAddress, pool: EthAddress, amount0: uint256, amount1: uint256, flParamGetterAddr: EthAddress = getAddr('Empty'), flParamGetterData: bytes = []) {
|
|
24
|
-
super(
|
|
25
|
-
|
|
26
|
-
getAddr('
|
|
27
|
-
|
|
28
|
-
[[token0, token1, pool], [amount0, amount1], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
29
|
-
);
|
|
22
|
+
super({
|
|
23
|
+
flashLoanId: FLSource.UNIV3,
|
|
24
|
+
args: [[token0, token1, pool], [amount0, amount1], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []],
|
|
25
|
+
});
|
|
30
26
|
}
|
|
31
27
|
}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
export * from './DyDxFlashLoanAction';
|
|
2
|
-
export * from './DyDxFlashLoanPaybackAction';
|
|
3
1
|
export * from './AaveV2FlashLoanAction';
|
|
4
|
-
export * from './AaveV2FlashLoanPaybackAction';
|
|
5
2
|
export * from './AaveV3FlashLoanAction';
|
|
6
|
-
export * from './AaveV3FlashLoanPaybackAction';
|
|
7
|
-
export * from './AaveV3FlashLoanNoFeeAction';
|
|
8
|
-
export * from './AaveV3FlashLoanNoFeePaybackAction';
|
|
9
3
|
export * from './AaveV3FlashLoanCarryDebtAction';
|
|
10
4
|
export * from './SparkFlashLoanAction';
|
|
11
|
-
export * from './SparkFlashLoanPaybackAction';
|
|
12
5
|
export * from './MakerFlashLoanAction';
|
|
13
|
-
export * from './MakerFlashLoanPaybackAction';
|
|
14
6
|
export * from './BalancerFlashLoanAction';
|
|
15
|
-
export * from './BalancerFlashLoanPaybackAction';
|
|
16
|
-
export * from './EulerFlashLoanAction';
|
|
17
|
-
export * from './EulerFlashLoanPaybackAction';
|
|
18
7
|
export * from './FLAction';
|
|
8
|
+
export * from './FLSource';
|
|
19
9
|
export * from './UniV3FlashLoanAction';
|
|
20
|
-
export * from './UniV3FlashLoanPaybackAction';
|
|
21
10
|
export * from './GhoFlashLoanAction';
|
|
22
|
-
export * from './GhoFlashLoanPaybackAction';
|
|
23
11
|
export * from './MorphoBlueFlashLoanAction';
|
|
24
|
-
export * from './MorphoBlueFlashLoanPaybackAction';
|
|
25
12
|
export * from './FLPaybackAction';
|
|
26
13
|
export * from './CurveUsdFlashLoanAction';
|
|
27
14
|
export * from './BalancerV3FlashLoanAction';
|