@defisaver/sdk 1.3.26 → 1.3.27-midnight-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/aaveV3/AaveV3DelegateCredit.d.ts +1 -1
- package/esm/src/actions/aaveV3/AaveV3DelegateCredit.js +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.d.ts +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.js +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.d.ts +4 -2
- package/esm/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.js +12 -6
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.d.ts +1 -1
- package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.js +1 -1
- 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/actions/uniswap/index.d.ts +0 -1
- package/esm/src/actions/uniswap/index.js +0 -1
- package/esm/src/addresses.d.ts +44 -14
- package/esm/src/addresses.js +10 -13
- package/esm/src/index.d.ts +176 -56
- package/package.json +1 -1
- package/src/Action.ts +21 -5
- package/src/actions/aaveV3/AaveV3DelegateCredit.ts +1 -1
- package/src/actions/flashloan/AaveV3FlashLoanAction.ts +1 -1
- package/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.ts +13 -7
- package/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.ts +1 -1
- 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/actions/uniswap/index.ts +1 -2
- package/src/addresses.ts +11 -13
- package/umd/index.js +898 -727
- package/esm/src/actions/uniswap/UniswapClaimAction.d.ts +0 -16
- package/esm/src/actions/uniswap/UniswapClaimAction.js +0 -23
- package/src/actions/uniswap/UniswapClaimAction.ts +0 -31
- package/test/actions/uniswap/UniswapClaimAction.js +0 -31
package/esm/src/Action.js
CHANGED
|
@@ -63,14 +63,32 @@ export class Action {
|
|
|
63
63
|
}
|
|
64
64
|
_parseParamType(paramType, arg) {
|
|
65
65
|
if (typeof (paramType) === 'string') {
|
|
66
|
-
if (paramType.startsWith('(')) {
|
|
67
|
-
let _paramType = paramType.replace('(', '');
|
|
68
|
-
_paramType = _paramType.replace(')', '');
|
|
69
|
-
return _paramType.split(',');
|
|
70
|
-
}
|
|
71
66
|
if (paramType.endsWith('[]')) {
|
|
72
67
|
return Array.from(Array(arg.length).fill(paramType.replace('[]', '')));
|
|
73
68
|
}
|
|
69
|
+
if (paramType.startsWith('(') || paramType.startsWith('tuple(')) {
|
|
70
|
+
const tupleStart = paramType.indexOf('(');
|
|
71
|
+
const tupleEnd = paramType.lastIndexOf(')');
|
|
72
|
+
const tupleContents = paramType.slice(tupleStart + 1, tupleEnd);
|
|
73
|
+
const tupleTypes = [];
|
|
74
|
+
let currentType = '';
|
|
75
|
+
let nestingDepth = 0;
|
|
76
|
+
for (const character of tupleContents) {
|
|
77
|
+
if (character === ',' && nestingDepth === 0) {
|
|
78
|
+
tupleTypes.push(currentType);
|
|
79
|
+
currentType = '';
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
currentType += character;
|
|
83
|
+
if (character === '(')
|
|
84
|
+
nestingDepth += 1;
|
|
85
|
+
if (character === ')')
|
|
86
|
+
nestingDepth -= 1;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
tupleTypes.push(currentType);
|
|
90
|
+
return tupleTypes;
|
|
91
|
+
}
|
|
74
92
|
}
|
|
75
93
|
return paramType;
|
|
76
94
|
}
|
|
@@ -12,7 +12,7 @@ export declare class AaveV3DelegateCredit extends ActionWithL2 {
|
|
|
12
12
|
* @param amount Amount of tokens to be payed back
|
|
13
13
|
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
14
14
|
* @param assetId The id of the token to be borrowed
|
|
15
|
-
* @param delegatee The
|
|
15
|
+
* @param delegatee The id of the underlying asset to be repaid
|
|
16
16
|
*/
|
|
17
17
|
constructor(useOnDefaultMarket: boolean, market: EthAddress, amount: uint256, rateMode: uint8, assetId: uint16, delegatee: EthAddress);
|
|
18
18
|
encodeInputs(): string;
|
|
@@ -12,7 +12,7 @@ export class AaveV3DelegateCredit extends ActionWithL2 {
|
|
|
12
12
|
* @param amount Amount of tokens to be payed back
|
|
13
13
|
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
14
14
|
* @param assetId The id of the token to be borrowed
|
|
15
|
-
* @param delegatee The
|
|
15
|
+
* @param delegatee The id of the underlying asset to be repaid
|
|
16
16
|
*/
|
|
17
17
|
constructor(useOnDefaultMarket, market, amount, rateMode, assetId, delegatee) {
|
|
18
18
|
super('AaveV3DelegateCredit', getAddr('Empty'), ['uint256', 'address', 'uint16', 'uint8', 'bool', 'address'], [amount, delegatee, assetId, rateMode, useOnDefaultMarket, market]);
|
|
@@ -9,8 +9,8 @@ import { FlashLoanId } from './FlashLoanId';
|
|
|
9
9
|
export declare class AaveV3FlashLoanAction extends ActionWithL2 implements FlashLoanId {
|
|
10
10
|
flashLoanId: number;
|
|
11
11
|
/**
|
|
12
|
-
* @param tokens
|
|
13
12
|
* @param loanAmounts
|
|
13
|
+
* @param tokens
|
|
14
14
|
* @param modes
|
|
15
15
|
* @param loanPayer
|
|
16
16
|
* @param flParamGetterAddr
|
|
@@ -7,10 +7,12 @@ import { EthAddress, uint256, bytes } from '../../types';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class AaveV3FlashLoanCarryDebtAction extends ActionWithL2 {
|
|
9
9
|
/**
|
|
10
|
-
* @param tokens
|
|
11
10
|
* @param loanAmounts
|
|
11
|
+
* @param tokens
|
|
12
|
+
* @param modes
|
|
13
|
+
* @param loanPayer
|
|
12
14
|
* @param flParamGetterAddr
|
|
13
15
|
* @param flParamGetterData
|
|
14
16
|
*/
|
|
15
|
-
constructor(tokens: Array<EthAddress>, loanAmounts: Array<uint256>, flParamGetterAddr?: EthAddress, flParamGetterData?: bytes);
|
|
17
|
+
constructor(tokens: Array<EthAddress>, loanAmounts: Array<uint256>, modes: Array<uint256>, loanPayer: EthAddress, flParamGetterAddr?: EthAddress, flParamGetterData?: bytes);
|
|
16
18
|
}
|
|
@@ -7,16 +7,22 @@ import { getAddr } from '../../addresses';
|
|
|
7
7
|
*/
|
|
8
8
|
export class AaveV3FlashLoanCarryDebtAction extends ActionWithL2 {
|
|
9
9
|
/**
|
|
10
|
-
* @param tokens
|
|
11
10
|
* @param loanAmounts
|
|
11
|
+
* @param tokens
|
|
12
|
+
* @param modes
|
|
13
|
+
* @param loanPayer
|
|
12
14
|
* @param flParamGetterAddr
|
|
13
15
|
* @param flParamGetterData
|
|
14
16
|
*/
|
|
15
|
-
constructor(tokens, loanAmounts, flParamGetterAddr = getAddr('Empty'), flParamGetterData = []) {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
constructor(tokens, loanAmounts, modes, loanPayer, flParamGetterAddr = getAddr('Empty'), flParamGetterData = []) {
|
|
18
|
+
super('FLAaveV3CarryDebt', getAddr('FLAaveV3CarryDebt'), ['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'], [tokens, loanAmounts, modes, loanPayer, flParamGetterAddr, flParamGetterData, []]);
|
|
19
|
+
if (tokens.length !== modes.length || tokens.length !== loanAmounts.length) {
|
|
20
|
+
throw new Error('Arrays must be of the same length');
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
modes.forEach((mode) => {
|
|
23
|
+
if (mode.toString() !== '1' && mode.toString() !== '2') {
|
|
24
|
+
throw new Error('Invalid borrow mode set');
|
|
25
|
+
}
|
|
26
|
+
});
|
|
21
27
|
}
|
|
22
28
|
}
|
|
@@ -7,8 +7,8 @@ import { EthAddress, uint256, bytes } from '../../types';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class AaveV3FlashLoanNoFeeAction extends ActionWithL2 {
|
|
9
9
|
/**
|
|
10
|
-
* @param tokens
|
|
11
10
|
* @param loanAmounts
|
|
11
|
+
* @param tokens
|
|
12
12
|
* @param modes
|
|
13
13
|
* @param loanPayer
|
|
14
14
|
* @param flParamGetterAddr
|
|
@@ -40,4 +40,5 @@ 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
|
-
|
|
43
|
+
import * as midnight from './midnight';
|
|
44
|
+
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, summerfi, llamalend, merkl, eulerV2, sky, liquityV2, stkgho, renzo, etherfi, fluid, pendle, umbrella, aaveV4, midnight, };
|
package/esm/src/actions/index.js
CHANGED
|
@@ -40,4 +40,5 @@ 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
|
-
|
|
43
|
+
import * as midnight from './midnight';
|
|
44
|
+
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, summerfi, llamalend, merkl, eulerV2, sky, liquityV2, stkgho, renzo, etherfi, fluid, pendle, umbrella, aaveV4, midnight, };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightBorrowFromOrders
|
|
7
|
+
*/
|
|
8
|
+
export declare class MidnightBorrowFromOrdersAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param to Address to send the borrowed tokens to.
|
|
13
|
+
* @param amount Amount of tokens to borrow.
|
|
14
|
+
* @param maxUnits Maximum number of units to take from the orders (slippage protection).
|
|
15
|
+
* @param offerFills Array of offer fills to borrow from.
|
|
16
|
+
*/
|
|
17
|
+
constructor(marketId: bytes32, onBehalf: EthAddress, to: EthAddress, amount: uint256, maxUnits: uint256, offerFills: Array<any>);
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
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)[]';
|
|
4
|
+
/**
|
|
5
|
+
* MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
|
|
6
|
+
*
|
|
7
|
+
* @category MidnightBorrowFromOrders
|
|
8
|
+
*/
|
|
9
|
+
export class MidnightBorrowFromOrdersAction extends Action {
|
|
10
|
+
/**
|
|
11
|
+
* @param marketId Market id.
|
|
12
|
+
* @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
|
|
13
|
+
* @param to Address to send the borrowed tokens to.
|
|
14
|
+
* @param amount Amount of tokens to borrow.
|
|
15
|
+
* @param maxUnits Maximum number of units to take from the orders (slippage protection).
|
|
16
|
+
* @param offerFills Array of offer fills to borrow from.
|
|
17
|
+
*/
|
|
18
|
+
constructor(marketId, onBehalf, to, amount, maxUnits, offerFills) {
|
|
19
|
+
super('MidnightBorrowFromOrders', getAddr('MidnightBorrowFromOrders'), ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType], [marketId, onBehalf, to, amount, maxUnits, offerFills]);
|
|
20
|
+
this.mappableArgs = [
|
|
21
|
+
this.args[0],
|
|
22
|
+
this.args[1],
|
|
23
|
+
this.args[2],
|
|
24
|
+
this.args[3],
|
|
25
|
+
this.args[4],
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightPaybackDirectAction - Payback a debt directly to the Midnight protocol.
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightPaybackDirect
|
|
7
|
+
*/
|
|
8
|
+
export declare class MidnightPaybackDirectAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to payback tokens on behalf of.
|
|
12
|
+
* @param from Address from which to pull the payback tokens.
|
|
13
|
+
* @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
|
|
14
|
+
*/
|
|
15
|
+
constructor(marketId: bytes32, onBehalf: EthAddress, from: EthAddress, amount: uint256);
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightPaybackDirectAction - Payback a debt directly to the Midnight protocol.
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightPaybackDirect
|
|
7
|
+
*/
|
|
8
|
+
export class MidnightPaybackDirectAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to payback tokens on behalf of.
|
|
12
|
+
* @param from Address from which to pull the payback tokens.
|
|
13
|
+
* @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
|
|
14
|
+
*/
|
|
15
|
+
constructor(marketId, onBehalf, from, amount) {
|
|
16
|
+
super('MidnightPaybackDirect', getAddr('MidnightPaybackDirect'), ['bytes32', 'address', 'address', 'uint256'], [marketId, onBehalf, from, amount]);
|
|
17
|
+
this.mappableArgs = [
|
|
18
|
+
this.args[0],
|
|
19
|
+
this.args[1],
|
|
20
|
+
this.args[2],
|
|
21
|
+
this.args[3],
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightPaybackFromOrdersAction - Pay back debt through one or more Midnight offers.
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightPaybackFromOrders
|
|
7
|
+
*/
|
|
8
|
+
export declare class MidnightPaybackFromOrdersAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address whose debt is repaid. Defaults to the user's wallet if not provided.
|
|
12
|
+
* @param from Address from which to pull the payback tokens.
|
|
13
|
+
* @param amount Amount of tokens to spend. Send type(uint).max to pay back the whole debt.
|
|
14
|
+
* @param minUnits Minimum number of debt units to repay (slippage protection).
|
|
15
|
+
* @param offerFills Array of offer fills to pay back from.
|
|
16
|
+
*/
|
|
17
|
+
constructor(marketId: bytes32, onBehalf: EthAddress, from: EthAddress, amount: uint256, minUnits: uint256, offerFills: Array<any>);
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
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)[]';
|
|
4
|
+
/**
|
|
5
|
+
* MidnightPaybackFromOrdersAction - Pay back debt through one or more Midnight offers.
|
|
6
|
+
*
|
|
7
|
+
* @category MidnightPaybackFromOrders
|
|
8
|
+
*/
|
|
9
|
+
export class MidnightPaybackFromOrdersAction extends Action {
|
|
10
|
+
/**
|
|
11
|
+
* @param marketId Market id.
|
|
12
|
+
* @param onBehalf Address whose debt is repaid. Defaults to the user's wallet if not provided.
|
|
13
|
+
* @param from Address from which to pull the payback tokens.
|
|
14
|
+
* @param amount Amount of tokens to spend. Send type(uint).max to pay back the whole debt.
|
|
15
|
+
* @param minUnits Minimum number of debt units to repay (slippage protection).
|
|
16
|
+
* @param offerFills Array of offer fills to pay back from.
|
|
17
|
+
*/
|
|
18
|
+
constructor(marketId, onBehalf, from, amount, minUnits, offerFills) {
|
|
19
|
+
super('MidnightPaybackFromOrders', getAddr('MidnightPaybackFromOrders'), ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType], [marketId, onBehalf, from, amount, minUnits, offerFills]);
|
|
20
|
+
this.mappableArgs = [
|
|
21
|
+
this.args[0],
|
|
22
|
+
this.args[1],
|
|
23
|
+
this.args[2],
|
|
24
|
+
this.args[3],
|
|
25
|
+
this.args[4],
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightSupplyCollateralAction
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightSupplyCollateral
|
|
7
|
+
*/
|
|
8
|
+
export declare class MidnightSupplyCollateralAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to supply tokens on behalf of.
|
|
12
|
+
* @param from Address from which to pull collateral asset.
|
|
13
|
+
* @param amount Amount of tokens to supply.
|
|
14
|
+
* @param collateralIndex Collateral index (0-based).
|
|
15
|
+
*/
|
|
16
|
+
constructor(marketId: bytes32, onBehalf: EthAddress, from: EthAddress, amount: uint256, collateralIndex: uint256);
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightSupplyCollateralAction
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightSupplyCollateral
|
|
7
|
+
*/
|
|
8
|
+
export class MidnightSupplyCollateralAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to supply tokens on behalf of.
|
|
12
|
+
* @param from Address from which to pull collateral asset.
|
|
13
|
+
* @param amount Amount of tokens to supply.
|
|
14
|
+
* @param collateralIndex Collateral index (0-based).
|
|
15
|
+
*/
|
|
16
|
+
constructor(marketId, onBehalf, from, amount, collateralIndex) {
|
|
17
|
+
super('MidnightSupplyCollateral', getAddr('MidnightSupplyCollateral'), ['bytes32', 'address', 'address', 'uint256', 'uint256'], [marketId, onBehalf, from, amount, collateralIndex]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0],
|
|
20
|
+
this.args[1],
|
|
21
|
+
this.args[2],
|
|
22
|
+
this.args[3],
|
|
23
|
+
this.args[4],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightWithdrawCollateralAction
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightWithdrawCollateral
|
|
7
|
+
*/
|
|
8
|
+
export declare class MidnightWithdrawCollateralAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to withdraw tokens on behalf of.
|
|
12
|
+
* @param to Address that will receive the withdrawn tokens.
|
|
13
|
+
* @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
|
|
14
|
+
* @param collateralIndex Collateral index (0-based).
|
|
15
|
+
*/
|
|
16
|
+
constructor(marketId: bytes32, onBehalf: EthAddress, to: EthAddress, amount: uint256, collateralIndex: uint256);
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* MidnightWithdrawCollateralAction
|
|
5
|
+
*
|
|
6
|
+
* @category MidnightWithdrawCollateral
|
|
7
|
+
*/
|
|
8
|
+
export class MidnightWithdrawCollateralAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param marketId Market id.
|
|
11
|
+
* @param onBehalf Address to withdraw tokens on behalf of.
|
|
12
|
+
* @param to Address that will receive the withdrawn tokens.
|
|
13
|
+
* @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
|
|
14
|
+
* @param collateralIndex Collateral index (0-based).
|
|
15
|
+
*/
|
|
16
|
+
constructor(marketId, onBehalf, to, amount, collateralIndex) {
|
|
17
|
+
super('MidnightWithdrawCollateral', getAddr('MidnightWithdrawCollateral'), ['bytes32', 'address', 'address', 'uint256', 'uint256'], [marketId, onBehalf, to, amount, collateralIndex]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0],
|
|
20
|
+
this.args[1],
|
|
21
|
+
this.args[2],
|
|
22
|
+
this.args[3],
|
|
23
|
+
this.args[4],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -72,7 +72,6 @@ export declare const actionAddresses: {
|
|
|
72
72
|
AaveV3ATokenPayback: string;
|
|
73
73
|
AaveV3View: string;
|
|
74
74
|
AaveV3DelegateWithSig: string;
|
|
75
|
-
AaveV3DelegateCredit: string;
|
|
76
75
|
GhoClaimAAVE: string;
|
|
77
76
|
GhoUnstake: string;
|
|
78
77
|
GhoStake: string;
|
|
@@ -124,7 +123,6 @@ export declare const actionAddresses: {
|
|
|
124
123
|
FLMorphoBlue: string;
|
|
125
124
|
UniSupply: string;
|
|
126
125
|
UniWithdraw: string;
|
|
127
|
-
UniswapClaim: string;
|
|
128
126
|
UniCollectV3: string;
|
|
129
127
|
UniMintV3: string;
|
|
130
128
|
UniSupplyV3: string;
|
|
@@ -289,10 +287,17 @@ export declare const actionAddresses: {
|
|
|
289
287
|
AaveV4DelegateWithdrawWithSig: string;
|
|
290
288
|
AaveV4DelegateBorrowWithSig: string;
|
|
291
289
|
AaveV4DelegateSetUsingAsCollateralWithSig: string;
|
|
290
|
+
AaveV3DelegateCredit?: undefined;
|
|
292
291
|
AaveV3RatioTrigger?: undefined;
|
|
293
292
|
GasFeeTakerL2?: undefined;
|
|
294
293
|
AaveV3RatioCheck?: undefined;
|
|
295
294
|
MorphoBlueView?: undefined;
|
|
295
|
+
MidnightPaybackDirect?: undefined;
|
|
296
|
+
MidnightBorrowFromOrders?: undefined;
|
|
297
|
+
MidnightPaybackFromOrders?: undefined;
|
|
298
|
+
MidnightSupplyCollateral?: undefined;
|
|
299
|
+
MidnightWithdrawCollateral?: undefined;
|
|
300
|
+
MidnightView?: undefined;
|
|
296
301
|
} | {
|
|
297
302
|
DFSSell: string;
|
|
298
303
|
DFSSellNoFee: string;
|
|
@@ -329,7 +334,6 @@ export declare const actionAddresses: {
|
|
|
329
334
|
FLAaveV3: string;
|
|
330
335
|
FLBalancer: string;
|
|
331
336
|
FLAction: string;
|
|
332
|
-
FLAaveV3CarryDebt: string;
|
|
333
337
|
AaveV3RatioTrigger: string;
|
|
334
338
|
GasFeeTakerL2: string;
|
|
335
339
|
AaveV3RatioCheck: string;
|
|
@@ -428,6 +432,7 @@ export declare const actionAddresses: {
|
|
|
428
432
|
CompGetDebt?: undefined;
|
|
429
433
|
CompCollateralSwitch?: undefined;
|
|
430
434
|
FLAaveV2?: undefined;
|
|
435
|
+
FLAaveV3CarryDebt?: undefined;
|
|
431
436
|
FLDyDx?: undefined;
|
|
432
437
|
FLMaker?: undefined;
|
|
433
438
|
FLSpark?: undefined;
|
|
@@ -436,7 +441,6 @@ export declare const actionAddresses: {
|
|
|
436
441
|
FLMorphoBlue?: undefined;
|
|
437
442
|
UniSupply?: undefined;
|
|
438
443
|
UniWithdraw?: undefined;
|
|
439
|
-
UniswapClaim?: undefined;
|
|
440
444
|
DyDxWithdraw?: undefined;
|
|
441
445
|
YearnSupply?: undefined;
|
|
442
446
|
YearnWithdraw?: undefined;
|
|
@@ -586,6 +590,12 @@ export declare const actionAddresses: {
|
|
|
586
590
|
AaveV4DelegateBorrowWithSig?: undefined;
|
|
587
591
|
AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
|
|
588
592
|
MorphoBlueView?: undefined;
|
|
593
|
+
MidnightPaybackDirect?: undefined;
|
|
594
|
+
MidnightBorrowFromOrders?: undefined;
|
|
595
|
+
MidnightPaybackFromOrders?: undefined;
|
|
596
|
+
MidnightSupplyCollateral?: undefined;
|
|
597
|
+
MidnightWithdrawCollateral?: undefined;
|
|
598
|
+
MidnightView?: undefined;
|
|
589
599
|
} | {
|
|
590
600
|
DFSSell: string;
|
|
591
601
|
DFSSellNoFee: string;
|
|
@@ -618,7 +628,6 @@ export declare const actionAddresses: {
|
|
|
618
628
|
AaveV3Withdraw: string;
|
|
619
629
|
AaveV3ClaimRewards: string;
|
|
620
630
|
AaveV3DelegateWithSig: string;
|
|
621
|
-
AaveV3DelegateCredit: string;
|
|
622
631
|
CompV3Allow: string;
|
|
623
632
|
CompV3Borrow: string;
|
|
624
633
|
CompV3Claim: string;
|
|
@@ -632,7 +641,6 @@ export declare const actionAddresses: {
|
|
|
632
641
|
FLUniV3: string;
|
|
633
642
|
FLAction: string;
|
|
634
643
|
FLMorphoBlue: string;
|
|
635
|
-
FLAaveV3CarryDebt: string;
|
|
636
644
|
GasFeeTakerL2: string;
|
|
637
645
|
AaveV3RatioCheck: string;
|
|
638
646
|
UniCollectV3: string;
|
|
@@ -756,13 +764,13 @@ export declare const actionAddresses: {
|
|
|
756
764
|
CompGetDebt?: undefined;
|
|
757
765
|
CompCollateralSwitch?: undefined;
|
|
758
766
|
FLAaveV2?: undefined;
|
|
767
|
+
FLAaveV3CarryDebt?: undefined;
|
|
759
768
|
FLDyDx?: undefined;
|
|
760
769
|
FLMaker?: undefined;
|
|
761
770
|
FLSpark?: undefined;
|
|
762
771
|
FLGho?: undefined;
|
|
763
772
|
UniSupply?: undefined;
|
|
764
773
|
UniWithdraw?: undefined;
|
|
765
|
-
UniswapClaim?: undefined;
|
|
766
774
|
DyDxWithdraw?: undefined;
|
|
767
775
|
YearnSupply?: undefined;
|
|
768
776
|
YearnWithdraw?: undefined;
|
|
@@ -878,7 +886,14 @@ export declare const actionAddresses: {
|
|
|
878
886
|
AaveV4DelegateWithdrawWithSig?: undefined;
|
|
879
887
|
AaveV4DelegateBorrowWithSig?: undefined;
|
|
880
888
|
AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
|
|
889
|
+
AaveV3DelegateCredit?: undefined;
|
|
881
890
|
AaveV3RatioTrigger?: undefined;
|
|
891
|
+
MidnightPaybackDirect?: undefined;
|
|
892
|
+
MidnightBorrowFromOrders?: undefined;
|
|
893
|
+
MidnightPaybackFromOrders?: undefined;
|
|
894
|
+
MidnightSupplyCollateral?: undefined;
|
|
895
|
+
MidnightWithdrawCollateral?: undefined;
|
|
896
|
+
MidnightView?: undefined;
|
|
882
897
|
} | {
|
|
883
898
|
DFSSell: string;
|
|
884
899
|
DFSSellNoFee: string;
|
|
@@ -905,7 +920,6 @@ export declare const actionAddresses: {
|
|
|
905
920
|
FLUniV3: string;
|
|
906
921
|
FLAction: string;
|
|
907
922
|
FLMorphoBlue: string;
|
|
908
|
-
FLAaveV3CarryDebt: string;
|
|
909
923
|
AaveV3Withdraw: string;
|
|
910
924
|
AaveV3SwapBorrowRateMode: string;
|
|
911
925
|
AaveV3Supply: string;
|
|
@@ -917,7 +931,6 @@ export declare const actionAddresses: {
|
|
|
917
931
|
AaveV3ATokenPayback: string;
|
|
918
932
|
AaveV3View: string;
|
|
919
933
|
AaveV3DelegateWithSig: string;
|
|
920
|
-
AaveV3DelegateCredit: string;
|
|
921
934
|
CompV3Allow: string;
|
|
922
935
|
CompV3Borrow: string;
|
|
923
936
|
CompV3Claim: string;
|
|
@@ -952,6 +965,12 @@ export declare const actionAddresses: {
|
|
|
952
965
|
SFApproveTokens: string;
|
|
953
966
|
SummerfiUnsub: string;
|
|
954
967
|
SummerfiUnsubV2: string;
|
|
968
|
+
MidnightPaybackDirect: string;
|
|
969
|
+
MidnightBorrowFromOrders: string;
|
|
970
|
+
MidnightPaybackFromOrders: string;
|
|
971
|
+
MidnightSupplyCollateral: string;
|
|
972
|
+
MidnightWithdrawCollateral: string;
|
|
973
|
+
MidnightView: string;
|
|
955
974
|
AutomationV2Unsub?: undefined;
|
|
956
975
|
SendTokenAndUnwrap?: undefined;
|
|
957
976
|
SDaiWrap?: undefined;
|
|
@@ -1032,13 +1051,13 @@ export declare const actionAddresses: {
|
|
|
1032
1051
|
CompCollateralSwitch?: undefined;
|
|
1033
1052
|
FLAaveV2?: undefined;
|
|
1034
1053
|
FLAaveV3NoFee?: undefined;
|
|
1054
|
+
FLAaveV3CarryDebt?: undefined;
|
|
1035
1055
|
FLDyDx?: undefined;
|
|
1036
1056
|
FLMaker?: undefined;
|
|
1037
1057
|
FLSpark?: undefined;
|
|
1038
1058
|
FLGho?: undefined;
|
|
1039
1059
|
UniSupply?: undefined;
|
|
1040
1060
|
UniWithdraw?: undefined;
|
|
1041
|
-
UniswapClaim?: undefined;
|
|
1042
1061
|
UniCollectV3?: undefined;
|
|
1043
1062
|
UniMintV3?: undefined;
|
|
1044
1063
|
UniSupplyV3?: undefined;
|
|
@@ -1170,6 +1189,7 @@ export declare const actionAddresses: {
|
|
|
1170
1189
|
AaveV4DelegateWithdrawWithSig?: undefined;
|
|
1171
1190
|
AaveV4DelegateBorrowWithSig?: undefined;
|
|
1172
1191
|
AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
|
|
1192
|
+
AaveV3DelegateCredit?: undefined;
|
|
1173
1193
|
AaveV3RatioTrigger?: undefined;
|
|
1174
1194
|
AaveV3RatioCheck?: undefined;
|
|
1175
1195
|
} | {
|
|
@@ -1191,7 +1211,6 @@ export declare const actionAddresses: {
|
|
|
1191
1211
|
TokenizedVaultAdapter: string;
|
|
1192
1212
|
FLAction: string;
|
|
1193
1213
|
FLAaveV3: string;
|
|
1194
|
-
FLAaveV3CarryDebt: string;
|
|
1195
1214
|
AaveV3Withdraw: string;
|
|
1196
1215
|
AaveV3Supply: string;
|
|
1197
1216
|
AaveV3SetEMode: string;
|
|
@@ -1288,6 +1307,7 @@ export declare const actionAddresses: {
|
|
|
1288
1307
|
CompCollateralSwitch?: undefined;
|
|
1289
1308
|
FLAaveV2?: undefined;
|
|
1290
1309
|
FLAaveV3NoFee?: undefined;
|
|
1310
|
+
FLAaveV3CarryDebt?: undefined;
|
|
1291
1311
|
FLDyDx?: undefined;
|
|
1292
1312
|
FLMaker?: undefined;
|
|
1293
1313
|
FLBalancer?: undefined;
|
|
@@ -1297,7 +1317,6 @@ export declare const actionAddresses: {
|
|
|
1297
1317
|
FLMorphoBlue?: undefined;
|
|
1298
1318
|
UniSupply?: undefined;
|
|
1299
1319
|
UniWithdraw?: undefined;
|
|
1300
|
-
UniswapClaim?: undefined;
|
|
1301
1320
|
UniCollectV3?: undefined;
|
|
1302
1321
|
UniMintV3?: undefined;
|
|
1303
1322
|
UniSupplyV3?: undefined;
|
|
@@ -1465,6 +1484,12 @@ export declare const actionAddresses: {
|
|
|
1465
1484
|
GasFeeTakerL2?: undefined;
|
|
1466
1485
|
AaveV3RatioCheck?: undefined;
|
|
1467
1486
|
MorphoBlueView?: undefined;
|
|
1487
|
+
MidnightPaybackDirect?: undefined;
|
|
1488
|
+
MidnightBorrowFromOrders?: undefined;
|
|
1489
|
+
MidnightPaybackFromOrders?: undefined;
|
|
1490
|
+
MidnightSupplyCollateral?: undefined;
|
|
1491
|
+
MidnightWithdrawCollateral?: undefined;
|
|
1492
|
+
MidnightView?: undefined;
|
|
1468
1493
|
} | {
|
|
1469
1494
|
DFSSell: string;
|
|
1470
1495
|
DFSSellNoFee: string;
|
|
@@ -1484,7 +1509,6 @@ export declare const actionAddresses: {
|
|
|
1484
1509
|
TokenizedVaultAdapter: string;
|
|
1485
1510
|
FLAction: string;
|
|
1486
1511
|
FLAaveV3: string;
|
|
1487
|
-
FLAaveV3CarryDebt: string;
|
|
1488
1512
|
AaveV3Withdraw: string;
|
|
1489
1513
|
AaveV3Supply: string;
|
|
1490
1514
|
AaveV3SetEMode: string;
|
|
@@ -1594,6 +1618,7 @@ export declare const actionAddresses: {
|
|
|
1594
1618
|
CompCollateralSwitch?: undefined;
|
|
1595
1619
|
FLAaveV2?: undefined;
|
|
1596
1620
|
FLAaveV3NoFee?: undefined;
|
|
1621
|
+
FLAaveV3CarryDebt?: undefined;
|
|
1597
1622
|
FLDyDx?: undefined;
|
|
1598
1623
|
FLMaker?: undefined;
|
|
1599
1624
|
FLBalancer?: undefined;
|
|
@@ -1603,7 +1628,6 @@ export declare const actionAddresses: {
|
|
|
1603
1628
|
FLMorphoBlue?: undefined;
|
|
1604
1629
|
UniSupply?: undefined;
|
|
1605
1630
|
UniWithdraw?: undefined;
|
|
1606
|
-
UniswapClaim?: undefined;
|
|
1607
1631
|
UniCollectV3?: undefined;
|
|
1608
1632
|
UniMintV3?: undefined;
|
|
1609
1633
|
UniSupplyV3?: undefined;
|
|
@@ -1758,6 +1782,12 @@ export declare const actionAddresses: {
|
|
|
1758
1782
|
GasFeeTakerL2?: undefined;
|
|
1759
1783
|
AaveV3RatioCheck?: undefined;
|
|
1760
1784
|
MorphoBlueView?: undefined;
|
|
1785
|
+
MidnightPaybackDirect?: undefined;
|
|
1786
|
+
MidnightBorrowFromOrders?: undefined;
|
|
1787
|
+
MidnightPaybackFromOrders?: undefined;
|
|
1788
|
+
MidnightSupplyCollateral?: undefined;
|
|
1789
|
+
MidnightWithdrawCollateral?: undefined;
|
|
1790
|
+
MidnightView?: undefined;
|
|
1761
1791
|
};
|
|
1762
1792
|
};
|
|
1763
1793
|
export declare const otherAddresses: {
|