@defisaver/sdk 1.3.28 → 1.3.30-aave-v4-delegate-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/src/Action.js +23 -5
- package/esm/src/actions/aavev4/AaveV4DelegateBorrowAction.d.ts +16 -0
- package/esm/src/actions/aavev4/AaveV4DelegateBorrowAction.js +24 -0
- package/esm/src/actions/aavev4/AaveV4DelegateSetUsingAsCollateralAction.d.ts +15 -0
- package/esm/src/actions/aavev4/AaveV4DelegateSetUsingAsCollateralAction.js +22 -0
- package/esm/src/actions/aavev4/AaveV4DelegateWithdrawAction.d.ts +16 -0
- package/esm/src/actions/aavev4/AaveV4DelegateWithdrawAction.js +24 -0
- package/esm/src/actions/aavev4/AaveV4SetUserManagersAction.d.ts +14 -0
- package/esm/src/actions/aavev4/AaveV4SetUserManagersAction.js +16 -0
- package/esm/src/actions/aavev4/index.d.ts +4 -0
- package/esm/src/actions/aavev4/index.js +4 -0
- package/esm/src/actions/checkers/SparkRatioCheckAction.d.ts +4 -2
- package/esm/src/actions/checkers/SparkRatioCheckAction.js +6 -2
- package/esm/src/actions/checkers/SparkTargetRatioCheck.d.ts +2 -1
- package/esm/src/actions/checkers/SparkTargetRatioCheck.js +4 -2
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.d.ts +18 -0
- package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.js +28 -0
- package/esm/src/actions/midnight/MidnightPaybackDirectAction.d.ts +16 -0
- package/esm/src/actions/midnight/MidnightPaybackDirectAction.js +24 -0
- package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.d.ts +18 -0
- package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.js +28 -0
- package/esm/src/actions/midnight/MidnightSupplyCollateralAction.d.ts +17 -0
- package/esm/src/actions/midnight/MidnightSupplyCollateralAction.js +26 -0
- package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.d.ts +17 -0
- package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.js +26 -0
- package/esm/src/actions/midnight/index.d.ts +5 -0
- package/esm/src/actions/midnight/index.js +5 -0
- package/esm/src/addresses.d.ts +60 -0
- package/esm/src/addresses.js +12 -2
- package/esm/src/index.d.ts +240 -0
- package/package.json +1 -1
- package/src/Action.ts +21 -5
- package/src/actions/aavev4/AaveV4DelegateBorrowAction.ts +36 -0
- package/src/actions/aavev4/AaveV4DelegateSetUsingAsCollateralAction.ts +33 -0
- package/src/actions/aavev4/AaveV4DelegateWithdrawAction.ts +36 -0
- package/src/actions/aavev4/AaveV4SetUserManagersAction.ts +26 -0
- package/src/actions/aavev4/index.ts +5 -1
- package/src/actions/checkers/SparkRatioCheckAction.ts +18 -4
- package/src/actions/checkers/SparkTargetRatioCheck.ts +14 -3
- package/src/actions/index.ts +2 -0
- package/src/actions/midnight/MidnightBorrowFromOrdersAction.ts +44 -0
- package/src/actions/midnight/MidnightPaybackDirectAction.ts +36 -0
- package/src/actions/midnight/MidnightPaybackFromOrdersAction.ts +44 -0
- package/src/actions/midnight/MidnightSupplyCollateralAction.ts +39 -0
- package/src/actions/midnight/MidnightWithdrawCollateralAction.ts +39 -0
- package/src/actions/midnight/index.ts +5 -0
- package/src/addresses.ts +13 -2
- package/umd/index.js +443 -98
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV4DelegateBorrowAction - Approves a spender to borrow from the specified reserve on behalf of the wallet.
|
|
7
|
+
*
|
|
8
|
+
* @category AaveV4DelegateBorrow
|
|
9
|
+
*/
|
|
10
|
+
export class AaveV4DelegateBorrowAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param spoke Address of the spoke.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param spender Address that will receive the borrow allowance.
|
|
15
|
+
* @param amount Amount of borrow allowance.
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
spoke: EthAddress,
|
|
19
|
+
reserveId: uint256,
|
|
20
|
+
spender: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'AaveV4DelegateBorrow',
|
|
25
|
+
getAddr('AaveV4DelegateBorrow'),
|
|
26
|
+
['address', 'uint256', 'address', 'uint256'],
|
|
27
|
+
[spoke, reserveId, spender, amount],
|
|
28
|
+
);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV4DelegateSetUsingAsCollateralAction - Approves a delegatee to set using as collateral on behalf of the wallet.
|
|
7
|
+
*
|
|
8
|
+
* @category AaveV4DelegateSetUsingAsCollateral
|
|
9
|
+
*/
|
|
10
|
+
export class AaveV4DelegateSetUsingAsCollateralAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param spoke Address of the spoke.
|
|
13
|
+
* @param delegatee Address that will receive the permission.
|
|
14
|
+
* @param permission Whether the delegatee can set using as collateral.
|
|
15
|
+
*/
|
|
16
|
+
constructor(
|
|
17
|
+
spoke: EthAddress,
|
|
18
|
+
delegatee: EthAddress,
|
|
19
|
+
permission: boolean,
|
|
20
|
+
) {
|
|
21
|
+
super(
|
|
22
|
+
'AaveV4DelegateSetUsingAsCollateral',
|
|
23
|
+
getAddr('AaveV4DelegateSetUsingAsCollateral'),
|
|
24
|
+
['address', 'address', 'bool'],
|
|
25
|
+
[spoke, delegatee, permission],
|
|
26
|
+
);
|
|
27
|
+
this.mappableArgs = [
|
|
28
|
+
this.args[0],
|
|
29
|
+
this.args[1],
|
|
30
|
+
this.args[2],
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV4DelegateWithdrawAction - Approves a spender to withdraw from the specified reserve on behalf of the wallet.
|
|
7
|
+
*
|
|
8
|
+
* @category AaveV4DelegateWithdraw
|
|
9
|
+
*/
|
|
10
|
+
export class AaveV4DelegateWithdrawAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param spoke Address of the spoke.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param spender Address that will receive the withdraw allowance.
|
|
15
|
+
* @param amount Amount of withdraw allowance.
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
spoke: EthAddress,
|
|
19
|
+
reserveId: uint256,
|
|
20
|
+
spender: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'AaveV4DelegateWithdraw',
|
|
25
|
+
getAddr('AaveV4DelegateWithdraw'),
|
|
26
|
+
['address', 'uint256', 'address', 'uint256'],
|
|
27
|
+
[spoke, reserveId, spender, amount],
|
|
28
|
+
);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV4SetUserManagersAction - Sets position managers for the user's wallet.
|
|
7
|
+
*
|
|
8
|
+
* @category AaveV4
|
|
9
|
+
*/
|
|
10
|
+
export class AaveV4SetUserManagersAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param spoke Address of the spoke.
|
|
13
|
+
* @param updates The array of position manager updates.
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
spoke: EthAddress,
|
|
17
|
+
updates: Array<[EthAddress, boolean]>,
|
|
18
|
+
) {
|
|
19
|
+
super(
|
|
20
|
+
'AaveV4SetUserManagers',
|
|
21
|
+
getAddr('AaveV4SetUserManagers'),
|
|
22
|
+
['address', 'tuple(address,bool)[]'],
|
|
23
|
+
[spoke, updates],
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -8,4 +8,8 @@ export * from './AaveV4RefreshPremiumAction';
|
|
|
8
8
|
export * from './AaveV4DelegateBorrowWithSigAction';
|
|
9
9
|
export * from './AaveV4DelegateWithdrawWithSigAction';
|
|
10
10
|
export * from './AaveV4SetUserManagersWithSigAction';
|
|
11
|
-
export * from './AaveV4DelegateSetUsingAsCollateralWithSigAction';
|
|
11
|
+
export * from './AaveV4DelegateSetUsingAsCollateralWithSigAction';
|
|
12
|
+
export * from './AaveV4DelegateBorrowAction';
|
|
13
|
+
export * from './AaveV4DelegateWithdrawAction';
|
|
14
|
+
export * from './AaveV4DelegateSetUsingAsCollateralAction';
|
|
15
|
+
export * from './AaveV4SetUserManagersAction';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
|
-
import { uint8, uint256 } from '../../types';
|
|
3
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* SparkRatioCheckAction - Checks spark ratio for users proxy position and reverts if faulty
|
|
@@ -11,13 +11,27 @@ export class SparkRatioCheckAction extends Action {
|
|
|
11
11
|
/**
|
|
12
12
|
* @param ratioState If it should lower/higher
|
|
13
13
|
* @param targetRatio The ratio user want to be at
|
|
14
|
+
* @param market Address provider for specific market. This param was added later
|
|
15
|
+
* @param user Address of the user (EOA/SW). This param was added later
|
|
14
16
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
17
|
+
constructor(
|
|
18
|
+
ratioState: uint8,
|
|
19
|
+
targetRatio: uint256,
|
|
20
|
+
market: EthAddress = getAddr('Empty'),
|
|
21
|
+
user: EthAddress = getAddr('Empty'),
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'SparkRatioCheck',
|
|
25
|
+
getAddr('Empty'),
|
|
26
|
+
['uint8', 'uint256', 'address', 'address'],
|
|
27
|
+
[ratioState, targetRatio, market, user],
|
|
28
|
+
);
|
|
17
29
|
|
|
18
30
|
this.mappableArgs = [
|
|
19
31
|
this.args[0],
|
|
20
32
|
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
21
35
|
];
|
|
22
36
|
}
|
|
23
|
-
}
|
|
37
|
+
}
|
|
@@ -11,13 +11,24 @@ export class SparkTargetRatioCheck extends Action {
|
|
|
11
11
|
/**
|
|
12
12
|
* @param targetRatio The ratio user want to be at
|
|
13
13
|
* @param market Address of the market
|
|
14
|
+
* @param user Address of the user (EOA/SW). This param was added later
|
|
14
15
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
16
|
+
constructor(
|
|
17
|
+
targetRatio: uint256,
|
|
18
|
+
market: EthAddress,
|
|
19
|
+
user: EthAddress = getAddr('Empty'),
|
|
20
|
+
) {
|
|
21
|
+
super(
|
|
22
|
+
'SparkTargetRatioCheck',
|
|
23
|
+
getAddr('Empty'),
|
|
24
|
+
['uint256', 'address', 'address'],
|
|
25
|
+
[targetRatio, market, user],
|
|
26
|
+
);
|
|
17
27
|
|
|
18
28
|
this.mappableArgs = [
|
|
19
29
|
this.args[0],
|
|
20
30
|
this.args[1],
|
|
31
|
+
this.args[2],
|
|
21
32
|
];
|
|
22
33
|
}
|
|
23
|
-
}
|
|
34
|
+
}
|
package/src/actions/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ import * as fluid from './fluid';
|
|
|
40
40
|
import * as pendle from './pendle';
|
|
41
41
|
import * as umbrella from './umbrella';
|
|
42
42
|
import * as aaveV4 from './aavev4';
|
|
43
|
+
import * as midnight from './midnight';
|
|
43
44
|
|
|
44
45
|
export {
|
|
45
46
|
aave,
|
|
@@ -84,4 +85,5 @@ export {
|
|
|
84
85
|
pendle,
|
|
85
86
|
umbrella,
|
|
86
87
|
aaveV4,
|
|
88
|
+
midnight,
|
|
87
89
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
|
|
9
|
+
*
|
|
10
|
+
* @category MidnightBorrowFromOrders
|
|
11
|
+
*/
|
|
12
|
+
export class MidnightBorrowFromOrdersAction extends Action {
|
|
13
|
+
/**
|
|
14
|
+
* @param marketId Market id.
|
|
15
|
+
* @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
16
|
+
* @param to Address to send the borrowed tokens to.
|
|
17
|
+
* @param amount Amount of tokens to borrow.
|
|
18
|
+
* @param maxUnits Maximum number of units to take from the orders (slippage protection).
|
|
19
|
+
* @param offerFills Array of offer fills to borrow from.
|
|
20
|
+
*/
|
|
21
|
+
constructor(
|
|
22
|
+
marketId: bytes32,
|
|
23
|
+
onBehalf: EthAddress,
|
|
24
|
+
to: EthAddress,
|
|
25
|
+
amount: uint256,
|
|
26
|
+
maxUnits: uint256,
|
|
27
|
+
offerFills: Array<any>,
|
|
28
|
+
) {
|
|
29
|
+
super(
|
|
30
|
+
'MidnightBorrowFromOrders',
|
|
31
|
+
getAddr('MidnightBorrowFromOrders'),
|
|
32
|
+
['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType],
|
|
33
|
+
[marketId, onBehalf, to, amount, maxUnits, offerFills],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
this.mappableArgs = [
|
|
37
|
+
this.args[0],
|
|
38
|
+
this.args[1],
|
|
39
|
+
this.args[2],
|
|
40
|
+
this.args[3],
|
|
41
|
+
this.args[4],
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MidnightPaybackDirectAction - Payback a debt directly to the Midnight protocol.
|
|
7
|
+
*
|
|
8
|
+
* @category MidnightPaybackDirect
|
|
9
|
+
*/
|
|
10
|
+
export class MidnightPaybackDirectAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param marketId Market id.
|
|
13
|
+
* @param onBehalf Address to payback tokens on behalf of.
|
|
14
|
+
* @param from Address from which to pull the payback tokens.
|
|
15
|
+
* @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
marketId: bytes32,
|
|
19
|
+
onBehalf: EthAddress,
|
|
20
|
+
from: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'MidnightPaybackDirect',
|
|
25
|
+
getAddr('MidnightPaybackDirect'),
|
|
26
|
+
['bytes32', 'address', 'address', 'uint256'],
|
|
27
|
+
[marketId, onBehalf, from, amount],
|
|
28
|
+
);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* MidnightPaybackFromOrdersAction - Pay back debt through one or more Midnight offers.
|
|
9
|
+
*
|
|
10
|
+
* @category MidnightPaybackFromOrders
|
|
11
|
+
*/
|
|
12
|
+
export class MidnightPaybackFromOrdersAction extends Action {
|
|
13
|
+
/**
|
|
14
|
+
* @param marketId Market id.
|
|
15
|
+
* @param onBehalf Address whose debt is repaid. Defaults to the user's wallet if not provided.
|
|
16
|
+
* @param from Address from which to pull the payback tokens.
|
|
17
|
+
* @param amount Amount of tokens to spend. Send type(uint).max to pay back the whole debt.
|
|
18
|
+
* @param minUnits Minimum number of debt units to repay (slippage protection).
|
|
19
|
+
* @param offerFills Array of offer fills to pay back from.
|
|
20
|
+
*/
|
|
21
|
+
constructor(
|
|
22
|
+
marketId: bytes32,
|
|
23
|
+
onBehalf: EthAddress,
|
|
24
|
+
from: EthAddress,
|
|
25
|
+
amount: uint256,
|
|
26
|
+
minUnits: uint256,
|
|
27
|
+
offerFills: Array<any>,
|
|
28
|
+
) {
|
|
29
|
+
super(
|
|
30
|
+
'MidnightPaybackFromOrders',
|
|
31
|
+
getAddr('MidnightPaybackFromOrders'),
|
|
32
|
+
['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType],
|
|
33
|
+
[marketId, onBehalf, from, amount, minUnits, offerFills],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
this.mappableArgs = [
|
|
37
|
+
this.args[0],
|
|
38
|
+
this.args[1],
|
|
39
|
+
this.args[2],
|
|
40
|
+
this.args[3],
|
|
41
|
+
this.args[4],
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MidnightSupplyCollateralAction
|
|
7
|
+
*
|
|
8
|
+
* @category MidnightSupplyCollateral
|
|
9
|
+
*/
|
|
10
|
+
export class MidnightSupplyCollateralAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param marketId Market id.
|
|
13
|
+
* @param onBehalf Address to supply tokens on behalf of.
|
|
14
|
+
* @param from Address from which to pull collateral asset.
|
|
15
|
+
* @param amount Amount of tokens to supply.
|
|
16
|
+
* @param collateralIndex Collateral index (0-based).
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
marketId: bytes32,
|
|
20
|
+
onBehalf: EthAddress,
|
|
21
|
+
from: EthAddress,
|
|
22
|
+
amount: uint256,
|
|
23
|
+
collateralIndex: uint256,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'MidnightSupplyCollateral',
|
|
27
|
+
getAddr('MidnightSupplyCollateral'),
|
|
28
|
+
['bytes32', 'address', 'address', 'uint256', 'uint256'],
|
|
29
|
+
[marketId, onBehalf, from, amount, collateralIndex],
|
|
30
|
+
);
|
|
31
|
+
this.mappableArgs = [
|
|
32
|
+
this.args[0],
|
|
33
|
+
this.args[1],
|
|
34
|
+
this.args[2],
|
|
35
|
+
this.args[3],
|
|
36
|
+
this.args[4],
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MidnightWithdrawCollateralAction
|
|
7
|
+
*
|
|
8
|
+
* @category MidnightWithdrawCollateral
|
|
9
|
+
*/
|
|
10
|
+
export class MidnightWithdrawCollateralAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param marketId Market id.
|
|
13
|
+
* @param onBehalf Address to withdraw tokens on behalf of.
|
|
14
|
+
* @param to Address that will receive the withdrawn tokens.
|
|
15
|
+
* @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
|
|
16
|
+
* @param collateralIndex Collateral index (0-based).
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
marketId: bytes32,
|
|
20
|
+
onBehalf: EthAddress,
|
|
21
|
+
to: EthAddress,
|
|
22
|
+
amount: uint256,
|
|
23
|
+
collateralIndex: uint256,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'MidnightWithdrawCollateral',
|
|
27
|
+
getAddr('MidnightWithdrawCollateral'),
|
|
28
|
+
['bytes32', 'address', 'address', 'uint256', 'uint256'],
|
|
29
|
+
[marketId, onBehalf, to, amount, collateralIndex],
|
|
30
|
+
);
|
|
31
|
+
this.mappableArgs = [
|
|
32
|
+
this.args[0],
|
|
33
|
+
this.args[1],
|
|
34
|
+
this.args[2],
|
|
35
|
+
this.args[3],
|
|
36
|
+
this.args[4],
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -208,8 +208,8 @@ export const actionAddresses = {
|
|
|
208
208
|
LiquityV2Adjust: '0x3BbC88f3b75cB898395C9b5AE8D9c2a26744993b',
|
|
209
209
|
LiquityV2AdjustInterestRate:
|
|
210
210
|
'0x685f0237D8b85B2018278E975a481b0650dE0b54',
|
|
211
|
-
LiquityV2SPDeposit: '
|
|
212
|
-
LiquityV2SPWithdraw: '
|
|
211
|
+
LiquityV2SPDeposit: '0x256e97E7f7B42Cf7De5258C59A2935AdEdDdfC63',
|
|
212
|
+
LiquityV2SPWithdraw: '0x7ab4A43DE2628EA53c88E27755325d090f28D9c9',
|
|
213
213
|
LiquityV2SPClaimColl: '0x3f783de20C3095bcB999AEA999aF4DF184b6630f',
|
|
214
214
|
LiquityV2AdjustZombieTrove:
|
|
215
215
|
'0x45F5CEe8f89AdBCe4f5B20f38a49402b152ba99e',
|
|
@@ -404,6 +404,10 @@ export const actionAddresses = {
|
|
|
404
404
|
AaveV4DelegateWithdrawWithSig: '0x81864dBd69c46B19463eC7BEC6cE0B271126531a',
|
|
405
405
|
AaveV4DelegateBorrowWithSig: '0x9D68b41BB9f9e9Ac1E1ee49d3566CAd4624886BA',
|
|
406
406
|
AaveV4DelegateSetUsingAsCollateralWithSig: '0xF3D7C7e8F5154c669EAA0dE996cdE0575D7d3A00',
|
|
407
|
+
AaveV4DelegateBorrow: '0x4284B4e09c46Ee2b4E703dB8e5A2F892d12638e1',
|
|
408
|
+
AaveV4DelegateWithdraw: '0x5e7c404d46971E7BD3a95570A80Bc37F38bf9E29',
|
|
409
|
+
AaveV4DelegateSetUsingAsCollateral: '0xa97f8E483C147f27aE7370DeaC4E6585A37884A2',
|
|
410
|
+
AaveV4SetUserManagers: '0x61e5d59bD82FFC61B916d2F2114eF671b17d0662',
|
|
407
411
|
},
|
|
408
412
|
[NETWORKS.optimism.chainId]: {
|
|
409
413
|
DFSSell: '0x9f234af5c10c136863a20865ba00b26951ab8269',
|
|
@@ -685,6 +689,13 @@ export const actionAddresses = {
|
|
|
685
689
|
SFApproveTokens: '0x03EDC9A683f37BFB7516FF234223fFb6E38D5eb9',
|
|
686
690
|
SummerfiUnsub: '0x0000000000000000000000000000000000000000', // Only exists for Maker on Mainnet
|
|
687
691
|
SummerfiUnsubV2: '0x60587B8Fe62Fc149d285a611822263206b4138da',
|
|
692
|
+
|
|
693
|
+
MidnightPaybackDirect: '0xC1B049A038f9E9811dc1Ad1D335369844d4268D9',
|
|
694
|
+
MidnightBorrowFromOrders: '0x82F9dd7eA821463178A2c7bC4047057Bd338E5e5',
|
|
695
|
+
MidnightPaybackFromOrders: '0x4B0c242195B1C941A2e7a871Bfa242c40dbf032F',
|
|
696
|
+
MidnightSupplyCollateral: '0xC83C7Ca37203FC30636EDcd3Ef127194542504c5',
|
|
697
|
+
MidnightWithdrawCollateral: '0x4fA4DA5fDD813279409B4Bf0Bde5Fe9ca8006A9C',
|
|
698
|
+
MidnightView: '0x3aa272f329E8B562A3bA56Bb6979a44D23A28839',
|
|
688
699
|
},
|
|
689
700
|
[NETWORKS.linea.chainId]: {
|
|
690
701
|
// Basic
|