@gearbox-protocol/sdk 11.11.3 → 11.12.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 (29) hide show
  1. package/dist/cjs/plugins/bots/BotsPlugin.js +26 -111
  2. package/dist/cjs/plugins/bots/PartialLiquidationBotV310Contract.js +38 -6
  3. package/dist/cjs/plugins/bots/config.js +2 -5
  4. package/dist/cjs/plugins/bots/index.js +0 -2
  5. package/dist/cjs/plugins/bots/types.js +3 -11
  6. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +38 -9
  7. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +16 -1
  8. package/dist/esm/plugins/bots/BotsPlugin.js +28 -121
  9. package/dist/esm/plugins/bots/PartialLiquidationBotV310Contract.js +41 -6
  10. package/dist/esm/plugins/bots/config.js +2 -5
  11. package/dist/esm/plugins/bots/index.js +0 -1
  12. package/dist/esm/plugins/bots/types.js +2 -9
  13. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +38 -9
  14. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +17 -2
  15. package/dist/types/plugins/bots/BotsPlugin.d.ts +3 -13
  16. package/dist/types/plugins/bots/PartialLiquidationBotV310Contract.d.ts +19 -6
  17. package/dist/types/plugins/bots/config.d.ts +1 -1
  18. package/dist/types/plugins/bots/index.d.ts +0 -1
  19. package/dist/types/plugins/bots/types.d.ts +10 -25
  20. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +5 -6
  21. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  22. package/dist/types/sdk/accounts/types.d.ts +8 -6
  23. package/package.json +1 -1
  24. package/dist/cjs/plugins/bots/PartialLiquidationBotBaseContract.js +0 -75
  25. package/dist/cjs/plugins/bots/PartialLiquidationBotV300Contract.js +0 -65
  26. package/dist/esm/plugins/bots/PartialLiquidationBotBaseContract.js +0 -53
  27. package/dist/esm/plugins/bots/PartialLiquidationBotV300Contract.js +0 -41
  28. package/dist/types/plugins/bots/PartialLiquidationBotBaseContract.d.ts +0 -25
  29. package/dist/types/plugins/bots/PartialLiquidationBotV300Contract.d.ts +0 -227
@@ -1,41 +0,0 @@
1
- import { iPartialLiquidationBotV300Abi } from "./abi/index.js";
2
- import { PartialLiquidationBotBaseContract } from "./PartialLiquidationBotBaseContract.js";
3
- const abi = iPartialLiquidationBotV300Abi;
4
- class PartialLiquidationBotV300Contract extends PartialLiquidationBotBaseContract {
5
- #botType;
6
- constructor(sdk, args, marketConfigurator) {
7
- super(sdk, {
8
- abi,
9
- ...args.baseParams,
10
- requiredPermissions: args.requiredPermissions,
11
- marketConfigurator,
12
- name: "PartialLiquidationBotV300"
13
- });
14
- }
15
- stateHuman(raw) {
16
- return {
17
- ...super.stateHuman(raw),
18
- botType: this.botType
19
- };
20
- }
21
- /**
22
- * Set the bot type
23
- * This method should only be called once from BotsPlugin
24
- */
25
- set botType(type) {
26
- if (this.#botType) {
27
- throw new Error("bot type already set");
28
- }
29
- this.#botType = type;
30
- this.name = `PartialLiquidationBotV300 (${type})`;
31
- }
32
- get botType() {
33
- if (!this.#botType) {
34
- throw new Error("bot type not set");
35
- }
36
- return this.#botType;
37
- }
38
- }
39
- export {
40
- PartialLiquidationBotV300Contract
41
- };
@@ -1,25 +0,0 @@
1
- import type { Address } from "abitype";
2
- import type { Abi, Hex } from "viem";
3
- import type { GearboxSDK } from "../../sdk/index.js";
4
- import { BaseContract } from "../../sdk/index.js";
5
- import { type BotParameters, type BotState, type BotStateBaseHuman } from "./types.js";
6
- export interface PartialLiquidationBotBaseArgs<abi extends Abi | readonly unknown[]> {
7
- abi: abi;
8
- addr: Address;
9
- name?: string;
10
- version?: number | bigint;
11
- contractType?: string;
12
- serializedParams: Hex;
13
- requiredPermissions: bigint;
14
- marketConfigurator: Address;
15
- }
16
- export interface PartialLiquidationBotBaseContract<abi extends Abi | readonly unknown[]> extends BotParameters, BaseContract<abi> {
17
- }
18
- export declare abstract class PartialLiquidationBotBaseContract<abi extends Abi | readonly unknown[]> extends BaseContract<abi> {
19
- #private;
20
- readonly requiredPermissions: bigint;
21
- readonly marketConfigurator: Address;
22
- constructor(sdk: GearboxSDK, args: PartialLiquidationBotBaseArgs<abi>);
23
- stateHuman(raw?: boolean): BotStateBaseHuman;
24
- get state(): BotState;
25
- }
@@ -1,227 +0,0 @@
1
- import type { Address } from "abitype";
2
- import type { GearboxSDK } from "../../sdk/index.js";
3
- import { PartialLiquidationBotBaseContract } from "./PartialLiquidationBotBaseContract.js";
4
- import type { BotState, BotStateV300Human, LiquidationBotType } from "./types.js";
5
- declare const abi: readonly [{
6
- readonly type: "function";
7
- readonly name: "feeScaleFactor";
8
- readonly inputs: readonly [];
9
- readonly outputs: readonly [{
10
- readonly name: "";
11
- readonly type: "uint16";
12
- readonly internalType: "uint16";
13
- }];
14
- readonly stateMutability: "view";
15
- }, {
16
- readonly type: "function";
17
- readonly name: "liquidateExactCollateral";
18
- readonly inputs: readonly [{
19
- readonly name: "creditAccount";
20
- readonly type: "address";
21
- readonly internalType: "address";
22
- }, {
23
- readonly name: "token";
24
- readonly type: "address";
25
- readonly internalType: "address";
26
- }, {
27
- readonly name: "seizedAmount";
28
- readonly type: "uint256";
29
- readonly internalType: "uint256";
30
- }, {
31
- readonly name: "maxRepaidAmount";
32
- readonly type: "uint256";
33
- readonly internalType: "uint256";
34
- }, {
35
- readonly name: "to";
36
- readonly type: "address";
37
- readonly internalType: "address";
38
- }, {
39
- readonly name: "priceUpdates";
40
- readonly type: "tuple[]";
41
- readonly internalType: "struct IPartialLiquidationBotV3.PriceUpdate[]";
42
- readonly components: readonly [{
43
- readonly name: "token";
44
- readonly type: "address";
45
- readonly internalType: "address";
46
- }, {
47
- readonly name: "reserve";
48
- readonly type: "bool";
49
- readonly internalType: "bool";
50
- }, {
51
- readonly name: "data";
52
- readonly type: "bytes";
53
- readonly internalType: "bytes";
54
- }];
55
- }];
56
- readonly outputs: readonly [{
57
- readonly name: "repaidAmount";
58
- readonly type: "uint256";
59
- readonly internalType: "uint256";
60
- }];
61
- readonly stateMutability: "nonpayable";
62
- }, {
63
- readonly type: "function";
64
- readonly name: "liquidateExactDebt";
65
- readonly inputs: readonly [{
66
- readonly name: "creditAccount";
67
- readonly type: "address";
68
- readonly internalType: "address";
69
- }, {
70
- readonly name: "token";
71
- readonly type: "address";
72
- readonly internalType: "address";
73
- }, {
74
- readonly name: "repaidAmount";
75
- readonly type: "uint256";
76
- readonly internalType: "uint256";
77
- }, {
78
- readonly name: "minSeizedAmount";
79
- readonly type: "uint256";
80
- readonly internalType: "uint256";
81
- }, {
82
- readonly name: "to";
83
- readonly type: "address";
84
- readonly internalType: "address";
85
- }, {
86
- readonly name: "priceUpdates";
87
- readonly type: "tuple[]";
88
- readonly internalType: "struct IPartialLiquidationBotV3.PriceUpdate[]";
89
- readonly components: readonly [{
90
- readonly name: "token";
91
- readonly type: "address";
92
- readonly internalType: "address";
93
- }, {
94
- readonly name: "reserve";
95
- readonly type: "bool";
96
- readonly internalType: "bool";
97
- }, {
98
- readonly name: "data";
99
- readonly type: "bytes";
100
- readonly internalType: "bytes";
101
- }];
102
- }];
103
- readonly outputs: readonly [{
104
- readonly name: "seizedAmount";
105
- readonly type: "uint256";
106
- readonly internalType: "uint256";
107
- }];
108
- readonly stateMutability: "nonpayable";
109
- }, {
110
- readonly type: "function";
111
- readonly name: "maxHealthFactor";
112
- readonly inputs: readonly [];
113
- readonly outputs: readonly [{
114
- readonly name: "";
115
- readonly type: "uint16";
116
- readonly internalType: "uint16";
117
- }];
118
- readonly stateMutability: "view";
119
- }, {
120
- readonly type: "function";
121
- readonly name: "minHealthFactor";
122
- readonly inputs: readonly [];
123
- readonly outputs: readonly [{
124
- readonly name: "";
125
- readonly type: "uint16";
126
- readonly internalType: "uint16";
127
- }];
128
- readonly stateMutability: "view";
129
- }, {
130
- readonly type: "function";
131
- readonly name: "premiumScaleFactor";
132
- readonly inputs: readonly [];
133
- readonly outputs: readonly [{
134
- readonly name: "";
135
- readonly type: "uint16";
136
- readonly internalType: "uint16";
137
- }];
138
- readonly stateMutability: "view";
139
- }, {
140
- readonly type: "function";
141
- readonly name: "treasury";
142
- readonly inputs: readonly [];
143
- readonly outputs: readonly [{
144
- readonly name: "";
145
- readonly type: "address";
146
- readonly internalType: "address";
147
- }];
148
- readonly stateMutability: "view";
149
- }, {
150
- readonly type: "function";
151
- readonly name: "version";
152
- readonly inputs: readonly [];
153
- readonly outputs: readonly [{
154
- readonly name: "";
155
- readonly type: "uint256";
156
- readonly internalType: "uint256";
157
- }];
158
- readonly stateMutability: "view";
159
- }, {
160
- readonly type: "event";
161
- readonly name: "LiquidatePartial";
162
- readonly inputs: readonly [{
163
- readonly name: "creditManager";
164
- readonly type: "address";
165
- readonly indexed: true;
166
- readonly internalType: "address";
167
- }, {
168
- readonly name: "creditAccount";
169
- readonly type: "address";
170
- readonly indexed: true;
171
- readonly internalType: "address";
172
- }, {
173
- readonly name: "token";
174
- readonly type: "address";
175
- readonly indexed: true;
176
- readonly internalType: "address";
177
- }, {
178
- readonly name: "repaidDebt";
179
- readonly type: "uint256";
180
- readonly indexed: false;
181
- readonly internalType: "uint256";
182
- }, {
183
- readonly name: "seizedCollateral";
184
- readonly type: "uint256";
185
- readonly indexed: false;
186
- readonly internalType: "uint256";
187
- }, {
188
- readonly name: "fee";
189
- readonly type: "uint256";
190
- readonly indexed: false;
191
- readonly internalType: "uint256";
192
- }];
193
- readonly anonymous: false;
194
- }, {
195
- readonly type: "error";
196
- readonly name: "LiquidatedLessThanNeededException";
197
- readonly inputs: readonly [];
198
- }, {
199
- readonly type: "error";
200
- readonly name: "LiquidatedMoreThanNeededException";
201
- readonly inputs: readonly [];
202
- }, {
203
- readonly type: "error";
204
- readonly name: "RepaidMoreThanAllowedException";
205
- readonly inputs: readonly [];
206
- }, {
207
- readonly type: "error";
208
- readonly name: "SeizedLessThanRequiredException";
209
- readonly inputs: readonly [];
210
- }, {
211
- readonly type: "error";
212
- readonly name: "UnderlyingNotLiquidatableException";
213
- readonly inputs: readonly [];
214
- }];
215
- type abi = typeof abi;
216
- export declare class PartialLiquidationBotV300Contract extends PartialLiquidationBotBaseContract<abi> {
217
- #private;
218
- constructor(sdk: GearboxSDK, args: BotState, marketConfigurator: Address);
219
- stateHuman(raw?: boolean): BotStateV300Human;
220
- /**
221
- * Set the bot type
222
- * This method should only be called once from BotsPlugin
223
- */
224
- set botType(type: LiquidationBotType);
225
- get botType(): LiquidationBotType;
226
- }
227
- export {};