@gearbox-protocol/sdk 3.0.0-next.46 → 3.0.0-next.48

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.
@@ -1,5 +1,4 @@
1
1
  import { GaugeDataPayload, GaugeQuotaParams, GaugeStakingDataPayload } from "../payload/gauge";
2
- import { BigintifyProps } from "../utils/types";
3
2
  export declare class GaugeData {
4
3
  readonly address: string;
5
4
  readonly pool: string;
@@ -11,12 +10,17 @@ export declare class GaugeData {
11
10
  readonly quotaParams: Record<string, GaugeQuotaParams>;
12
11
  constructor(payload: GaugeDataPayload);
13
12
  }
13
+ interface WithDrawableGaugeItem {
14
+ amount: bigint;
15
+ epochsLeft: number;
16
+ }
14
17
  export declare class GaugeStakingData {
15
18
  readonly availableBalance: bigint;
16
19
  readonly totalBalance: bigint;
17
20
  readonly epoch: number;
18
21
  readonly withdrawableNow: bigint;
19
22
  readonly withdrawableInEpochsTotal: bigint;
20
- readonly withdrawableInEpochs: BigintifyProps<GaugeStakingDataPayload["withdrawableAmounts"]["withdrawableInEpochs"]>;
23
+ readonly withdrawableInEpochs: Array<WithDrawableGaugeItem>;
21
24
  constructor(payload: GaugeStakingDataPayload);
22
25
  }
26
+ export {};
package/lib/core/gauge.js CHANGED
@@ -51,14 +51,13 @@ class GaugeStakingData {
51
51
  this.totalBalance = (0, sdk_gov_1.toBigInt)(payload.totalBalance);
52
52
  this.epoch = payload.epoch;
53
53
  this.withdrawableNow = (0, sdk_gov_1.toBigInt)(payload.withdrawableAmounts.withdrawableNow);
54
- const { total, list } = payload.withdrawableAmounts.withdrawableInEpochs.reduce(({ total, list }, a) => {
54
+ const { total, list } = payload.withdrawableAmounts.withdrawableInEpochs.reduce(({ total, list }, a, i) => {
55
55
  const bn = (0, sdk_gov_1.toBigInt)(a);
56
- list.push(bn);
56
+ list.push({ amount: bn, epochsLeft: i + 1 });
57
57
  return { total: total + bn, list };
58
58
  }, { total: 0n, list: [] });
59
59
  this.withdrawableInEpochsTotal = total;
60
- this.withdrawableInEpochs =
61
- list;
60
+ this.withdrawableInEpochs = list;
62
61
  }
63
62
  }
64
63
  exports.GaugeStakingData = GaugeStakingData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-next.46",
3
+ "version": "3.0.0-next.48",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "test": "npx mocha -r ts-node/register -r dotenv/config src/**/*.spec.ts"
31
31
  },
32
32
  "dependencies": {
33
- "@gearbox-protocol/sdk-gov": "^1.11.5",
33
+ "@gearbox-protocol/sdk-gov": "^1.13.0",
34
34
  "axios": "^1.2.6",
35
35
  "decimal.js-light": "^2.5.1",
36
36
  "deep-eql": "^4.1.0",
@@ -41,10 +41,10 @@
41
41
  "@commitlint/cli": "^17.6.3",
42
42
  "@commitlint/config-conventional": "^17.0.3",
43
43
  "@gearbox-protocol/core-v2": "1.19.0-base.17",
44
- "@gearbox-protocol/core-v3": "^1.42.2",
44
+ "@gearbox-protocol/core-v3": "^1.43.0",
45
45
  "@gearbox-protocol/eslint-config": "^1.4.1",
46
- "@gearbox-protocol/integrations-v3": "^1.20.2",
47
- "@gearbox-protocol/oracles-v3": "^1.7.6",
46
+ "@gearbox-protocol/integrations-v3": "^1.21.0",
47
+ "@gearbox-protocol/oracles-v3": "^1.8.0",
48
48
  "@gearbox-protocol/periphery-v3": "^1.3.8",
49
49
  "@gearbox-protocol/prettier-config": "^1.4.1",
50
50
  "@gearbox-protocol/router-v3": "^1.4.0",