@gearbox-protocol/sdk 3.0.1-next.1 → 3.0.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 (40) hide show
  1. package/dist/cjs/abi/compressors.js +527 -1133
  2. package/dist/cjs/adapters/abi/adapters.js +0 -123
  3. package/dist/cjs/adapters/abi/iBalancerV3RouterAdapter.js +153 -0
  4. package/dist/cjs/adapters/abi/index.js +3 -1
  5. package/dist/cjs/sdk/accounts/CreditAccountsService.js +7 -4
  6. package/dist/cjs/sdk/constants/address-provider.js +14 -8
  7. package/dist/cjs/sdk/market/MarketSuite.js +1 -1
  8. package/dist/cjs/sdk/market/credit/CreditFacadeV300Contract.js +5 -1
  9. package/dist/cjs/sdk/market/credit/CreditFacadeV310Contract.js +5 -1
  10. package/dist/cjs/sdk/market/oracle/PriceOracleBaseContract.js +5 -6
  11. package/dist/cjs/sdk/market/pool/PoolSuite.js +1 -1
  12. package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +4 -4
  13. package/dist/esm/abi/compressors.js +522 -1133
  14. package/dist/esm/adapters/abi/adapters.js +0 -120
  15. package/dist/esm/adapters/abi/iBalancerV3RouterAdapter.js +129 -0
  16. package/dist/esm/adapters/abi/index.js +1 -0
  17. package/dist/esm/sdk/accounts/CreditAccountsService.js +7 -4
  18. package/dist/esm/sdk/constants/address-provider.js +12 -8
  19. package/dist/esm/sdk/market/MarketSuite.js +1 -1
  20. package/dist/esm/sdk/market/credit/CreditFacadeV300Contract.js +5 -1
  21. package/dist/esm/sdk/market/credit/CreditFacadeV310Contract.js +5 -1
  22. package/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js +5 -6
  23. package/dist/esm/sdk/market/pool/PoolSuite.js +1 -1
  24. package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +6 -9
  25. package/dist/types/abi/compressors.d.ts +1106 -1734
  26. package/dist/types/adapters/BalancerV3RouterAdapterContract.d.ts +104 -62
  27. package/dist/types/adapters/abi/adapters.d.ts +0 -213
  28. package/dist/types/adapters/abi/iBalancerV3RouterAdapter.d.ts +230 -0
  29. package/dist/types/adapters/abi/index.d.ts +1 -0
  30. package/dist/types/sdk/accounts/CreditAccountsService.d.ts +2 -1
  31. package/dist/types/sdk/accounts/types.d.ts +2 -2
  32. package/dist/types/sdk/base/types.d.ts +6 -6
  33. package/dist/types/sdk/constants/address-provider.d.ts +10 -8
  34. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +85 -425
  35. package/dist/types/sdk/market/pool/PoolQuotaKeeperV300Contract.d.ts +2 -2
  36. package/dist/types/sdk/market/pool/PoolQuotaKeeperV310Contract.d.ts +2 -2
  37. package/dist/types/sdk/market/pool/createPoolQuotaKeeper.d.ts +2 -2
  38. package/dist/types/sdk/router/types.d.ts +4 -0
  39. package/dist/types/sdk/types/state-human.d.ts +3 -1
  40. package/package.json +2 -2
@@ -0,0 +1,230 @@
1
+ export declare const iBalancerV3RouterAdapterAbi: readonly [{
2
+ readonly type: "constructor";
3
+ readonly inputs: readonly [{
4
+ readonly name: "_creditManager";
5
+ readonly type: "address";
6
+ readonly internalType: "address";
7
+ }, {
8
+ readonly name: "_router";
9
+ readonly type: "address";
10
+ readonly internalType: "address";
11
+ }];
12
+ readonly stateMutability: "nonpayable";
13
+ }, {
14
+ readonly type: "function";
15
+ readonly name: "_gearboxAdapterType";
16
+ readonly inputs: readonly [];
17
+ readonly outputs: readonly [{
18
+ readonly name: "";
19
+ readonly type: "uint8";
20
+ readonly internalType: "enum AdapterType";
21
+ }];
22
+ readonly stateMutability: "view";
23
+ }, {
24
+ readonly type: "function";
25
+ readonly name: "_gearboxAdapterVersion";
26
+ readonly inputs: readonly [];
27
+ readonly outputs: readonly [{
28
+ readonly name: "";
29
+ readonly type: "uint16";
30
+ readonly internalType: "uint16";
31
+ }];
32
+ readonly stateMutability: "view";
33
+ }, {
34
+ readonly type: "function";
35
+ readonly name: "acl";
36
+ readonly inputs: readonly [];
37
+ readonly outputs: readonly [{
38
+ readonly name: "";
39
+ readonly type: "address";
40
+ readonly internalType: "address";
41
+ }];
42
+ readonly stateMutability: "view";
43
+ }, {
44
+ readonly type: "function";
45
+ readonly name: "addressProvider";
46
+ readonly inputs: readonly [];
47
+ readonly outputs: readonly [{
48
+ readonly name: "";
49
+ readonly type: "address";
50
+ readonly internalType: "address";
51
+ }];
52
+ readonly stateMutability: "view";
53
+ }, {
54
+ readonly type: "function";
55
+ readonly name: "creditManager";
56
+ readonly inputs: readonly [];
57
+ readonly outputs: readonly [{
58
+ readonly name: "";
59
+ readonly type: "address";
60
+ readonly internalType: "address";
61
+ }];
62
+ readonly stateMutability: "view";
63
+ }, {
64
+ readonly type: "function";
65
+ readonly name: "getAllowedPools";
66
+ readonly inputs: readonly [];
67
+ readonly outputs: readonly [{
68
+ readonly name: "pools";
69
+ readonly type: "address[]";
70
+ readonly internalType: "address[]";
71
+ }];
72
+ readonly stateMutability: "view";
73
+ }, {
74
+ readonly type: "function";
75
+ readonly name: "isPoolAllowed";
76
+ readonly inputs: readonly [{
77
+ readonly name: "pool";
78
+ readonly type: "address";
79
+ readonly internalType: "address";
80
+ }];
81
+ readonly outputs: readonly [{
82
+ readonly name: "";
83
+ readonly type: "bool";
84
+ readonly internalType: "bool";
85
+ }];
86
+ readonly stateMutability: "view";
87
+ }, {
88
+ readonly type: "function";
89
+ readonly name: "setPoolStatusBatch";
90
+ readonly inputs: readonly [{
91
+ readonly name: "pools";
92
+ readonly type: "address[]";
93
+ readonly internalType: "address[]";
94
+ }, {
95
+ readonly name: "statuses";
96
+ readonly type: "bool[]";
97
+ readonly internalType: "bool[]";
98
+ }];
99
+ readonly outputs: readonly [];
100
+ readonly stateMutability: "nonpayable";
101
+ }, {
102
+ readonly type: "function";
103
+ readonly name: "swapSingleTokenDiffIn";
104
+ readonly inputs: readonly [{
105
+ readonly name: "pool";
106
+ readonly type: "address";
107
+ readonly internalType: "address";
108
+ }, {
109
+ readonly name: "tokenIn";
110
+ readonly type: "address";
111
+ readonly internalType: "contract IERC20";
112
+ }, {
113
+ readonly name: "tokenOut";
114
+ readonly type: "address";
115
+ readonly internalType: "contract IERC20";
116
+ }, {
117
+ readonly name: "leftoverAmount";
118
+ readonly type: "uint256";
119
+ readonly internalType: "uint256";
120
+ }, {
121
+ readonly name: "rateMinRAY";
122
+ readonly type: "uint256";
123
+ readonly internalType: "uint256";
124
+ }, {
125
+ readonly name: "deadline";
126
+ readonly type: "uint256";
127
+ readonly internalType: "uint256";
128
+ }];
129
+ readonly outputs: readonly [{
130
+ readonly name: "tokensToEnable";
131
+ readonly type: "uint256";
132
+ readonly internalType: "uint256";
133
+ }, {
134
+ readonly name: "tokensToDisable";
135
+ readonly type: "uint256";
136
+ readonly internalType: "uint256";
137
+ }];
138
+ readonly stateMutability: "nonpayable";
139
+ }, {
140
+ readonly type: "function";
141
+ readonly name: "swapSingleTokenExactIn";
142
+ readonly inputs: readonly [{
143
+ readonly name: "pool";
144
+ readonly type: "address";
145
+ readonly internalType: "address";
146
+ }, {
147
+ readonly name: "tokenIn";
148
+ readonly type: "address";
149
+ readonly internalType: "contract IERC20";
150
+ }, {
151
+ readonly name: "tokenOut";
152
+ readonly type: "address";
153
+ readonly internalType: "contract IERC20";
154
+ }, {
155
+ readonly name: "exactAmountIn";
156
+ readonly type: "uint256";
157
+ readonly internalType: "uint256";
158
+ }, {
159
+ readonly name: "minAmountOut";
160
+ readonly type: "uint256";
161
+ readonly internalType: "uint256";
162
+ }, {
163
+ readonly name: "deadline";
164
+ readonly type: "uint256";
165
+ readonly internalType: "uint256";
166
+ }, {
167
+ readonly name: "";
168
+ readonly type: "bool";
169
+ readonly internalType: "bool";
170
+ }, {
171
+ readonly name: "";
172
+ readonly type: "bytes";
173
+ readonly internalType: "bytes";
174
+ }];
175
+ readonly outputs: readonly [{
176
+ readonly name: "tokensToEnable";
177
+ readonly type: "uint256";
178
+ readonly internalType: "uint256";
179
+ }, {
180
+ readonly name: "tokensToDisable";
181
+ readonly type: "uint256";
182
+ readonly internalType: "uint256";
183
+ }];
184
+ readonly stateMutability: "nonpayable";
185
+ }, {
186
+ readonly type: "function";
187
+ readonly name: "targetContract";
188
+ readonly inputs: readonly [];
189
+ readonly outputs: readonly [{
190
+ readonly name: "";
191
+ readonly type: "address";
192
+ readonly internalType: "address";
193
+ }];
194
+ readonly stateMutability: "view";
195
+ }, {
196
+ readonly type: "event";
197
+ readonly name: "SetPoolStatus";
198
+ readonly inputs: readonly [{
199
+ readonly name: "pool";
200
+ readonly type: "address";
201
+ readonly indexed: true;
202
+ readonly internalType: "address";
203
+ }, {
204
+ readonly name: "allowed";
205
+ readonly type: "bool";
206
+ readonly indexed: false;
207
+ readonly internalType: "bool";
208
+ }];
209
+ readonly anonymous: false;
210
+ }, {
211
+ readonly type: "error";
212
+ readonly name: "CallerNotConfiguratorException";
213
+ readonly inputs: readonly [];
214
+ }, {
215
+ readonly type: "error";
216
+ readonly name: "CallerNotCreditFacadeException";
217
+ readonly inputs: readonly [];
218
+ }, {
219
+ readonly type: "error";
220
+ readonly name: "InvalidLengthException";
221
+ readonly inputs: readonly [];
222
+ }, {
223
+ readonly type: "error";
224
+ readonly name: "InvalidPoolException";
225
+ readonly inputs: readonly [];
226
+ }, {
227
+ readonly type: "error";
228
+ readonly name: "ZeroAddressException";
229
+ readonly inputs: readonly [];
230
+ }];
@@ -1 +1,2 @@
1
1
  export * from "./adapters.js";
2
+ export * from "./iBalancerV3RouterAdapter.js";
@@ -73,9 +73,10 @@ export declare class CreditAccountsService extends SDKConstruct {
73
73
  * @param account
74
74
  * @param to Address to transfer underlying left after liquidation
75
75
  * @param slippage
76
+ * @param force TODO: legacy v3 option to remove
76
77
  * @returns
77
78
  */
78
- fullyLiquidate(account: RouterCASlice, to: Address, slippage?: bigint): Promise<CloseCreditAccountResult>;
79
+ fullyLiquidate(account: RouterCASlice, to: Address, slippage?: bigint, force?: boolean): Promise<CloseCreditAccountResult>;
79
80
  /**
80
81
  * Closes credit account or closes credit account and keeps it open with zero debt.
81
82
  - Ca is closed in the following order: price update -> close path to swap all tokens into underlying ->
@@ -8,8 +8,8 @@ export interface CreditAccountFilter {
8
8
  creditManager?: Address;
9
9
  owner?: Address;
10
10
  includeZeroDebt?: boolean;
11
- minHealthFactor?: bigint;
12
- maxHealthFactor?: bigint;
11
+ minHealthFactor?: number;
12
+ maxHealthFactor?: number;
13
13
  }
14
14
  export interface CloseCreditAccountResult extends CreditAccountOperationResult {
15
15
  routerCloseResult: RouterCloseResult;
@@ -15,7 +15,7 @@ export type MarketFilter = AbiParametersToPrimitiveTypes<ExtractAbiFunction<type
15
15
  export type CreditAccountData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iCreditAccountCompressorAbi, "getCreditAccountData">["outputs"]>>;
16
16
  export type RewardInfo = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iRewardsCompressorAbi, "getRewards">["outputs"]>>;
17
17
  export type MarketData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iMarketCompressorAbi, "getMarkets">["outputs"]>>;
18
- export type GaugeData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iGaugeCompressorAbi, "getGaugeInfo">["outputs"]>>;
18
+ export type GaugeData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iGaugeCompressorAbi, "getGauge">["outputs"]>>;
19
19
  export type ConnectedBotData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iPeripheryCompressorAbi, "getConnectedBots">["outputs"]>>;
20
20
  export type CreditSuiteState = Unarray<MarketData["creditManagers"]>;
21
21
  export type CreditManagerState = CreditSuiteState["creditManager"];
@@ -24,12 +24,12 @@ export type CreditConfiguratorState = CreditSuiteState["creditConfigurator"];
24
24
  export type AdapterData = Unarray<CreditSuiteState["adapters"]>;
25
25
  export type TokenMetaData = Unarray<MarketData["tokens"]>;
26
26
  export type PoolState = MarketData["pool"];
27
- export type QuotaKeeperState = MarketData["quotaKeeper"];
28
- export type QuotaState = Unarray<QuotaKeeperState["quotas"]>;
27
+ export type PoolQuotaKeeperState = MarketData["poolQuotaKeeper"];
28
+ export type QuotaState = Unarray<PoolQuotaKeeperState["quotas"]>;
29
29
  export type RateKeeperState = MarketData["rateKeeper"];
30
- export type PriceOracleData = MarketData["priceOracle"];
31
- export type PriceFeedMapEntry = Unarray<PriceOracleData["priceFeedMap"]>;
32
- export type PriceFeedTreeNode = Unarray<PriceOracleData["priceFeedTree"]>;
30
+ export type PriceOracleData = MarketData["priceOracleData"];
31
+ export type PriceFeedMapEntry = Unarray<PriceOracleData["priceFeedMapping"]>;
32
+ export type PriceFeedTreeNode = Unarray<PriceOracleData["priceFeedStructure"]>;
33
33
  export type PriceFeedAnswer = PriceFeedTreeNode["answer"];
34
34
  export type CreditManagerDebtParams = Unarray<PoolState["creditManagerDebtParams"]>;
35
35
  export declare enum VotingContractStatus {
@@ -3,30 +3,32 @@ import type { NetworkType } from "../chain/index.js";
3
3
  export declare const NO_VERSION = 0;
4
4
  export declare const AP_ACCOUNT_FACTORY = "ACCOUNT_FACTORY";
5
5
  export declare const AP_ACL = "ACL";
6
+ export declare const AP_ADAPTER_COMPRESSOR = "ADAPTER_COMPRESSOR";
6
7
  export declare const AP_BOT_LIST = "BOT_LIST";
7
8
  export declare const AP_BYTECODE_REPOSITORY = "BYTECODE_REPOSITORY";
8
9
  export declare const AP_CONTRACTS_REGISTER = "CONTRACTS_REGISTER";
9
10
  export declare const AP_CONTROLLER_TIMELOCK = "CONTROLLER_TIMELOCK";
10
- export declare const AP_CREDIT_ACCOUNT_COMPRESSOR = "GLOBAL::ACCOUNT_COMPRESSOR";
11
- export declare const AP_CREDIT_SUITE_COMPRESSOR = "GLOBAL::CREDIT_SUITE_COMPRESSOR";
11
+ export declare const AP_CREDIT_ACCOUNT_COMPRESSOR = "CREDIT_ACCOUNT_COMPRESSOR";
12
+ export declare const AP_CREDIT_SUITE_COMPRESSOR = "CREDIT_SUITE_COMPRESSOR";
12
13
  export declare const AP_DATA_COMPRESSOR = "DATA_COMPRESSOR";
13
14
  export declare const AP_DELEVERAGE_BOT_HV = "DELEVERAGE_BOT_HV";
14
15
  export declare const AP_DELEVERAGE_BOT_LV = "DELEVERAGE_BOT_LV";
15
16
  export declare const AP_DELEVERAGE_BOT_PEGGED = "DELEVERAGE_BOT_PEGGED";
16
- export declare const AP_GAUGE_COMPRESSOR = "GLOBAL::GAUGE_COMPRESSOR";
17
+ export declare const AP_GAUGE_COMPRESSOR = "GAUGE_COMPRESSOR";
17
18
  export declare const AP_GEAR_STAKING = "GEAR_STAKING";
18
19
  export declare const AP_GEAR_TOKEN = "GEAR_TOKEN";
19
20
  export declare const AP_INFLATION_ATTACK_BLOCKER = "INFLATION_ATTACK_BLOCKER";
20
21
  export declare const AP_INSOLVENCY_CHECKER = "INSOLVENCY_CHECKER";
21
- export declare const AP_MARKET_COMPRESSOR = "GLOBAL::MARKET_COMPRESSOR";
22
+ export declare const AP_MARKET_COMPRESSOR = "MARKET_COMPRESSOR";
22
23
  export declare const AP_MARKET_CONFIGURATOR = "MARKET_CONFIGURATOR";
23
24
  export declare const AP_PARTIAL_LIQUIDATION_BOT = "PARTIAL_LIQUIDATION_BOT";
24
- export declare const AP_PERIPHERY_COMPRESSOR = "GLOBAL::PERIPHERY_COMPRESSOR";
25
- export declare const AP_PRICE_FEED_COMPRESSOR = "GLOBAL::PRICE_FEED_COMPRESSOR";
25
+ export declare const AP_PERIPHERY_COMPRESSOR = "PERIPHERY_COMPRESSOR";
26
+ export declare const AP_POOL_COMPRESSOR = "POOL_COMPRESSOR";
27
+ export declare const AP_PRICE_FEED_COMPRESSOR = "PRICE_FEED_COMPRESSOR";
26
28
  export declare const AP_PRICE_ORACLE = "PRICE_ORACLE";
27
- export declare const AP_REWARDS_COMPRESSOR = "GLOBAL::REWARDS_COMPRESSOR";
29
+ export declare const AP_REWARDS_COMPRESSOR = "REWARDS_COMPRESSOR";
28
30
  export declare const AP_ROUTER = "LOCAL::ROUTER";
29
- export declare const AP_TOKEN_COMPRESSOR = "GLOBAL::TOKEN_COMPRESSOR";
31
+ export declare const AP_TOKEN_COMPRESSOR = "TOKEN_COMPRESSOR";
30
32
  export declare const AP_TREASURY = "TREASURY";
31
33
  export declare const AP_WETH_GATEWAY = "WETH_GATEWAY";
32
34
  export declare const AP_WETH_TOKEN = "WETH_TOKEN";