@gearbox-protocol/sdk 3.0.0-next.24 → 3.0.0-next.25

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.
@@ -0,0 +1,11 @@
1
+ import { GaugeDataPayload, GaugeQuotaParams } from "../payload/gauge";
2
+ export declare class GaugeData {
3
+ readonly address: string;
4
+ readonly pool: string;
5
+ readonly name: string;
6
+ readonly symbol: string;
7
+ readonly currentEpoch: number;
8
+ readonly epochFrozen: boolean;
9
+ readonly quotaParams: Record<string, GaugeQuotaParams>;
10
+ constructor(payload: GaugeDataPayload);
11
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GaugeData = void 0;
4
+ const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
+ class GaugeData {
6
+ address;
7
+ pool;
8
+ name;
9
+ symbol;
10
+ currentEpoch;
11
+ epochFrozen;
12
+ quotaParams;
13
+ constructor(payload) {
14
+ this.address = payload.addr.toLowerCase();
15
+ this.pool = payload.pool.toLowerCase();
16
+ this.name = payload.name;
17
+ this.symbol = payload.symbol;
18
+ this.currentEpoch = payload.currentEpoch;
19
+ this.epochFrozen = payload.epochFrozen;
20
+ this.quotaParams = Object.fromEntries(payload.quotaParams.map((q) => [
21
+ q.token.toLowerCase(),
22
+ {
23
+ token: q.token.toLowerCase(),
24
+ isActive: q.isActive,
25
+ rate: q.rate,
26
+ minRate: q.minRate,
27
+ maxRate: q.maxRate,
28
+ quotaIncreaseFee: q.quotaIncreaseFee,
29
+ totalQuoted: (0, sdk_gov_1.toBigInt)(q.totalQuoted),
30
+ limit: (0, sdk_gov_1.toBigInt)(q.limit),
31
+ totalVotesLpSide: (0, sdk_gov_1.toBigInt)(q.totalVotesLpSide),
32
+ totalVotesCaSide: (0, sdk_gov_1.toBigInt)(q.totalVotesCaSide),
33
+ stakerVotesLpSide: (0, sdk_gov_1.toBigInt)(q.stakerVotesLpSide),
34
+ stakerVotesCaSide: (0, sdk_gov_1.toBigInt)(q.stakerVotesCaSide),
35
+ },
36
+ ]));
37
+ }
38
+ }
39
+ exports.GaugeData = GaugeData;
@@ -1,7 +1,7 @@
1
1
  import { providers, Signer } from "ethers";
2
- import { CreditManagerDebtParams, QuotaInfo } from "../../payload/creditManager";
3
- import { ChartsPoolDataPayload, LinearModel, PoolDataPayload, PoolZapper, UserPoolPayload } from "../../payload/pool";
4
- import { IPoolService, IPoolV3 } from "../../types";
2
+ import { CreditManagerDebtParams, QuotaInfo } from "../payload/creditManager";
3
+ import { ChartsPoolDataPayload, LinearModel, PoolDataPayload, PoolZapper, UserPoolPayload } from "../payload/pool";
4
+ import { IPoolService, IPoolV3 } from "../types";
5
5
  export declare class PoolData {
6
6
  readonly address: string;
7
7
  readonly underlyingToken: string;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UserPoolData = exports.ChartsPoolData = exports.PoolData = void 0;
4
4
  const sdk_gov_1 = require("@gearbox-protocol/sdk-gov");
5
- const types_1 = require("../../types");
6
- const formatter_1 = require("../../utils/formatter");
5
+ const types_1 = require("../types");
6
+ const formatter_1 = require("../utils/formatter");
7
7
  class PoolData {
8
8
  address;
9
9
  underlyingToken;
package/lib/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from "./core/creditSession";
7
7
  export * from "./core/errors";
8
8
  export * from "./core/eventOrTx";
9
9
  export * from "./core/events";
10
+ export * from "./core/gauge";
10
11
  export * from "./core/pool";
11
12
  export * from "./core/rewardClaimer";
12
13
  export * from "./core/strategy";
@@ -19,6 +20,7 @@ export * from "./pathfinder/pathfinder";
19
20
  export * from "./payload/creditAccount";
20
21
  export * from "./payload/creditManager";
21
22
  export * from "./payload/creditSession";
23
+ export * from "./payload/gauge";
22
24
  export * from "./payload/graphPayload";
23
25
  export * from "./payload/pool";
24
26
  export * from "./payload/token";
package/lib/index.js CHANGED
@@ -24,6 +24,7 @@ __exportStar(require("./core/creditSession"), exports);
24
24
  __exportStar(require("./core/errors"), exports);
25
25
  __exportStar(require("./core/eventOrTx"), exports);
26
26
  __exportStar(require("./core/events"), exports);
27
+ __exportStar(require("./core/gauge"), exports);
27
28
  __exportStar(require("./core/pool"), exports);
28
29
  __exportStar(require("./core/rewardClaimer"), exports);
29
30
  __exportStar(require("./core/strategy"), exports);
@@ -36,6 +37,7 @@ __exportStar(require("./pathfinder/pathfinder"), exports);
36
37
  __exportStar(require("./payload/creditAccount"), exports);
37
38
  __exportStar(require("./payload/creditManager"), exports);
38
39
  __exportStar(require("./payload/creditSession"), exports);
40
+ __exportStar(require("./payload/gauge"), exports);
39
41
  __exportStar(require("./payload/graphPayload"), exports);
40
42
  __exportStar(require("./payload/pool"), exports);
41
43
  __exportStar(require("./payload/token"), exports);
@@ -0,0 +1,5 @@
1
+ import { ExcludeArrayProps } from "@gearbox-protocol/sdk-gov";
2
+ import { GaugeInfoStructOutput, GaugeQuotaParamsStructOutput } from "../types/IDataCompressorV3_00";
3
+ import { BigintifyProps } from "../utils/types";
4
+ export type GaugeQuotaParams = BigintifyProps<ExcludeArrayProps<GaugeQuotaParamsStructOutput>>;
5
+ export type GaugeDataPayload = ExcludeArrayProps<GaugeInfoStructOutput>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-next.24",
3
+ "version": "3.0.0-next.25",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1 +0,0 @@
1
- export * from "./data";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./data"), exports);