@gearbox-protocol/sdk 11.1.0 → 11.1.2

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.
@@ -290,6 +290,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
290
290
  lossPolicyData = await market.lossPolicy.getLiquidationData(
291
291
  account.creditAccount
292
292
  );
293
+ this.#logger?.debug({ lossPolicyData }, "loss policy data");
293
294
  }
294
295
  const tx = cm.creditFacade.liquidateCreditAccount(
295
296
  account.creditAccount,
@@ -66,7 +66,7 @@ class AliasLossPolicyV310Contract extends import_base.BaseContract {
66
66
  args: [creditAccount],
67
67
  blockNumber
68
68
  });
69
- this.logger?.debug({ feeds: pfs }, "got required alias price feeds");
69
+ this.logger?.debug({ feeds: pfs }, "required alias price feeds");
70
70
  if (pfs.length === 0) {
71
71
  return "0x";
72
72
  }
@@ -74,6 +74,10 @@ class AliasLossPolicyV310Contract extends import_base.BaseContract {
74
74
  [...pfs],
75
75
  blockNumber ? { blockNumber } : void 0
76
76
  );
77
+ this.logger?.debug(
78
+ { updates: updates.map((u) => this.sdk.labelAddress(u.priceFeed)) },
79
+ "encoding alias price feeds updates"
80
+ );
77
81
  return (0, import_viem.encodeAbiParameters)(
78
82
  [
79
83
  {
@@ -24,6 +24,9 @@ module.exports = __toCommonJS(isDust_exports);
24
24
  var import_constants = require("../constants/index.js");
25
25
  function isDust(opts) {
26
26
  const { sdk, token, balance, creditManager } = opts;
27
+ if (balance <= 1n) {
28
+ return true;
29
+ }
27
30
  const minBalanceUSD = (opts.minBalanceUSD ?? 10n) * 10n ** 8n;
28
31
  const { priceOracle } = sdk.marketRegister.findByCreditManager(creditManager);
29
32
  let balanceUSD = import_constants.MAX_UINT256;
@@ -280,6 +280,7 @@ class AbstractCreditAccountService extends SDKConstruct {
280
280
  lossPolicyData = await market.lossPolicy.getLiquidationData(
281
281
  account.creditAccount
282
282
  );
283
+ this.#logger?.debug({ lossPolicyData }, "loss policy data");
283
284
  }
284
285
  const tx = cm.creditFacade.liquidateCreditAccount(
285
286
  account.creditAccount,
@@ -46,7 +46,7 @@ class AliasLossPolicyV310Contract extends BaseContract {
46
46
  args: [creditAccount],
47
47
  blockNumber
48
48
  });
49
- this.logger?.debug({ feeds: pfs }, "got required alias price feeds");
49
+ this.logger?.debug({ feeds: pfs }, "required alias price feeds");
50
50
  if (pfs.length === 0) {
51
51
  return "0x";
52
52
  }
@@ -54,6 +54,10 @@ class AliasLossPolicyV310Contract extends BaseContract {
54
54
  [...pfs],
55
55
  blockNumber ? { blockNumber } : void 0
56
56
  );
57
+ this.logger?.debug(
58
+ { updates: updates.map((u) => this.sdk.labelAddress(u.priceFeed)) },
59
+ "encoding alias price feeds updates"
60
+ );
57
61
  return encodeAbiParameters(
58
62
  [
59
63
  {
@@ -1,6 +1,9 @@
1
1
  import { MAX_UINT256 } from "../constants/index.js";
2
2
  function isDust(opts) {
3
3
  const { sdk, token, balance, creditManager } = opts;
4
+ if (balance <= 1n) {
5
+ return true;
6
+ }
4
7
  const minBalanceUSD = (opts.minBalanceUSD ?? 10n) * 10n ** 8n;
5
8
  const { priceOracle } = sdk.marketRegister.findByCreditManager(creditManager);
6
9
  let balanceUSD = MAX_UINT256;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "11.1.0",
3
+ "version": "11.1.2",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",