@gearbox-protocol/sdk 8.16.2 → 8.17.1
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.
|
@@ -22,6 +22,7 @@ __export(chains_exports, {
|
|
|
22
22
|
SUPPORTED_NETWORKS: () => SUPPORTED_NETWORKS,
|
|
23
23
|
chains: () => chains,
|
|
24
24
|
getChain: () => getChain,
|
|
25
|
+
getCuratorName: () => getCuratorName,
|
|
25
26
|
getNetworkType: () => getNetworkType,
|
|
26
27
|
isPublicNetwork: () => isPublicNetwork,
|
|
27
28
|
isSupportedNetwork: () => isSupportedNetwork
|
|
@@ -324,12 +325,27 @@ function isPublicNetwork(networkOrChainId) {
|
|
|
324
325
|
return c.id === Number(networkOrChainId) && c.isPublic;
|
|
325
326
|
});
|
|
326
327
|
}
|
|
328
|
+
function getCuratorName(marketConfigurator, network) {
|
|
329
|
+
const chainz = network ? [chains[network]] : Object.values(chains);
|
|
330
|
+
for (const c of chainz) {
|
|
331
|
+
for (const [a, curator] of Object.entries({
|
|
332
|
+
...c.defaultMarketConfigurators,
|
|
333
|
+
...c.testMarketConfigurators
|
|
334
|
+
})) {
|
|
335
|
+
if (a.toLowerCase() === marketConfigurator.toLowerCase()) {
|
|
336
|
+
return curator;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return void 0;
|
|
341
|
+
}
|
|
327
342
|
// Annotate the CommonJS export names for ESM import in node:
|
|
328
343
|
0 && (module.exports = {
|
|
329
344
|
NetworkType,
|
|
330
345
|
SUPPORTED_NETWORKS,
|
|
331
346
|
chains,
|
|
332
347
|
getChain,
|
|
348
|
+
getCuratorName,
|
|
333
349
|
getNetworkType,
|
|
334
350
|
isPublicNetwork,
|
|
335
351
|
isSupportedNetwork
|
|
@@ -310,11 +310,26 @@ function isPublicNetwork(networkOrChainId) {
|
|
|
310
310
|
return c.id === Number(networkOrChainId) && c.isPublic;
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
+
function getCuratorName(marketConfigurator, network) {
|
|
314
|
+
const chainz = network ? [chains[network]] : Object.values(chains);
|
|
315
|
+
for (const c of chainz) {
|
|
316
|
+
for (const [a, curator] of Object.entries({
|
|
317
|
+
...c.defaultMarketConfigurators,
|
|
318
|
+
...c.testMarketConfigurators
|
|
319
|
+
})) {
|
|
320
|
+
if (a.toLowerCase() === marketConfigurator.toLowerCase()) {
|
|
321
|
+
return curator;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return void 0;
|
|
326
|
+
}
|
|
313
327
|
export {
|
|
314
328
|
NetworkType,
|
|
315
329
|
SUPPORTED_NETWORKS,
|
|
316
330
|
chains,
|
|
317
331
|
getChain,
|
|
332
|
+
getCuratorName,
|
|
318
333
|
getNetworkType,
|
|
319
334
|
isPublicNetwork,
|
|
320
335
|
isSupportedNetwork
|
|
@@ -50,3 +50,10 @@ export declare function getChain(chainIdOrNetworkType: number | bigint | Network
|
|
|
50
50
|
export declare function getNetworkType(chainId: number | bigint): NetworkType;
|
|
51
51
|
export declare function isSupportedNetwork(chainId: number | undefined): chainId is number;
|
|
52
52
|
export declare function isPublicNetwork(networkOrChainId: NetworkType | number | bigint): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Tries to find curator name by market configurator address among all default and test market configurators
|
|
55
|
+
* @param marketConfigurator
|
|
56
|
+
* @param network
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
export declare function getCuratorName(marketConfigurator: Address, network?: NetworkType): string | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type Address } from "viem";
|
|
1
2
|
import { z } from "zod/v4";
|
|
2
3
|
/**
|
|
3
4
|
* Like Address from abitype/zod, but converts an address into an address that is checksum encoded.
|
|
4
5
|
*/
|
|
5
|
-
export declare const ZodAddress: () => z.ZodPipe<z.ZodString, z.ZodTransform
|
|
6
|
+
export declare const ZodAddress: () => z.ZodPipe<z.ZodString, z.ZodTransform<Address, string>>;
|