@gearbox-protocol/sdk 8.27.2 → 8.27.4

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.
@@ -59,7 +59,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
59
59
  async getCreditAccountData(account, blockNumber) {
60
60
  let raw;
61
61
  try {
62
- raw = await this.provider.publicClient.readContract({
62
+ raw = await this.client.readContract({
63
63
  abi: import_compressors.iCreditAccountCompressorAbi,
64
64
  address: this.#compressor,
65
65
  functionName: "getCreditAccountData",
@@ -77,7 +77,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
77
77
  const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(void 0, {
78
78
  account
79
79
  });
80
- const [cad] = await (0, import_viem2.simulateWithPriceUpdates)(this.provider.publicClient, {
80
+ const [cad] = await (0, import_viem2.simulateWithPriceUpdates)(this.client, {
81
81
  priceUpdates: priceUpdateTxs,
82
82
  contracts: [
83
83
  {
@@ -150,7 +150,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
150
150
  * @returns {Array<Rewards>} list of {@link Rewards} that can be claimed
151
151
  */
152
152
  async getRewards(creditAccount) {
153
- const rewards = await this.provider.publicClient.readContract({
153
+ const rewards = await this.client.readContract({
154
154
  abi: import_compressors.iRewardsCompressorAbi,
155
155
  address: this.rewardCompressor,
156
156
  functionName: "getRewards",
@@ -195,7 +195,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
195
195
  */
196
196
  async getConnectedBots(accountsToCheck) {
197
197
  const [resp, migration] = await Promise.all([
198
- this.provider.publicClient.multicall({
198
+ this.client.multicall({
199
199
  contracts: accountsToCheck.map((o) => {
200
200
  const pool = this.sdk.marketRegister.findByCreditManager(
201
201
  o.creditManager
@@ -218,7 +218,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
218
218
  this.sdk.provider.chainId
219
219
  );
220
220
  if (migrationBot) {
221
- const result = await this.provider.publicClient.multicall({
221
+ const result = await this.client.multicall({
222
222
  contracts: accountsToCheck.map((ca) => {
223
223
  const cm = this.sdk.marketRegister.findCreditManager(
224
224
  ca.creditManager
@@ -755,7 +755,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
755
755
  );
756
756
  let resp;
757
757
  if (priceUpdateTxs?.length) {
758
- [resp] = await (0, import_viem2.simulateWithPriceUpdates)(this.provider.publicClient, {
758
+ [resp] = await (0, import_viem2.simulateWithPriceUpdates)(this.client, {
759
759
  priceUpdates: priceUpdateTxs,
760
760
  contracts: [
761
761
  {
@@ -769,7 +769,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
769
769
  gas: this.sdk.gasLimit
770
770
  });
771
771
  } else {
772
- resp = await this.provider.publicClient.readContract({
772
+ resp = await this.client.readContract({
773
773
  abi: import_compressors.iCreditAccountCompressorAbi,
774
774
  address: this.#compressor,
775
775
  functionName: "getCreditAccounts",
@@ -1052,9 +1052,6 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
1052
1052
  import_constants.VERSION_RANGE_310
1053
1053
  )[0];
1054
1054
  }
1055
- get client() {
1056
- return this.sdk.provider.publicClient;
1057
- }
1058
1055
  }
1059
1056
  const iMellowClaimerAdapterAbi = [
1060
1057
  {
@@ -15,11 +15,17 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
16
  var accounts_exports = {};
17
17
  module.exports = __toCommonJS(accounts_exports);
18
+ __reExport(accounts_exports, require("./AbstractCreditAccountsService.js"), module.exports);
19
+ __reExport(accounts_exports, require("./CreditAccountsServiceV300.js"), module.exports);
20
+ __reExport(accounts_exports, require("./CreditAccountsServiceV310.js"), module.exports);
18
21
  __reExport(accounts_exports, require("./constants.js"), module.exports);
19
22
  __reExport(accounts_exports, require("./createCreditAccountService.js"), module.exports);
20
23
  __reExport(accounts_exports, require("./types.js"), module.exports);
21
24
  // Annotate the CommonJS export names for ESM import in node:
22
25
  0 && (module.exports = {
26
+ ...require("./AbstractCreditAccountsService.js"),
27
+ ...require("./CreditAccountsServiceV300.js"),
28
+ ...require("./CreditAccountsServiceV310.js"),
23
29
  ...require("./constants.js"),
24
30
  ...require("./createCreditAccountService.js"),
25
31
  ...require("./types.js")
@@ -56,7 +56,7 @@ class AbstractCreditAccountService extends SDKConstruct {
56
56
  async getCreditAccountData(account, blockNumber) {
57
57
  let raw;
58
58
  try {
59
- raw = await this.provider.publicClient.readContract({
59
+ raw = await this.client.readContract({
60
60
  abi: iCreditAccountCompressorAbi,
61
61
  address: this.#compressor,
62
62
  functionName: "getCreditAccountData",
@@ -74,7 +74,7 @@ class AbstractCreditAccountService extends SDKConstruct {
74
74
  const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(void 0, {
75
75
  account
76
76
  });
77
- const [cad] = await simulateWithPriceUpdates(this.provider.publicClient, {
77
+ const [cad] = await simulateWithPriceUpdates(this.client, {
78
78
  priceUpdates: priceUpdateTxs,
79
79
  contracts: [
80
80
  {
@@ -147,7 +147,7 @@ class AbstractCreditAccountService extends SDKConstruct {
147
147
  * @returns {Array<Rewards>} list of {@link Rewards} that can be claimed
148
148
  */
149
149
  async getRewards(creditAccount) {
150
- const rewards = await this.provider.publicClient.readContract({
150
+ const rewards = await this.client.readContract({
151
151
  abi: iRewardsCompressorAbi,
152
152
  address: this.rewardCompressor,
153
153
  functionName: "getRewards",
@@ -192,7 +192,7 @@ class AbstractCreditAccountService extends SDKConstruct {
192
192
  */
193
193
  async getConnectedBots(accountsToCheck) {
194
194
  const [resp, migration] = await Promise.all([
195
- this.provider.publicClient.multicall({
195
+ this.client.multicall({
196
196
  contracts: accountsToCheck.map((o) => {
197
197
  const pool = this.sdk.marketRegister.findByCreditManager(
198
198
  o.creditManager
@@ -215,7 +215,7 @@ class AbstractCreditAccountService extends SDKConstruct {
215
215
  this.sdk.provider.chainId
216
216
  );
217
217
  if (migrationBot) {
218
- const result = await this.provider.publicClient.multicall({
218
+ const result = await this.client.multicall({
219
219
  contracts: accountsToCheck.map((ca) => {
220
220
  const cm = this.sdk.marketRegister.findCreditManager(
221
221
  ca.creditManager
@@ -752,7 +752,7 @@ class AbstractCreditAccountService extends SDKConstruct {
752
752
  );
753
753
  let resp;
754
754
  if (priceUpdateTxs?.length) {
755
- [resp] = await simulateWithPriceUpdates(this.provider.publicClient, {
755
+ [resp] = await simulateWithPriceUpdates(this.client, {
756
756
  priceUpdates: priceUpdateTxs,
757
757
  contracts: [
758
758
  {
@@ -766,7 +766,7 @@ class AbstractCreditAccountService extends SDKConstruct {
766
766
  gas: this.sdk.gasLimit
767
767
  });
768
768
  } else {
769
- resp = await this.provider.publicClient.readContract({
769
+ resp = await this.client.readContract({
770
770
  abi: iCreditAccountCompressorAbi,
771
771
  address: this.#compressor,
772
772
  functionName: "getCreditAccounts",
@@ -1049,9 +1049,6 @@ class AbstractCreditAccountService extends SDKConstruct {
1049
1049
  VERSION_RANGE_310
1050
1050
  )[0];
1051
1051
  }
1052
- get client() {
1053
- return this.sdk.provider.publicClient;
1054
- }
1055
1052
  }
1056
1053
  const iMellowClaimerAdapterAbi = [
1057
1054
  {
@@ -1,3 +1,6 @@
1
+ export * from "./AbstractCreditAccountsService.js";
2
+ export * from "./CreditAccountsServiceV300.js";
3
+ export * from "./CreditAccountsServiceV310.js";
1
4
  export * from "./constants.js";
2
5
  export * from "./createCreditAccountService.js";
3
6
  export * from "./types.js";
@@ -1,4 +1,4 @@
1
- import type { Address, PublicClient } from "viem";
1
+ import type { Address } from "viem";
2
2
  import type { CreditAccountData } from "../base/index.js";
3
3
  import { SDKConstruct } from "../base/index.js";
4
4
  import type { GearboxSDK } from "../GearboxSDK.js";
@@ -213,5 +213,4 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
213
213
  private get marketConfigurators();
214
214
  private get rewardCompressor();
215
215
  private get peripheryCompressor();
216
- get client(): PublicClient;
217
216
  }
@@ -1,3 +1,6 @@
1
+ export * from "./AbstractCreditAccountsService.js";
2
+ export * from "./CreditAccountsServiceV300.js";
3
+ export * from "./CreditAccountsServiceV310.js";
1
4
  export * from "./constants.js";
2
5
  export * from "./createCreditAccountService.js";
3
6
  export * from "./types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.27.2",
3
+ "version": "8.27.4",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",