@defisaver/automation-sdk 2.0.1 → 2.0.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/.eslintrc.js +1 -0
- package/esm/abis/index.js +27 -15
- package/esm/automation/private/Automation.js +9 -6
- package/esm/automation/private/LegacyAutomation.d.ts +5 -5
- package/esm/automation/private/LegacyAutomation.js +30 -23
- package/esm/automation/private/LegacyProtocol.js +4 -1
- package/esm/automation/private/Protocol.js +4 -1
- package/esm/automation/private/StrategiesAutomation.d.ts +2 -2
- package/esm/automation/private/StrategiesAutomation.js +27 -21
- package/esm/automation/public/ArbitrumStrategies.js +10 -4
- package/esm/automation/public/EthereumStrategies.js +10 -4
- package/esm/automation/public/OptimismStrategies.js +10 -4
- package/esm/automation/public/legacy/LegacyAaveAutomation.js +13 -7
- package/esm/automation/public/legacy/LegacyCompoundAutomation.js +13 -7
- package/esm/automation/public/legacy/LegacyMakerAutomation.js +13 -7
- package/esm/configuration.js +8 -5
- package/esm/constants/index.js +281 -265
- package/esm/index.js +57 -17
- package/esm/services/contractService.js +22 -14
- package/esm/services/ethereumService.js +18 -10
- package/esm/services/strategiesService.js +144 -100
- package/esm/services/strategySubService.d.ts +2 -0
- package/esm/services/strategySubService.js +100 -55
- package/esm/services/subDataService.d.ts +12 -0
- package/esm/services/subDataService.js +165 -127
- package/esm/services/triggerService.d.ts +8 -8
- package/esm/services/triggerService.js +125 -95
- package/esm/services/utils.js +82 -33
- package/esm/services/utils.test.d.ts +1 -0
- package/esm/services/utils.test.js +362 -0
- package/esm/types/contracts/generated/Erc20.js +2 -1
- package/esm/types/contracts/generated/Legacy_AaveV2Subscriptions.js +2 -1
- package/esm/types/contracts/generated/Legacy_AuthCheck.js +2 -1
- package/esm/types/contracts/generated/Legacy_CompoundV2Subscriptions.js +2 -1
- package/esm/types/contracts/generated/Legacy_MakerSubscriptions.js +2 -1
- package/esm/types/contracts/generated/SubStorage.js +2 -1
- package/esm/types/contracts/generated/UniMulticall.js +2 -1
- package/esm/types/contracts/generated/index.js +2 -1
- package/esm/types/contracts/generated/types.js +2 -1
- package/esm/types/enums.d.ts +9 -1
- package/esm/types/enums.js +24 -12
- package/esm/types/index.js +2 -1
- package/package.json +12 -8
- package/src/automation/private/LegacyAutomation.ts +11 -10
- package/src/automation/private/StrategiesAutomation.ts +5 -6
- package/src/configuration.ts +0 -3
- package/src/constants/index.ts +10 -0
- package/src/index.ts +0 -1
- package/src/services/ethereumService.ts +6 -6
- package/src/services/strategiesService.ts +24 -0
- package/src/services/strategySubService.ts +30 -0
- package/src/services/subDataService.ts +104 -67
- package/src/services/triggerService.ts +86 -85
- package/src/services/utils.test.ts +414 -0
- package/src/services/utils.ts +6 -7
- package/src/types/enums.ts +9 -0
- package/tsconfig.json +1 -1
- package/umd/index.js +7142 -4138
- package/src/types/typings/process.d.ts +0 -9
- package/yarn-error.log +0 -7233
|
@@ -1,101 +1,146 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.sparkEncode = exports.exchangeEncode = exports.morphoAaveV2Encode = exports.compoundV3Encode = exports.compoundV2Encode = exports.aaveV3Encode = exports.aaveV2Encode = exports.chickenBondsEncode = exports.liquityEncode = exports.makerEncode = void 0;
|
|
30
|
+
const decimal_js_1 = __importDefault(require("decimal.js"));
|
|
31
|
+
const tokens_1 = require("@defisaver/tokens");
|
|
32
|
+
const enums_1 = require("../types/enums");
|
|
33
|
+
const subDataService = __importStar(require("./subDataService"));
|
|
34
|
+
const triggerService = __importStar(require("./triggerService"));
|
|
35
|
+
const utils_1 = require("./utils");
|
|
36
|
+
exports.makerEncode = {
|
|
37
|
+
repayFromSavings(bundleId, vaultId, triggerRepayRatio, targetRepayRatio, isBundle = true, chainId = enums_1.ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
9
38
|
const subData = subDataService.makerRepayFromSavingsSubData.encode(vaultId, targetRepayRatio, chainId, daiAddr, mcdCdpManagerAddr);
|
|
10
|
-
const triggerData = triggerService.makerRatioTrigger.encode(vaultId, triggerRepayRatio, RatioState.UNDER);
|
|
39
|
+
const triggerData = triggerService.makerRatioTrigger.encode(vaultId, triggerRepayRatio, enums_1.RatioState.UNDER);
|
|
11
40
|
return [bundleId, isBundle, triggerData, subData];
|
|
12
41
|
},
|
|
13
|
-
closeOnPrice(vaultId, ratioState, price, closeToAssetAddr, chainlinkCollAddress, chainId = ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
14
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
42
|
+
closeOnPrice(vaultId, ratioState, price, closeToAssetAddr, chainlinkCollAddress, chainId = enums_1.ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
43
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
15
44
|
const subData = subDataService.makerCloseSubData.encode(vaultId, closeToAssetAddr, chainId, daiAddr, mcdCdpManagerAddr);
|
|
16
45
|
const triggerData = triggerService.chainlinkPriceTrigger.encode(chainlinkCollAddress, price, ratioState);
|
|
17
|
-
const strategyOrBundleId = compareAddresses(closeToAssetAddr, getAssetInfo('DAI', chainId).address)
|
|
18
|
-
? Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI
|
|
19
|
-
: Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL;
|
|
46
|
+
const strategyOrBundleId = (0, utils_1.compareAddresses)(closeToAssetAddr, (0, tokens_1.getAssetInfo)('DAI', chainId).address)
|
|
47
|
+
? enums_1.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_DAI
|
|
48
|
+
: enums_1.Strategies.MainnetIds.MAKER_CLOSE_ON_PRICE_TO_COLL;
|
|
20
49
|
const isBundle = false;
|
|
21
50
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
22
51
|
},
|
|
23
|
-
trailingStop(vaultId, triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
24
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
52
|
+
trailingStop(vaultId, triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = enums_1.ChainId.Ethereum, daiAddr, mcdCdpManagerAddr) {
|
|
53
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
25
54
|
const subData = subDataService.makerCloseSubData.encode(vaultId, closeToAssetAddr, chainId, daiAddr, mcdCdpManagerAddr);
|
|
26
55
|
const triggerData = triggerService.trailingStopTrigger.encode(chainlinkCollAddress, triggerPercentage, roundId);
|
|
27
|
-
const strategyOrBundleId = compareAddresses(closeToAssetAddr, getAssetInfo('DAI', chainId).address)
|
|
28
|
-
? Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI
|
|
29
|
-
: Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL;
|
|
56
|
+
const strategyOrBundleId = (0, utils_1.compareAddresses)(closeToAssetAddr, (0, tokens_1.getAssetInfo)('DAI', chainId).address)
|
|
57
|
+
? enums_1.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_DAI
|
|
58
|
+
: enums_1.Strategies.MainnetIds.MAKER_TRAILING_STOP_LOSS_TO_COLL;
|
|
30
59
|
const isBundle = false;
|
|
31
60
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
32
61
|
},
|
|
33
62
|
leverageManagement(vaultId, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
34
63
|
return [
|
|
35
64
|
vaultId,
|
|
36
|
-
new
|
|
37
|
-
new
|
|
38
|
-
new
|
|
39
|
-
new
|
|
65
|
+
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
66
|
+
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
67
|
+
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
68
|
+
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
40
69
|
boostEnabled,
|
|
41
70
|
];
|
|
42
71
|
},
|
|
43
72
|
};
|
|
44
|
-
|
|
45
|
-
closeOnPrice(priceOverOrUnder, price, closeToAssetAddr, chainlinkCollAddress, chainId = ChainId.Ethereum, collAddr, debtAddr) {
|
|
46
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
73
|
+
exports.liquityEncode = {
|
|
74
|
+
closeOnPrice(priceOverOrUnder, price, closeToAssetAddr, chainlinkCollAddress, chainId = enums_1.ChainId.Ethereum, collAddr, debtAddr) {
|
|
75
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
47
76
|
const subData = subDataService.liquityCloseSubData.encode(closeToAssetAddr, chainId, collAddr, debtAddr);
|
|
48
77
|
const triggerData = triggerService.chainlinkPriceTrigger.encode(chainlinkCollAddress, price, priceOverOrUnder);
|
|
49
|
-
const strategyOrBundleId = Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL;
|
|
78
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_CLOSE_ON_PRICE_TO_COLL;
|
|
50
79
|
const isBundle = false;
|
|
51
80
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
52
81
|
},
|
|
53
|
-
trailingStop(triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = ChainId.Ethereum, collAddr, debtAddr) {
|
|
54
|
-
requireAddresses([closeToAssetAddr, chainlinkCollAddress]);
|
|
82
|
+
trailingStop(triggerPercentage, closeToAssetAddr, chainlinkCollAddress, roundId, chainId = enums_1.ChainId.Ethereum, collAddr, debtAddr) {
|
|
83
|
+
(0, utils_1.requireAddresses)([closeToAssetAddr, chainlinkCollAddress]);
|
|
55
84
|
const subData = subDataService.liquityCloseSubData.encode(closeToAssetAddr, chainId, collAddr, debtAddr);
|
|
56
85
|
const triggerData = triggerService.trailingStopTrigger.encode(chainlinkCollAddress, triggerPercentage, roundId);
|
|
57
|
-
const strategyOrBundleId = Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL;
|
|
86
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_TRAILING_STOP_LOSS_TO_COLL;
|
|
58
87
|
const isBundle = false;
|
|
59
88
|
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
60
89
|
},
|
|
61
|
-
paybackFromChickenBondStrategySub(proxyAddress, ratio, sourceId, sourceType, ratioState = RatioState.UNDER) {
|
|
62
|
-
requireAddress(proxyAddress);
|
|
90
|
+
paybackFromChickenBondStrategySub(proxyAddress, ratio, sourceId, sourceType, ratioState = enums_1.RatioState.UNDER) {
|
|
91
|
+
(0, utils_1.requireAddress)(proxyAddress);
|
|
63
92
|
const subData = subDataService.liquityPaybackUsingChickenBondSubData.encode(sourceId, sourceType);
|
|
64
93
|
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, ratio, ratioState);
|
|
65
|
-
const strategyId = Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND;
|
|
94
|
+
const strategyId = enums_1.Bundles.MainnetIds.LIQUITY_PAYBACK_USING_CHICKEN_BOND;
|
|
66
95
|
const isBundle = true;
|
|
67
96
|
return [strategyId, isBundle, triggerData, subData];
|
|
68
97
|
},
|
|
69
98
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
70
99
|
return [
|
|
71
|
-
new
|
|
72
|
-
new
|
|
73
|
-
new
|
|
74
|
-
new
|
|
100
|
+
new decimal_js_1.default(triggerRepayRatio).mul(1e16).toString(),
|
|
101
|
+
new decimal_js_1.default(triggerBoostRatio).mul(1e16).toString(),
|
|
102
|
+
new decimal_js_1.default(targetBoostRatio).mul(1e16).toString(),
|
|
103
|
+
new decimal_js_1.default(targetRepayRatio).mul(1e16).toString(),
|
|
75
104
|
boostEnabled,
|
|
76
105
|
];
|
|
77
106
|
},
|
|
107
|
+
dsrPayback(proxyAddress, triggerRatio, targetRatio) {
|
|
108
|
+
(0, utils_1.requireAddress)(proxyAddress);
|
|
109
|
+
const subData = subDataService.liquityDsrPaybackSubData.encode(targetRatio);
|
|
110
|
+
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, triggerRatio, enums_1.RatioState.UNDER);
|
|
111
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_DSR_PAYBACK;
|
|
112
|
+
const isBundle = false;
|
|
113
|
+
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
114
|
+
},
|
|
115
|
+
dsrSupply(proxyAddress, triggerRatio, targetRatio) {
|
|
116
|
+
(0, utils_1.requireAddress)(proxyAddress);
|
|
117
|
+
const subData = subDataService.liquityDsrSupplySubData.encode(targetRatio);
|
|
118
|
+
const triggerData = triggerService.liquityRatioTrigger.encode(proxyAddress, triggerRatio, enums_1.RatioState.UNDER);
|
|
119
|
+
const strategyOrBundleId = enums_1.Strategies.MainnetIds.LIQUITY_DSR_SUPPLY;
|
|
120
|
+
const isBundle = false;
|
|
121
|
+
return [strategyOrBundleId, isBundle, triggerData, subData];
|
|
122
|
+
},
|
|
78
123
|
};
|
|
79
|
-
|
|
124
|
+
exports.chickenBondsEncode = {
|
|
80
125
|
rebond(bondId) {
|
|
81
126
|
return subDataService.cBondsRebondSubData.encode(bondId);
|
|
82
127
|
},
|
|
83
128
|
};
|
|
84
|
-
|
|
129
|
+
exports.aaveV2Encode = {
|
|
85
130
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
86
131
|
return subDataService.aaveV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
87
132
|
},
|
|
88
133
|
};
|
|
89
|
-
|
|
134
|
+
exports.aaveV3Encode = {
|
|
90
135
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
91
136
|
let subInput = '0x';
|
|
92
|
-
subInput = subInput.concat(new
|
|
137
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
93
138
|
.padStart(32, '0'));
|
|
94
|
-
subInput = subInput.concat(new
|
|
139
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
95
140
|
.padStart(32, '0'));
|
|
96
|
-
subInput = subInput.concat(new
|
|
141
|
+
subInput = subInput.concat(new decimal_js_1.default(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
97
142
|
.padStart(32, '0'));
|
|
98
|
-
subInput = subInput.concat(new
|
|
143
|
+
subInput = subInput.concat(new decimal_js_1.default(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
99
144
|
.padStart(32, '0'));
|
|
100
145
|
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
101
146
|
return subInput;
|
|
@@ -108,24 +153,24 @@ export const aaveV3Encode = {
|
|
|
108
153
|
return [strategyOrBundleId, isBundle, triggerDataEncoded, subDataEncoded];
|
|
109
154
|
},
|
|
110
155
|
};
|
|
111
|
-
|
|
156
|
+
exports.compoundV2Encode = {
|
|
112
157
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
113
158
|
return subDataService.compoundV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
114
159
|
},
|
|
115
160
|
};
|
|
116
|
-
|
|
161
|
+
exports.compoundV3Encode = {
|
|
117
162
|
leverageManagement(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA) {
|
|
118
163
|
return subDataService.compoundV3LeverageManagementSubData.encode(market, baseToken, triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled, isEOA);
|
|
119
164
|
},
|
|
120
165
|
};
|
|
121
|
-
|
|
166
|
+
exports.morphoAaveV2Encode = {
|
|
122
167
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
123
168
|
return subDataService.morphoAaveV2LeverageManagementSubData.encode(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled);
|
|
124
169
|
},
|
|
125
170
|
};
|
|
126
|
-
|
|
171
|
+
exports.exchangeEncode = {
|
|
127
172
|
dca(fromToken, toToken, amount, timestamp, interval, network) {
|
|
128
|
-
requireAddresses([fromToken, toToken]);
|
|
173
|
+
(0, utils_1.requireAddresses)([fromToken, toToken]);
|
|
129
174
|
const subData = subDataService.exchangeDcaSubData.encode(fromToken, toToken, amount, interval);
|
|
130
175
|
const triggerData = triggerService.exchangeTimestampTrigger.encode(timestamp, interval);
|
|
131
176
|
const selectedNetwork = network === 1
|
|
@@ -133,23 +178,23 @@ export const exchangeEncode = {
|
|
|
133
178
|
: network === 10
|
|
134
179
|
? 'OptimismIds'
|
|
135
180
|
: 'ArbitrumIds';
|
|
136
|
-
const strategyId = Strategies[selectedNetwork].EXCHANGE_DCA;
|
|
181
|
+
const strategyId = enums_1.Strategies[selectedNetwork].EXCHANGE_DCA;
|
|
137
182
|
return [strategyId, false, triggerData, subData];
|
|
138
183
|
},
|
|
139
184
|
limitOrder(fromToken, toToken, amount, targetPrice, goodUntil, orderType) {
|
|
140
185
|
return subDataService.exchangeLimitOrderSubData.encode(fromToken, toToken, amount, targetPrice, goodUntil, orderType);
|
|
141
186
|
},
|
|
142
187
|
};
|
|
143
|
-
|
|
188
|
+
exports.sparkEncode = {
|
|
144
189
|
leverageManagement(triggerRepayRatio, triggerBoostRatio, targetBoostRatio, targetRepayRatio, boostEnabled) {
|
|
145
190
|
let subInput = '0x';
|
|
146
|
-
subInput = subInput.concat(new
|
|
191
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerRepayRatio).mul(1e16).toHex().slice(2)
|
|
147
192
|
.padStart(32, '0'));
|
|
148
|
-
subInput = subInput.concat(new
|
|
193
|
+
subInput = subInput.concat(new decimal_js_1.default(triggerBoostRatio).mul(1e16).toHex().slice(2)
|
|
149
194
|
.padStart(32, '0'));
|
|
150
|
-
subInput = subInput.concat(new
|
|
195
|
+
subInput = subInput.concat(new decimal_js_1.default(targetBoostRatio).mul(1e16).toHex().slice(2)
|
|
151
196
|
.padStart(32, '0'));
|
|
152
|
-
subInput = subInput.concat(new
|
|
197
|
+
subInput = subInput.concat(new decimal_js_1.default(targetRepayRatio).mul(1e16).toHex().slice(2)
|
|
153
198
|
.padStart(32, '0'));
|
|
154
199
|
subInput = subInput.concat(boostEnabled ? '01' : '00');
|
|
155
200
|
return subInput;
|
|
@@ -121,3 +121,15 @@ export declare const sparkQuotePriceSubData: {
|
|
|
121
121
|
debtAssetId: number;
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
+
export declare const liquityDsrPaybackSubData: {
|
|
125
|
+
encode: (targetRatio: number) => string[];
|
|
126
|
+
decode: (subData: string[]) => {
|
|
127
|
+
targetRatio: number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export declare const liquityDsrSupplySubData: {
|
|
131
|
+
encode: (targetRatio: number) => string[];
|
|
132
|
+
decode: (subData: string[]) => {
|
|
133
|
+
targetRatio: number;
|
|
134
|
+
};
|
|
135
|
+
};
|