@gearbox-protocol/sdk 16.3.0-next.5 → 16.3.0
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/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,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 };
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
//#region src/plugins/bots/abi/iPartialLiquidationBotV310.d.ts
|
|
2
|
-
declare const iPartialLiquidationBotV310Abi: readonly [{
|
|
3
|
-
readonly type: "function";
|
|
4
|
-
readonly name: "contractType";
|
|
5
|
-
readonly inputs: readonly [];
|
|
6
|
-
readonly outputs: readonly [{
|
|
7
|
-
readonly name: "";
|
|
8
|
-
readonly type: "bytes32";
|
|
9
|
-
readonly internalType: "bytes32";
|
|
10
|
-
}];
|
|
11
|
-
readonly stateMutability: "view";
|
|
12
|
-
}, {
|
|
13
|
-
readonly type: "function";
|
|
14
|
-
readonly name: "feeScaleFactor";
|
|
15
|
-
readonly inputs: readonly [];
|
|
16
|
-
readonly outputs: readonly [{
|
|
17
|
-
readonly name: "";
|
|
18
|
-
readonly type: "uint16";
|
|
19
|
-
readonly internalType: "uint16";
|
|
20
|
-
}];
|
|
21
|
-
readonly stateMutability: "view";
|
|
22
|
-
}, {
|
|
23
|
-
readonly type: "function";
|
|
24
|
-
readonly name: "maxHealthFactor";
|
|
25
|
-
readonly inputs: readonly [];
|
|
26
|
-
readonly outputs: readonly [{
|
|
27
|
-
readonly name: "";
|
|
28
|
-
readonly type: "uint16";
|
|
29
|
-
readonly internalType: "uint16";
|
|
30
|
-
}];
|
|
31
|
-
readonly stateMutability: "view";
|
|
32
|
-
}, {
|
|
33
|
-
readonly type: "function";
|
|
34
|
-
readonly name: "minHealthFactor";
|
|
35
|
-
readonly inputs: readonly [];
|
|
36
|
-
readonly outputs: readonly [{
|
|
37
|
-
readonly name: "";
|
|
38
|
-
readonly type: "uint16";
|
|
39
|
-
readonly internalType: "uint16";
|
|
40
|
-
}];
|
|
41
|
-
readonly stateMutability: "view";
|
|
42
|
-
}, {
|
|
43
|
-
readonly type: "function";
|
|
44
|
-
readonly name: "partiallyLiquidate";
|
|
45
|
-
readonly inputs: readonly [{
|
|
46
|
-
readonly name: "creditAccount";
|
|
47
|
-
readonly type: "address";
|
|
48
|
-
readonly internalType: "address";
|
|
49
|
-
}, {
|
|
50
|
-
readonly name: "token";
|
|
51
|
-
readonly type: "address";
|
|
52
|
-
readonly internalType: "address";
|
|
53
|
-
}, {
|
|
54
|
-
readonly name: "repaidAmount";
|
|
55
|
-
readonly type: "uint256";
|
|
56
|
-
readonly internalType: "uint256";
|
|
57
|
-
}, {
|
|
58
|
-
readonly name: "minSeizedAmount";
|
|
59
|
-
readonly type: "uint256";
|
|
60
|
-
readonly internalType: "uint256";
|
|
61
|
-
}, {
|
|
62
|
-
readonly name: "to";
|
|
63
|
-
readonly type: "address";
|
|
64
|
-
readonly internalType: "address";
|
|
65
|
-
}, {
|
|
66
|
-
readonly name: "priceUpdates";
|
|
67
|
-
readonly type: "tuple[]";
|
|
68
|
-
readonly internalType: "struct PriceUpdate[]";
|
|
69
|
-
readonly components: readonly [{
|
|
70
|
-
readonly name: "priceFeed";
|
|
71
|
-
readonly type: "address";
|
|
72
|
-
readonly internalType: "address";
|
|
73
|
-
}, {
|
|
74
|
-
readonly name: "data";
|
|
75
|
-
readonly type: "bytes";
|
|
76
|
-
readonly internalType: "bytes";
|
|
77
|
-
}];
|
|
78
|
-
}];
|
|
79
|
-
readonly outputs: readonly [{
|
|
80
|
-
readonly name: "seizedAmount";
|
|
81
|
-
readonly type: "uint256";
|
|
82
|
-
readonly internalType: "uint256";
|
|
83
|
-
}];
|
|
84
|
-
readonly stateMutability: "nonpayable";
|
|
85
|
-
}, {
|
|
86
|
-
readonly type: "function";
|
|
87
|
-
readonly name: "premiumScaleFactor";
|
|
88
|
-
readonly inputs: readonly [];
|
|
89
|
-
readonly outputs: readonly [{
|
|
90
|
-
readonly name: "";
|
|
91
|
-
readonly type: "uint16";
|
|
92
|
-
readonly internalType: "uint16";
|
|
93
|
-
}];
|
|
94
|
-
readonly stateMutability: "view";
|
|
95
|
-
}, {
|
|
96
|
-
readonly type: "function";
|
|
97
|
-
readonly name: "requiredPermissions";
|
|
98
|
-
readonly inputs: readonly [];
|
|
99
|
-
readonly outputs: readonly [{
|
|
100
|
-
readonly name: "";
|
|
101
|
-
readonly type: "uint192";
|
|
102
|
-
readonly internalType: "uint192";
|
|
103
|
-
}];
|
|
104
|
-
readonly stateMutability: "view";
|
|
105
|
-
}, {
|
|
106
|
-
readonly type: "function";
|
|
107
|
-
readonly name: "serialize";
|
|
108
|
-
readonly inputs: readonly [];
|
|
109
|
-
readonly outputs: readonly [{
|
|
110
|
-
readonly name: "serializedData";
|
|
111
|
-
readonly type: "bytes";
|
|
112
|
-
readonly internalType: "bytes";
|
|
113
|
-
}];
|
|
114
|
-
readonly stateMutability: "view";
|
|
115
|
-
}, {
|
|
116
|
-
readonly type: "function";
|
|
117
|
-
readonly name: "treasury";
|
|
118
|
-
readonly inputs: readonly [];
|
|
119
|
-
readonly outputs: readonly [{
|
|
120
|
-
readonly name: "";
|
|
121
|
-
readonly type: "address";
|
|
122
|
-
readonly internalType: "address";
|
|
123
|
-
}];
|
|
124
|
-
readonly stateMutability: "view";
|
|
125
|
-
}, {
|
|
126
|
-
readonly type: "function";
|
|
127
|
-
readonly name: "version";
|
|
128
|
-
readonly inputs: readonly [];
|
|
129
|
-
readonly outputs: readonly [{
|
|
130
|
-
readonly name: "";
|
|
131
|
-
readonly type: "uint256";
|
|
132
|
-
readonly internalType: "uint256";
|
|
133
|
-
}];
|
|
134
|
-
readonly stateMutability: "view";
|
|
135
|
-
}, {
|
|
136
|
-
readonly type: "event";
|
|
137
|
-
readonly name: "PartiallyLiquidate";
|
|
138
|
-
readonly inputs: readonly [{
|
|
139
|
-
readonly name: "creditManager";
|
|
140
|
-
readonly type: "address";
|
|
141
|
-
readonly indexed: true;
|
|
142
|
-
readonly internalType: "address";
|
|
143
|
-
}, {
|
|
144
|
-
readonly name: "creditAccount";
|
|
145
|
-
readonly type: "address";
|
|
146
|
-
readonly indexed: true;
|
|
147
|
-
readonly internalType: "address";
|
|
148
|
-
}, {
|
|
149
|
-
readonly name: "token";
|
|
150
|
-
readonly type: "address";
|
|
151
|
-
readonly indexed: true;
|
|
152
|
-
readonly internalType: "address";
|
|
153
|
-
}, {
|
|
154
|
-
readonly name: "liquidator";
|
|
155
|
-
readonly type: "address";
|
|
156
|
-
readonly indexed: false;
|
|
157
|
-
readonly internalType: "address";
|
|
158
|
-
}, {
|
|
159
|
-
readonly name: "repaidDebt";
|
|
160
|
-
readonly type: "uint256";
|
|
161
|
-
readonly indexed: false;
|
|
162
|
-
readonly internalType: "uint256";
|
|
163
|
-
}, {
|
|
164
|
-
readonly name: "seizedCollateral";
|
|
165
|
-
readonly type: "uint256";
|
|
166
|
-
readonly indexed: false;
|
|
167
|
-
readonly internalType: "uint256";
|
|
168
|
-
}, {
|
|
169
|
-
readonly name: "fee";
|
|
170
|
-
readonly type: "uint256";
|
|
171
|
-
readonly indexed: false;
|
|
172
|
-
readonly internalType: "uint256";
|
|
173
|
-
}];
|
|
174
|
-
readonly anonymous: false;
|
|
175
|
-
}, {
|
|
176
|
-
readonly type: "error";
|
|
177
|
-
readonly name: "LiquidatedLessThanNeededException";
|
|
178
|
-
readonly inputs: readonly [];
|
|
179
|
-
}, {
|
|
180
|
-
readonly type: "error";
|
|
181
|
-
readonly name: "LiquidatedMoreThanNeededException";
|
|
182
|
-
readonly inputs: readonly [];
|
|
183
|
-
}, {
|
|
184
|
-
readonly type: "error";
|
|
185
|
-
readonly name: "SeizedLessThanRequiredException";
|
|
186
|
-
readonly inputs: readonly [];
|
|
187
|
-
}, {
|
|
188
|
-
readonly type: "error";
|
|
189
|
-
readonly name: "UnderlyingNotLiquidatableException";
|
|
190
|
-
readonly inputs: readonly [];
|
|
191
|
-
}];
|
|
192
|
-
//#endregion
|
|
193
|
-
export { iPartialLiquidationBotV310Abi };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NetworkType } from "../../onchain/chain/chains.js";
|
|
2
|
-
import "../../onchain/index.js";
|
|
3
|
-
import { BotBaseType, BotParameters, MigrationBotState } from "./types.js";
|
|
4
|
-
import { Address } from "viem";
|
|
5
|
-
//#region src/plugins/bots/config.d.ts
|
|
6
|
-
declare const PARTIAL_LIQUIDATION_BOT_CONFIGS: Partial<Record<NetworkType, Omit<BotParameters, "treasury">[]>>;
|
|
7
|
-
declare const PARTIAL_LIQUIDATION_BOT_SALT = "GEARBOX";
|
|
8
|
-
declare const PARTIAL_LIQUIDATION_BOT_DEPLOYER: Address;
|
|
9
|
-
declare const LEGACY_MIGRATION_BOT: MigrationBotState;
|
|
10
|
-
declare const PERMISSION_BY_TYPE: Record<Extract<BotBaseType, "LEGACY_MIGRATION">, bigint>;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { LEGACY_MIGRATION_BOT, PARTIAL_LIQUIDATION_BOT_CONFIGS, PARTIAL_LIQUIDATION_BOT_DEPLOYER, PARTIAL_LIQUIDATION_BOT_SALT, PERMISSION_BY_TYPE };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseParams } from "../../onchain/base/types.js";
|
|
2
|
-
import "../../onchain/index.js";
|
|
3
|
-
import { BotParameters } from "./types.js";
|
|
4
|
-
//#region src/plugins/bots/deserializePartialLiquidationBotParams.d.ts
|
|
5
|
-
declare function deserializePartialLiquidationBotParams(params: Pick<BaseParams, "serializedParams">): BotParameters;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { deserializePartialLiquidationBotParams as default };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BOT_PARAMS_ABI, BOT_PARTIAL_LIQUIDATION, BotBaseType, BotParameters, BotState, BotStateHuman, BotStateV310Human, BotsPluginState, BotsPluginStateHuman, MigrationBotState } from "./types.js";
|
|
2
|
-
import { PartialLiquidationBotV310Contract, PartialLiquidationBotV310Params } from "./PartialLiquidationBotV310Contract.js";
|
|
3
|
-
import { BotsPlugin } from "./BotsPlugin.js";
|
|
4
|
-
import { iPartialLiquidationBotV310Abi } from "./abi/iPartialLiquidationBotV310.js";
|
|
5
|
-
import "./abi/index.js";
|
|
6
|
-
import { LEGACY_MIGRATION_BOT, PARTIAL_LIQUIDATION_BOT_CONFIGS, PARTIAL_LIQUIDATION_BOT_DEPLOYER, PARTIAL_LIQUIDATION_BOT_SALT, PERMISSION_BY_TYPE } from "./config.js";
|
|
7
|
-
export { BOT_PARAMS_ABI, BOT_PARTIAL_LIQUIDATION, BotBaseType, BotParameters, BotState, BotStateHuman, BotStateV310Human, BotsPlugin, BotsPluginState, BotsPluginStateHuman, LEGACY_MIGRATION_BOT, MigrationBotState, PARTIAL_LIQUIDATION_BOT_CONFIGS, PARTIAL_LIQUIDATION_BOT_DEPLOYER, PARTIAL_LIQUIDATION_BOT_SALT, PERMISSION_BY_TYPE, PartialLiquidationBotV310Contract, PartialLiquidationBotV310Params, iPartialLiquidationBotV310Abi };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { BaseContractStateHuman } from "../../onchain/types/state-human.js";
|
|
2
|
-
import "../../onchain/index.js";
|
|
3
|
-
import { PartialLiquidationBotV310Params } from "./PartialLiquidationBotV310Contract.js";
|
|
4
|
-
import { Address } from "viem";
|
|
5
|
-
//#region src/plugins/bots/types.d.ts
|
|
6
|
-
interface BotParameters {
|
|
7
|
-
treasury: Address;
|
|
8
|
-
minHealthFactor: number;
|
|
9
|
-
maxHealthFactor: number;
|
|
10
|
-
premiumScaleFactor: number;
|
|
11
|
-
feeScaleFactor: number;
|
|
12
|
-
}
|
|
13
|
-
declare const BOT_PARTIAL_LIQUIDATION = "BOT::PARTIAL_LIQUIDATION";
|
|
14
|
-
declare const BOT_PARAMS_ABI: readonly [{
|
|
15
|
-
readonly type: "address";
|
|
16
|
-
readonly name: "treasury";
|
|
17
|
-
}, {
|
|
18
|
-
readonly type: "uint16";
|
|
19
|
-
readonly name: "minHealthFactor";
|
|
20
|
-
}, {
|
|
21
|
-
readonly type: "uint16";
|
|
22
|
-
readonly name: "maxHealthFactor";
|
|
23
|
-
}, {
|
|
24
|
-
readonly type: "uint16";
|
|
25
|
-
readonly name: "premiumScaleFactor";
|
|
26
|
-
}, {
|
|
27
|
-
readonly type: "uint16";
|
|
28
|
-
readonly name: "feeScaleFactor";
|
|
29
|
-
}];
|
|
30
|
-
interface BotStateV310Human extends BaseContractStateHuman {
|
|
31
|
-
treasury: Address;
|
|
32
|
-
minHealthFactor: string;
|
|
33
|
-
maxHealthFactor: string;
|
|
34
|
-
premiumScaleFactor: string;
|
|
35
|
-
feeScaleFactor: string;
|
|
36
|
-
}
|
|
37
|
-
type BotStateHuman = BotStateV310Human;
|
|
38
|
-
type BotState = PartialLiquidationBotV310Params;
|
|
39
|
-
interface BotsPluginStateHuman {
|
|
40
|
-
bots: BotStateHuman[];
|
|
41
|
-
}
|
|
42
|
-
interface BotsPluginState {
|
|
43
|
-
bots: BotState[];
|
|
44
|
-
}
|
|
45
|
-
type BotBaseType = "LIQUIDATION_PROTECTION" | "LEGACY_MIGRATION";
|
|
46
|
-
type MigrationBotState = {
|
|
47
|
-
address: Address;
|
|
48
|
-
version: 310;
|
|
49
|
-
previewer: Address;
|
|
50
|
-
baseType: Extract<BotBaseType, "LEGACY_MIGRATION">;
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { BOT_PARAMS_ABI, BOT_PARTIAL_LIQUIDATION, BotBaseType, BotParameters, BotState, BotStateHuman, BotStateV310Human, BotsPluginState, BotsPluginStateHuman, MigrationBotState };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { AddressMap } from "../../onchain/utils/AddressMap.js";
|
|
2
|
-
import { BasePlugin } from "../../onchain/plugins/BasePlugin.js";
|
|
3
|
-
import { IOnchainSDKPlugin } from "../../onchain/plugins/types.js";
|
|
4
|
-
import "../../onchain/index.js";
|
|
5
|
-
import { DegenDistributorsStateHuman } from "./types.js";
|
|
6
|
-
import { Address } from "viem";
|
|
7
|
-
//#region src/plugins/degen-distributors/DegenDistributorsPlugin.d.ts
|
|
8
|
-
interface DegenDistributorsPluginState {
|
|
9
|
-
distributors: Record<Address, Address>;
|
|
10
|
-
}
|
|
11
|
-
declare class DegenDistributorsPlugin extends BasePlugin<DegenDistributorsPluginState> implements IOnchainSDKPlugin<DegenDistributorsPluginState> {
|
|
12
|
-
#private;
|
|
13
|
-
load(force?: boolean): Promise<DegenDistributorsPluginState>;
|
|
14
|
-
get loaded(): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Returns a map of pool addresses to degen distributor addresses
|
|
17
|
-
* @throws if degen distributor plugin is not attached
|
|
18
|
-
*/
|
|
19
|
-
get distributors(): AddressMap<Address>;
|
|
20
|
-
stateHuman(_?: boolean): DegenDistributorsStateHuman[];
|
|
21
|
-
get state(): DegenDistributorsPluginState;
|
|
22
|
-
hydrate(state: DegenDistributorsPluginState): void;
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { DegenDistributorsPlugin, DegenDistributorsPluginState };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseContractStateHuman } from "../../onchain/types/state-human.js";
|
|
2
|
-
import "../../onchain/index.js";
|
|
3
|
-
//#region src/plugins/degen-distributors/types.d.ts
|
|
4
|
-
interface DegenDistributorsStateHuman extends BaseContractStateHuman {
|
|
5
|
-
pool: string;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { DegenDistributorsStateHuman };
|