@gearbox-protocol/sdk 4.2.0-next.1 → 4.2.0-next.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.
- package/dist/cjs/sdk/GearboxSDK.js +0 -5
- package/dist/cjs/sdk/market/MarketRegister.js +0 -12
- package/dist/cjs/sdk/market/credit/CreditSuite.js +0 -5
- package/dist/esm/sdk/GearboxSDK.js +1 -11
- package/dist/esm/sdk/market/MarketRegister.js +0 -12
- package/dist/esm/sdk/market/credit/CreditSuite.js +0 -5
- package/dist/types/sdk/GearboxSDK.d.ts +0 -1
- package/dist/types/sdk/market/MarketRegister.d.ts +1 -2
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +1 -2
- package/dist/types/sdk/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/sdk/types/tvl.js +0 -16
- package/dist/esm/sdk/types/tvl.js +0 -0
- package/dist/types/sdk/types/tvl.d.ts +0 -4
|
@@ -331,11 +331,6 @@ class GearboxSDK {
|
|
|
331
331
|
markets: this.marketRegister.state
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
async tvl() {
|
|
335
|
-
const { tvl, tvlUSD } = await this.marketRegister.tvl();
|
|
336
|
-
this.logger?.info(tvl);
|
|
337
|
-
this.logger?.info(`Total TVL: ${(0, import_utils.formatBN)(tvlUSD, 8)}`);
|
|
338
|
-
}
|
|
339
334
|
/**
|
|
340
335
|
* Reloads markets states based on events from last processed block to new block (defaults to latest block)
|
|
341
336
|
* @param opts
|
|
@@ -233,18 +233,6 @@ class MarketRegister extends import_base.SDKConstruct {
|
|
|
233
233
|
get markets() {
|
|
234
234
|
return this.#markets.values();
|
|
235
235
|
}
|
|
236
|
-
async tvl() {
|
|
237
|
-
const creditManagers = this.creditManagers;
|
|
238
|
-
const tvls = await Promise.all(creditManagers.map((cm) => cm.tvl()));
|
|
239
|
-
return tvls.reduce(
|
|
240
|
-
(acc, curr) => {
|
|
241
|
-
acc.tvl += curr.tvl;
|
|
242
|
-
acc.tvlUSD += curr.tvlUSD;
|
|
243
|
-
return acc;
|
|
244
|
-
},
|
|
245
|
-
{ tvl: 0n, tvlUSD: 0n }
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
236
|
}
|
|
249
237
|
// Annotate the CommonJS export names for ESM import in node:
|
|
250
238
|
0 && (module.exports = {
|
|
@@ -58,11 +58,6 @@ class CreditSuite extends import_base.SDKConstruct {
|
|
|
58
58
|
get router() {
|
|
59
59
|
return this.sdk.routerFor(this);
|
|
60
60
|
}
|
|
61
|
-
async tvl() {
|
|
62
|
-
const tvl = 0n;
|
|
63
|
-
const tvlUSD = 0n;
|
|
64
|
-
return { tvl, tvlUSD };
|
|
65
|
-
}
|
|
66
61
|
get dirty() {
|
|
67
62
|
return this.creditFacade.dirty || this.creditManager.dirty || this.creditConfigurator.dirty;
|
|
68
63
|
}
|
|
@@ -26,12 +26,7 @@ import {
|
|
|
26
26
|
defaultPlugins
|
|
27
27
|
} from "./plugins/index.js";
|
|
28
28
|
import { createRouter } from "./router/index.js";
|
|
29
|
-
import {
|
|
30
|
-
AddressMap,
|
|
31
|
-
formatBN,
|
|
32
|
-
toAddress,
|
|
33
|
-
TypedObjectUtils
|
|
34
|
-
} from "./utils/index.js";
|
|
29
|
+
import { AddressMap, toAddress, TypedObjectUtils } from "./utils/index.js";
|
|
35
30
|
import { Hooks } from "./utils/internal/index.js";
|
|
36
31
|
import { getLogsSafe } from "./utils/viem/index.js";
|
|
37
32
|
const ERR_NOT_ATTACHED = new Error("Gearbox SDK not attached");
|
|
@@ -331,11 +326,6 @@ class GearboxSDK {
|
|
|
331
326
|
markets: this.marketRegister.state
|
|
332
327
|
};
|
|
333
328
|
}
|
|
334
|
-
async tvl() {
|
|
335
|
-
const { tvl, tvlUSD } = await this.marketRegister.tvl();
|
|
336
|
-
this.logger?.info(tvl);
|
|
337
|
-
this.logger?.info(`Total TVL: ${formatBN(tvlUSD, 8)}`);
|
|
338
|
-
}
|
|
339
329
|
/**
|
|
340
330
|
* Reloads markets states based on events from last processed block to new block (defaults to latest block)
|
|
341
331
|
* @param opts
|
|
@@ -210,18 +210,6 @@ class MarketRegister extends SDKConstruct {
|
|
|
210
210
|
get markets() {
|
|
211
211
|
return this.#markets.values();
|
|
212
212
|
}
|
|
213
|
-
async tvl() {
|
|
214
|
-
const creditManagers = this.creditManagers;
|
|
215
|
-
const tvls = await Promise.all(creditManagers.map((cm) => cm.tvl()));
|
|
216
|
-
return tvls.reduce(
|
|
217
|
-
(acc, curr) => {
|
|
218
|
-
acc.tvl += curr.tvl;
|
|
219
|
-
acc.tvlUSD += curr.tvlUSD;
|
|
220
|
-
return acc;
|
|
221
|
-
},
|
|
222
|
-
{ tvl: 0n, tvlUSD: 0n }
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
213
|
}
|
|
226
214
|
export {
|
|
227
215
|
MarketRegister
|
|
@@ -25,11 +25,6 @@ class CreditSuite extends SDKConstruct {
|
|
|
25
25
|
get router() {
|
|
26
26
|
return this.sdk.routerFor(this);
|
|
27
27
|
}
|
|
28
|
-
async tvl() {
|
|
29
|
-
const tvl = 0n;
|
|
30
|
-
const tvlUSD = 0n;
|
|
31
|
-
return { tvl, tvlUSD };
|
|
32
|
-
}
|
|
33
28
|
get dirty() {
|
|
34
29
|
return this.creditFacade.dirty || this.creditManager.dirty || this.creditConfigurator.dirty;
|
|
35
30
|
}
|
|
@@ -141,7 +141,6 @@ export declare class GearboxSDK<Plugins extends PluginMap = {}> {
|
|
|
141
141
|
} | null)[];
|
|
142
142
|
stateHuman(raw?: boolean): GearboxStateHuman;
|
|
143
143
|
get state(): GearboxState;
|
|
144
|
-
tvl(): Promise<void>;
|
|
145
144
|
/**
|
|
146
145
|
* Reloads markets states based on events from last processed block to new block (defaults to latest block)
|
|
147
146
|
* @param opts
|
|
@@ -2,7 +2,7 @@ import type { Address } from "viem";
|
|
|
2
2
|
import type { MarketData } from "../base/index.js";
|
|
3
3
|
import { SDKConstruct } from "../base/index.js";
|
|
4
4
|
import type { GearboxSDK } from "../GearboxSDK.js";
|
|
5
|
-
import type { MarketStateHuman
|
|
5
|
+
import type { MarketStateHuman } from "../types/index.js";
|
|
6
6
|
import { AddressMap } from "../utils/index.js";
|
|
7
7
|
import type { CreditSuite } from "./credit/index.js";
|
|
8
8
|
import type { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
|
|
@@ -38,5 +38,4 @@ export declare class MarketRegister extends SDKConstruct {
|
|
|
38
38
|
findByPool(address: Address): MarketSuite;
|
|
39
39
|
get marketsMap(): AddressMap<MarketSuite>;
|
|
40
40
|
get markets(): MarketSuite[];
|
|
41
|
-
tvl(): Promise<TVL>;
|
|
42
41
|
}
|
|
@@ -3,7 +3,7 @@ import type { CreditSuiteState, MarketData } from "../../base/index.js";
|
|
|
3
3
|
import { SDKConstruct } from "../../base/index.js";
|
|
4
4
|
import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
5
5
|
import type { IRouterContract } from "../../router/index.js";
|
|
6
|
-
import type { CreditSuiteStateHuman
|
|
6
|
+
import type { CreditSuiteStateHuman } from "../../types/index.js";
|
|
7
7
|
import type { CreditFacadeContract, ICreditConfiguratorContract, ICreditManagerContract } from "./types.js";
|
|
8
8
|
export declare class CreditSuite extends SDKConstruct {
|
|
9
9
|
readonly name: string;
|
|
@@ -15,7 +15,6 @@ export declare class CreditSuite extends SDKConstruct {
|
|
|
15
15
|
readonly state: CreditSuiteState;
|
|
16
16
|
constructor(sdk: GearboxSDK, marketData: MarketData, index: number);
|
|
17
17
|
get router(): IRouterContract;
|
|
18
|
-
tvl(): Promise<TVL>;
|
|
19
18
|
get dirty(): boolean;
|
|
20
19
|
get watchAddresses(): Set<Address>;
|
|
21
20
|
stateHuman(raw?: boolean): CreditSuiteStateHuman;
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var tvl_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(tvl_exports);
|
|
File without changes
|