@gearbox-protocol/sdk 3.0.1-next.1 → 3.0.1-next.3

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.
@@ -91,20 +91,21 @@ class CreditAccountsService extends import_base.SDKConstruct {
91
91
  * TODO: do we want to expose pagination?
92
92
  * TODO: do we want to expose "reverting"?
93
93
  * TODO: do we want to expose MarketFilter in any way? If so, we need to check that the MarketFilter is compatibled with attached markets?
94
- * @param args
94
+ * @param options
95
95
  * @param blockNumber
96
96
  * @returns returned credit accounts are sorted by health factor in ascending order
97
97
  */
98
- async getCreditAccounts(args, blockNumber) {
98
+ async getCreditAccounts(options, blockNumber) {
99
99
  const {
100
100
  creditManager,
101
101
  includeZeroDebt = false,
102
102
  maxHealthFactor = import_constants.MAX_UINT256,
103
103
  minHealthFactor = 0n,
104
104
  owner = import_constants.ADDRESS_0X0
105
- } = args ?? {};
105
+ } = options ?? {};
106
106
  const arg0 = creditManager ?? {
107
107
  configurators: this.marketConfigurators,
108
+ creditManagers: [],
108
109
  pools: [],
109
110
  underlying: import_constants.ADDRESS_0X0
110
111
  };
@@ -112,7 +113,8 @@ class CreditAccountsService extends import_base.SDKConstruct {
112
113
  owner,
113
114
  includeZeroDebt,
114
115
  minHealthFactor,
115
- maxHealthFactor
116
+ maxHealthFactor,
117
+ reverting: false
116
118
  };
117
119
  const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
118
120
  const allCAs = [];
@@ -70,7 +70,7 @@ const AP_DELEVERAGE_BOT_LV = "DELEVERAGE_BOT_LV";
70
70
  const AP_DELEVERAGE_BOT_PEGGED = "DELEVERAGE_BOT_PEGGED";
71
71
  const AP_GAUGE_COMPRESSOR = "GLOBAL::GAUGE_COMPRESSOR";
72
72
  const AP_GEAR_STAKING = "GEAR_STAKING";
73
- const AP_GEAR_TOKEN = "GEAR_TOKEN";
73
+ const AP_GEAR_TOKEN = "GLOBAL::GEAR_TOKEN";
74
74
  const AP_INFLATION_ATTACK_BLOCKER = "INFLATION_ATTACK_BLOCKER";
75
75
  const AP_INSOLVENCY_CHECKER = "INSOLVENCY_CHECKER";
76
76
  const AP_MARKET_COMPRESSOR = "GLOBAL::MARKET_COMPRESSOR";
@@ -95,20 +95,21 @@ class CreditAccountsService extends SDKConstruct {
95
95
  * TODO: do we want to expose pagination?
96
96
  * TODO: do we want to expose "reverting"?
97
97
  * TODO: do we want to expose MarketFilter in any way? If so, we need to check that the MarketFilter is compatibled with attached markets?
98
- * @param args
98
+ * @param options
99
99
  * @param blockNumber
100
100
  * @returns returned credit accounts are sorted by health factor in ascending order
101
101
  */
102
- async getCreditAccounts(args, blockNumber) {
102
+ async getCreditAccounts(options, blockNumber) {
103
103
  const {
104
104
  creditManager,
105
105
  includeZeroDebt = false,
106
106
  maxHealthFactor = MAX_UINT256,
107
107
  minHealthFactor = 0n,
108
108
  owner = ADDRESS_0X0
109
- } = args ?? {};
109
+ } = options ?? {};
110
110
  const arg0 = creditManager ?? {
111
111
  configurators: this.marketConfigurators,
112
+ creditManagers: [],
112
113
  pools: [],
113
114
  underlying: ADDRESS_0X0
114
115
  };
@@ -116,7 +117,8 @@ class CreditAccountsService extends SDKConstruct {
116
117
  owner,
117
118
  includeZeroDebt,
118
119
  minHealthFactor,
119
- maxHealthFactor
120
+ maxHealthFactor,
121
+ reverting: false
120
122
  };
121
123
  const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
122
124
  const allCAs = [];
@@ -14,7 +14,7 @@ const AP_DELEVERAGE_BOT_LV = "DELEVERAGE_BOT_LV";
14
14
  const AP_DELEVERAGE_BOT_PEGGED = "DELEVERAGE_BOT_PEGGED";
15
15
  const AP_GAUGE_COMPRESSOR = "GLOBAL::GAUGE_COMPRESSOR";
16
16
  const AP_GEAR_STAKING = "GEAR_STAKING";
17
- const AP_GEAR_TOKEN = "GEAR_TOKEN";
17
+ const AP_GEAR_TOKEN = "GLOBAL::GEAR_TOKEN";
18
18
  const AP_INFLATION_ATTACK_BLOCKER = "INFLATION_ATTACK_BLOCKER";
19
19
  const AP_INSOLVENCY_CHECKER = "INSOLVENCY_CHECKER";
20
20
  const AP_MARKET_COMPRESSOR = "GLOBAL::MARKET_COMPRESSOR";
@@ -5,7 +5,7 @@ import type { GearboxSDK } from "../GearboxSDK.js";
5
5
  import type { OnDemandPriceUpdate, UpdatePriceFeedsResult } from "../market/index.js";
6
6
  import { type Asset, type RouterCASlice } from "../router/index.js";
7
7
  import type { MultiCall } from "../types/index.js";
8
- import type { AddCollateralProps, ChangeDeptProps, ClaimFarmRewardsProps, CloseCreditAccountProps, CloseCreditAccountResult, CreditAccountFilter, CreditAccountOperationResult, EnableTokensProps, ExecuteSwapProps, OpenCAProps, RepayAndLiquidateCreditAccountProps, RepayCreditAccountProps, Rewards, UpdateQuotasProps, WithdrawCollateralProps } from "./types.js";
8
+ import type { AddCollateralProps, ChangeDeptProps, ClaimFarmRewardsProps, CloseCreditAccountProps, CloseCreditAccountResult, CreditAccountOperationResult, EnableTokensProps, ExecuteSwapProps, GetCreditAccountsOptions, OpenCAProps, RepayAndLiquidateCreditAccountProps, RepayCreditAccountProps, Rewards, UpdateQuotasProps, WithdrawCollateralProps } from "./types.js";
9
9
  export interface CreditAccountServiceOptions {
10
10
  batchSize?: number;
11
11
  }
@@ -27,11 +27,11 @@ export declare class CreditAccountsService extends SDKConstruct {
27
27
  * TODO: do we want to expose pagination?
28
28
  * TODO: do we want to expose "reverting"?
29
29
  * TODO: do we want to expose MarketFilter in any way? If so, we need to check that the MarketFilter is compatibled with attached markets?
30
- * @param args
30
+ * @param options
31
31
  * @param blockNumber
32
32
  * @returns returned credit accounts are sorted by health factor in ascending order
33
33
  */
34
- getCreditAccounts(args?: CreditAccountFilter, blockNumber?: bigint): Promise<Array<CreditAccountData>>;
34
+ getCreditAccounts(options?: GetCreditAccountsOptions, blockNumber?: bigint): Promise<Array<CreditAccountData>>;
35
35
  /**
36
36
  * Method to get all claimable rewards for credit account (ex. stkUSDS SKY rewards)
37
37
  Assosiates rewards by adapter + stakedPhantomToken
@@ -5,6 +5,19 @@ import type { Asset, RouterCASlice, RouterCloseResult } from "../router/index.js
5
5
  import type { MultiCall, RawTx } from "../types/index.js";
6
6
  export type GetCreditAccountsArgs = ContractFunctionArgs<typeof iCreditAccountCompressorAbi, "pure" | "view", "getCreditAccounts">;
7
7
  export interface CreditAccountFilter {
8
+ owner: Address;
9
+ includeZeroDebt: boolean;
10
+ minHealthFactor: bigint;
11
+ maxHealthFactor: bigint;
12
+ reverting: boolean;
13
+ }
14
+ export interface CreditManagerFilter {
15
+ configurators: readonly Address[];
16
+ creditManagers: readonly Address[];
17
+ pools: readonly Address[];
18
+ underlying: Address;
19
+ }
20
+ export interface GetCreditAccountsOptions {
8
21
  creditManager?: Address;
9
22
  owner?: Address;
10
23
  includeZeroDebt?: boolean;
@@ -15,7 +15,7 @@ export declare const AP_DELEVERAGE_BOT_LV = "DELEVERAGE_BOT_LV";
15
15
  export declare const AP_DELEVERAGE_BOT_PEGGED = "DELEVERAGE_BOT_PEGGED";
16
16
  export declare const AP_GAUGE_COMPRESSOR = "GLOBAL::GAUGE_COMPRESSOR";
17
17
  export declare const AP_GEAR_STAKING = "GEAR_STAKING";
18
- export declare const AP_GEAR_TOKEN = "GEAR_TOKEN";
18
+ export declare const AP_GEAR_TOKEN = "GLOBAL::GEAR_TOKEN";
19
19
  export declare const AP_INFLATION_ATTACK_BLOCKER = "INFLATION_ATTACK_BLOCKER";
20
20
  export declare const AP_INSOLVENCY_CHECKER = "INSOLVENCY_CHECKER";
21
21
  export declare const AP_MARKET_COMPRESSOR = "GLOBAL::MARKET_COMPRESSOR";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.1-next.1",
3
+ "version": "3.0.1-next.3",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",