@gearbox-protocol/sdk 3.0.0-next.23 → 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.
- package/lib/core/gauge.d.ts +11 -0
- package/lib/core/gauge.js +39 -0
- package/lib/core/{pool/data.d.ts → pool.d.ts} +4 -3
- package/lib/core/{pool/data.js → pool.js} +4 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/payload/gauge.d.ts +5 -0
- package/lib/payload/gauge.js +2 -0
- package/lib/payload/pool.d.ts +1 -0
- package/package.json +1 -1
- package/lib/core/pool/index.d.ts +0 -1
- package/lib/core/pool/index.js +0 -17
|
@@ -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 "
|
|
3
|
-
import { ChartsPoolDataPayload, LinearModel, PoolDataPayload, PoolZapper, UserPoolPayload } from "
|
|
4
|
-
import { IPoolService, IPoolV3 } from "
|
|
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;
|
|
@@ -23,6 +23,7 @@ export declare class PoolData {
|
|
|
23
23
|
readonly zappers: Record<string, PoolZapper>;
|
|
24
24
|
readonly totalAssets: bigint;
|
|
25
25
|
readonly totalSupply: bigint;
|
|
26
|
+
readonly borrowAPY7D: number | undefined;
|
|
26
27
|
readonly depositAPY: number;
|
|
27
28
|
readonly borrowAPY: number;
|
|
28
29
|
readonly interestModel: LinearModel;
|
|
@@ -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("
|
|
6
|
-
const formatter_1 = require("
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const formatter_1 = require("../utils/formatter");
|
|
7
7
|
class PoolData {
|
|
8
8
|
address;
|
|
9
9
|
underlyingToken;
|
|
@@ -26,6 +26,7 @@ class PoolData {
|
|
|
26
26
|
zappers;
|
|
27
27
|
totalAssets;
|
|
28
28
|
totalSupply;
|
|
29
|
+
borrowAPY7D;
|
|
29
30
|
depositAPY;
|
|
30
31
|
borrowAPY;
|
|
31
32
|
interestModel;
|
|
@@ -91,6 +92,7 @@ class PoolData {
|
|
|
91
92
|
this.totalSupply = (0, sdk_gov_1.toBigInt)(payload.totalSupply);
|
|
92
93
|
this.depositAPY = (0, formatter_1.rayToNumber)((0, sdk_gov_1.toBigInt)(payload.supplyRate) * sdk_gov_1.PERCENTAGE_DECIMALS);
|
|
93
94
|
this.borrowAPY = (0, formatter_1.rayToNumber)((0, sdk_gov_1.toBigInt)(payload.baseInterestRate) * sdk_gov_1.PERCENTAGE_DECIMALS);
|
|
95
|
+
this.borrowAPY7D = payload.borrowAPY7D;
|
|
94
96
|
this.interestModel = {
|
|
95
97
|
interestModel: payload.lirm.interestModel.toLowerCase(),
|
|
96
98
|
U_1: payload.lirm.U_1,
|
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>;
|
package/lib/payload/pool.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ZapperInfoStructOutput } from "../types/IDataCompressorV2_10";
|
|
|
4
4
|
import { LinearModelStructOutput, PoolDataStructOutput } from "../types/IDataCompressorV3_00";
|
|
5
5
|
export type PoolDataPayload = Omit<ExcludeArrayProps<PoolDataStructOutput>, "zappers"> & {
|
|
6
6
|
zappers: Array<PoolZapper>;
|
|
7
|
+
borrowAPY7D: number | undefined;
|
|
7
8
|
};
|
|
8
9
|
export type LinearModel = Omit<ExcludeArrayProps<LinearModelStructOutput>, "version"> & {
|
|
9
10
|
version: number;
|
package/package.json
CHANGED
package/lib/core/pool/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./data";
|
package/lib/core/pool/index.js
DELETED
|
@@ -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);
|