@gearbox-protocol/sdk 13.0.0-next.20 → 13.0.0-next.21

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.
@@ -65,6 +65,9 @@ class MarketSuite extends import_base.SDKConstruct {
65
65
  get underlying() {
66
66
  return this.pool.underlying;
67
67
  }
68
+ async getKYCFactory() {
69
+ return this.pool.getKYCFactory();
70
+ }
68
71
  get dirty() {
69
72
  return this.configurator.dirty || this.pool.dirty || this.priceOracle.dirty || this.creditManagers.some((cm) => cm.dirty);
70
73
  }
@@ -17,7 +17,6 @@ var market_exports = {};
17
17
  module.exports = __toCommonJS(market_exports);
18
18
  __reExport(market_exports, require("./adapters/index.js"), module.exports);
19
19
  __reExport(market_exports, require("./credit/index.js"), module.exports);
20
- __reExport(market_exports, require("./kyc/index.js"), module.exports);
21
20
  __reExport(market_exports, require("./MarketRegister.js"), module.exports);
22
21
  __reExport(market_exports, require("./MarketSuite.js"), module.exports);
23
22
  __reExport(market_exports, require("./oracle/index.js"), module.exports);
@@ -28,7 +27,6 @@ __reExport(market_exports, require("./types.js"), module.exports);
28
27
  0 && (module.exports = {
29
28
  ...require("./adapters/index.js"),
30
29
  ...require("./credit/index.js"),
31
- ...require("./kyc/index.js"),
32
30
  ...require("./MarketRegister.js"),
33
31
  ...require("./MarketSuite.js"),
34
32
  ...require("./oracle/index.js"),
@@ -88,6 +88,9 @@ class PoolSuite extends import_base.SDKConstruct {
88
88
  get underlying() {
89
89
  return this.pool.underlying;
90
90
  }
91
+ async getKYCFactory() {
92
+ return this.pool.getKYCFactory();
93
+ }
91
94
  get dirty() {
92
95
  return this.pool.dirty || this.rateKeeper.dirty || this.pqk.dirty || this.interestRateModel.dirty;
93
96
  }
@@ -46,6 +46,9 @@ class PoolV300Contract extends import_base.BaseContract {
46
46
  symbol: data.symbol
47
47
  });
48
48
  }
49
+ async getKYCFactory() {
50
+ return void 0;
51
+ }
49
52
  stateHuman(raw = true) {
50
53
  return {
51
54
  ...super.stateHuman(raw),
@@ -25,16 +25,20 @@ var import_generated = require("../../../abi/310/generated.js");
25
25
  var import_iPausable = require("../../../abi/iPausable.js");
26
26
  var import_base = require("../../base/index.js");
27
27
  var import_utils = require("../../utils/index.js");
28
+ var import_SecuritizeKYCFactory = require("./SecuritizeKYCFactory.js");
28
29
  const abi = [...import_generated.iPoolV310Abi, ...import_iPausable.iPausableAbi];
29
30
  class PoolV310Contract extends import_base.BaseContract {
30
31
  creditManagerDebtParams;
31
- constructor(options, data) {
32
+ #sdk;
33
+ #kycFactory;
34
+ constructor(sdk, data) {
32
35
  const { baseParams, creditManagerDebtParams, ...rest } = data;
33
- super(options, {
36
+ super(sdk, {
34
37
  ...data.baseParams,
35
38
  name: `PoolV3(${data.name})`,
36
39
  abi
37
40
  });
41
+ this.#sdk = sdk;
38
42
  Object.assign(this, rest);
39
43
  this.creditManagerDebtParams = new import_utils.AddressMap(
40
44
  creditManagerDebtParams.map((p) => [p.creditManager, p])
@@ -46,6 +50,17 @@ class PoolV310Contract extends import_base.BaseContract {
46
50
  symbol: data.symbol
47
51
  });
48
52
  }
53
+ async getKYCFactory() {
54
+ if (this.#kycFactory) {
55
+ return this.#kycFactory;
56
+ }
57
+ await this.#sdk.tokensMeta.loadTokenData(this.underlying);
58
+ const u = this.#sdk.tokensMeta.mustGet(this.underlying);
59
+ if (this.#sdk.tokensMeta.isKYCUnderlying(u)) {
60
+ this.#kycFactory = new import_SecuritizeKYCFactory.SecuritizeKYCFactory(this.#sdk, u.kycFactory);
61
+ }
62
+ return this.#kycFactory;
63
+ }
49
64
  stateHuman(raw = true) {
50
65
  return {
51
66
  ...super.stateHuman(raw),
@@ -20,6 +20,7 @@ __reExport(pool_exports, require("./LinearInterestRateModelContract.js"), module
20
20
  __reExport(pool_exports, require("./PoolQuotaKeeperV300Contract.js"), module.exports);
21
21
  __reExport(pool_exports, require("./PoolSuite.js"), module.exports);
22
22
  __reExport(pool_exports, require("./PoolV300Contract.js"), module.exports);
23
+ __reExport(pool_exports, require("./SecuritizeKYCFactory.js"), module.exports);
23
24
  __reExport(pool_exports, require("./types.js"), module.exports);
24
25
  // Annotate the CommonJS export names for ESM import in node:
25
26
  0 && (module.exports = {
@@ -28,5 +29,6 @@ __reExport(pool_exports, require("./types.js"), module.exports);
28
29
  ...require("./PoolQuotaKeeperV300Contract.js"),
29
30
  ...require("./PoolSuite.js"),
30
31
  ...require("./PoolV300Contract.js"),
32
+ ...require("./SecuritizeKYCFactory.js"),
31
33
  ...require("./types.js")
32
34
  });
@@ -44,6 +44,9 @@ class MarketSuite extends SDKConstruct {
44
44
  get underlying() {
45
45
  return this.pool.underlying;
46
46
  }
47
+ async getKYCFactory() {
48
+ return this.pool.getKYCFactory();
49
+ }
47
50
  get dirty() {
48
51
  return this.configurator.dirty || this.pool.dirty || this.priceOracle.dirty || this.creditManagers.some((cm) => cm.dirty);
49
52
  }
@@ -1,6 +1,5 @@
1
1
  export * from "./adapters/index.js";
2
2
  export * from "./credit/index.js";
3
- export * from "./kyc/index.js";
4
3
  export * from "./MarketRegister.js";
5
4
  export * from "./MarketSuite.js";
6
5
  export * from "./oracle/index.js";
@@ -55,6 +55,9 @@ class PoolSuite extends SDKConstruct {
55
55
  get underlying() {
56
56
  return this.pool.underlying;
57
57
  }
58
+ async getKYCFactory() {
59
+ return this.pool.getKYCFactory();
60
+ }
58
61
  get dirty() {
59
62
  return this.pool.dirty || this.rateKeeper.dirty || this.pqk.dirty || this.interestRateModel.dirty;
60
63
  }
@@ -28,6 +28,9 @@ class PoolV300Contract extends BaseContract {
28
28
  symbol: data.symbol
29
29
  });
30
30
  }
31
+ async getKYCFactory() {
32
+ return void 0;
33
+ }
31
34
  stateHuman(raw = true) {
32
35
  return {
33
36
  ...super.stateHuman(raw),
@@ -7,16 +7,20 @@ import {
7
7
  formatBNvalue,
8
8
  percentFmt
9
9
  } from "../../utils/index.js";
10
+ import { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
10
11
  const abi = [...iPoolV310Abi, ...iPausableAbi];
11
12
  class PoolV310Contract extends BaseContract {
12
13
  creditManagerDebtParams;
13
- constructor(options, data) {
14
+ #sdk;
15
+ #kycFactory;
16
+ constructor(sdk, data) {
14
17
  const { baseParams, creditManagerDebtParams, ...rest } = data;
15
- super(options, {
18
+ super(sdk, {
16
19
  ...data.baseParams,
17
20
  name: `PoolV3(${data.name})`,
18
21
  abi
19
22
  });
23
+ this.#sdk = sdk;
20
24
  Object.assign(this, rest);
21
25
  this.creditManagerDebtParams = new AddressMap(
22
26
  creditManagerDebtParams.map((p) => [p.creditManager, p])
@@ -28,6 +32,17 @@ class PoolV310Contract extends BaseContract {
28
32
  symbol: data.symbol
29
33
  });
30
34
  }
35
+ async getKYCFactory() {
36
+ if (this.#kycFactory) {
37
+ return this.#kycFactory;
38
+ }
39
+ await this.#sdk.tokensMeta.loadTokenData(this.underlying);
40
+ const u = this.#sdk.tokensMeta.mustGet(this.underlying);
41
+ if (this.#sdk.tokensMeta.isKYCUnderlying(u)) {
42
+ this.#kycFactory = new SecuritizeKYCFactory(this.#sdk, u.kycFactory);
43
+ }
44
+ return this.#kycFactory;
45
+ }
31
46
  stateHuman(raw = true) {
32
47
  return {
33
48
  ...super.stateHuman(raw),
@@ -3,4 +3,5 @@ export * from "./LinearInterestRateModelContract.js";
3
3
  export * from "./PoolQuotaKeeperV300Contract.js";
4
4
  export * from "./PoolSuite.js";
5
5
  export * from "./PoolV300Contract.js";
6
+ export * from "./SecuritizeKYCFactory.js";
6
7
  export * from "./types.js";
@@ -8,6 +8,7 @@ import { type ILossPolicyContract } from "./loss-policy/index.js";
8
8
  import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
9
9
  import type { IPriceOracleContract } from "./oracle/index.js";
10
10
  import { PoolSuite } from "./pool/index.js";
11
+ import type { SecuritizeKYCFactory } from "./pool/SecuritizeKYCFactory.js";
11
12
  export declare class MarketSuite extends SDKConstruct {
12
13
  readonly acl: Address;
13
14
  readonly treasury: Address;
@@ -22,6 +23,7 @@ export declare class MarketSuite extends SDKConstruct {
22
23
  readonly state: MarketData;
23
24
  constructor(sdk: GearboxSDK, marketData: MarketData);
24
25
  get underlying(): Address;
26
+ getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
25
27
  get dirty(): boolean;
26
28
  get watchAddresses(): Set<Address>;
27
29
  stateHuman(raw?: boolean): MarketStateHuman;
@@ -1,6 +1,5 @@
1
1
  export * from "./adapters/index.js";
2
2
  export * from "./credit/index.js";
3
- export * from "./kyc/index.js";
4
3
  export * from "./MarketRegister.js";
5
4
  export * from "./MarketSuite.js";
6
5
  export * from "./oracle/index.js";
@@ -6,6 +6,7 @@ import type { PoolSuiteStateHuman } from "../../types/index.js";
6
6
  import type { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
7
7
  import { GaugeContract } from "./GaugeContract.js";
8
8
  import { LinearInterestRateModelContract } from "./LinearInterestRateModelContract.js";
9
+ import type { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
9
10
  import { TumblerContract } from "./TumblerContract.js";
10
11
  import type { IInterestRateModelContract, IRateKeeperContract, PoolContract, PoolQuotaKeeperContract } from "./types.js";
11
12
  export declare class PoolSuite extends SDKConstruct {
@@ -20,6 +21,7 @@ export declare class PoolSuite extends SDKConstruct {
20
21
  get linearModel(): LinearInterestRateModelContract;
21
22
  get marketConfigurator(): MarketConfiguratorContract;
22
23
  get underlying(): Address;
24
+ getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
23
25
  get dirty(): boolean;
24
26
  get watchAddresses(): Set<Address>;
25
27
  stateHuman(raw?: boolean): PoolSuiteStateHuman;
@@ -3,6 +3,7 @@ import type { ConstructOptions, CreditManagerDebtParams, PoolState } from "../..
3
3
  import { BaseContract } from "../../base/index.js";
4
4
  import type { PoolStateHuman } from "../../types/index.js";
5
5
  import { AddressMap } from "../../utils/index.js";
6
+ import type { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
6
7
  declare const abi: readonly [{
7
8
  readonly type: "function";
8
9
  readonly name: "DOMAIN_SEPARATOR";
@@ -1100,6 +1101,7 @@ export interface PoolV300Contract extends Omit<PoolState, "baseParams" | "credit
1100
1101
  export declare class PoolV300Contract extends BaseContract<abi> {
1101
1102
  readonly creditManagerDebtParams: AddressMap<CreditManagerDebtParams>;
1102
1103
  constructor(options: ConstructOptions, data: PoolState);
1104
+ getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
1103
1105
  stateHuman(raw?: boolean): PoolStateHuman;
1104
1106
  processLog(log: Log<bigint, number, false, undefined, undefined, abi, ContractEventName<abi>>): void;
1105
1107
  protected stringifyFunctionParams(params: DecodeFunctionDataReturnType<abi>): string[];
@@ -1,8 +1,10 @@
1
1
  import type { ContractEventName, DecodeFunctionDataReturnType, Log } from "viem";
2
- import type { ConstructOptions, CreditManagerDebtParams, PoolState } from "../../base/index.js";
2
+ import type { CreditManagerDebtParams, PoolState } from "../../base/index.js";
3
3
  import { BaseContract } from "../../base/index.js";
4
+ import type { GearboxSDK } from "../../GearboxSDK.js";
4
5
  import type { PoolStateHuman } from "../../types/index.js";
5
6
  import { AddressMap } from "../../utils/index.js";
7
+ import { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
6
8
  declare const abi: readonly [{
7
9
  readonly type: "function";
8
10
  readonly inputs: readonly [];
@@ -1130,8 +1132,10 @@ type abi = typeof abi;
1130
1132
  export interface PoolV310Contract extends Omit<PoolState, "baseParams" | "creditManagerDebtParams" | "name">, BaseContract<abi> {
1131
1133
  }
1132
1134
  export declare class PoolV310Contract extends BaseContract<abi> {
1135
+ #private;
1133
1136
  readonly creditManagerDebtParams: AddressMap<CreditManagerDebtParams>;
1134
- constructor(options: ConstructOptions, data: PoolState);
1137
+ constructor(sdk: GearboxSDK, data: PoolState);
1138
+ getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
1135
1139
  stateHuman(raw?: boolean): PoolStateHuman;
1136
1140
  processLog(log: Log<bigint, number, false, undefined, undefined, abi, ContractEventName<abi>>): void;
1137
1141
  protected stringifyFunctionParams(params: DecodeFunctionDataReturnType<abi>): string[];
@@ -3,4 +3,5 @@ export * from "./LinearInterestRateModelContract.js";
3
3
  export * from "./PoolQuotaKeeperV300Contract.js";
4
4
  export * from "./PoolSuite.js";
5
5
  export * from "./PoolV300Contract.js";
6
+ export * from "./SecuritizeKYCFactory.js";
6
7
  export * from "./types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "13.0.0-next.20",
3
+ "version": "13.0.0-next.21",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",
@@ -1,22 +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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var kyc_exports = {};
17
- module.exports = __toCommonJS(kyc_exports);
18
- __reExport(kyc_exports, require("./SecuritizeKYCFactory.js"), module.exports);
19
- // Annotate the CommonJS export names for ESM import in node:
20
- 0 && (module.exports = {
21
- ...require("./SecuritizeKYCFactory.js")
22
- });
@@ -1 +0,0 @@
1
- export * from "./SecuritizeKYCFactory.js";
@@ -1 +0,0 @@
1
- export * from "./SecuritizeKYCFactory.js";