@gearbox-protocol/sdk 0.0.29 → 0.0.30

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.
@@ -21,6 +21,7 @@ export declare class CreditAccountData {
21
21
  balances: Record<string, BigNumber>;
22
22
  allBalances: Record<string, BigNumber>;
23
23
  isDeleting: boolean;
24
+ readonly version: number;
24
25
  constructor(payload: CreditAccountDataPayload);
25
26
  balancesSorted(prices: Record<string, number>, tokens: Record<string, TokenData>): Array<Balance>;
26
27
  }
@@ -25,6 +25,7 @@ var CreditAccountData = /** @class */ (function () {
25
25
  this.allTokens = [];
26
26
  this.balances = {};
27
27
  this.allBalances = {};
28
+ this.version = 1;
28
29
  this.id = payload.creditManager;
29
30
  this.addr = payload.addr;
30
31
  this.borrower = payload.borrower;
@@ -14,6 +14,7 @@ export declare class CreditManagerData {
14
14
  readonly availableLiquidity: BigNumber;
15
15
  readonly allowedTokens: Array<string>;
16
16
  readonly adapters: Record<string, string>;
17
+ readonly version: number;
17
18
  constructor(payload: CreditManagerDataPayload);
18
19
  validateOpenAccount(balance: BigNumber, decimals: number, amount_BN: BigNumber, leverage: number): string | null;
19
20
  getContractETH(signer: Signer | ethers.providers.Provider): IAppCreditManager;
@@ -25,6 +25,7 @@ var CreditManagerData = /** @class */ (function () {
25
25
  var _this = this;
26
26
  var _a;
27
27
  this.adapters = {};
28
+ this.version = 1;
28
29
  this.id = payload.addr;
29
30
  this.address = payload.addr;
30
31
  this.underlyingToken = payload.underlyingToken || "";
package/lib/index.d.ts CHANGED
@@ -28,7 +28,9 @@ export * from "./utils/math";
28
28
  export * from "./core/creditCard";
29
29
  export * from "./payload/graphPayload";
30
30
  export * from "./types/index";
31
- export type { IAppPoolService, IAppCreditManager, IAppERC20, IAppAddressProvider, IDataCompressor, IWETHGateway, } from "./types";
31
+ export type { IAppPoolService, IAppCreditManager, IAppERC20, IAppAddressProvider, IDataCompressor, IWETHGateway } from "./types";
32
32
  export * from "./core/history";
33
33
  export { MultiCallContract } from "./utils/multicall";
34
34
  export { callRepeater } from "./utils/repeater";
35
+ export { getContractName } from "./core/contractsRegister";
36
+ export { AdapterInterface } from "./core/contracts";
package/lib/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.callRepeater = exports.MultiCallContract = void 0;
17
+ exports.AdapterInterface = exports.getContractName = exports.callRepeater = exports.MultiCallContract = void 0;
18
18
  __exportStar(require("./core/constants"), exports);
19
19
  __exportStar(require("./core/creditAccount"), exports);
20
20
  __exportStar(require("./core/creditManager"), exports);
@@ -50,3 +50,7 @@ var multicall_1 = require("./utils/multicall");
50
50
  Object.defineProperty(exports, "MultiCallContract", { enumerable: true, get: function () { return multicall_1.MultiCallContract; } });
51
51
  var repeater_1 = require("./utils/repeater");
52
52
  Object.defineProperty(exports, "callRepeater", { enumerable: true, get: function () { return repeater_1.callRepeater; } });
53
+ var contractsRegister_1 = require("./core/contractsRegister");
54
+ Object.defineProperty(exports, "getContractName", { enumerable: true, get: function () { return contractsRegister_1.getContractName; } });
55
+ var contracts_1 = require("./core/contracts");
56
+ Object.defineProperty(exports, "AdapterInterface", { enumerable: true, get: function () { return contracts_1.AdapterInterface; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import { BigNumber } from "ethers";
2
2
  import {
3
3
  CreditAccountDataExtendedPayload,
4
- CreditAccountDataPayload,
4
+ CreditAccountDataPayload
5
5
  } from "../payload/creditAccount";
6
6
  import { PERCENTAGE_FACTOR, RAY } from "./constants";
7
7
  import { TokenData } from "./tokenData";
@@ -25,6 +25,7 @@ export class CreditAccountData {
25
25
  public balances: Record<string, BigNumber> = {};
26
26
  public allBalances: Record<string, BigNumber> = {};
27
27
  public isDeleting: boolean;
28
+ public readonly version: number = 1;
28
29
 
29
30
  constructor(payload: CreditAccountDataPayload) {
30
31
  this.id = payload.creditManager;
@@ -46,7 +47,7 @@ export class CreditAccountData {
46
47
  .div(RAY)
47
48
  .toNumber() / PERCENTAGE_FACTOR;
48
49
 
49
- (payload.balances || []).forEach((b) => {
50
+ (payload.balances || []).forEach(b => {
50
51
  if (b.isAllowed) {
51
52
  this.balances[b.token] = BigNumber.from(b.balance);
52
53
  this.allowedTokens.push(b.token);
@@ -24,6 +24,7 @@ export class CreditManagerData {
24
24
  public readonly availableLiquidity: BigNumber;
25
25
  public readonly allowedTokens: Array<string>;
26
26
  public readonly adapters: Record<string, string> = {};
27
+ public readonly version: number = 1;
27
28
 
28
29
  constructor(payload: CreditManagerDataPayload) {
29
30
  this.id = payload.addr;
package/src/index.ts CHANGED
@@ -27,7 +27,7 @@ export * from "./utils/events";
27
27
  export * from "./utils/math";
28
28
  export * from "./core/creditCard";
29
29
  export * from "./payload/graphPayload";
30
- export * from "./types/index"
30
+ export * from "./types/index";
31
31
 
32
32
  export type {
33
33
  IAppPoolService,
@@ -35,9 +35,11 @@ export type {
35
35
  IAppERC20,
36
36
  IAppAddressProvider,
37
37
  IDataCompressor,
38
- IWETHGateway,
38
+ IWETHGateway
39
39
  } from "./types";
40
40
 
41
41
  export * from "./core/history";
42
- export { MultiCallContract} from "./utils/multicall";
43
- export { callRepeater } from "./utils/repeater"
42
+ export { MultiCallContract } from "./utils/multicall";
43
+ export { callRepeater } from "./utils/repeater";
44
+ export { getContractName } from "./core/contractsRegister";
45
+ export { AdapterInterface } from "./core/contracts";