@defisaver/sdk 1.0.66-dev-1 → 1.0.66-dev-3
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/actions/basic/SellAction.js +1 -1
- package/esm/src/actions/basic/WrapEthAction.d.ts +2 -1
- package/esm/src/actions/basic/WrapEthAction.js +4 -3
- 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 +1 -1
- package/esm/src/addresses.d.ts +11 -3
- package/esm/src/addresses.js +8 -3
- package/esm/src/index.d.ts +44 -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/package.json +1 -1
- package/src/actions/basic/SellAction.ts +2 -2
- package/src/actions/flashloan/FLAction.ts +2 -2
- package/src/addresses.ts +5 -3
- package/umd/index.js +419 -349
|
@@ -27,7 +27,7 @@ export class SellAction extends ActionWithL2 {
|
|
|
27
27
|
*/
|
|
28
28
|
constructor(exchangeOrder, from, to, protocolFee = '0') {
|
|
29
29
|
requireAddress(to);
|
|
30
|
-
super('
|
|
30
|
+
super('DFSSellTEMP', getAddr('DFSSellTEMP'), [
|
|
31
31
|
['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address', 'bytes', ['address', 'address', 'address', 'uint256', 'uint256', 'bytes']],
|
|
32
32
|
'address',
|
|
33
33
|
'address',
|
|
@@ -8,8 +8,9 @@ import { uint256 } from '../../types';
|
|
|
8
8
|
export declare class WrapEthAction extends ActionWithL2 {
|
|
9
9
|
/**
|
|
10
10
|
* @param amount Wrap amount
|
|
11
|
+
* @param includeEthInTx If true, the transaction will include the ETH value in the transaction
|
|
11
12
|
*/
|
|
12
|
-
constructor(amount: uint256);
|
|
13
|
+
constructor(amount: uint256, includeEthInTx?: boolean);
|
|
13
14
|
getEthValue(): Promise<any>;
|
|
14
15
|
encodeInputs(): string;
|
|
15
16
|
}
|
|
@@ -17,13 +17,14 @@ import { getAddr } from '../../addresses';
|
|
|
17
17
|
export class WrapEthAction extends ActionWithL2 {
|
|
18
18
|
/**
|
|
19
19
|
* @param amount Wrap amount
|
|
20
|
+
* @param includeEthInTx If true, the transaction will include the ETH value in the transaction
|
|
20
21
|
*/
|
|
21
|
-
constructor(amount) {
|
|
22
|
-
super('WrapEth', getAddr('WrapEth'), ['uint256'], [amount]);
|
|
22
|
+
constructor(amount, includeEthInTx = true) {
|
|
23
|
+
super('WrapEth', getAddr('WrapEth'), ['uint256', 'bool'], [amount, includeEthInTx]);
|
|
23
24
|
}
|
|
24
25
|
getEthValue() {
|
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
return this.args[0];
|
|
27
|
+
return this.args[1] ? this.args[0] : 0;
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
encodeInputs() {
|
|
@@ -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
|
+
}
|
|
@@ -13,7 +13,7 @@ import { getAddr } from '../../addresses';
|
|
|
13
13
|
*/
|
|
14
14
|
export class FLAction extends Action {
|
|
15
15
|
constructor(specificFLAction) {
|
|
16
|
-
super('
|
|
16
|
+
super('FLActionTEMP', getAddr('FLActionTEMP'), [], []);
|
|
17
17
|
_FLAction_instances.add(this);
|
|
18
18
|
this.paramTypes = ['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'];
|
|
19
19
|
this.args = __classPrivateFieldGet(this, _FLAction_instances, "m", _FLAction_handleArgs).call(this, specificFLAction);
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const actionAddresses: {
|
|
|
20
20
|
SDaiUnwrap: string;
|
|
21
21
|
TokenizedVaultAdapter: string;
|
|
22
22
|
DFSSell: string;
|
|
23
|
+
DFSSellTEMP: string;
|
|
23
24
|
McdGenerate: string;
|
|
24
25
|
McdGive: string;
|
|
25
26
|
McdMerge: string;
|
|
@@ -97,6 +98,7 @@ export declare const actionAddresses: {
|
|
|
97
98
|
FLBalancer: string;
|
|
98
99
|
FLSpark: string;
|
|
99
100
|
FLAction: string;
|
|
101
|
+
FLActionTEMP: string;
|
|
100
102
|
FLUniV3: string;
|
|
101
103
|
FLGho: string;
|
|
102
104
|
FLMorphoBlue: string;
|
|
@@ -206,6 +208,7 @@ export declare const actionAddresses: {
|
|
|
206
208
|
ToggleSub: string;
|
|
207
209
|
TokenBalance: string;
|
|
208
210
|
TokenizedVaultAdapter: string;
|
|
211
|
+
ChangeProxyOwner: string;
|
|
209
212
|
AaveV3ATokenPayback: string;
|
|
210
213
|
AaveV3Borrow: string;
|
|
211
214
|
AaveV3CollateralSwitch: string;
|
|
@@ -230,13 +233,13 @@ export declare const actionAddresses: {
|
|
|
230
233
|
UniCreatePoolV3: string;
|
|
231
234
|
SumInputs?: undefined;
|
|
232
235
|
SubInputs?: undefined;
|
|
233
|
-
ChangeProxyOwner?: undefined;
|
|
234
236
|
AutomationV2Unsub?: undefined;
|
|
235
237
|
UpdateSub?: undefined;
|
|
236
238
|
TransferNFT?: undefined;
|
|
237
239
|
CreateSub?: undefined;
|
|
238
240
|
SDaiWrap?: undefined;
|
|
239
241
|
SDaiUnwrap?: undefined;
|
|
242
|
+
DFSSellTEMP?: undefined;
|
|
240
243
|
McdGenerate?: undefined;
|
|
241
244
|
McdGive?: undefined;
|
|
242
245
|
McdMerge?: undefined;
|
|
@@ -301,6 +304,7 @@ export declare const actionAddresses: {
|
|
|
301
304
|
FLDyDx?: undefined;
|
|
302
305
|
FLMaker?: undefined;
|
|
303
306
|
FLSpark?: undefined;
|
|
307
|
+
FLActionTEMP?: undefined;
|
|
304
308
|
FLUniV3?: undefined;
|
|
305
309
|
FLGho?: undefined;
|
|
306
310
|
FLMorphoBlue?: undefined;
|
|
@@ -400,6 +404,7 @@ export declare const actionAddresses: {
|
|
|
400
404
|
ToggleSub: string;
|
|
401
405
|
TokenBalance: string;
|
|
402
406
|
TokenizedVaultAdapter: string;
|
|
407
|
+
ChangeProxyOwner: string;
|
|
403
408
|
AaveV3ATokenPayback: string;
|
|
404
409
|
AaveV3Borrow: string;
|
|
405
410
|
AaveV3CollateralSwitch: string;
|
|
@@ -428,7 +433,6 @@ export declare const actionAddresses: {
|
|
|
428
433
|
UniCreatePoolV3: string;
|
|
429
434
|
SumInputs?: undefined;
|
|
430
435
|
SubInputs?: undefined;
|
|
431
|
-
ChangeProxyOwner?: undefined;
|
|
432
436
|
AutomationV2Unsub?: undefined;
|
|
433
437
|
UpdateSub?: undefined;
|
|
434
438
|
TransferNFT?: undefined;
|
|
@@ -436,6 +440,7 @@ export declare const actionAddresses: {
|
|
|
436
440
|
ApproveToken?: undefined;
|
|
437
441
|
SDaiWrap?: undefined;
|
|
438
442
|
SDaiUnwrap?: undefined;
|
|
443
|
+
DFSSellTEMP?: undefined;
|
|
439
444
|
McdGenerate?: undefined;
|
|
440
445
|
McdGive?: undefined;
|
|
441
446
|
McdMerge?: undefined;
|
|
@@ -501,6 +506,7 @@ export declare const actionAddresses: {
|
|
|
501
506
|
FLDyDx?: undefined;
|
|
502
507
|
FLMaker?: undefined;
|
|
503
508
|
FLSpark?: undefined;
|
|
509
|
+
FLActionTEMP?: undefined;
|
|
504
510
|
FLUniV3?: undefined;
|
|
505
511
|
FLGho?: undefined;
|
|
506
512
|
FLMorphoBlue?: undefined;
|
|
@@ -592,6 +598,7 @@ export declare const actionAddresses: {
|
|
|
592
598
|
SendToken: string;
|
|
593
599
|
PullToken: string;
|
|
594
600
|
TokenBalance: string;
|
|
601
|
+
ChangeProxyOwner: string;
|
|
595
602
|
FLAaveV3: string;
|
|
596
603
|
FLBalancer: string;
|
|
597
604
|
FLUniV3: string;
|
|
@@ -614,7 +621,6 @@ export declare const actionAddresses: {
|
|
|
614
621
|
CompV3Withdraw: string;
|
|
615
622
|
SumInputs?: undefined;
|
|
616
623
|
SubInputs?: undefined;
|
|
617
|
-
ChangeProxyOwner?: undefined;
|
|
618
624
|
AutomationV2Unsub?: undefined;
|
|
619
625
|
SendTokenAndUnwrap?: undefined;
|
|
620
626
|
ToggleSub?: undefined;
|
|
@@ -625,6 +631,7 @@ export declare const actionAddresses: {
|
|
|
625
631
|
SDaiWrap?: undefined;
|
|
626
632
|
SDaiUnwrap?: undefined;
|
|
627
633
|
TokenizedVaultAdapter?: undefined;
|
|
634
|
+
DFSSellTEMP?: undefined;
|
|
628
635
|
McdGenerate?: undefined;
|
|
629
636
|
McdGive?: undefined;
|
|
630
637
|
McdMerge?: undefined;
|
|
@@ -690,6 +697,7 @@ export declare const actionAddresses: {
|
|
|
690
697
|
FLMaker?: undefined;
|
|
691
698
|
FLSpark?: undefined;
|
|
692
699
|
FLAction?: undefined;
|
|
700
|
+
FLActionTEMP?: undefined;
|
|
693
701
|
FLGho?: undefined;
|
|
694
702
|
FLMorphoBlue?: undefined;
|
|
695
703
|
UniSupply?: undefined;
|
package/esm/src/addresses.js
CHANGED
|
@@ -21,7 +21,8 @@ export const actionAddresses = {
|
|
|
21
21
|
SDaiUnwrap: '0xe8Cb536BB96075241c4bd8f1831A8577562F2B32',
|
|
22
22
|
TokenizedVaultAdapter: '0x3944364Ce3a273D269707484F3a676fCa17E08b8',
|
|
23
23
|
// exchange
|
|
24
|
-
DFSSell: '
|
|
24
|
+
DFSSell: '0x951D7B421f45FF0e4A8ddE0288aE3f9C2C69b784',
|
|
25
|
+
DFSSellTEMP: '0x8bfc99652358884AF965324e6A233014510F0CFc',
|
|
25
26
|
// maker
|
|
26
27
|
McdGenerate: '0xCb50a91C0f12f439b8bf11E9474B9c1ED62Bf7a3',
|
|
27
28
|
McdGive: '0xf9556A87BF424834FDe7De0547b58E36Cb42EF01',
|
|
@@ -109,7 +110,8 @@ export const actionAddresses = {
|
|
|
109
110
|
FLMaker: '0x672DE08e36A1698fD5e9E34045F81558dB4c1AFE',
|
|
110
111
|
FLBalancer: '0x540a83E36E5E6Aa916A6c591934d800e17115048',
|
|
111
112
|
FLSpark: '0xe9Fe5a0f5e4B370Ae60d837da58744666D5C06F7',
|
|
112
|
-
FLAction: '
|
|
113
|
+
FLAction: '0x72915D41982DfCAf30b871290618E59C45Edba7F',
|
|
114
|
+
FLActionTEMP: '0xC2b92B6c69e5c3b6b29385C1a17FEe906e0CA910',
|
|
113
115
|
FLUniV3: '0x9CAdAC8Be718572F82B672b950c53F0b58483A35',
|
|
114
116
|
FLGho: '0xbb67b81dD080a406227A38965d0393f396ddECBc',
|
|
115
117
|
FLMorphoBlue: '0x6206C96EAc5EAC546861438A9f953B6BEa50EBAB',
|
|
@@ -234,6 +236,7 @@ export const actionAddresses = {
|
|
|
234
236
|
ToggleSub: '0x988C5C24AE6348404196267e19962f36961CAc29',
|
|
235
237
|
TokenBalance: '0xC6FF5b01f7c7b35b6e093fF70D2332B361C5Be5A',
|
|
236
238
|
TokenizedVaultAdapter: '0xdf31669FEd440f5BfF658ca0bBF0D22B8abdeb73',
|
|
239
|
+
ChangeProxyOwner: '0x62769258ea8b3a85cc6fb4332fc2760a122dbc9e',
|
|
237
240
|
// aave v3
|
|
238
241
|
AaveV3ATokenPayback: '0x71B27114D1777298bD46c3770C42F9f807C49847',
|
|
239
242
|
AaveV3Borrow: '0x8CaDc8A911D19B9e4D36c9bAdE47d970f362BcEa',
|
|
@@ -271,6 +274,7 @@ export const actionAddresses = {
|
|
|
271
274
|
ToggleSub: '0x71015226EADFd4aC887fB56556F64338e352439b',
|
|
272
275
|
TokenBalance: '0x483B903E702F60698Dd8124558C6199922737f1F',
|
|
273
276
|
TokenizedVaultAdapter: '0xD05C512bDFf6D3eAc5328807B3bC075F35271167',
|
|
277
|
+
ChangeProxyOwner: '0x29F66A5fcB601c806E7156f29FDEC771BdC9c08d',
|
|
274
278
|
// aave v3
|
|
275
279
|
AaveV3ATokenPayback: '0x261906e5E0D0D38D9cBb5c10dB9c4031aabdf8C1',
|
|
276
280
|
AaveV3Borrow: '0x5786809DA660dB613994460F096F19fcd19eD4c9',
|
|
@@ -310,6 +314,7 @@ export const actionAddresses = {
|
|
|
310
314
|
SendToken: '0x1420f4977E7B71AFddccBFc6F6e1505CefdF99F0',
|
|
311
315
|
PullToken: '0x5B0B7E38C2a8e46CfAe13c360BC5927570BeEe94',
|
|
312
316
|
TokenBalance: '0xc44bcE580B1b3339fE9272D3bC3d6566083ea59C',
|
|
317
|
+
ChangeProxyOwner: '0x1947a44d3717a47556175d64fdc208619aa08874',
|
|
313
318
|
// Flashloan
|
|
314
319
|
FLAaveV3: '0x79Eb9cEe432Cd3e7b09A9eFdB21A733A6d7b4c3A',
|
|
315
320
|
FLBalancer: '0x862E533198C9656B75bB6A5dDF0953F7ED5E8507',
|
|
@@ -337,7 +342,7 @@ export const actionAddresses = {
|
|
|
337
342
|
};
|
|
338
343
|
export const otherAddresses = {
|
|
339
344
|
[NETWORKS.ethereum.chainId]: {
|
|
340
|
-
RecipeExecutor: '
|
|
345
|
+
RecipeExecutor: '0x5029336642814bC51a42bA80BF83a6322110035D',
|
|
341
346
|
DFSRegistry: '0x287778F121F134C66212FB16c9b53eC991D32f5b',
|
|
342
347
|
DFSProxyRegistry: '0x29474FdaC7142f9aB7773B8e38264FA15E3805ed',
|
|
343
348
|
ProxyRegistry: '0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4',
|