@gearbox-protocol/sdk 16.3.1-next.1 → 16.3.1

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.
Files changed (27) hide show
  1. package/dist/cjs/plugins/bots/BotsPlugin.js +107 -0
  2. package/dist/cjs/plugins/bots/PartialLiquidationBotV310Contract.js +47 -0
  3. package/dist/cjs/plugins/bots/abi/iPartialLiquidationBotV310.js +225 -0
  4. package/dist/cjs/plugins/bots/abi/index.js +3 -0
  5. package/dist/cjs/plugins/bots/config.js +39 -0
  6. package/dist/cjs/plugins/bots/deserializePartialLiquidationBotParams.js +39 -0
  7. package/dist/cjs/plugins/bots/index.js +17 -0
  8. package/dist/cjs/plugins/bots/package.json +1 -0
  9. package/dist/cjs/plugins/bots/types.js +28 -0
  10. package/dist/esm/plugins/bots/BotsPlugin.js +106 -0
  11. package/dist/esm/plugins/bots/PartialLiquidationBotV310Contract.js +46 -0
  12. package/dist/esm/plugins/bots/abi/iPartialLiquidationBotV310.js +224 -0
  13. package/dist/esm/plugins/bots/abi/index.js +2 -0
  14. package/dist/esm/plugins/bots/config.js +34 -0
  15. package/dist/esm/plugins/bots/deserializePartialLiquidationBotParams.js +35 -0
  16. package/dist/esm/plugins/bots/index.js +7 -0
  17. package/dist/esm/plugins/bots/package.json +1 -0
  18. package/dist/esm/plugins/bots/types.js +26 -0
  19. package/dist/types/plugins/bots/BotsPlugin.d.ts +18 -0
  20. package/dist/types/plugins/bots/PartialLiquidationBotV310Contract.d.ts +216 -0
  21. package/dist/types/plugins/bots/abi/iPartialLiquidationBotV310.d.ts +193 -0
  22. package/dist/types/plugins/bots/abi/index.d.ts +2 -0
  23. package/dist/types/plugins/bots/config.d.ts +12 -0
  24. package/dist/types/plugins/bots/deserializePartialLiquidationBotParams.d.ts +7 -0
  25. package/dist/types/plugins/bots/index.d.ts +7 -0
  26. package/dist/types/plugins/bots/types.d.ts +53 -0
  27. package/package.json +1 -1
@@ -0,0 +1,193 @@
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 };
@@ -0,0 +1,2 @@
1
+ import { iPartialLiquidationBotV310Abi } from "./iPartialLiquidationBotV310.js";
2
+ export { iPartialLiquidationBotV310Abi };
@@ -0,0 +1,12 @@
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 };
@@ -0,0 +1,7 @@
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 };
@@ -0,0 +1,7 @@
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 };
@@ -0,0 +1,53 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "16.3.1-next.1",
3
+ "version": "16.3.1",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {