@gearbox-protocol/sdk 16.3.0-next.5 → 16.3.0-next.6
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/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/history/trace/extractTransfers.js +1 -1
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/onchain/base/TokensMeta.js +3 -3
- package/dist/esm/onchain/core/createAddressProvider.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/onchain/market/rwa/createDegenNFT.js +1 -1
- package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/onchain/preview/preview/previewPoolPositionOperation.js +2 -2
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/plugins/bots/BotsPlugin.js +0 -107
- package/dist/cjs/plugins/bots/PartialLiquidationBotV310Contract.js +0 -47
- package/dist/cjs/plugins/bots/abi/iPartialLiquidationBotV310.js +0 -225
- package/dist/cjs/plugins/bots/abi/index.js +0 -3
- package/dist/cjs/plugins/bots/config.js +0 -39
- package/dist/cjs/plugins/bots/deserializePartialLiquidationBotParams.js +0 -39
- package/dist/cjs/plugins/bots/index.js +0 -17
- package/dist/cjs/plugins/bots/package.json +0 -1
- package/dist/cjs/plugins/bots/types.js +0 -28
- package/dist/cjs/plugins/degen-distributors/DegenDistributorsPlugin.js +0 -61
- package/dist/cjs/plugins/degen-distributors/index.js +0 -4
- package/dist/cjs/plugins/degen-distributors/package.json +0 -1
- package/dist/cjs/plugins/degen-distributors/types.js +0 -1
- package/dist/cjs/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +0 -114
- package/dist/cjs/plugins/delayed-withdrawal/index.js +0 -4
- package/dist/cjs/plugins/delayed-withdrawal/package.json +0 -1
- package/dist/cjs/plugins/delayed-withdrawal/types.js +0 -1
- package/dist/esm/plugins/bots/BotsPlugin.js +0 -106
- package/dist/esm/plugins/bots/PartialLiquidationBotV310Contract.js +0 -46
- package/dist/esm/plugins/bots/abi/iPartialLiquidationBotV310.js +0 -224
- package/dist/esm/plugins/bots/abi/index.js +0 -2
- package/dist/esm/plugins/bots/config.js +0 -34
- package/dist/esm/plugins/bots/deserializePartialLiquidationBotParams.js +0 -35
- package/dist/esm/plugins/bots/index.js +0 -7
- package/dist/esm/plugins/bots/package.json +0 -1
- package/dist/esm/plugins/bots/types.js +0 -26
- package/dist/esm/plugins/degen-distributors/DegenDistributorsPlugin.js +0 -60
- package/dist/esm/plugins/degen-distributors/index.js +0 -3
- package/dist/esm/plugins/degen-distributors/package.json +0 -1
- package/dist/esm/plugins/degen-distributors/types.js +0 -1
- package/dist/esm/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +0 -113
- package/dist/esm/plugins/delayed-withdrawal/index.js +0 -3
- package/dist/esm/plugins/delayed-withdrawal/package.json +0 -1
- package/dist/esm/plugins/delayed-withdrawal/types.js +0 -1
- package/dist/types/plugins/bots/BotsPlugin.d.ts +0 -18
- package/dist/types/plugins/bots/PartialLiquidationBotV310Contract.d.ts +0 -216
- package/dist/types/plugins/bots/abi/iPartialLiquidationBotV310.d.ts +0 -193
- package/dist/types/plugins/bots/abi/index.d.ts +0 -2
- package/dist/types/plugins/bots/config.d.ts +0 -12
- package/dist/types/plugins/bots/deserializePartialLiquidationBotParams.d.ts +0 -7
- package/dist/types/plugins/bots/index.d.ts +0 -7
- package/dist/types/plugins/bots/types.d.ts +0 -53
- package/dist/types/plugins/degen-distributors/DegenDistributorsPlugin.d.ts +0 -25
- package/dist/types/plugins/degen-distributors/index.d.ts +0 -3
- package/dist/types/plugins/degen-distributors/types.d.ts +0 -8
- package/dist/types/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.d.ts +0 -25
- package/dist/types/plugins/delayed-withdrawal/index.d.ts +0 -3
- package/dist/types/plugins/delayed-withdrawal/types.d.ts +0 -10
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import "../../onchain/constants/bot-permissions.js";
|
|
2
|
-
import "../../onchain/index.js";
|
|
3
|
-
//#region src/plugins/bots/config.ts
|
|
4
|
-
const PARTIAL_LIQUIDATION_BOT_CONFIGS = {
|
|
5
|
-
Mainnet: [{
|
|
6
|
-
minHealthFactor: 10300,
|
|
7
|
-
maxHealthFactor: 10700,
|
|
8
|
-
premiumScaleFactor: 1e4,
|
|
9
|
-
feeScaleFactor: 1e4
|
|
10
|
-
}],
|
|
11
|
-
Monad: [{
|
|
12
|
-
minHealthFactor: 10300,
|
|
13
|
-
maxHealthFactor: 10700,
|
|
14
|
-
premiumScaleFactor: 1e4,
|
|
15
|
-
feeScaleFactor: 1e4
|
|
16
|
-
}],
|
|
17
|
-
Plasma: [{
|
|
18
|
-
minHealthFactor: 10300,
|
|
19
|
-
maxHealthFactor: 10700,
|
|
20
|
-
premiumScaleFactor: 1e4,
|
|
21
|
-
feeScaleFactor: 1e4
|
|
22
|
-
}]
|
|
23
|
-
};
|
|
24
|
-
const PARTIAL_LIQUIDATION_BOT_SALT = "GEARBOX";
|
|
25
|
-
const PARTIAL_LIQUIDATION_BOT_DEPLOYER = "0xc93155E0a835Cf4E17a19463Fa67ed43c164d06a";
|
|
26
|
-
const LEGACY_MIGRATION_BOT = {
|
|
27
|
-
address: "0x286Fe53994f5668D56538Aa10eaa3Ac36f878e9C".toLowerCase(),
|
|
28
|
-
previewer: "0x6523B8c9daB92eea7944a79b4Dbb598c7934DCca".toLowerCase(),
|
|
29
|
-
version: 310,
|
|
30
|
-
baseType: "LEGACY_MIGRATION"
|
|
31
|
-
};
|
|
32
|
-
const PERMISSION_BY_TYPE = { LEGACY_MIGRATION: BigInt(65604) };
|
|
33
|
-
//#endregion
|
|
34
|
-
export { LEGACY_MIGRATION_BOT, PARTIAL_LIQUIDATION_BOT_CONFIGS, PARTIAL_LIQUIDATION_BOT_DEPLOYER, PARTIAL_LIQUIDATION_BOT_SALT, PERMISSION_BY_TYPE };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { decodeAbiParameters } from "viem";
|
|
2
|
-
//#region src/plugins/bots/deserializePartialLiquidationBotParams.ts
|
|
3
|
-
function deserializePartialLiquidationBotParams(params) {
|
|
4
|
-
const [treasury, minHealthFactor, maxHealthFactor, premiumScaleFactor, feeScaleFactor] = decodeAbiParameters([
|
|
5
|
-
{
|
|
6
|
-
name: "treasury",
|
|
7
|
-
type: "address"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
name: "minHealthFactor",
|
|
11
|
-
type: "uint16"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: "maxHealthFactor",
|
|
15
|
-
type: "uint16"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
name: "premiumScaleFactor",
|
|
19
|
-
type: "uint16"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "feeScaleFactor",
|
|
23
|
-
type: "uint16"
|
|
24
|
-
}
|
|
25
|
-
], params.serializedParams);
|
|
26
|
-
return {
|
|
27
|
-
treasury,
|
|
28
|
-
minHealthFactor,
|
|
29
|
-
maxHealthFactor,
|
|
30
|
-
premiumScaleFactor,
|
|
31
|
-
feeScaleFactor
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { deserializePartialLiquidationBotParams as default };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { iPartialLiquidationBotV310Abi } from "./abi/iPartialLiquidationBotV310.js";
|
|
2
|
-
import { LEGACY_MIGRATION_BOT, PARTIAL_LIQUIDATION_BOT_CONFIGS, PARTIAL_LIQUIDATION_BOT_DEPLOYER, PARTIAL_LIQUIDATION_BOT_SALT, PERMISSION_BY_TYPE } from "./config.js";
|
|
3
|
-
import "./abi/index.js";
|
|
4
|
-
import { BOT_PARAMS_ABI, BOT_PARTIAL_LIQUIDATION } from "./types.js";
|
|
5
|
-
import { PartialLiquidationBotV310Contract } from "./PartialLiquidationBotV310Contract.js";
|
|
6
|
-
import { BotsPlugin } from "./BotsPlugin.js";
|
|
7
|
-
export { BOT_PARAMS_ABI, BOT_PARTIAL_LIQUIDATION, BotsPlugin, LEGACY_MIGRATION_BOT, PARTIAL_LIQUIDATION_BOT_CONFIGS, PARTIAL_LIQUIDATION_BOT_DEPLOYER, PARTIAL_LIQUIDATION_BOT_SALT, PERMISSION_BY_TYPE, PartialLiquidationBotV310Contract, iPartialLiquidationBotV310Abi };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type": "module","sideEffects":false}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/bots/types.ts
|
|
2
|
-
const BOT_PARTIAL_LIQUIDATION = "BOT::PARTIAL_LIQUIDATION";
|
|
3
|
-
const BOT_PARAMS_ABI = [
|
|
4
|
-
{
|
|
5
|
-
type: "address",
|
|
6
|
-
name: "treasury"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
type: "uint16",
|
|
10
|
-
name: "minHealthFactor"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
type: "uint16",
|
|
14
|
-
name: "maxHealthFactor"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
type: "uint16",
|
|
18
|
-
name: "premiumScaleFactor"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: "uint16",
|
|
22
|
-
name: "feeScaleFactor"
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
//#endregion
|
|
26
|
-
export { BOT_PARAMS_ABI, BOT_PARTIAL_LIQUIDATION };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { AddressMap } from "../../onchain/utils/AddressMap.js";
|
|
2
|
-
import { MarketConfiguratorContract } from "../../onchain/market/MarketConfiguratorContract.js";
|
|
3
|
-
import { BasePlugin } from "../../onchain/plugins/BasePlugin.js";
|
|
4
|
-
import "../../onchain/index.js";
|
|
5
|
-
//#region src/plugins/degen-distributors/DegenDistributorsPlugin.ts
|
|
6
|
-
const MAP_LABEL = "degenDistributors";
|
|
7
|
-
var DegenDistributorsPlugin = class extends BasePlugin {
|
|
8
|
-
#distributors;
|
|
9
|
-
async load(force) {
|
|
10
|
-
if (!force && this.loaded) return this.state;
|
|
11
|
-
const configurators = Object.values(this.sdk.marketRegister.markets.reduce((acc, market) => {
|
|
12
|
-
const cfgLC = market.configurator.address.toLowerCase();
|
|
13
|
-
acc[cfgLC] = market.configurator;
|
|
14
|
-
return acc;
|
|
15
|
-
}, {}));
|
|
16
|
-
this.sdk.logger?.debug(`loading degen distributors for ${this.sdk.networkType}`);
|
|
17
|
-
const distributors = await MarketConfiguratorContract.getPeripheryContractBatch(Object.values(configurators), this.sdk.client, "DEGEN_DISTRIBUTOR", this.sdk.currentBlock);
|
|
18
|
-
const distributorByConfigurator = configurators.reduce((acc, cfg, index) => {
|
|
19
|
-
const cfgLC = cfg.address.toLowerCase();
|
|
20
|
-
acc[cfgLC] = distributors[index];
|
|
21
|
-
return acc;
|
|
22
|
-
}, {});
|
|
23
|
-
this.#distributors = new AddressMap(void 0, MAP_LABEL);
|
|
24
|
-
this.sdk.marketRegister.markets.forEach((m) => {
|
|
25
|
-
const pool = m.pool.pool.address;
|
|
26
|
-
const cfg = m.configurator.address;
|
|
27
|
-
const cfgLC = cfg.toLowerCase();
|
|
28
|
-
const r = distributorByConfigurator?.[cfgLC];
|
|
29
|
-
if (r.status === "success" && r.result.length > 0) this.#distributors?.upsert(pool, r.result[0]);
|
|
30
|
-
else this.sdk.logger?.warn(`failed to load degen distributor for market configurator ${this.labelAddress(cfg)} and pool ${this.labelAddress(pool)}: ${r.error}`);
|
|
31
|
-
});
|
|
32
|
-
return this.state;
|
|
33
|
-
}
|
|
34
|
-
get loaded() {
|
|
35
|
-
return !!this.#distributors;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Returns a map of pool addresses to degen distributor addresses
|
|
39
|
-
* @throws if degen distributor plugin is not attached
|
|
40
|
-
*/
|
|
41
|
-
get distributors() {
|
|
42
|
-
if (!this.#distributors) throw new Error("degen distributor plugin not attached");
|
|
43
|
-
return this.#distributors;
|
|
44
|
-
}
|
|
45
|
-
stateHuman(_) {
|
|
46
|
-
return this.distributors.entries().flatMap(([pool, distributor]) => ({
|
|
47
|
-
address: distributor,
|
|
48
|
-
version: this.version,
|
|
49
|
-
pool
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
get state() {
|
|
53
|
-
return { distributors: this.distributors.asRecord() };
|
|
54
|
-
}
|
|
55
|
-
hydrate(state) {
|
|
56
|
-
this.#distributors = new AddressMap(Object.entries(state.distributors), MAP_LABEL);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
//#endregion
|
|
60
|
-
export { DegenDistributorsPlugin };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type": "module","sideEffects":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { AddressMap } from "../../onchain/utils/AddressMap.js";
|
|
2
|
-
import { BasePlugin } from "../../onchain/plugins/BasePlugin.js";
|
|
3
|
-
import "../../onchain/index.js";
|
|
4
|
-
//#region src/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.ts
|
|
5
|
-
const MAP_LABEL = "delayedWithdrawal";
|
|
6
|
-
var DelayedWithdrawalPlugin = class extends BasePlugin {
|
|
7
|
-
async load(force) {
|
|
8
|
-
if (!force && this.loaded) return this.state;
|
|
9
|
-
await this.sdk.withdrawalCompressor?.loadWithdrawableAssets(force);
|
|
10
|
-
return this.state;
|
|
11
|
-
}
|
|
12
|
-
get loaded() {
|
|
13
|
-
return !!this.sdk.withdrawalCompressor?.state;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Returns a map of cmAddress -> array of delayed assets
|
|
17
|
-
* @throws if withdrawable assets have not been loaded
|
|
18
|
-
*/
|
|
19
|
-
get withdrawableAssets() {
|
|
20
|
-
const compressor = this.sdk.withdrawalCompressor;
|
|
21
|
-
if (!compressor?.state) throw new Error("withdrawable assets are not loaded");
|
|
22
|
-
const result = new AddressMap(void 0, MAP_LABEL);
|
|
23
|
-
for (const cfg of compressor.getWithdrawableAssets()) {
|
|
24
|
-
const assets = result.get(cfg.creditManager) ?? [];
|
|
25
|
-
assets.push({
|
|
26
|
-
...cfg,
|
|
27
|
-
disabled: isConfigToOmit({
|
|
28
|
-
creditManager: cfg.creditManager,
|
|
29
|
-
token: cfg.token,
|
|
30
|
-
withdrawalPhantomToken: cfg.withdrawalPhantomToken,
|
|
31
|
-
underlying: cfg.underlying
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
result.upsert(cfg.creditManager, assets);
|
|
35
|
-
}
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
stateHuman(_) {
|
|
39
|
-
return this.withdrawableAssets.values().flatMap((cm) => {
|
|
40
|
-
return cm.map((a) => {
|
|
41
|
-
return {
|
|
42
|
-
address: a.creditManager,
|
|
43
|
-
version: this.version,
|
|
44
|
-
...a
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
get state() {
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
function getConfigKey(config) {
|
|
54
|
-
return `${config.creditManager}-${config.token}-${config.withdrawalPhantomToken}-${config.underlying}`.toLowerCase();
|
|
55
|
-
}
|
|
56
|
-
function isConfigToOmit(config) {
|
|
57
|
-
return !!CONFIGS_TO_OMIT_RECORD[getConfigKey(config)];
|
|
58
|
-
}
|
|
59
|
-
const CONFIGS_TO_OMIT_RECORD = [
|
|
60
|
-
{
|
|
61
|
-
creditManager: "0xf5edc34204e67e592bdcb84114571c9e4bd0bdf7",
|
|
62
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
63
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
64
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
creditManager: "0xb79d6544839d169869476589d2e54014a074317b",
|
|
68
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
69
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
70
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
creditManager: "0x79c6c1ce5b12abcc3e407ce8c160ee1160250921",
|
|
74
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
75
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
76
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
creditManager: "0xc307a074bd5aec2d6ad1d9b74465c24a59b490fd",
|
|
80
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
81
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
82
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
creditManager: "0x9a0fdf7cdab4604fc27ebeab4b3d57bd825e8ebe",
|
|
86
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
87
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
88
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
creditManager: "0x06c0df5ac1f24bc2097b59ed8ee1db86bf0b09df",
|
|
92
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
93
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
94
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
creditManager: "0x1128860755c6d452d9326e35d1672ca7c920b7c1",
|
|
98
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
99
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
100
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
creditManager: "0x35e154be3c856c37d539aae90178fe5ac6d37644",
|
|
104
|
-
token: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
|
|
105
|
-
withdrawalPhantomToken: "0x6252467C2FefB61cB55180282943139BAeEA36c5",
|
|
106
|
-
underlying: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
|
|
107
|
-
}
|
|
108
|
-
].reduce((acc, config) => {
|
|
109
|
-
acc[getConfigKey(config)] = config;
|
|
110
|
-
return acc;
|
|
111
|
-
}, {});
|
|
112
|
-
//#endregion
|
|
113
|
-
export { DelayedWithdrawalPlugin };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type": "module","sideEffects":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BasePlugin } from "../../onchain/plugins/BasePlugin.js";
|
|
2
|
-
import { IOnchainSDKPlugin } from "../../onchain/plugins/types.js";
|
|
3
|
-
import "../../onchain/index.js";
|
|
4
|
-
import { BotsPluginState, BotsPluginStateHuman, MigrationBotState } from "./types.js";
|
|
5
|
-
import { PartialLiquidationBotV310Contract } from "./PartialLiquidationBotV310Contract.js";
|
|
6
|
-
//#region src/plugins/bots/BotsPlugin.d.ts
|
|
7
|
-
declare class BotsPlugin extends BasePlugin<BotsPluginState> implements IOnchainSDKPlugin<BotsPluginState> {
|
|
8
|
-
#private;
|
|
9
|
-
get loaded(): boolean;
|
|
10
|
-
get bots(): PartialLiquidationBotV310Contract[];
|
|
11
|
-
load(force?: boolean): Promise<BotsPluginState>;
|
|
12
|
-
stateHuman(raw?: boolean): BotsPluginStateHuman;
|
|
13
|
-
get state(): BotsPluginState;
|
|
14
|
-
hydrate(state: BotsPluginState): void;
|
|
15
|
-
static getMigrationBotData(chainId: number): MigrationBotState | undefined;
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { BotsPlugin };
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { OnchainSDK } from "../../onchain/OnchainSDK.js";
|
|
2
|
-
import { BaseContract } from "../../onchain/base/BaseContract.js";
|
|
3
|
-
import "../../onchain/index.js";
|
|
4
|
-
import { BotStateV310Human } from "./types.js";
|
|
5
|
-
import { Address, Hex } from "viem";
|
|
6
|
-
//#region src/plugins/bots/PartialLiquidationBotV310Contract.d.ts
|
|
7
|
-
declare const abi: readonly [{
|
|
8
|
-
readonly type: "function";
|
|
9
|
-
readonly name: "contractType";
|
|
10
|
-
readonly inputs: readonly [];
|
|
11
|
-
readonly outputs: readonly [{
|
|
12
|
-
readonly name: "";
|
|
13
|
-
readonly type: "bytes32";
|
|
14
|
-
readonly internalType: "bytes32";
|
|
15
|
-
}];
|
|
16
|
-
readonly stateMutability: "view";
|
|
17
|
-
}, {
|
|
18
|
-
readonly type: "function";
|
|
19
|
-
readonly name: "feeScaleFactor";
|
|
20
|
-
readonly inputs: readonly [];
|
|
21
|
-
readonly outputs: readonly [{
|
|
22
|
-
readonly name: "";
|
|
23
|
-
readonly type: "uint16";
|
|
24
|
-
readonly internalType: "uint16";
|
|
25
|
-
}];
|
|
26
|
-
readonly stateMutability: "view";
|
|
27
|
-
}, {
|
|
28
|
-
readonly type: "function";
|
|
29
|
-
readonly name: "maxHealthFactor";
|
|
30
|
-
readonly inputs: readonly [];
|
|
31
|
-
readonly outputs: readonly [{
|
|
32
|
-
readonly name: "";
|
|
33
|
-
readonly type: "uint16";
|
|
34
|
-
readonly internalType: "uint16";
|
|
35
|
-
}];
|
|
36
|
-
readonly stateMutability: "view";
|
|
37
|
-
}, {
|
|
38
|
-
readonly type: "function";
|
|
39
|
-
readonly name: "minHealthFactor";
|
|
40
|
-
readonly inputs: readonly [];
|
|
41
|
-
readonly outputs: readonly [{
|
|
42
|
-
readonly name: "";
|
|
43
|
-
readonly type: "uint16";
|
|
44
|
-
readonly internalType: "uint16";
|
|
45
|
-
}];
|
|
46
|
-
readonly stateMutability: "view";
|
|
47
|
-
}, {
|
|
48
|
-
readonly type: "function";
|
|
49
|
-
readonly name: "partiallyLiquidate";
|
|
50
|
-
readonly inputs: readonly [{
|
|
51
|
-
readonly name: "creditAccount";
|
|
52
|
-
readonly type: "address";
|
|
53
|
-
readonly internalType: "address";
|
|
54
|
-
}, {
|
|
55
|
-
readonly name: "token";
|
|
56
|
-
readonly type: "address";
|
|
57
|
-
readonly internalType: "address";
|
|
58
|
-
}, {
|
|
59
|
-
readonly name: "repaidAmount";
|
|
60
|
-
readonly type: "uint256";
|
|
61
|
-
readonly internalType: "uint256";
|
|
62
|
-
}, {
|
|
63
|
-
readonly name: "minSeizedAmount";
|
|
64
|
-
readonly type: "uint256";
|
|
65
|
-
readonly internalType: "uint256";
|
|
66
|
-
}, {
|
|
67
|
-
readonly name: "to";
|
|
68
|
-
readonly type: "address";
|
|
69
|
-
readonly internalType: "address";
|
|
70
|
-
}, {
|
|
71
|
-
readonly name: "priceUpdates";
|
|
72
|
-
readonly type: "tuple[]";
|
|
73
|
-
readonly internalType: "struct PriceUpdate[]";
|
|
74
|
-
readonly components: readonly [{
|
|
75
|
-
readonly name: "priceFeed";
|
|
76
|
-
readonly type: "address";
|
|
77
|
-
readonly internalType: "address";
|
|
78
|
-
}, {
|
|
79
|
-
readonly name: "data";
|
|
80
|
-
readonly type: "bytes";
|
|
81
|
-
readonly internalType: "bytes";
|
|
82
|
-
}];
|
|
83
|
-
}];
|
|
84
|
-
readonly outputs: readonly [{
|
|
85
|
-
readonly name: "seizedAmount";
|
|
86
|
-
readonly type: "uint256";
|
|
87
|
-
readonly internalType: "uint256";
|
|
88
|
-
}];
|
|
89
|
-
readonly stateMutability: "nonpayable";
|
|
90
|
-
}, {
|
|
91
|
-
readonly type: "function";
|
|
92
|
-
readonly name: "premiumScaleFactor";
|
|
93
|
-
readonly inputs: readonly [];
|
|
94
|
-
readonly outputs: readonly [{
|
|
95
|
-
readonly name: "";
|
|
96
|
-
readonly type: "uint16";
|
|
97
|
-
readonly internalType: "uint16";
|
|
98
|
-
}];
|
|
99
|
-
readonly stateMutability: "view";
|
|
100
|
-
}, {
|
|
101
|
-
readonly type: "function";
|
|
102
|
-
readonly name: "requiredPermissions";
|
|
103
|
-
readonly inputs: readonly [];
|
|
104
|
-
readonly outputs: readonly [{
|
|
105
|
-
readonly name: "";
|
|
106
|
-
readonly type: "uint192";
|
|
107
|
-
readonly internalType: "uint192";
|
|
108
|
-
}];
|
|
109
|
-
readonly stateMutability: "view";
|
|
110
|
-
}, {
|
|
111
|
-
readonly type: "function";
|
|
112
|
-
readonly name: "serialize";
|
|
113
|
-
readonly inputs: readonly [];
|
|
114
|
-
readonly outputs: readonly [{
|
|
115
|
-
readonly name: "serializedData";
|
|
116
|
-
readonly type: "bytes";
|
|
117
|
-
readonly internalType: "bytes";
|
|
118
|
-
}];
|
|
119
|
-
readonly stateMutability: "view";
|
|
120
|
-
}, {
|
|
121
|
-
readonly type: "function";
|
|
122
|
-
readonly name: "treasury";
|
|
123
|
-
readonly inputs: readonly [];
|
|
124
|
-
readonly outputs: readonly [{
|
|
125
|
-
readonly name: "";
|
|
126
|
-
readonly type: "address";
|
|
127
|
-
readonly internalType: "address";
|
|
128
|
-
}];
|
|
129
|
-
readonly stateMutability: "view";
|
|
130
|
-
}, {
|
|
131
|
-
readonly type: "function";
|
|
132
|
-
readonly name: "version";
|
|
133
|
-
readonly inputs: readonly [];
|
|
134
|
-
readonly outputs: readonly [{
|
|
135
|
-
readonly name: "";
|
|
136
|
-
readonly type: "uint256";
|
|
137
|
-
readonly internalType: "uint256";
|
|
138
|
-
}];
|
|
139
|
-
readonly stateMutability: "view";
|
|
140
|
-
}, {
|
|
141
|
-
readonly type: "event";
|
|
142
|
-
readonly name: "PartiallyLiquidate";
|
|
143
|
-
readonly inputs: readonly [{
|
|
144
|
-
readonly name: "creditManager";
|
|
145
|
-
readonly type: "address";
|
|
146
|
-
readonly indexed: true;
|
|
147
|
-
readonly internalType: "address";
|
|
148
|
-
}, {
|
|
149
|
-
readonly name: "creditAccount";
|
|
150
|
-
readonly type: "address";
|
|
151
|
-
readonly indexed: true;
|
|
152
|
-
readonly internalType: "address";
|
|
153
|
-
}, {
|
|
154
|
-
readonly name: "token";
|
|
155
|
-
readonly type: "address";
|
|
156
|
-
readonly indexed: true;
|
|
157
|
-
readonly internalType: "address";
|
|
158
|
-
}, {
|
|
159
|
-
readonly name: "liquidator";
|
|
160
|
-
readonly type: "address";
|
|
161
|
-
readonly indexed: false;
|
|
162
|
-
readonly internalType: "address";
|
|
163
|
-
}, {
|
|
164
|
-
readonly name: "repaidDebt";
|
|
165
|
-
readonly type: "uint256";
|
|
166
|
-
readonly indexed: false;
|
|
167
|
-
readonly internalType: "uint256";
|
|
168
|
-
}, {
|
|
169
|
-
readonly name: "seizedCollateral";
|
|
170
|
-
readonly type: "uint256";
|
|
171
|
-
readonly indexed: false;
|
|
172
|
-
readonly internalType: "uint256";
|
|
173
|
-
}, {
|
|
174
|
-
readonly name: "fee";
|
|
175
|
-
readonly type: "uint256";
|
|
176
|
-
readonly indexed: false;
|
|
177
|
-
readonly internalType: "uint256";
|
|
178
|
-
}];
|
|
179
|
-
readonly anonymous: false;
|
|
180
|
-
}, {
|
|
181
|
-
readonly type: "error";
|
|
182
|
-
readonly name: "LiquidatedLessThanNeededException";
|
|
183
|
-
readonly inputs: readonly [];
|
|
184
|
-
}, {
|
|
185
|
-
readonly type: "error";
|
|
186
|
-
readonly name: "LiquidatedMoreThanNeededException";
|
|
187
|
-
readonly inputs: readonly [];
|
|
188
|
-
}, {
|
|
189
|
-
readonly type: "error";
|
|
190
|
-
readonly name: "SeizedLessThanRequiredException";
|
|
191
|
-
readonly inputs: readonly [];
|
|
192
|
-
}, {
|
|
193
|
-
readonly type: "error";
|
|
194
|
-
readonly name: "UnderlyingNotLiquidatableException";
|
|
195
|
-
readonly inputs: readonly [];
|
|
196
|
-
}];
|
|
197
|
-
type abi = typeof abi;
|
|
198
|
-
interface PartialLiquidationBotV310Params {
|
|
199
|
-
addr: Address;
|
|
200
|
-
version: bigint;
|
|
201
|
-
contractType: string;
|
|
202
|
-
serializedParams: Hex;
|
|
203
|
-
}
|
|
204
|
-
declare class PartialLiquidationBotV310Contract extends BaseContract<abi> {
|
|
205
|
-
#private;
|
|
206
|
-
readonly treasury: Address;
|
|
207
|
-
readonly minHealthFactor: number;
|
|
208
|
-
readonly maxHealthFactor: number;
|
|
209
|
-
readonly premiumScaleFactor: number;
|
|
210
|
-
readonly feeScaleFactor: number;
|
|
211
|
-
constructor(sdk: OnchainSDK, args: PartialLiquidationBotV310Params);
|
|
212
|
-
stateHuman(raw?: boolean): BotStateV310Human;
|
|
213
|
-
get state(): PartialLiquidationBotV310Params;
|
|
214
|
-
}
|
|
215
|
-
//#endregion
|
|
216
|
-
export { PartialLiquidationBotV310Contract, PartialLiquidationBotV310Params };
|