@gearbox-protocol/sdk 14.12.0-next.33 → 14.12.0-next.35
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/dist/cjs/abi/IWithdrawalCompressorV313.js +136 -0
- package/dist/cjs/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +24 -33
- package/dist/cjs/preview/prerequisites/buildCollateralPrerequisites.js +39 -3
- package/dist/cjs/preview/prerequisites/checkPrerequisites.js +2 -1
- package/dist/cjs/preview/preview/buildDelayedPreview.js +6 -5
- package/dist/cjs/preview/preview/previewOperation.js +4 -1
- package/dist/cjs/sdk/MultichainSDK.js +7 -0
- package/dist/cjs/sdk/OnchainSDK.js +14 -4
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +16 -3
- package/dist/cjs/sdk/accounts/index.js +2 -0
- package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +207 -0
- package/dist/cjs/sdk/accounts/liquidations/MultichainLiquidationsService.js +65 -0
- package/dist/cjs/sdk/accounts/liquidations/helpers.js +63 -0
- package/dist/cjs/sdk/accounts/liquidations/index.js +28 -0
- package/dist/cjs/sdk/accounts/liquidations/types.js +16 -0
- package/dist/cjs/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +142 -74
- package/dist/cjs/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +97 -0
- package/dist/cjs/sdk/accounts/withdrawal-compressor/createWithdrawalCompressor.js +1 -7
- package/dist/cjs/sdk/accounts/withdrawal-compressor/types.js +20 -0
- package/dist/esm/abi/IWithdrawalCompressorV313.js +136 -0
- package/dist/esm/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +24 -33
- package/dist/esm/preview/prerequisites/buildCollateralPrerequisites.js +43 -4
- package/dist/esm/preview/prerequisites/checkPrerequisites.js +2 -1
- package/dist/esm/preview/preview/buildDelayedPreview.js +6 -5
- package/dist/esm/preview/preview/previewOperation.js +4 -1
- package/dist/esm/sdk/MultichainSDK.js +7 -0
- package/dist/esm/sdk/OnchainSDK.js +16 -5
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +16 -3
- package/dist/esm/sdk/accounts/index.js +1 -0
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +188 -0
- package/dist/esm/sdk/accounts/liquidations/MultichainLiquidationsService.js +41 -0
- package/dist/esm/sdk/accounts/liquidations/helpers.js +36 -0
- package/dist/esm/sdk/accounts/liquidations/index.js +4 -0
- package/dist/esm/sdk/accounts/liquidations/types.js +0 -0
- package/dist/esm/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +138 -74
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +104 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/createWithdrawalCompressor.js +1 -7
- package/dist/esm/sdk/accounts/withdrawal-compressor/types.js +12 -0
- package/dist/types/abi/IWithdrawalCompressorV313.d.ts +200 -0
- package/dist/types/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.d.ts +7 -7
- package/dist/types/preview/prerequisites/buildCollateralPrerequisites.d.ts +1 -0
- package/dist/types/preview/prerequisites/types.d.ts +10 -2
- package/dist/types/preview/preview/buildDelayedPreview.d.ts +7 -2
- package/dist/types/sdk/MultichainSDK.d.ts +6 -0
- package/dist/types/sdk/OnchainSDK.d.ts +8 -5
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/index.d.ts +1 -0
- package/dist/types/sdk/accounts/liquidations/LiquidationsService.d.ts +20 -0
- package/dist/types/sdk/accounts/liquidations/MultichainLiquidationsService.d.ts +23 -0
- package/dist/types/sdk/accounts/liquidations/helpers.d.ts +34 -0
- package/dist/types/sdk/accounts/liquidations/index.d.ts +4 -0
- package/dist/types/sdk/accounts/liquidations/types.d.ts +172 -0
- package/dist/types/sdk/accounts/types.d.ts +6 -0
- package/dist/types/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts +80 -6
- package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.d.ts +222 -0
- package/dist/types/sdk/accounts/withdrawal-compressor/createWithdrawalCompressor.d.ts +5 -4
- package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +106 -7
- package/dist/types/sdk/types/state.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var LiquidationsService_exports = {};
|
|
20
|
+
__export(LiquidationsService_exports, {
|
|
21
|
+
LiquidationsService: () => LiquidationsService
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(LiquidationsService_exports);
|
|
24
|
+
var import_base = require("../../base/index.js");
|
|
25
|
+
var import_constants = require("../../constants/index.js");
|
|
26
|
+
var import_utils = require("../../utils/index.js");
|
|
27
|
+
var import_helpers = require("./helpers.js");
|
|
28
|
+
class LiquidationsService extends import_base.SDKConstruct {
|
|
29
|
+
/**
|
|
30
|
+
* {@inheritDoc ILiquidationsService.getLiquidatableAccounts}
|
|
31
|
+
**/
|
|
32
|
+
async getLiquidatableAccounts(props) {
|
|
33
|
+
if (props?.networks && !props.networks.includes(this.sdk.networkType)) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
await this.sdk.withdrawalCompressor?.loadWithdrawableAssets();
|
|
37
|
+
const accounts = await this.sdk.accounts.getCreditAccounts({
|
|
38
|
+
maxHealthFactor: import_constants.WAD - 1n,
|
|
39
|
+
includeZeroDebt: false
|
|
40
|
+
});
|
|
41
|
+
const seen = new import_utils.AddressSet(accounts.map((ca) => ca.creditAccount));
|
|
42
|
+
for (const ca of await this.#getExpiredCreditAccounts()) {
|
|
43
|
+
if (!seen.has(ca.creditAccount)) {
|
|
44
|
+
seen.add(ca.creditAccount);
|
|
45
|
+
accounts.push(ca);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const rows = [];
|
|
49
|
+
for (const ca of accounts) {
|
|
50
|
+
if (!ca.success) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
rows.push(this.#buildAccount(ca));
|
|
54
|
+
}
|
|
55
|
+
const allowedAssets = props?.assets?.length ? new import_utils.AddressSet(props.assets) : void 0;
|
|
56
|
+
return rows.filter((row) => {
|
|
57
|
+
if (props?.delayed !== void 0 && row.isDelayed !== props.delayed) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (allowedAssets && !allowedAssets.has(row.asset)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* {@inheritDoc ILiquidationsService.getLiquidationDetails}
|
|
68
|
+
**/
|
|
69
|
+
async getLiquidationDetails(props) {
|
|
70
|
+
const { network, creditAccount } = props;
|
|
71
|
+
if (network !== this.sdk.networkType) {
|
|
72
|
+
throw new Error(
|
|
73
|
+
`network mismatch: this SDK is attached to ${this.sdk.networkType}, requested ${network}`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
const ca = await this.sdk.accounts.getCreditAccountData(creditAccount);
|
|
77
|
+
if (!ca) {
|
|
78
|
+
throw new Error(`credit account ${creditAccount} not found`);
|
|
79
|
+
}
|
|
80
|
+
if (!ca.success) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`cannot compute liquidation details for ${creditAccount}: collateral computation failed`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const compressor = this.sdk.withdrawalCompressor;
|
|
86
|
+
await compressor?.loadWithdrawableAssets();
|
|
87
|
+
const account = this.#buildAccount(ca);
|
|
88
|
+
const receivedAssets = [];
|
|
89
|
+
for (const t of ca.tokens) {
|
|
90
|
+
if (t.balance > import_helpers.DUST_THRESHOLD && !compressor?.getWithdrawalSourceToken(t.token)) {
|
|
91
|
+
receivedAssets.push({
|
|
92
|
+
isDelayed: false,
|
|
93
|
+
token: t.token,
|
|
94
|
+
amount: t.balance
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (account.isDelayed && compressor) {
|
|
99
|
+
const { claimable, pending } = await compressor.getCurrentWithdrawals(creditAccount);
|
|
100
|
+
for (const w of claimable) {
|
|
101
|
+
for (const o of w.outputs) {
|
|
102
|
+
receivedAssets.push({
|
|
103
|
+
isDelayed: true,
|
|
104
|
+
token: o.token,
|
|
105
|
+
amount: o.amount,
|
|
106
|
+
sourceToken: w.token
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
for (const w of pending) {
|
|
111
|
+
for (const o of w.expectedOutputs) {
|
|
112
|
+
receivedAssets.push({
|
|
113
|
+
isDelayed: true,
|
|
114
|
+
token: o.token,
|
|
115
|
+
amount: o.amount,
|
|
116
|
+
sourceToken: w.token,
|
|
117
|
+
claimableAt: w.claimableAt
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { ...account, receivedAssets };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Accounts of expired credit managers with outstanding debt are liquidatable
|
|
126
|
+
* regardless of their health factor.
|
|
127
|
+
**/
|
|
128
|
+
async #getExpiredCreditAccounts() {
|
|
129
|
+
const expiredCMs = [];
|
|
130
|
+
for (const market of this.sdk.marketRegister.markets) {
|
|
131
|
+
if (market.pool.pool.totalBorrowed === 0n) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
for (const cm of market.creditManagers) {
|
|
135
|
+
const borrowed = market.pool.pool.creditManagerDebtParams.get(cm.creditManager.address)?.borrowed ?? 0n;
|
|
136
|
+
if (cm.isExpired && borrowed > 0n) {
|
|
137
|
+
expiredCMs.push(cm.creditManager.address);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (expiredCMs.length === 0) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
this.logger?.debug(
|
|
145
|
+
`getting credit accounts of ${expiredCMs.length} expired credit managers`
|
|
146
|
+
);
|
|
147
|
+
const result = [];
|
|
148
|
+
for (const creditManager of expiredCMs) {
|
|
149
|
+
const accounts = await this.sdk.accounts.getCreditAccounts({
|
|
150
|
+
creditManager,
|
|
151
|
+
includeZeroDebt: false
|
|
152
|
+
});
|
|
153
|
+
result.push(...accounts);
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Requires the compressor's withdrawable assets cache to be loaded
|
|
159
|
+
* (see `loadWithdrawableAssets`) so that phantom token lookups are sync.
|
|
160
|
+
**/
|
|
161
|
+
#buildAccount(ca) {
|
|
162
|
+
const compressor = this.sdk.withdrawalCompressor;
|
|
163
|
+
const suite = this.sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
164
|
+
const market = suite.market;
|
|
165
|
+
const meta = this.sdk.tokensMeta.get(suite.underlying);
|
|
166
|
+
const unwrappedUnderlying = meta && this.sdk.tokensMeta.isRWAUnderlying(meta) ? meta.asset : suite.underlying;
|
|
167
|
+
const liquidationDiscount = suite.isExpired ? suite.creditManager.liquidationDiscountExpired : suite.creditManager.liquidationDiscount;
|
|
168
|
+
let asset = (0, import_helpers.pickMainAsset)(ca, (token, balance) => {
|
|
169
|
+
try {
|
|
170
|
+
return market.priceOracle.convert(token, market.underlying, balance);
|
|
171
|
+
} catch {
|
|
172
|
+
return 0n;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
if (asset) {
|
|
176
|
+
asset = compressor?.getWithdrawalSourceToken(asset) ?? asset;
|
|
177
|
+
} else {
|
|
178
|
+
asset = unwrappedUnderlying;
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
creditAccount: ca.creditAccount,
|
|
182
|
+
creditManager: ca.creditManager,
|
|
183
|
+
network: this.sdk.networkType,
|
|
184
|
+
asset,
|
|
185
|
+
totalValue: {
|
|
186
|
+
token: unwrappedUnderlying,
|
|
187
|
+
balance: ca.totalValue
|
|
188
|
+
},
|
|
189
|
+
totalValueUSD: ca.totalValueUSD,
|
|
190
|
+
repaymentAmount: {
|
|
191
|
+
token: unwrappedUnderlying,
|
|
192
|
+
balance: (0, import_helpers.calcRepaymentAmount)(ca.totalValue, liquidationDiscount)
|
|
193
|
+
},
|
|
194
|
+
estimatedProfit: {
|
|
195
|
+
token: unwrappedUnderlying,
|
|
196
|
+
balance: (0, import_helpers.calcEstimatedProfit)(ca.totalValue, liquidationDiscount)
|
|
197
|
+
},
|
|
198
|
+
isDelayed: ca.tokens.some(
|
|
199
|
+
(t) => t.balance > import_helpers.DUST_THRESHOLD && !!compressor?.getWithdrawalSourceToken(t.token)
|
|
200
|
+
)
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
205
|
+
0 && (module.exports = {
|
|
206
|
+
LiquidationsService
|
|
207
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var MultichainLiquidationsService_exports = {};
|
|
20
|
+
__export(MultichainLiquidationsService_exports, {
|
|
21
|
+
MultichainLiquidationsService: () => MultichainLiquidationsService
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(MultichainLiquidationsService_exports);
|
|
24
|
+
class MultichainLiquidationsService {
|
|
25
|
+
#sdk;
|
|
26
|
+
constructor(sdk) {
|
|
27
|
+
this.#sdk = sdk;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* {@inheritDoc ILiquidationsService.getLiquidatableAccounts}
|
|
31
|
+
**/
|
|
32
|
+
async getLiquidatableAccounts(props) {
|
|
33
|
+
const chains = [...this.#sdk.chains.entries()].filter(
|
|
34
|
+
([network]) => !props?.networks || props.networks.includes(network)
|
|
35
|
+
);
|
|
36
|
+
const results = await Promise.allSettled(
|
|
37
|
+
chains.map(
|
|
38
|
+
([, chainSdk]) => chainSdk.liquidations.getLiquidatableAccounts(props)
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
const accounts = [];
|
|
42
|
+
results.forEach((result, i) => {
|
|
43
|
+
const [network, chainSdk] = chains[i];
|
|
44
|
+
if (result.status === "fulfilled") {
|
|
45
|
+
accounts.push(...result.value);
|
|
46
|
+
} else {
|
|
47
|
+
chainSdk.logger?.warn(
|
|
48
|
+
result.reason,
|
|
49
|
+
`failed to get liquidatable accounts on ${network}`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return accounts;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* {@inheritDoc ILiquidationsService.getLiquidationDetails}
|
|
57
|
+
**/
|
|
58
|
+
async getLiquidationDetails(props) {
|
|
59
|
+
return this.#sdk.chain(props.network).liquidations.getLiquidationDetails(props);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
MultichainLiquidationsService
|
|
65
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var helpers_exports = {};
|
|
20
|
+
__export(helpers_exports, {
|
|
21
|
+
DUST_THRESHOLD: () => DUST_THRESHOLD,
|
|
22
|
+
calcEstimatedProfit: () => calcEstimatedProfit,
|
|
23
|
+
calcRepaymentAmount: () => calcRepaymentAmount,
|
|
24
|
+
pickMainAsset: () => pickMainAsset
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
27
|
+
var import_constants = require("../../constants/index.js");
|
|
28
|
+
var import_utils = require("../../utils/index.js");
|
|
29
|
+
const DUST_THRESHOLD = 10n;
|
|
30
|
+
function calcRepaymentAmount(totalValue, liquidationDiscount) {
|
|
31
|
+
return totalValue * BigInt(liquidationDiscount) / import_constants.PERCENTAGE_FACTOR;
|
|
32
|
+
}
|
|
33
|
+
function calcEstimatedProfit(totalValue, liquidationDiscount) {
|
|
34
|
+
return totalValue * (import_constants.PERCENTAGE_FACTOR - BigInt(liquidationDiscount)) / import_constants.PERCENTAGE_FACTOR;
|
|
35
|
+
}
|
|
36
|
+
function pickMainAsset(ca, convert) {
|
|
37
|
+
let bestValue = 0n;
|
|
38
|
+
let bestToken;
|
|
39
|
+
for (const t of ca.tokens) {
|
|
40
|
+
if ((0, import_utils.hexEq)(t.token, ca.underlying)) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if ((t.mask & ca.enabledTokensMask) === 0n) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (t.balance <= DUST_THRESHOLD) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const value = convert(t.token, t.balance);
|
|
50
|
+
if (value > bestValue) {
|
|
51
|
+
bestValue = value;
|
|
52
|
+
bestToken = t.token;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return bestToken;
|
|
56
|
+
}
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
DUST_THRESHOLD,
|
|
60
|
+
calcEstimatedProfit,
|
|
61
|
+
calcRepaymentAmount,
|
|
62
|
+
pickMainAsset
|
|
63
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var liquidations_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(liquidations_exports);
|
|
18
|
+
__reExport(liquidations_exports, require("./helpers.js"), module.exports);
|
|
19
|
+
__reExport(liquidations_exports, require("./LiquidationsService.js"), module.exports);
|
|
20
|
+
__reExport(liquidations_exports, require("./MultichainLiquidationsService.js"), module.exports);
|
|
21
|
+
__reExport(liquidations_exports, require("./types.js"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("./helpers.js"),
|
|
25
|
+
...require("./LiquidationsService.js"),
|
|
26
|
+
...require("./MultichainLiquidationsService.js"),
|
|
27
|
+
...require("./types.js")
|
|
28
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(types_exports);
|