@gearbox-protocol/sdk 8.27.8 → 8.27.10
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.
|
@@ -28,17 +28,25 @@ var import_viem = require("viem");
|
|
|
28
28
|
var import_sdk = require("../sdk/index.js");
|
|
29
29
|
function createTransport(config) {
|
|
30
30
|
const { rpcProviders = [], protocol, network, ...rest } = config;
|
|
31
|
-
const rpcUrls = /* @__PURE__ */ new
|
|
31
|
+
const rpcUrls = /* @__PURE__ */ new Map();
|
|
32
32
|
for (const { provider, keys } of rpcProviders) {
|
|
33
33
|
for (const key of keys) {
|
|
34
34
|
const url = getProviderUrl(provider, network, key, protocol);
|
|
35
35
|
if (url) {
|
|
36
|
-
rpcUrls.
|
|
36
|
+
rpcUrls.set(url, provider);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
const transports = Array.from(rpcUrls).map(
|
|
41
|
-
(url) => protocol === "http" ? (0, import_viem.http)(url,
|
|
40
|
+
const transports = Array.from(rpcUrls.entries()).map(
|
|
41
|
+
([url, provider], index) => protocol === "http" ? (0, import_viem.http)(url, {
|
|
42
|
+
...rest,
|
|
43
|
+
key: `${provider}-${index}`,
|
|
44
|
+
name: `${provider}-${index}`
|
|
45
|
+
}) : (0, import_viem.webSocket)(url, {
|
|
46
|
+
...rest,
|
|
47
|
+
key: `${provider}-${index}`,
|
|
48
|
+
name: `${provider}-${index}`
|
|
49
|
+
})
|
|
42
50
|
);
|
|
43
51
|
if (transports.length === 0) {
|
|
44
52
|
throw new Error("no fitting rpc urls found");
|
|
@@ -327,7 +327,7 @@ function isPublicNetwork(networkOrChainId) {
|
|
|
327
327
|
function getCuratorName(marketConfigurator, network) {
|
|
328
328
|
const chainz = network ? [chains[network]] : Object.values(chains);
|
|
329
329
|
for (const c of chainz) {
|
|
330
|
-
for (const [a, curator] of
|
|
330
|
+
for (const [a, curator] of import_utils.TypedObjectUtils.entries({
|
|
331
331
|
...c.defaultMarketConfigurators,
|
|
332
332
|
...c.testMarketConfigurators
|
|
333
333
|
})) {
|
|
@@ -2,17 +2,25 @@ import { fallback, http, webSocket } from "viem";
|
|
|
2
2
|
import { getChain } from "../sdk/index.js";
|
|
3
3
|
function createTransport(config) {
|
|
4
4
|
const { rpcProviders = [], protocol, network, ...rest } = config;
|
|
5
|
-
const rpcUrls = /* @__PURE__ */ new
|
|
5
|
+
const rpcUrls = /* @__PURE__ */ new Map();
|
|
6
6
|
for (const { provider, keys } of rpcProviders) {
|
|
7
7
|
for (const key of keys) {
|
|
8
8
|
const url = getProviderUrl(provider, network, key, protocol);
|
|
9
9
|
if (url) {
|
|
10
|
-
rpcUrls.
|
|
10
|
+
rpcUrls.set(url, provider);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
const transports = Array.from(rpcUrls).map(
|
|
15
|
-
(url) => protocol === "http" ? http(url,
|
|
14
|
+
const transports = Array.from(rpcUrls.entries()).map(
|
|
15
|
+
([url, provider], index) => protocol === "http" ? http(url, {
|
|
16
|
+
...rest,
|
|
17
|
+
key: `${provider}-${index}`,
|
|
18
|
+
name: `${provider}-${index}`
|
|
19
|
+
}) : webSocket(url, {
|
|
20
|
+
...rest,
|
|
21
|
+
key: `${provider}-${index}`,
|
|
22
|
+
name: `${provider}-${index}`
|
|
23
|
+
})
|
|
16
24
|
);
|
|
17
25
|
if (transports.length === 0) {
|
|
18
26
|
throw new Error("no fitting rpc urls found");
|
|
@@ -311,7 +311,7 @@ function isPublicNetwork(networkOrChainId) {
|
|
|
311
311
|
function getCuratorName(marketConfigurator, network) {
|
|
312
312
|
const chainz = network ? [chains[network]] : Object.values(chains);
|
|
313
313
|
for (const c of chainz) {
|
|
314
|
-
for (const [a, curator] of
|
|
314
|
+
for (const [a, curator] of TypedObjectUtils.entries({
|
|
315
315
|
...c.defaultMarketConfigurators,
|
|
316
316
|
...c.testMarketConfigurators
|
|
317
317
|
})) {
|
|
@@ -56,7 +56,7 @@ export declare function isPublicNetwork(networkOrChainId: NetworkType | number |
|
|
|
56
56
|
* @param network
|
|
57
57
|
* @returns
|
|
58
58
|
*/
|
|
59
|
-
export declare function getCuratorName(marketConfigurator: Address, network?: NetworkType):
|
|
59
|
+
export declare function getCuratorName(marketConfigurator: Address, network?: NetworkType): Curator | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* Finds market configurator address by curator name
|
|
62
62
|
* @param curator
|