@gearbox-protocol/sdk 12.3.10 → 12.3.11

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.
@@ -45,7 +45,7 @@ const providerConfigSchema = import_v4.z.object({
45
45
  /**
46
46
  * HTTP transport options to use for this provider
47
47
  */
48
- httpClientOptions: import_transports.httpTransportConfigSchema.optional()
48
+ httpTransportOptions: import_transports.httpTransportOptionsSchema.optional()
49
49
  });
50
50
  const SelectionStrategy = import_v4.z.enum(["simple", "ordered"]);
51
51
  const revolverTransportConfigSchema = import_v4.z.object({
@@ -66,7 +66,7 @@ const revolverTransportConfigSchema = import_v4.z.object({
66
66
  /**
67
67
  * Default HTTP options to use for all providers, can be overridden by provider config
68
68
  */
69
- defaultHTTPOptions: import_transports.httpTransportConfigSchema.optional(),
69
+ defaultHTTPOptions: import_transports.httpTransportOptionsSchema.optional(),
70
70
  /**
71
71
  * Default cooldown, in milliseconds, to wait before try this transport again
72
72
  */
@@ -107,11 +107,11 @@ class RevolverTransport {
107
107
  shouldRetry: config.shouldRetry ?? defaultShouldRetry
108
108
  };
109
109
  const transports = config.providers.map(
110
- ({ url, name, cooldown, httpClientOptions }) => ({
110
+ ({ url, name, cooldown, httpTransportOptions }) => ({
111
111
  name,
112
112
  transport: (0, import_viem.http)(url, {
113
113
  ...config.defaultHTTPOptions,
114
- ...httpClientOptions,
114
+ ...httpTransportOptions,
115
115
  key: name,
116
116
  name,
117
117
  onFetchRequest: this.#config.onRequest ? (...args) => this.#config.onRequest?.(name, ...args) : void 0,
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var transports_exports = {};
20
20
  __export(transports_exports, {
21
- httpTransportConfigSchema: () => httpTransportConfigSchema
21
+ httpTransportOptionsSchema: () => httpTransportOptionsSchema
22
22
  });
23
23
  module.exports = __toCommonJS(transports_exports);
24
24
  var import_v4 = require("zod/v4");
25
- const httpTransportConfigSchema = import_v4.z.object({
25
+ const httpTransportOptionsSchema = import_v4.z.object({
26
26
  /**
27
27
  * Whether to enable Batch JSON-RPC.
28
28
  * @link https://www.jsonrpc.org/specification#batch
@@ -67,5 +67,5 @@ const httpTransportConfigSchema = import_v4.z.object({
67
67
  });
68
68
  // Annotate the CommonJS export names for ESM import in node:
69
69
  0 && (module.exports = {
70
- httpTransportConfigSchema
70
+ httpTransportOptionsSchema
71
71
  });
@@ -46,7 +46,7 @@ function createClient(opts, network) {
46
46
  } else {
47
47
  const rpcs = opts.rpcURLs.map(
48
48
  (url) => (0, import_viem.http)(url, {
49
- ...opts.httpClientOptions,
49
+ ...opts.httpTransportOptions,
50
50
  timeout: opts.timeout,
51
51
  retryCount: opts.retryCount
52
52
  })
@@ -12,7 +12,7 @@ import {
12
12
  } from "viem";
13
13
  import { z } from "zod/v4";
14
14
  import { NetworkType } from "../sdk/index.js";
15
- import { httpTransportConfigSchema } from "./transports.js";
15
+ import { httpTransportOptionsSchema } from "./transports.js";
16
16
  const providerConfigSchema = z.object({
17
17
  /**
18
18
  * Provider name for display purposes
@@ -29,7 +29,7 @@ const providerConfigSchema = z.object({
29
29
  /**
30
30
  * HTTP transport options to use for this provider
31
31
  */
32
- httpClientOptions: httpTransportConfigSchema.optional()
32
+ httpTransportOptions: httpTransportOptionsSchema.optional()
33
33
  });
34
34
  const SelectionStrategy = z.enum(["simple", "ordered"]);
35
35
  const revolverTransportConfigSchema = z.object({
@@ -50,7 +50,7 @@ const revolverTransportConfigSchema = z.object({
50
50
  /**
51
51
  * Default HTTP options to use for all providers, can be overridden by provider config
52
52
  */
53
- defaultHTTPOptions: httpTransportConfigSchema.optional(),
53
+ defaultHTTPOptions: httpTransportOptionsSchema.optional(),
54
54
  /**
55
55
  * Default cooldown, in milliseconds, to wait before try this transport again
56
56
  */
@@ -91,11 +91,11 @@ class RevolverTransport {
91
91
  shouldRetry: config.shouldRetry ?? defaultShouldRetry
92
92
  };
93
93
  const transports = config.providers.map(
94
- ({ url, name, cooldown, httpClientOptions }) => ({
94
+ ({ url, name, cooldown, httpTransportOptions }) => ({
95
95
  name,
96
96
  transport: http(url, {
97
97
  ...config.defaultHTTPOptions,
98
- ...httpClientOptions,
98
+ ...httpTransportOptions,
99
99
  key: name,
100
100
  name,
101
101
  onFetchRequest: this.#config.onRequest ? (...args) => this.#config.onRequest?.(name, ...args) : void 0,
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod/v4";
2
- const httpTransportConfigSchema = z.object({
2
+ const httpTransportOptionsSchema = z.object({
3
3
  /**
4
4
  * Whether to enable Batch JSON-RPC.
5
5
  * @link https://www.jsonrpc.org/specification#batch
@@ -43,5 +43,5 @@ const httpTransportConfigSchema = z.object({
43
43
  timeout: z.number().optional()
44
44
  });
45
45
  export {
46
- httpTransportConfigSchema
46
+ httpTransportOptionsSchema
47
47
  };
@@ -45,7 +45,7 @@ function createClient(opts, network) {
45
45
  } else {
46
46
  const rpcs = opts.rpcURLs.map(
47
47
  (url) => http(url, {
48
- ...opts.httpClientOptions,
48
+ ...opts.httpTransportOptions,
49
49
  timeout: opts.timeout,
50
50
  retryCount: opts.retryCount
51
51
  })
@@ -6,7 +6,7 @@ export declare const providerConfigSchema: z.ZodObject<{
6
6
  name: z.ZodString;
7
7
  url: z.ZodURL;
8
8
  cooldown: z.ZodOptional<z.ZodNumber>;
9
- httpClientOptions: z.ZodOptional<z.ZodObject<{
9
+ httpTransportOptions: z.ZodOptional<z.ZodObject<{
10
10
  batch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
11
11
  batchSize: z.ZodOptional<z.ZodNumber>;
12
12
  wait: z.ZodOptional<z.ZodNumber>;
@@ -62,7 +62,7 @@ export declare const revolverTransportConfigSchema: z.ZodObject<{
62
62
  name: z.ZodString;
63
63
  url: z.ZodURL;
64
64
  cooldown: z.ZodOptional<z.ZodNumber>;
65
- httpClientOptions: z.ZodOptional<z.ZodObject<{
65
+ httpTransportOptions: z.ZodOptional<z.ZodObject<{
66
66
  batch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
67
67
  batchSize: z.ZodOptional<z.ZodNumber>;
68
68
  wait: z.ZodOptional<z.ZodNumber>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod/v4";
2
- export declare const httpTransportConfigSchema: z.ZodObject<{
2
+ export declare const httpTransportOptionsSchema: z.ZodObject<{
3
3
  batch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
4
4
  batchSize: z.ZodOptional<z.ZodNumber>;
5
5
  wait: z.ZodOptional<z.ZodNumber>;
@@ -40,7 +40,7 @@ export type ClientOptions = {
40
40
  * Retry count for RPC
41
41
  */
42
42
  retryCount?: number;
43
- httpClientOptions?: HttpRpcClientOptions | undefined;
43
+ httpTransportOptions?: HttpRpcClientOptions | undefined;
44
44
  } | {
45
45
  /**
46
46
  * Alternatively, can pass viem transport
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "12.3.10",
3
+ "version": "12.3.11",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",
@@ -62,13 +62,13 @@
62
62
  "date-fns": "^4.1.0",
63
63
  "decimal.js-light": "^2.5.1",
64
64
  "viem": ">=2.23.15 <3.0.0",
65
- "zod": "^4.2.1"
65
+ "zod": "^4.3.5"
66
66
  },
67
67
  "devDependencies": {
68
- "@biomejs/biome": "^2.3.10",
69
- "@commitlint/cli": "^20.2.0",
70
- "@commitlint/config-conventional": "^20.2.0",
71
- "@gearbox-protocol/biome-config": "^1.0.16",
68
+ "@biomejs/biome": "^2.3.11",
69
+ "@commitlint/cli": "^20.3.0",
70
+ "@commitlint/config-conventional": "^20.3.0",
71
+ "@gearbox-protocol/biome-config": "^1.0.17",
72
72
  "@types/cross-spawn": "^6.0.6",
73
73
  "axios": "^1.13.2",
74
74
  "cross-spawn": "^7.0.6",