@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
@@ -19,9 +19,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var adapters_exports = {};
20
20
  __export(adapters_exports, {
21
21
  iBalancerV2VaultAdapterAbi: () => iBalancerV2VaultAdapterAbi,
22
- iBalancerV3RouterAdapterAbi: () => iBalancerV3RouterAdapterAbi,
23
- iBalancerV3RouterAdapterEventsAbi: () => iBalancerV3RouterAdapterEventsAbi,
24
- iBalancerV3RouterAdapterExceptionsAbi: () => iBalancerV3RouterAdapterExceptionsAbi,
25
22
  iCamelotV3AdapterAbi: () => iCamelotV3AdapterAbi,
26
23
  iConvexV1BaseRewardPoolAdapterAbi: () => iConvexV1BaseRewardPoolAdapterAbi,
27
24
  iConvexV1BoosterAdapterAbi: () => iConvexV1BoosterAdapterAbi,
@@ -337,123 +334,6 @@ const iBalancerV2VaultAdapterAbi = [
337
334
  },
338
335
  { type: "error", inputs: [], name: "PoolNotSupportedException" }
339
336
  ];
340
- const iBalancerV3RouterAdapterAbi = [
341
- {
342
- type: "function",
343
- inputs: [],
344
- name: "contractType",
345
- outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }],
346
- stateMutability: "view"
347
- },
348
- {
349
- type: "function",
350
- inputs: [],
351
- name: "creditManager",
352
- outputs: [{ name: "", internalType: "address", type: "address" }],
353
- stateMutability: "view"
354
- },
355
- {
356
- type: "function",
357
- inputs: [],
358
- name: "getAllowedPools",
359
- outputs: [{ name: "pools", internalType: "address[]", type: "address[]" }],
360
- stateMutability: "view"
361
- },
362
- {
363
- type: "function",
364
- inputs: [{ name: "pool", internalType: "address", type: "address" }],
365
- name: "isPoolAllowed",
366
- outputs: [{ name: "", internalType: "bool", type: "bool" }],
367
- stateMutability: "view"
368
- },
369
- {
370
- type: "function",
371
- inputs: [],
372
- name: "serialize",
373
- outputs: [{ name: "serializedData", internalType: "bytes", type: "bytes" }],
374
- stateMutability: "view"
375
- },
376
- {
377
- type: "function",
378
- inputs: [
379
- { name: "pools", internalType: "address[]", type: "address[]" },
380
- { name: "statuses", internalType: "bool[]", type: "bool[]" }
381
- ],
382
- name: "setPoolStatusBatch",
383
- outputs: [],
384
- stateMutability: "nonpayable"
385
- },
386
- {
387
- type: "function",
388
- inputs: [
389
- { name: "pool", internalType: "address", type: "address" },
390
- { name: "tokenIn", internalType: "contract IERC20", type: "address" },
391
- { name: "tokenOut", internalType: "contract IERC20", type: "address" },
392
- { name: "leftoverAmount", internalType: "uint256", type: "uint256" },
393
- { name: "rateMinRAY", internalType: "uint256", type: "uint256" },
394
- { name: "deadline", internalType: "uint256", type: "uint256" }
395
- ],
396
- name: "swapSingleTokenDiffIn",
397
- outputs: [{ name: "", internalType: "bool", type: "bool" }],
398
- stateMutability: "nonpayable"
399
- },
400
- {
401
- type: "function",
402
- inputs: [
403
- { name: "pool", internalType: "address", type: "address" },
404
- { name: "tokenIn", internalType: "contract IERC20", type: "address" },
405
- { name: "tokenOut", internalType: "contract IERC20", type: "address" },
406
- { name: "exactAmountIn", internalType: "uint256", type: "uint256" },
407
- { name: "minAmountOut", internalType: "uint256", type: "uint256" },
408
- { name: "deadline", internalType: "uint256", type: "uint256" },
409
- { name: "wethIsEth", internalType: "bool", type: "bool" },
410
- { name: "userData", internalType: "bytes", type: "bytes" }
411
- ],
412
- name: "swapSingleTokenExactIn",
413
- outputs: [{ name: "", internalType: "bool", type: "bool" }],
414
- stateMutability: "nonpayable"
415
- },
416
- {
417
- type: "function",
418
- inputs: [],
419
- name: "targetContract",
420
- outputs: [{ name: "", internalType: "address", type: "address" }],
421
- stateMutability: "view"
422
- },
423
- {
424
- type: "function",
425
- inputs: [],
426
- name: "version",
427
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
428
- stateMutability: "view"
429
- },
430
- {
431
- type: "event",
432
- anonymous: false,
433
- inputs: [
434
- { name: "pool", internalType: "address", type: "address", indexed: true },
435
- { name: "allowed", internalType: "bool", type: "bool", indexed: false }
436
- ],
437
- name: "SetPoolStatus"
438
- },
439
- { type: "error", inputs: [], name: "InvalidLengthException" },
440
- { type: "error", inputs: [], name: "InvalidPoolException" }
441
- ];
442
- const iBalancerV3RouterAdapterEventsAbi = [
443
- {
444
- type: "event",
445
- anonymous: false,
446
- inputs: [
447
- { name: "pool", internalType: "address", type: "address", indexed: true },
448
- { name: "allowed", internalType: "bool", type: "bool", indexed: false }
449
- ],
450
- name: "SetPoolStatus"
451
- }
452
- ];
453
- const iBalancerV3RouterAdapterExceptionsAbi = [
454
- { type: "error", inputs: [], name: "InvalidLengthException" },
455
- { type: "error", inputs: [], name: "InvalidPoolException" }
456
- ];
457
337
  const iCamelotV3AdapterAbi = [
458
338
  {
459
339
  type: "function",
@@ -4366,9 +4246,6 @@ const iwstEthv1AdapterAbi = [
4366
4246
  // Annotate the CommonJS export names for ESM import in node:
4367
4247
  0 && (module.exports = {
4368
4248
  iBalancerV2VaultAdapterAbi,
4369
- iBalancerV3RouterAdapterAbi,
4370
- iBalancerV3RouterAdapterEventsAbi,
4371
- iBalancerV3RouterAdapterExceptionsAbi,
4372
4249
  iCamelotV3AdapterAbi,
4373
4250
  iConvexV1BaseRewardPoolAdapterAbi,
4374
4251
  iConvexV1BoosterAdapterAbi,
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var iBalancerV3RouterAdapter_exports = {};
20
+ __export(iBalancerV3RouterAdapter_exports, {
21
+ iBalancerV3RouterAdapterAbi: () => iBalancerV3RouterAdapterAbi
22
+ });
23
+ module.exports = __toCommonJS(iBalancerV3RouterAdapter_exports);
24
+ const iBalancerV3RouterAdapterAbi = [
25
+ {
26
+ type: "constructor",
27
+ inputs: [
28
+ { name: "_creditManager", type: "address", internalType: "address" },
29
+ { name: "_router", type: "address", internalType: "address" }
30
+ ],
31
+ stateMutability: "nonpayable"
32
+ },
33
+ {
34
+ type: "function",
35
+ name: "_gearboxAdapterType",
36
+ inputs: [],
37
+ outputs: [{ name: "", type: "uint8", internalType: "enum AdapterType" }],
38
+ stateMutability: "view"
39
+ },
40
+ {
41
+ type: "function",
42
+ name: "_gearboxAdapterVersion",
43
+ inputs: [],
44
+ outputs: [{ name: "", type: "uint16", internalType: "uint16" }],
45
+ stateMutability: "view"
46
+ },
47
+ {
48
+ type: "function",
49
+ name: "acl",
50
+ inputs: [],
51
+ outputs: [{ name: "", type: "address", internalType: "address" }],
52
+ stateMutability: "view"
53
+ },
54
+ {
55
+ type: "function",
56
+ name: "addressProvider",
57
+ inputs: [],
58
+ outputs: [{ name: "", type: "address", internalType: "address" }],
59
+ stateMutability: "view"
60
+ },
61
+ {
62
+ type: "function",
63
+ name: "creditManager",
64
+ inputs: [],
65
+ outputs: [{ name: "", type: "address", internalType: "address" }],
66
+ stateMutability: "view"
67
+ },
68
+ {
69
+ type: "function",
70
+ name: "getAllowedPools",
71
+ inputs: [],
72
+ outputs: [{ name: "pools", type: "address[]", internalType: "address[]" }],
73
+ stateMutability: "view"
74
+ },
75
+ {
76
+ type: "function",
77
+ name: "isPoolAllowed",
78
+ inputs: [{ name: "pool", type: "address", internalType: "address" }],
79
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
80
+ stateMutability: "view"
81
+ },
82
+ {
83
+ type: "function",
84
+ name: "setPoolStatusBatch",
85
+ inputs: [
86
+ { name: "pools", type: "address[]", internalType: "address[]" },
87
+ { name: "statuses", type: "bool[]", internalType: "bool[]" }
88
+ ],
89
+ outputs: [],
90
+ stateMutability: "nonpayable"
91
+ },
92
+ {
93
+ type: "function",
94
+ name: "swapSingleTokenDiffIn",
95
+ inputs: [
96
+ { name: "pool", type: "address", internalType: "address" },
97
+ { name: "tokenIn", type: "address", internalType: "contract IERC20" },
98
+ { name: "tokenOut", type: "address", internalType: "contract IERC20" },
99
+ { name: "leftoverAmount", type: "uint256", internalType: "uint256" },
100
+ { name: "rateMinRAY", type: "uint256", internalType: "uint256" },
101
+ { name: "deadline", type: "uint256", internalType: "uint256" }
102
+ ],
103
+ outputs: [
104
+ { name: "tokensToEnable", type: "uint256", internalType: "uint256" },
105
+ { name: "tokensToDisable", type: "uint256", internalType: "uint256" }
106
+ ],
107
+ stateMutability: "nonpayable"
108
+ },
109
+ {
110
+ type: "function",
111
+ name: "swapSingleTokenExactIn",
112
+ inputs: [
113
+ { name: "pool", type: "address", internalType: "address" },
114
+ { name: "tokenIn", type: "address", internalType: "contract IERC20" },
115
+ { name: "tokenOut", type: "address", internalType: "contract IERC20" },
116
+ { name: "exactAmountIn", type: "uint256", internalType: "uint256" },
117
+ { name: "minAmountOut", type: "uint256", internalType: "uint256" },
118
+ { name: "deadline", type: "uint256", internalType: "uint256" },
119
+ { name: "", type: "bool", internalType: "bool" },
120
+ { name: "", type: "bytes", internalType: "bytes" }
121
+ ],
122
+ outputs: [
123
+ { name: "tokensToEnable", type: "uint256", internalType: "uint256" },
124
+ { name: "tokensToDisable", type: "uint256", internalType: "uint256" }
125
+ ],
126
+ stateMutability: "nonpayable"
127
+ },
128
+ {
129
+ type: "function",
130
+ name: "targetContract",
131
+ inputs: [],
132
+ outputs: [{ name: "", type: "address", internalType: "address" }],
133
+ stateMutability: "view"
134
+ },
135
+ {
136
+ type: "event",
137
+ name: "SetPoolStatus",
138
+ inputs: [
139
+ { name: "pool", type: "address", indexed: true, internalType: "address" },
140
+ { name: "allowed", type: "bool", indexed: false, internalType: "bool" }
141
+ ],
142
+ anonymous: false
143
+ },
144
+ { type: "error", name: "CallerNotConfiguratorException", inputs: [] },
145
+ { type: "error", name: "CallerNotCreditFacadeException", inputs: [] },
146
+ { type: "error", name: "InvalidLengthException", inputs: [] },
147
+ { type: "error", name: "InvalidPoolException", inputs: [] },
148
+ { type: "error", name: "ZeroAddressException", inputs: [] }
149
+ ];
150
+ // Annotate the CommonJS export names for ESM import in node:
151
+ 0 && (module.exports = {
152
+ iBalancerV3RouterAdapterAbi
153
+ });
@@ -16,7 +16,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
16
16
  var abi_exports = {};
17
17
  module.exports = __toCommonJS(abi_exports);
18
18
  __reExport(abi_exports, require("./adapters.js"), module.exports);
19
+ __reExport(abi_exports, require("./iBalancerV3RouterAdapter.js"), module.exports);
19
20
  // Annotate the CommonJS export names for ESM import in node:
20
21
  0 && (module.exports = {
21
- ...require("./adapters.js")
22
+ ...require("./adapters.js"),
23
+ ...require("./iBalancerV3RouterAdapter.js")
22
24
  });
@@ -99,8 +99,9 @@ class CreditAccountsService extends import_base.SDKConstruct {
99
99
  const {
100
100
  creditManager,
101
101
  includeZeroDebt = false,
102
- maxHealthFactor = import_constants.MAX_UINT256,
103
- minHealthFactor = 0n,
102
+ maxHealthFactor = 65535,
103
+ // TODO: this will change to bigint
104
+ minHealthFactor = 0,
104
105
  owner = import_constants.ADDRESS_0X0
105
106
  } = args ?? {};
106
107
  const arg0 = creditManager ?? {
@@ -208,14 +209,16 @@ class CreditAccountsService extends import_base.SDKConstruct {
208
209
  * @param account
209
210
  * @param to Address to transfer underlying left after liquidation
210
211
  * @param slippage
212
+ * @param force TODO: legacy v3 option to remove
211
213
  * @returns
212
214
  */
213
- async fullyLiquidate(account, to, slippage = 50n) {
215
+ async fullyLiquidate(account, to, slippage = 50n, force = false) {
214
216
  const cm = this.sdk.marketRegister.findCreditManager(account.creditManager);
215
217
  const routerCloseResult = await this.sdk.router.findBestClosePath({
216
218
  creditAccount: account,
217
219
  creditManager: cm.creditManager,
218
- slippage
220
+ slippage,
221
+ force
219
222
  });
220
223
  const priceUpdates = await this.getPriceUpdatesForFacade(
221
224
  account.creditManager,
@@ -22,6 +22,7 @@ __export(address_provider_exports, {
22
22
  ADDRESS_PROVIDER_V310: () => ADDRESS_PROVIDER_V310,
23
23
  AP_ACCOUNT_FACTORY: () => AP_ACCOUNT_FACTORY,
24
24
  AP_ACL: () => AP_ACL,
25
+ AP_ADAPTER_COMPRESSOR: () => AP_ADAPTER_COMPRESSOR,
25
26
  AP_BOT_LIST: () => AP_BOT_LIST,
26
27
  AP_BYTECODE_REPOSITORY: () => AP_BYTECODE_REPOSITORY,
27
28
  AP_CONTRACTS_REGISTER: () => AP_CONTRACTS_REGISTER,
@@ -41,6 +42,7 @@ __export(address_provider_exports, {
41
42
  AP_MARKET_CONFIGURATOR: () => AP_MARKET_CONFIGURATOR,
42
43
  AP_PARTIAL_LIQUIDATION_BOT: () => AP_PARTIAL_LIQUIDATION_BOT,
43
44
  AP_PERIPHERY_COMPRESSOR: () => AP_PERIPHERY_COMPRESSOR,
45
+ AP_POOL_COMPRESSOR: () => AP_POOL_COMPRESSOR,
44
46
  AP_PRICE_FEED_COMPRESSOR: () => AP_PRICE_FEED_COMPRESSOR,
45
47
  AP_PRICE_ORACLE: () => AP_PRICE_ORACLE,
46
48
  AP_REWARDS_COMPRESSOR: () => AP_REWARDS_COMPRESSOR,
@@ -58,30 +60,32 @@ var import_addresses = require("./addresses.js");
58
60
  const NO_VERSION = 0;
59
61
  const AP_ACCOUNT_FACTORY = "ACCOUNT_FACTORY";
60
62
  const AP_ACL = "ACL";
63
+ const AP_ADAPTER_COMPRESSOR = "ADAPTER_COMPRESSOR";
61
64
  const AP_BOT_LIST = "BOT_LIST";
62
65
  const AP_BYTECODE_REPOSITORY = "BYTECODE_REPOSITORY";
63
66
  const AP_CONTRACTS_REGISTER = "CONTRACTS_REGISTER";
64
67
  const AP_CONTROLLER_TIMELOCK = "CONTROLLER_TIMELOCK";
65
- const AP_CREDIT_ACCOUNT_COMPRESSOR = "GLOBAL::ACCOUNT_COMPRESSOR";
66
- const AP_CREDIT_SUITE_COMPRESSOR = "GLOBAL::CREDIT_SUITE_COMPRESSOR";
68
+ const AP_CREDIT_ACCOUNT_COMPRESSOR = "CREDIT_ACCOUNT_COMPRESSOR";
69
+ const AP_CREDIT_SUITE_COMPRESSOR = "CREDIT_SUITE_COMPRESSOR";
67
70
  const AP_DATA_COMPRESSOR = "DATA_COMPRESSOR";
68
71
  const AP_DELEVERAGE_BOT_HV = "DELEVERAGE_BOT_HV";
69
72
  const AP_DELEVERAGE_BOT_LV = "DELEVERAGE_BOT_LV";
70
73
  const AP_DELEVERAGE_BOT_PEGGED = "DELEVERAGE_BOT_PEGGED";
71
- const AP_GAUGE_COMPRESSOR = "GLOBAL::GAUGE_COMPRESSOR";
74
+ const AP_GAUGE_COMPRESSOR = "GAUGE_COMPRESSOR";
72
75
  const AP_GEAR_STAKING = "GEAR_STAKING";
73
76
  const AP_GEAR_TOKEN = "GEAR_TOKEN";
74
77
  const AP_INFLATION_ATTACK_BLOCKER = "INFLATION_ATTACK_BLOCKER";
75
78
  const AP_INSOLVENCY_CHECKER = "INSOLVENCY_CHECKER";
76
- const AP_MARKET_COMPRESSOR = "GLOBAL::MARKET_COMPRESSOR";
79
+ const AP_MARKET_COMPRESSOR = "MARKET_COMPRESSOR";
77
80
  const AP_MARKET_CONFIGURATOR = "MARKET_CONFIGURATOR";
78
81
  const AP_PARTIAL_LIQUIDATION_BOT = "PARTIAL_LIQUIDATION_BOT";
79
- const AP_PERIPHERY_COMPRESSOR = "GLOBAL::PERIPHERY_COMPRESSOR";
80
- const AP_PRICE_FEED_COMPRESSOR = "GLOBAL::PRICE_FEED_COMPRESSOR";
82
+ const AP_PERIPHERY_COMPRESSOR = "PERIPHERY_COMPRESSOR";
83
+ const AP_POOL_COMPRESSOR = "POOL_COMPRESSOR";
84
+ const AP_PRICE_FEED_COMPRESSOR = "PRICE_FEED_COMPRESSOR";
81
85
  const AP_PRICE_ORACLE = "PRICE_ORACLE";
82
- const AP_REWARDS_COMPRESSOR = "GLOBAL::REWARDS_COMPRESSOR";
86
+ const AP_REWARDS_COMPRESSOR = "REWARDS_COMPRESSOR";
83
87
  const AP_ROUTER = "LOCAL::ROUTER";
84
- const AP_TOKEN_COMPRESSOR = "GLOBAL::TOKEN_COMPRESSOR";
88
+ const AP_TOKEN_COMPRESSOR = "TOKEN_COMPRESSOR";
85
89
  const AP_TREASURY = "TREASURY";
86
90
  const AP_WETH_GATEWAY = "WETH_GATEWAY";
87
91
  const AP_WETH_TOKEN = "WETH_TOKEN";
@@ -106,6 +110,7 @@ const ADDRESS_PROVIDER_V310 = "0xBaB2014Dd88223E168bA06911c06df638311a097";
106
110
  ADDRESS_PROVIDER_V310,
107
111
  AP_ACCOUNT_FACTORY,
108
112
  AP_ACL,
113
+ AP_ADAPTER_COMPRESSOR,
109
114
  AP_BOT_LIST,
110
115
  AP_BYTECODE_REPOSITORY,
111
116
  AP_CONTRACTS_REGISTER,
@@ -125,6 +130,7 @@ const ADDRESS_PROVIDER_V310 = "0xBaB2014Dd88223E168bA06911c06df638311a097";
125
130
  AP_MARKET_CONFIGURATOR,
126
131
  AP_PARTIAL_LIQUIDATION_BOT,
127
132
  AP_PERIPHERY_COMPRESSOR,
133
+ AP_POOL_COMPRESSOR,
128
134
  AP_PRICE_FEED_COMPRESSOR,
129
135
  AP_PRICE_ORACLE,
130
136
  AP_REWARDS_COMPRESSOR,
@@ -60,7 +60,7 @@ class MarketSuite extends import_base.SDKConstruct {
60
60
  }
61
61
  this.priceOracle = (0, import_oracle.createPriceOracle)(
62
62
  sdk,
63
- marketData.priceOracle,
63
+ marketData.priceOracleData,
64
64
  marketData.pool.underlying
65
65
  );
66
66
  }
@@ -56,7 +56,11 @@ class CreditFacadeV300Contract extends import_base.BaseContract {
56
56
  botList: this.labelAddress(this.botList),
57
57
  minDebt: (0, import_utils.formatBNvalue)(this.minDebt, decimals),
58
58
  maxDebt: (0, import_utils.formatBNvalue)(this.maxDebt, decimals),
59
- forbiddenTokensMask: (0, import_utils.fmtBinaryMask)(this.forbiddenTokensMask),
59
+ currentCumulativeLoss: "0",
60
+ // TODO
61
+ maxCumulativeLoss: "0",
62
+ // TODO
63
+ forbiddenTokenMask: (0, import_utils.fmtBinaryMask)(this.forbiddenTokenMask),
60
64
  isPaused: this.isPaused
61
65
  };
62
66
  }
@@ -56,7 +56,11 @@ class CreditFacadeV310Contract extends import_base.BaseContract {
56
56
  botList: this.labelAddress(this.botList),
57
57
  minDebt: (0, import_utils.formatBNvalue)(this.minDebt, decimals),
58
58
  maxDebt: (0, import_utils.formatBNvalue)(this.maxDebt, decimals),
59
- forbiddenTokensMask: (0, import_utils.fmtBinaryMask)(this.forbiddenTokensMask),
59
+ currentCumulativeLoss: "0",
60
+ // TODO
61
+ maxCumulativeLoss: "0",
62
+ // TODO
63
+ forbiddenTokenMask: (0, import_utils.fmtBinaryMask)(this.forbiddenTokenMask),
60
64
  isPaused: this.isPaused
61
65
  };
62
66
  }
@@ -75,8 +75,8 @@ class PriceOracleBaseContract extends import_base.BaseContract {
75
75
  constructor(sdk, args, data, underlying) {
76
76
  super(sdk, args);
77
77
  this.underlying = underlying;
78
- const { priceFeedMap, priceFeedTree } = data;
79
- this.#loadState(priceFeedMap, priceFeedTree);
78
+ const { priceFeedMapping, priceFeedStructure } = data;
79
+ this.#loadState(priceFeedMapping, priceFeedStructure);
80
80
  }
81
81
  /**
82
82
  * Returns main and reserve price feeds for given tokens
@@ -238,12 +238,11 @@ class PriceOracleBaseContract extends import_base.BaseContract {
238
238
  call: {
239
239
  abi: import_compressors.iPriceFeedCompressorAbi,
240
240
  address,
241
- functionName: "getPriceOracleState",
241
+ functionName: "getPriceFeeds",
242
242
  args
243
243
  },
244
- onResult: (resp) => {
245
- const { priceFeedMap, priceFeedTree } = resp;
246
- this.#loadState(priceFeedMap, priceFeedTree);
244
+ onResult: ([entries, tree]) => {
245
+ this.#loadState(entries, tree);
247
246
  }
248
247
  };
249
248
  }
@@ -47,7 +47,7 @@ class PoolSuite extends import_base.SDKConstruct {
47
47
  constructor(sdk, data) {
48
48
  super(sdk);
49
49
  this.pool = (0, import_createPool.default)(sdk, data.pool);
50
- this.pqk = (0, import_createPoolQuotaKeeper.default)(sdk, data.pool, data.quotaKeeper);
50
+ this.pqk = (0, import_createPoolQuotaKeeper.default)(sdk, data.pool, data.poolQuotaKeeper);
51
51
  this.rateKeeper = (0, import_createRateKeeper.default)(sdk, data.pool, data.rateKeeper);
52
52
  this.interestRateModel = (0, import_createInterestRateModel.default)(
53
53
  sdk,
@@ -127,8 +127,8 @@ class PriceFeedRegister extends import_base.SDKConstruct {
127
127
  * This is not saved anywhere in PriceFeedRegister, and can later be used to load price feed updates
128
128
  */
129
129
  async getPartialUpdatablePriceFeeds(marketConfigurators, pools) {
130
- const priceFeedCompressorAddress = this.sdk.addressProvider.getAddress(
131
- import_constants.AP_PRICE_FEED_COMPRESSOR,
130
+ const marketCompressorAddress = this.sdk.addressProvider.getAddress(
131
+ import_constants.AP_MARKET_COMPRESSOR,
132
132
  310
133
133
  );
134
134
  const configurators = marketConfigurators ?? this.sdk.marketRegister.marketConfigurators.map((mc) => mc.address);
@@ -137,8 +137,8 @@ class PriceFeedRegister extends import_base.SDKConstruct {
137
137
  `calling getUpdatablePriceFeeds in block ${this.sdk.currentBlock}`
138
138
  );
139
139
  const result = await this.provider.publicClient.readContract({
140
- address: priceFeedCompressorAddress,
141
- abi: import_compressors.iPriceFeedCompressorAbi,
140
+ address: marketCompressorAddress,
141
+ abi: import_compressors.iMarketCompressorAbi,
142
142
  functionName: "getUpdatablePriceFeeds",
143
143
  args: [
144
144
  {