@gearbox-protocol/sdk 8.22.0 → 8.23.0

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(chains_exports, {
21
21
  NetworkType: () => NetworkType,
22
22
  SUPPORTED_NETWORKS: () => SUPPORTED_NETWORKS,
23
23
  chains: () => chains,
24
+ findCuratorMarketConfigurator: () => findCuratorMarketConfigurator,
24
25
  getChain: () => getChain,
25
26
  getCuratorName: () => getCuratorName,
26
27
  getNetworkType: () => getNetworkType,
@@ -31,6 +32,7 @@ module.exports = __toCommonJS(chains_exports);
31
32
  var import_viem = require("viem");
32
33
  var import_chains = require("viem/chains");
33
34
  var import_v4 = require("zod/v4");
35
+ var import_utils = require("../utils");
34
36
  const SUPPORTED_NETWORKS = [
35
37
  "Mainnet",
36
38
  "Arbitrum",
@@ -335,11 +337,22 @@ function getCuratorName(marketConfigurator, network) {
335
337
  }
336
338
  return void 0;
337
339
  }
340
+ function findCuratorMarketConfigurator(curator, network) {
341
+ const { defaultMarketConfigurators, testMarketConfigurators } = chains[network];
342
+ const all = { ...defaultMarketConfigurators, ...testMarketConfigurators };
343
+ for (const [a, c] of import_utils.TypedObjectUtils.entries(all)) {
344
+ if (c === curator) {
345
+ return a;
346
+ }
347
+ }
348
+ return void 0;
349
+ }
338
350
  // Annotate the CommonJS export names for ESM import in node:
339
351
  0 && (module.exports = {
340
352
  NetworkType,
341
353
  SUPPORTED_NETWORKS,
342
354
  chains,
355
+ findCuratorMarketConfigurator,
343
356
  getChain,
344
357
  getCuratorName,
345
358
  getNetworkType,
@@ -16,6 +16,7 @@ import {
16
16
  worldchain
17
17
  } from "viem/chains";
18
18
  import { z } from "zod/v4";
19
+ import { TypedObjectUtils } from "../utils";
19
20
  const SUPPORTED_NETWORKS = [
20
21
  "Mainnet",
21
22
  "Arbitrum",
@@ -320,10 +321,21 @@ function getCuratorName(marketConfigurator, network) {
320
321
  }
321
322
  return void 0;
322
323
  }
324
+ function findCuratorMarketConfigurator(curator, network) {
325
+ const { defaultMarketConfigurators, testMarketConfigurators } = chains[network];
326
+ const all = { ...defaultMarketConfigurators, ...testMarketConfigurators };
327
+ for (const [a, c] of TypedObjectUtils.entries(all)) {
328
+ if (c === curator) {
329
+ return a;
330
+ }
331
+ }
332
+ return void 0;
333
+ }
323
334
  export {
324
335
  NetworkType,
325
336
  SUPPORTED_NETWORKS,
326
337
  chains,
338
+ findCuratorMarketConfigurator,
327
339
  getChain,
328
340
  getCuratorName,
329
341
  getNetworkType,
@@ -57,3 +57,10 @@ export declare function isPublicNetwork(networkOrChainId: NetworkType | number |
57
57
  * @returns
58
58
  */
59
59
  export declare function getCuratorName(marketConfigurator: Address, network?: NetworkType): string | undefined;
60
+ /**
61
+ * Finds market configurator address by curator name
62
+ * @param curator
63
+ * @param network
64
+ * @returns
65
+ */
66
+ export declare function findCuratorMarketConfigurator(curator: Curator, network: NetworkType): Address | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "8.22.0",
3
+ "version": "8.23.0",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",