@defisaver/automation-sdk 3.1.10 → 3.1.14-spark-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/cjs/automation/private/StrategiesAutomation.d.ts +5 -3
- package/cjs/automation/private/StrategiesAutomation.js +27 -10
- package/cjs/automation/private/StrategiesAutomation.test.js +25 -0
- package/cjs/constants/index.d.ts +1 -0
- package/cjs/constants/index.js +352 -11
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +1 -1
- package/cjs/services/ethereumService.js +21 -14
- package/cjs/services/ethereumService.test.js +3 -0
- package/cjs/services/strategiesService.js +329 -54
- package/cjs/services/strategiesService.test.js +1 -0
- package/cjs/services/strategySubService.d.ts +24 -5
- package/cjs/services/strategySubService.js +116 -10
- package/cjs/services/strategySubService.test.js +1049 -173
- package/cjs/services/subDataService.d.ts +361 -88
- package/cjs/services/subDataService.js +799 -249
- package/cjs/services/subDataService.test.js +1287 -142
- package/cjs/services/triggerService.d.ts +100 -9
- package/cjs/services/triggerService.js +188 -19
- package/cjs/services/triggerService.test.js +437 -46
- package/cjs/services/utils.d.ts +1 -1
- package/cjs/services/utils.js +10 -2
- package/cjs/services/utils.test.js +0 -77
- package/cjs/types/enums.d.ts +88 -12
- package/cjs/types/enums.js +78 -2
- package/cjs/types/index.d.ts +59 -1
- package/esm/automation/private/StrategiesAutomation.d.ts +5 -3
- package/esm/automation/private/StrategiesAutomation.js +27 -10
- package/esm/automation/private/StrategiesAutomation.test.js +25 -0
- package/esm/constants/index.d.ts +1 -0
- package/esm/constants/index.js +351 -10
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -2
- package/esm/services/ethereumService.js +21 -14
- package/esm/services/ethereumService.test.js +3 -0
- package/esm/services/strategiesService.js +330 -55
- package/esm/services/strategiesService.test.js +1 -0
- package/esm/services/strategySubService.d.ts +24 -5
- package/esm/services/strategySubService.js +115 -9
- package/esm/services/strategySubService.test.js +1052 -176
- package/esm/services/subDataService.d.ts +361 -88
- package/esm/services/subDataService.js +799 -249
- package/esm/services/subDataService.test.js +1288 -143
- package/esm/services/triggerService.d.ts +100 -9
- package/esm/services/triggerService.js +187 -18
- package/esm/services/triggerService.test.js +438 -47
- package/esm/services/utils.d.ts +1 -1
- package/esm/services/utils.js +10 -2
- package/esm/services/utils.test.js +1 -52
- package/esm/types/enums.d.ts +88 -12
- package/esm/types/enums.js +78 -2
- package/esm/types/index.d.ts +59 -1
- package/package.json +4 -5
- package/src/automation/private/StrategiesAutomation.test.ts +40 -0
- package/src/automation/private/StrategiesAutomation.ts +38 -15
- package/src/constants/index.ts +353 -11
- package/src/index.ts +4 -2
- package/src/services/ethereumService.test.ts +3 -0
- package/src/services/ethereumService.ts +23 -16
- package/src/services/strategiesService.test.ts +1 -0
- package/src/services/strategiesService.ts +387 -72
- package/src/services/strategySubService.test.ts +1330 -316
- package/src/services/strategySubService.ts +365 -12
- package/src/services/subDataService.test.ts +1413 -170
- package/src/services/subDataService.ts +1148 -431
- package/src/services/triggerService.test.ts +482 -52
- package/src/services/triggerService.ts +272 -27
- package/src/services/utils.test.ts +0 -59
- package/src/services/utils.ts +15 -4
- package/src/types/enums.ts +78 -2
- package/src/types/index.ts +74 -1
- package/umd/index.js +0 -34219
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
import type { EthereumAddress } from '../types';
|
|
2
2
|
import type { CloseStrategyType, OrderType } from '../types/enums';
|
|
3
3
|
import { ChainId, RatioState } from '../types/enums';
|
|
4
|
+
/**
|
|
5
|
+
_______ _______ .______ .______ _______ ______ ___ .___________. _______ _______
|
|
6
|
+
| \ | ____|| _ \ | _ \ | ____| / | / \ | || ____|| \
|
|
7
|
+
| .--. || |__ | |_) | | |_) | | |__ | ,----' / ^ \ `---| |----`| |__ | .--. |
|
|
8
|
+
| | | || __| | ___/ | / | __| | | / /_\ \ | | | __| | | | |
|
|
9
|
+
| '--' || |____ | | | |\ \----.| |____ | `----./ _____ \ | | | |____ | '--' |
|
|
10
|
+
|_______/ |_______|| _| | _| `._____||_______| \______/__/ \__\ |__| |_______||_______/
|
|
11
|
+
*/
|
|
12
|
+
export declare const morphoAaveV2LeverageManagementSubData: {
|
|
13
|
+
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
14
|
+
decode(subData: string[]): {
|
|
15
|
+
targetRatio: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const cBondsRebondSubData: {
|
|
19
|
+
encode(bondId: number | string): string[];
|
|
20
|
+
decode(subData: string[]): {
|
|
21
|
+
bondId: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const liquityPaybackUsingChickenBondSubData: {
|
|
25
|
+
/**
|
|
26
|
+
* @param sourceId bondId or subId
|
|
27
|
+
* @param sourceType 0 for bond, 1 for subId
|
|
28
|
+
* @param chainId
|
|
29
|
+
*/
|
|
30
|
+
encode: (sourceId: string, sourceType: number, chainId?: ChainId) => string[];
|
|
31
|
+
decode: (subData: string[]) => {
|
|
32
|
+
sourceId: string;
|
|
33
|
+
sourceType: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
.___ ___. ___ __ ___ _______ .______
|
|
38
|
+
| \/ | / \ | |/ / | ____|| _ \
|
|
39
|
+
| \ / | / ^ \ | ' / | |__ | |_) |
|
|
40
|
+
| |\/| | / /_\ \ | < | __| | /
|
|
41
|
+
| | | | / _____ \ | . \ | |____ | |\ \----.
|
|
42
|
+
|__| |__| /__/ \__\ |__|\__\ |_______|| _| `._____|
|
|
43
|
+
*/
|
|
4
44
|
export declare const makerRepayFromSavingsSubData: {
|
|
5
45
|
encode(vaultId: number, targetRatioPercentage: number, chainId: ChainId, daiAddr?: EthereumAddress, mcdCdpManagerAddr?: EthereumAddress): string[];
|
|
6
46
|
decode(subData: string[]): {
|
|
@@ -10,11 +50,6 @@ export declare const makerRepayFromSavingsSubData: {
|
|
|
10
50
|
targetRatio: number;
|
|
11
51
|
};
|
|
12
52
|
};
|
|
13
|
-
export declare const liquityRepayFromSavingsSubData: {
|
|
14
|
-
decode(subData: string[]): {
|
|
15
|
-
targetRatio: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
53
|
export declare const makerCloseSubData: {
|
|
19
54
|
encode(vaultId: number, closeToAssetAddr: EthereumAddress, chainId: ChainId, daiAddr?: EthereumAddress, mcdCdpManagerAddr?: EthereumAddress): string[];
|
|
20
55
|
decode(subData: string[]): {
|
|
@@ -28,6 +63,27 @@ export declare const makerLeverageManagementSubData: {
|
|
|
28
63
|
targetRatio: number;
|
|
29
64
|
};
|
|
30
65
|
};
|
|
66
|
+
export declare const makerLeverageManagementWithoutSubProxy: {
|
|
67
|
+
encode(vaultId: number, targetRatio: number, daiAddr?: EthereumAddress): string[];
|
|
68
|
+
decode(subData: string[]): {
|
|
69
|
+
vaultId: number;
|
|
70
|
+
targetRatio: number;
|
|
71
|
+
daiAddr: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
__ __ ______ __ __ __ .___________.____ ____ ____ ____ __
|
|
76
|
+
| | | | / __ \ | | | | | | | |\ \ / / \ \ / / /_ |
|
|
77
|
+
| | | | | | | | | | | | | | `---| |----` \ \/ / \ \/ / | |
|
|
78
|
+
| | | | | | | | | | | | | | | | \_ _/ \ / | |
|
|
79
|
+
| `----.| | | `--' '--.| `--' | | | | | | | \ / | |
|
|
80
|
+
|_______||__| \_____\_____\\______/ |__| |__| |__| \__/ |_|
|
|
81
|
+
*/
|
|
82
|
+
export declare const liquityRepayFromSavingsSubData: {
|
|
83
|
+
decode(subData: string[]): {
|
|
84
|
+
targetRatio: number;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
31
87
|
export declare const liquityLeverageManagementSubData: {
|
|
32
88
|
decode: (subData: string[]) => {
|
|
33
89
|
targetRatio: number;
|
|
@@ -40,17 +96,142 @@ export declare const liquityCloseSubData: {
|
|
|
40
96
|
debtAddr: string;
|
|
41
97
|
};
|
|
42
98
|
};
|
|
99
|
+
export declare const liquityDsrPaybackSubData: {
|
|
100
|
+
encode: (targetRatio: number) => string[];
|
|
101
|
+
decode: (subData: string[]) => {
|
|
102
|
+
targetRatio: number;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export declare const liquityDsrSupplySubData: {
|
|
106
|
+
encode: (targetRatio: number) => string[];
|
|
107
|
+
decode: (subData: string[]) => {
|
|
108
|
+
targetRatio: number;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export declare const liquityDebtInFrontRepaySubData: {
|
|
112
|
+
encode: (targetRatioIncrease: number) => string[];
|
|
113
|
+
decode: (subData: string[]) => {
|
|
114
|
+
targetRatioIncrease: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* __ __ ______ __ __ __ .___________.____ ____ ____ ____ ___
|
|
119
|
+
| | | | / __ \ | | | | | | | |\ \ / / \ \ / / |__ \
|
|
120
|
+
| | | | | | | | | | | | | | `---| |----` \ \/ / \ \/ / ) |
|
|
121
|
+
| | | | | | | | | | | | | | | | \_ _/ \ / / /
|
|
122
|
+
| `----.| | | `--' '--.| `--' | | | | | | | \ / / /_
|
|
123
|
+
|_______||__| \_____\_____\\______/ |__| |__| |__| \__/ |____|
|
|
124
|
+
*/
|
|
125
|
+
export declare const liquityV2LeverageManagementSubData: {
|
|
126
|
+
encode: (market: EthereumAddress, troveId: string, collToken: EthereumAddress, boldToken: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
127
|
+
decode: (subData: string[]) => {
|
|
128
|
+
market: string;
|
|
129
|
+
troveId: string;
|
|
130
|
+
collToken: string;
|
|
131
|
+
boldToken: string;
|
|
132
|
+
ratioState: RatioState;
|
|
133
|
+
targetRatio: number;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export declare const liquityV2CloseSubData: {
|
|
137
|
+
encode(market: EthereumAddress, troveId: string, collToken: EthereumAddress, boldToken: EthereumAddress, closeType: CloseStrategyType): string[];
|
|
138
|
+
decode(subData: string[]): {
|
|
139
|
+
market: EthereumAddress;
|
|
140
|
+
troveId: string;
|
|
141
|
+
collToken: EthereumAddress;
|
|
142
|
+
boldToken: EthereumAddress;
|
|
143
|
+
closeType: CloseStrategyType;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export declare const liquityV2LeverageManagementOnPriceSubData: {
|
|
147
|
+
encode(market: EthereumAddress, troveId: string, collToken: EthereumAddress, boldToken: EthereumAddress, targetRatio: number, isRepayOnPrice: boolean): string[];
|
|
148
|
+
decode(subData: string[]): {
|
|
149
|
+
market: EthereumAddress;
|
|
150
|
+
troveId: string;
|
|
151
|
+
collToken: EthereumAddress;
|
|
152
|
+
boldToken: EthereumAddress;
|
|
153
|
+
targetRatio: number;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
export declare const liquityV2PaybackSubData: {
|
|
157
|
+
encode: (market: EthereumAddress, troveId: string, boldToken: EthereumAddress, targetRatio: number, ratioState: RatioState) => string[];
|
|
158
|
+
decode: (subData: string[]) => {
|
|
159
|
+
market: string;
|
|
160
|
+
troveId: string;
|
|
161
|
+
boldToken: string;
|
|
162
|
+
ratioState: RatioState;
|
|
163
|
+
targetRatio: number;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
___ ___ ____ ____ _______ ____ ____ ___
|
|
168
|
+
/ \ / \ \ \ / / | ____| \ \ / / |__ \
|
|
169
|
+
/ ^ \ / ^ \ \ \/ / | |__ \ \/ / ) |
|
|
170
|
+
/ /_\ \ / /_\ \ \ / | __| \ / / /
|
|
171
|
+
/ _____ \ / _____ \ \ / | |____ \ / / /_
|
|
172
|
+
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |____|
|
|
173
|
+
*/
|
|
43
174
|
export declare const aaveV2LeverageManagementSubData: {
|
|
44
175
|
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
45
176
|
decode(subData: string[]): {
|
|
46
177
|
targetRatio: number;
|
|
47
178
|
};
|
|
48
179
|
};
|
|
180
|
+
/**
|
|
181
|
+
___ ___ ____ ____ _______ ____ ____ ____
|
|
182
|
+
/ \ / \ \ \ / / | ____| \ \ / / |___ \
|
|
183
|
+
/ ^ \ / ^ \ \ \/ / | |__ \ \/ / __) |
|
|
184
|
+
/ /_\ \ / /_\ \ \ / | __| \ / |__ <
|
|
185
|
+
/ _____ \ / _____ \ \ / | |____ \ / ___) |
|
|
186
|
+
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |____/
|
|
187
|
+
*/
|
|
49
188
|
export declare const aaveV3LeverageManagementSubData: {
|
|
50
189
|
decode(subData: string[]): {
|
|
51
190
|
targetRatio: number;
|
|
52
191
|
};
|
|
53
192
|
};
|
|
193
|
+
export declare const aaveV3LeverageManagementSubDataWithoutSubProxy: {
|
|
194
|
+
encode(targetRatio: number, ratioState: RatioState, market: EthereumAddress, user: EthereumAddress, isGeneric: boolean): string[];
|
|
195
|
+
decode(subData: string[]): {
|
|
196
|
+
targetRatio: number;
|
|
197
|
+
ratioState: RatioState;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
export declare const aaveV3LeverageManagementOnPriceGeneric: {
|
|
201
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number, user: EthereumAddress): string[];
|
|
202
|
+
decode(subData: string[]): {
|
|
203
|
+
collAsset: EthereumAddress;
|
|
204
|
+
collAssetId: number;
|
|
205
|
+
debtAsset: EthereumAddress;
|
|
206
|
+
debtAssetId: number;
|
|
207
|
+
marketAddr: EthereumAddress;
|
|
208
|
+
targetRatio: number;
|
|
209
|
+
owner: EthereumAddress;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
export declare const aaveV3CloseGenericSubData: {
|
|
213
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, closeType: CloseStrategyType, marketAddr: EthereumAddress, user: EthereumAddress): string[];
|
|
214
|
+
decode(subData: string[]): {
|
|
215
|
+
collAsset: EthereumAddress;
|
|
216
|
+
collAssetId: number;
|
|
217
|
+
debtAsset: EthereumAddress;
|
|
218
|
+
debtAssetId: number;
|
|
219
|
+
closeType: CloseStrategyType;
|
|
220
|
+
marketAddr: EthereumAddress;
|
|
221
|
+
owner: EthereumAddress;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
export declare const aaveV3CollateralSwitchSubData: {
|
|
225
|
+
encode(fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, marketAddr: EthereumAddress, amountToSwitch: string, useOnBehalf?: boolean): string[];
|
|
226
|
+
decode(subData: string[]): {
|
|
227
|
+
fromAsset: EthereumAddress;
|
|
228
|
+
fromAssetId: number;
|
|
229
|
+
toAsset: EthereumAddress;
|
|
230
|
+
toAssetId: number;
|
|
231
|
+
marketAddr: EthereumAddress;
|
|
232
|
+
amountToSwitch: string;
|
|
233
|
+
};
|
|
234
|
+
};
|
|
54
235
|
export declare const aaveV3QuotePriceSubData: {
|
|
55
236
|
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, nullAddress?: EthereumAddress): string[];
|
|
56
237
|
decode(subData: string[]): {
|
|
@@ -60,12 +241,93 @@ export declare const aaveV3QuotePriceSubData: {
|
|
|
60
241
|
debtAssetId: number;
|
|
61
242
|
};
|
|
62
243
|
};
|
|
244
|
+
export declare const aaveV3LeverageManagementOnPriceSubData: {
|
|
245
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number): string[];
|
|
246
|
+
decode(subData: string[]): {
|
|
247
|
+
collAsset: EthereumAddress;
|
|
248
|
+
collAssetId: number;
|
|
249
|
+
debtAsset: EthereumAddress;
|
|
250
|
+
debtAssetId: number;
|
|
251
|
+
marketAddr: EthereumAddress;
|
|
252
|
+
targetRatio: number;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* ___ ___ ____ ____ _______ ____ ____ _ _
|
|
257
|
+
/ \ / \ \ \ / / | ____| \ \ / / | || |
|
|
258
|
+
/ ^ \ / ^ \ \ \/ / | |__ \ \/ / | || |_
|
|
259
|
+
/ /_\ \ / /_\ \ \ / | __| \ / |__ _|
|
|
260
|
+
/ _____ \ / _____ \ \ / | |____ \ / | |
|
|
261
|
+
/__/ \__\ /__/ \__\ \__/ |_______| \__/ |_|
|
|
262
|
+
*/
|
|
263
|
+
export declare const aaveV4LeverageManagementSubData: {
|
|
264
|
+
encode: (spoke: EthereumAddress, owner: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
265
|
+
decode: (subData: string[]) => {
|
|
266
|
+
spoke: string;
|
|
267
|
+
owner: string;
|
|
268
|
+
ratioState: RatioState;
|
|
269
|
+
targetRatio: number;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
export declare const aaveV4LeverageManagementOnPriceSubData: {
|
|
273
|
+
encode: (spoke: EthereumAddress, owner: EthereumAddress, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, ratioState: RatioState, targetRatio: number) => string[];
|
|
274
|
+
decode: (subData: string[]) => {
|
|
275
|
+
spoke: string;
|
|
276
|
+
owner: string;
|
|
277
|
+
collAsset: string;
|
|
278
|
+
collAssetId: number;
|
|
279
|
+
debtAsset: string;
|
|
280
|
+
debtAssetId: number;
|
|
281
|
+
ratioState: RatioState;
|
|
282
|
+
targetRatio: number;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
export declare const aaveV4CloseSubData: {
|
|
286
|
+
encode: (spoke: EthereumAddress, owner: EthereumAddress, collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, closeType: CloseStrategyType) => string[];
|
|
287
|
+
decode: (subData: string[]) => {
|
|
288
|
+
spoke: string;
|
|
289
|
+
owner: string;
|
|
290
|
+
collAsset: string;
|
|
291
|
+
collAssetId: number;
|
|
292
|
+
debtAsset: string;
|
|
293
|
+
debtAssetId: number;
|
|
294
|
+
closeType: CloseStrategyType;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
export declare const aaveV4CollateralSwitchSubData: {
|
|
298
|
+
encode: (spoke: EthereumAddress, owner: EthereumAddress, fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, amountToSwitch: string) => string[];
|
|
299
|
+
decode: (subData: string[]) => {
|
|
300
|
+
spoke: string;
|
|
301
|
+
owner: string;
|
|
302
|
+
fromAsset: string;
|
|
303
|
+
fromAssetId: number;
|
|
304
|
+
toAsset: string;
|
|
305
|
+
toAssetId: number;
|
|
306
|
+
amountToSwitch: string;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
______ ______ .___ ___. .______ ____ ____ ___
|
|
311
|
+
/ | / __ \ | \/ | | _ \ \ \ / / |__ \
|
|
312
|
+
| ,----'| | | | | \ / | | |_) | \ \/ / ) |
|
|
313
|
+
| | | | | | | |\/| | | ___/ \ / / /
|
|
314
|
+
| `----.| `--' | | | | | | | \ / / /_
|
|
315
|
+
\______| \______/ |__| |__| | _| \__/ |____|
|
|
316
|
+
*/
|
|
63
317
|
export declare const compoundV2LeverageManagementSubData: {
|
|
64
318
|
encode(triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string[];
|
|
65
319
|
decode(subData: string[]): {
|
|
66
320
|
targetRatio: number;
|
|
67
321
|
};
|
|
68
322
|
};
|
|
323
|
+
/**
|
|
324
|
+
______ ______ .___ ___. .______ ____ ____ ____
|
|
325
|
+
/ | / __ \ | \/ | | _ \ \ \ / / |___ \
|
|
326
|
+
| ,----'| | | | | \ / | | |_) | \ \/ / __) |
|
|
327
|
+
| | | | | | | |\/| | | ___/ \ / |__ <
|
|
328
|
+
| `----.| `--' | | | | | | | \ / ___) |
|
|
329
|
+
\______| \______/ |__| |__| | _| \__/ |____/
|
|
330
|
+
*/
|
|
69
331
|
export declare const compoundV3LeverageManagementSubData: {
|
|
70
332
|
encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string[];
|
|
71
333
|
decode(subData: string[]): {
|
|
@@ -73,35 +335,40 @@ export declare const compoundV3LeverageManagementSubData: {
|
|
|
73
335
|
};
|
|
74
336
|
};
|
|
75
337
|
export declare const compoundV3L2LeverageManagementSubData: {
|
|
76
|
-
encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean): string;
|
|
338
|
+
encode(market: EthereumAddress, baseToken: EthereumAddress, triggerRepayRatio: number, triggerBoostRatio: number, targetBoostRatio: number, targetRepayRatio: number, boostEnabled: boolean, isEOA: boolean): string;
|
|
77
339
|
decode(subData: string[]): {
|
|
78
340
|
targetRatio: number;
|
|
79
341
|
};
|
|
80
342
|
};
|
|
81
|
-
export declare const
|
|
82
|
-
encode(
|
|
343
|
+
export declare const compoundV3LeverageManagementOnPriceSubData: {
|
|
344
|
+
encode(market: EthereumAddress, collToken: EthereumAddress, baseToken: EthereumAddress, targetRatio: number, ratioState: RatioState, user: EthereumAddress): string[];
|
|
83
345
|
decode(subData: string[]): {
|
|
346
|
+
market: EthereumAddress;
|
|
347
|
+
collToken: EthereumAddress;
|
|
348
|
+
baseToken: EthereumAddress;
|
|
84
349
|
targetRatio: number;
|
|
350
|
+
ratioState: RatioState;
|
|
351
|
+
owner: EthereumAddress;
|
|
85
352
|
};
|
|
86
353
|
};
|
|
87
|
-
export declare const
|
|
88
|
-
encode(
|
|
354
|
+
export declare const compoundV3CloseSubData: {
|
|
355
|
+
encode(market: EthereumAddress, collToken: EthereumAddress, baseToken: EthereumAddress, closeType: CloseStrategyType, user: EthereumAddress): string[];
|
|
89
356
|
decode(subData: string[]): {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* @param sourceId bondId or subId
|
|
96
|
-
* @param sourceType 0 for bond, 1 for subId
|
|
97
|
-
* @param chainId
|
|
98
|
-
*/
|
|
99
|
-
encode: (sourceId: string, sourceType: number, chainId?: ChainId) => string[];
|
|
100
|
-
decode: (subData: string[]) => {
|
|
101
|
-
sourceId: string;
|
|
102
|
-
sourceType: string;
|
|
357
|
+
market: EthereumAddress;
|
|
358
|
+
collToken: EthereumAddress;
|
|
359
|
+
baseToken: EthereumAddress;
|
|
360
|
+
closeType: CloseStrategyType;
|
|
361
|
+
owner: EthereumAddress;
|
|
103
362
|
};
|
|
104
363
|
};
|
|
364
|
+
/**
|
|
365
|
+
__________ ___ ______ __ __ ___ .__ __. _______ _______
|
|
366
|
+
| ____\ \ / / / || | | | / \ | \ | | / _____|| ____|
|
|
367
|
+
| |__ \ V / | ,----'| |__| | / ^ \ | \| | | | __ | |__
|
|
368
|
+
| __| > < | | | __ | / /_\ \ | . ` | | | |_ | | __|
|
|
369
|
+
| |____ / . \ | `----.| | | | / _____ \ | |\ | | |__| | | |____
|
|
370
|
+
|_______/__/ \__\ \______||__| |__| /__/ \__\ |__| \__| \______| |_______|
|
|
371
|
+
*/
|
|
105
372
|
export declare const exchangeDcaSubData: {
|
|
106
373
|
encode: (fromToken: EthereumAddress, toToken: EthereumAddress, amount: string, interval: number) => string[];
|
|
107
374
|
decode: (subData: string[], chainId: ChainId) => {
|
|
@@ -119,38 +386,68 @@ export declare const exchangeLimitOrderSubData: {
|
|
|
119
386
|
amount: string;
|
|
120
387
|
};
|
|
121
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
_______..______ ___ .______ __ ___
|
|
391
|
+
/ || _ \ / \ | _ \ | |/ /
|
|
392
|
+
| (----`| |_) | / ^ \ | |_) | | ' /
|
|
393
|
+
\ \ | ___/ / /_\ \ | / | <
|
|
394
|
+
.----) | | | / _____ \ | |\ \----.| . \
|
|
395
|
+
|_______/ | _| /__/ \__\ | _| `._____||__|\__\
|
|
396
|
+
*/
|
|
122
397
|
export declare const sparkLeverageManagementSubData: {
|
|
123
398
|
decode(subData: string[]): {
|
|
124
399
|
targetRatio: number;
|
|
125
400
|
};
|
|
126
401
|
};
|
|
127
|
-
export declare const
|
|
128
|
-
encode(
|
|
402
|
+
export declare const sparkLeverageManagementSubDataWithoutSubProxy: {
|
|
403
|
+
encode(targetRatio: number, ratioState: RatioState): string[];
|
|
404
|
+
decode(subData: string[]): {
|
|
405
|
+
targetRatio: number;
|
|
406
|
+
ratioState: RatioState;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
export declare const sparkCloseGenericSubData: {
|
|
410
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, closeType: CloseStrategyType, marketAddr: EthereumAddress, user: EthereumAddress): string[];
|
|
129
411
|
decode(subData: string[]): {
|
|
130
412
|
collAsset: EthereumAddress;
|
|
131
413
|
collAssetId: number;
|
|
132
414
|
debtAsset: EthereumAddress;
|
|
133
415
|
debtAssetId: number;
|
|
416
|
+
closeType: CloseStrategyType;
|
|
417
|
+
marketAddr: EthereumAddress;
|
|
418
|
+
owner: EthereumAddress;
|
|
134
419
|
};
|
|
135
420
|
};
|
|
136
|
-
export declare const
|
|
137
|
-
encode:
|
|
138
|
-
decode
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
decode: (subData: string[]) => {
|
|
421
|
+
export declare const sparkLeverageManagementOnPriceSubData: {
|
|
422
|
+
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number): string[];
|
|
423
|
+
decode(subData: string[]): {
|
|
424
|
+
collAsset: EthereumAddress;
|
|
425
|
+
collAssetId: number;
|
|
426
|
+
debtAsset: EthereumAddress;
|
|
427
|
+
debtAssetId: number;
|
|
428
|
+
marketAddr: EthereumAddress;
|
|
145
429
|
targetRatio: number;
|
|
146
430
|
};
|
|
147
431
|
};
|
|
148
|
-
export declare const
|
|
149
|
-
encode:
|
|
150
|
-
decode
|
|
151
|
-
|
|
432
|
+
export declare const sparkCollateralSwitchSubData: {
|
|
433
|
+
encode(fromAsset: EthereumAddress, fromAssetId: number, toAsset: EthereumAddress, toAssetId: number, marketAddr: EthereumAddress, amountToSwitch: string, useOnBehalf?: boolean): string[];
|
|
434
|
+
decode(subData: string[]): {
|
|
435
|
+
fromAsset: EthereumAddress;
|
|
436
|
+
fromAssetId: number;
|
|
437
|
+
toAsset: EthereumAddress;
|
|
438
|
+
toAssetId: number;
|
|
439
|
+
marketAddr: EthereumAddress;
|
|
440
|
+
amountToSwitch: string;
|
|
152
441
|
};
|
|
153
442
|
};
|
|
443
|
+
/**
|
|
444
|
+
______ .______ ____ ____ __ __ _______. _______
|
|
445
|
+
/ || _ \ \ \ / / | | | | / || \
|
|
446
|
+
| ,----'| |_) | \ \/ / | | | | | (----`| .--. |
|
|
447
|
+
| | | / \ / | | | | \ \ | | | |
|
|
448
|
+
| `----.| |\ \----. \ / | `--' | .----) | | '--' |
|
|
449
|
+
\______|| _| `._____| \__/ \______/ |_______/ |_______/
|
|
450
|
+
*/
|
|
154
451
|
export declare const crvUSDLeverageManagementSubData: {
|
|
155
452
|
encode: (controllerAddr: EthereumAddress, ratioState: RatioState, targetRatio: number, collTokenAddr: EthereumAddress, crvUSDAddr: EthereumAddress) => string[];
|
|
156
453
|
decode: (subData: string[]) => {
|
|
@@ -167,6 +464,14 @@ export declare const crvUSDPaybackSubData: {
|
|
|
167
464
|
paybackAmount: string;
|
|
168
465
|
};
|
|
169
466
|
};
|
|
467
|
+
/**
|
|
468
|
+
.___ ___. ______ .______ .______ __ __ ______
|
|
469
|
+
| \/ | / __ \ | _ \ | _ \ | | | | / __ \
|
|
470
|
+
| \ / | | | | | | |_) | | |_) | | |__| | | | | |
|
|
471
|
+
| |\/| | | | | | | / | ___/ | __ | | | | |
|
|
472
|
+
| | | | | `--' | | |\ \----.| | | | | | | `--' |
|
|
473
|
+
|__| |__| \______/ | _| `._____|| _| |__| |__| \______/
|
|
474
|
+
*/
|
|
170
475
|
export declare const morphoBlueLeverageManagementSubData: {
|
|
171
476
|
encode: (loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, ratioState: RatioState, targetRatio: number, user: EthereumAddress, isEOA: boolean) => string[];
|
|
172
477
|
decode: (subData: string[]) => {
|
|
@@ -179,48 +484,6 @@ export declare const morphoBlueLeverageManagementSubData: {
|
|
|
179
484
|
targetRatio: number;
|
|
180
485
|
};
|
|
181
486
|
};
|
|
182
|
-
export declare const aaveV3LeverageManagementOnPriceSubData: {
|
|
183
|
-
encode(collAsset: EthereumAddress, collAssetId: number, debtAsset: EthereumAddress, debtAssetId: number, marketAddr: EthereumAddress, targetRatio: number): string[];
|
|
184
|
-
decode(subData: string[]): {
|
|
185
|
-
collAsset: EthereumAddress;
|
|
186
|
-
collAssetId: number;
|
|
187
|
-
debtAsset: EthereumAddress;
|
|
188
|
-
debtAssetId: number;
|
|
189
|
-
marketAddr: EthereumAddress;
|
|
190
|
-
targetRatio: number;
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
export declare const liquityV2LeverageManagementSubData: {
|
|
194
|
-
encode: (market: EthereumAddress, troveId: string, collToken: EthereumAddress, boldToken: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
195
|
-
decode: (subData: string[]) => {
|
|
196
|
-
market: string;
|
|
197
|
-
troveId: string;
|
|
198
|
-
collToken: string;
|
|
199
|
-
boldToken: string;
|
|
200
|
-
ratioState: RatioState;
|
|
201
|
-
targetRatio: number;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
export declare const liquityV2CloseSubData: {
|
|
205
|
-
encode(market: EthereumAddress, troveId: string, collToken: EthereumAddress, boldToken: EthereumAddress, closeType: CloseStrategyType): string[];
|
|
206
|
-
decode(subData: string[]): {
|
|
207
|
-
market: EthereumAddress;
|
|
208
|
-
troveId: string;
|
|
209
|
-
collToken: EthereumAddress;
|
|
210
|
-
boldToken: EthereumAddress;
|
|
211
|
-
closeType: CloseStrategyType;
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
export declare const liquityV2LeverageManagementOnPriceSubData: {
|
|
215
|
-
encode(market: EthereumAddress, troveId: string, collToken: EthereumAddress, boldToken: EthereumAddress, targetRatio: number, isRepayOnPrice: boolean): string[];
|
|
216
|
-
decode(subData: string[]): {
|
|
217
|
-
market: EthereumAddress;
|
|
218
|
-
troveId: string;
|
|
219
|
-
collToken: EthereumAddress;
|
|
220
|
-
boldToken: EthereumAddress;
|
|
221
|
-
targetRatio: number;
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
487
|
export declare const morphoBlueLeverageManagementOnPriceSubData: {
|
|
225
488
|
encode(loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, targetRatio: number, user: EthereumAddress): string[];
|
|
226
489
|
decode(subData: string[]): {
|
|
@@ -233,16 +496,26 @@ export declare const morphoBlueLeverageManagementOnPriceSubData: {
|
|
|
233
496
|
user: string;
|
|
234
497
|
};
|
|
235
498
|
};
|
|
236
|
-
export declare const
|
|
237
|
-
encode:
|
|
238
|
-
decode
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
499
|
+
export declare const morphoBlueCloseOnPriceSubData: {
|
|
500
|
+
encode(loanToken: EthereumAddress, collToken: EthereumAddress, oracle: EthereumAddress, irm: EthereumAddress, lltv: string, user: EthereumAddress, closeType: CloseStrategyType): string[];
|
|
501
|
+
decode(subData: string[]): {
|
|
502
|
+
loanToken: string;
|
|
503
|
+
collToken: string;
|
|
504
|
+
oracle: string;
|
|
505
|
+
irm: string;
|
|
506
|
+
lltv: string;
|
|
507
|
+
user: string;
|
|
508
|
+
closeType: CloseStrategyType;
|
|
244
509
|
};
|
|
245
510
|
};
|
|
511
|
+
/**
|
|
512
|
+
_______ __ __ __ __ _______
|
|
513
|
+
| ____|| | | | | | | | | \
|
|
514
|
+
| |__ | | | | | | | | | .--. |
|
|
515
|
+
| __| | | | | | | | | | | | |
|
|
516
|
+
| | | `----.| `--' | | | | '--' |
|
|
517
|
+
|__| |_______| \______/ |__| |_______/
|
|
518
|
+
*/
|
|
246
519
|
export declare const fluidLeverageManagementSubData: {
|
|
247
520
|
encode: (nftId: string, vault: EthereumAddress, ratioState: RatioState, targetRatio: number) => string[];
|
|
248
521
|
decode: (subData: string[]) => {
|