@gearbox-protocol/sdk 14.12.0-next.79 → 14.12.0-next.80
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.
- package/dist/cjs/model/filters.schema.js +2 -0
- package/dist/cjs/model/index.js +3 -0
- package/dist/cjs/model/opportunities.schema.js +45 -0
- package/dist/cjs/offchain/AbstractOffchainNamespace.js +132 -0
- package/dist/cjs/offchain/index.js +5 -0
- package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +34 -56
- package/dist/cjs/offchain/positions/OffchainPositions.js +5 -24
- package/dist/cjs/offchain/types.js +58 -0
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/model/filters.schema.js +2 -1
- package/dist/esm/model/index.js +3 -3
- package/dist/esm/model/opportunities.schema.js +45 -2
- package/dist/esm/offchain/AbstractOffchainNamespace.js +131 -0
- package/dist/esm/offchain/index.js +3 -2
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +34 -56
- package/dist/esm/offchain/positions/OffchainPositions.js +5 -24
- package/dist/esm/offchain/types.js +56 -1
- package/dist/esm/plugins/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +2 -2
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/sdk/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/model/filters.schema.d.ts +5 -1
- package/dist/types/model/index.d.ts +3 -3
- package/dist/types/model/opportunities.schema.d.ts +49 -1
- package/dist/types/offchain/AbstractOffchainNamespace.d.ts +87 -0
- package/dist/types/offchain/index.d.ts +3 -2
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +3 -33
- package/dist/types/offchain/positions/OffchainPositions.d.ts +2 -17
- package/dist/types/offchain/types.d.ts +49 -1
- package/package.json +2 -1
|
@@ -568,6 +568,54 @@ declare const opportunityFilterSchema: z.ZodObject<{
|
|
|
568
568
|
sunset: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
|
|
569
569
|
rwa: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
|
|
570
570
|
}, z.core.$strip>;
|
|
571
|
+
/**
|
|
572
|
+
* {@link OpportunityFilter} as a URL can carry it: every condition is a string,
|
|
573
|
+
* and a condition that does not narrow is absent rather than empty.
|
|
574
|
+
**/
|
|
575
|
+
declare const opportunityFilterQueryParamsSchema: z.ZodObject<{
|
|
576
|
+
kind: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pool">, z.ZodLiteral<"strategy">]>>;
|
|
577
|
+
chainIds: z.ZodOptional<z.ZodString>;
|
|
578
|
+
underlyingType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
579
|
+
paused: z.ZodOptional<z.ZodEnum<{
|
|
580
|
+
false: "false";
|
|
581
|
+
true: "true";
|
|
582
|
+
}>>;
|
|
583
|
+
sunset: z.ZodOptional<z.ZodEnum<{
|
|
584
|
+
false: "false";
|
|
585
|
+
true: "true";
|
|
586
|
+
}>>;
|
|
587
|
+
rwa: z.ZodOptional<z.ZodEnum<{
|
|
588
|
+
false: "false";
|
|
589
|
+
true: "true";
|
|
590
|
+
}>>;
|
|
591
|
+
}, z.core.$strip>;
|
|
592
|
+
/**
|
|
593
|
+
* Code for {@link OpportunityFilter} to encode/decode to/from url query parameters.
|
|
594
|
+
**/
|
|
595
|
+
declare const opportunityFilterQuerySchema: z.ZodCodec<z.ZodObject<{
|
|
596
|
+
kind: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"pool">, z.ZodLiteral<"strategy">]>>;
|
|
597
|
+
chainIds: z.ZodOptional<z.ZodString>;
|
|
598
|
+
underlyingType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
599
|
+
paused: z.ZodOptional<z.ZodEnum<{
|
|
600
|
+
false: "false";
|
|
601
|
+
true: "true";
|
|
602
|
+
}>>;
|
|
603
|
+
sunset: z.ZodOptional<z.ZodEnum<{
|
|
604
|
+
false: "false";
|
|
605
|
+
true: "true";
|
|
606
|
+
}>>;
|
|
607
|
+
rwa: z.ZodOptional<z.ZodEnum<{
|
|
608
|
+
false: "false";
|
|
609
|
+
true: "true";
|
|
610
|
+
}>>;
|
|
611
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
612
|
+
kind: z.ZodOptional<z.ZodUnion<[z.ZodUnion<readonly [z.ZodLiteral<"pool">, z.ZodLiteral<"strategy">]>, z.ZodLiteral<"all">]>>;
|
|
613
|
+
chainIds: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>>;
|
|
614
|
+
underlyingType: z.ZodOptional<z.ZodUnion<[z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>, z.ZodLiteral<"all">]>>;
|
|
615
|
+
paused: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
|
|
616
|
+
sunset: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
|
|
617
|
+
rwa: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
|
|
618
|
+
}, z.core.$strip>>;
|
|
571
619
|
/**
|
|
572
620
|
* {@link RateCurvePoint}
|
|
573
621
|
**/
|
|
@@ -1185,4 +1233,4 @@ declare const opportunityKeySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1185
1233
|
kind: z.ZodLiteral<"strategy">;
|
|
1186
1234
|
}, z.core.$strip>], "kind">;
|
|
1187
1235
|
//#endregion
|
|
1188
|
-
export { apyBreakdownSchema, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterSchema, opportunityKeySchema, opportunityKindSchema, opportunitySchema, pointRewardsSchema, pointsProgramSchema, poolOpportunityDetailSchema, poolOpportunityKeySchema, poolOpportunitySchema, priceFeedDataSchema, priceFeedSummarySchema, quotaAssetSchema, rateCurvePointSchema, rateCurveSchema, rewardsSchema, strategyOpportunityDetailSchema, strategyOpportunityKeySchema, strategyOpportunitySchema, tokenRewardsSchema };
|
|
1236
|
+
export { apyBreakdownSchema, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityKeySchema, opportunityKindSchema, opportunitySchema, pointRewardsSchema, pointsProgramSchema, poolOpportunityDetailSchema, poolOpportunityKeySchema, poolOpportunitySchema, priceFeedDataSchema, priceFeedSummarySchema, quotaAssetSchema, rateCurvePointSchema, rateCurveSchema, rewardsSchema, strategyOpportunityDetailSchema, strategyOpportunityKeySchema, strategyOpportunitySchema, tokenRewardsSchema };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ILogger } from "../sdk/types/logger.js";
|
|
2
|
+
import { HistoryMetric, HistoryRange, HistorySeries } from "../model/history.js";
|
|
3
|
+
import { GearboxAPIOptions, OffchainResult } from "./types.js";
|
|
4
|
+
import { z } from "zod/v4";
|
|
5
|
+
//#region src/offchain/AbstractOffchainNamespace.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Query parameters of a backend read. An entry set to `undefined` is a
|
|
8
|
+
* condition that does not narrow, and is left out of the URL.
|
|
9
|
+
**/
|
|
10
|
+
type OffchainQuery = Record<string, string | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* One backend read.
|
|
13
|
+
*
|
|
14
|
+
* @typeParam S - Schema the payload is decoded with.
|
|
15
|
+
**/
|
|
16
|
+
interface OffchainGetRequest<S extends z.ZodType> {
|
|
17
|
+
/**
|
|
18
|
+
* Path below the base URL, e.g. `"/v2/opportunities/pools/1/0x..."`.
|
|
19
|
+
**/
|
|
20
|
+
path: string;
|
|
21
|
+
/**
|
|
22
|
+
* Parameters to append, see {@link OffchainQuery}.
|
|
23
|
+
**/
|
|
24
|
+
query?: OffchainQuery;
|
|
25
|
+
/**
|
|
26
|
+
* Schema the payload is decoded with. Decoding is what turns the response
|
|
27
|
+
* into read model values, so it is required rather than optional.
|
|
28
|
+
**/
|
|
29
|
+
schema: S;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One backend read of a historical series.
|
|
33
|
+
*
|
|
34
|
+
* @typeParam M - Metric the series carries.
|
|
35
|
+
**/
|
|
36
|
+
interface OffchainHistoryRequest<M extends HistoryMetric> {
|
|
37
|
+
/**
|
|
38
|
+
* Path of the series, metric included.
|
|
39
|
+
**/
|
|
40
|
+
path: string;
|
|
41
|
+
/**
|
|
42
|
+
* Metric the response must carry, see
|
|
43
|
+
* {@link AbstractOffchainNamespace.readHistory}.
|
|
44
|
+
**/
|
|
45
|
+
metric: M;
|
|
46
|
+
/**
|
|
47
|
+
* Window to cover.
|
|
48
|
+
**/
|
|
49
|
+
range: HistoryRange;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Common logic of every {@link GearboxAPI} namespace.
|
|
53
|
+
*
|
|
54
|
+
* A namespace is a set of routes: it knows which path answers which read and
|
|
55
|
+
* which schema describes the payload. Everything under that — where the
|
|
56
|
+
* backend is, how long a request may take, how a failure is reported and how a
|
|
57
|
+
* response becomes read model values — lives here, so a namespace holds
|
|
58
|
+
* nothing but its routes.
|
|
59
|
+
**/
|
|
60
|
+
declare abstract class AbstractOffchainNamespace {
|
|
61
|
+
#private;
|
|
62
|
+
protected readonly logger?: ILogger;
|
|
63
|
+
protected constructor(name: string, options?: GearboxAPIOptions);
|
|
64
|
+
/**
|
|
65
|
+
* Base URL every read of this namespace is issued against.
|
|
66
|
+
**/
|
|
67
|
+
get baseUrl(): string | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Reads one endpoint and decodes its payload.
|
|
70
|
+
*
|
|
71
|
+
* The envelope is built here rather than by the caller: the status is
|
|
72
|
+
* `"success"` whenever this returns at all, because anything else has
|
|
73
|
+
* already thrown.
|
|
74
|
+
**/
|
|
75
|
+
protected get<S extends z.ZodType>(request: OffchainGetRequest<S>): Promise<OffchainResult<z.output<S>>>;
|
|
76
|
+
/**
|
|
77
|
+
* Reads one historical series.
|
|
78
|
+
*
|
|
79
|
+
* The requested metric is pinned in the schema, which is what upholds the
|
|
80
|
+
* `HistorySeries<M>` a caller gets back: a response carrying a different
|
|
81
|
+
* metric is version skew and fails validation like any other mismatch,
|
|
82
|
+
* rather than being cast into the requested shape.
|
|
83
|
+
**/
|
|
84
|
+
protected readHistory<M extends HistoryMetric>(request: OffchainHistoryRequest<M>): Promise<OffchainResult<HistorySeries<M>>>;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { AbstractOffchainNamespace, OffchainGetRequest, OffchainHistoryRequest, OffchainQuery };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { GearboxAPIOptions, OffchainNotImplementedError, OffchainResult, OffchainSourceMeta } from "./types.js";
|
|
1
|
+
import { GearboxAPIOptions, OffchainNotConfiguredError, OffchainNotImplementedError, OffchainResult, OffchainSourceMeta, OffchainTransportError, OffchainValidationError } from "./types.js";
|
|
2
|
+
import { AbstractOffchainNamespace, OffchainGetRequest, OffchainHistoryRequest, OffchainQuery } from "./AbstractOffchainNamespace.js";
|
|
2
3
|
import { OffchainOpportunities } from "./opportunities/OffchainOpportunities.js";
|
|
3
4
|
import "./opportunities/index.js";
|
|
4
5
|
import { OffchainPositions } from "./positions/OffchainPositions.js";
|
|
5
6
|
import "./positions/index.js";
|
|
6
7
|
import { GearboxAPI } from "./GearboxAPI.js";
|
|
7
|
-
export { GearboxAPI, GearboxAPIOptions, OffchainNotImplementedError, OffchainOpportunities, OffchainPositions, OffchainResult, OffchainSourceMeta };
|
|
8
|
+
export { AbstractOffchainNamespace, GearboxAPI, GearboxAPIOptions, OffchainGetRequest, OffchainHistoryRequest, OffchainNotConfiguredError, OffchainNotImplementedError, OffchainOpportunities, OffchainPositions, OffchainQuery, OffchainResult, OffchainSourceMeta, OffchainTransportError, OffchainValidationError };
|
|
@@ -1,59 +1,29 @@
|
|
|
1
1
|
import { Opportunity, OpportunityFilter, PoolOpportunityDetail, PoolOpportunityKey, StrategyOpportunityDetail, StrategyOpportunityKey } from "../../model/opportunities.js";
|
|
2
2
|
import { HistoryMetric, HistorySeries, OpportunityHistoryQuery } from "../../model/history.js";
|
|
3
3
|
import { GearboxAPIOptions, OffchainResult } from "../types.js";
|
|
4
|
+
import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
4
5
|
//#region src/offchain/opportunities/OffchainOpportunities.d.ts
|
|
5
6
|
/**
|
|
6
7
|
* Backend counterpart of the `opportunities` namespace.
|
|
7
|
-
*
|
|
8
|
-
* This is a stub: the HTTP client is not written yet, so list reads answer with
|
|
9
|
-
* an empty list and detail reads throw. Every signature is already the final
|
|
10
|
-
* one, because the backend returns the read model types directly — there is no
|
|
11
|
-
* wire DTO and no mapper between the two.
|
|
12
|
-
*
|
|
13
|
-
* When the transport lands, each method will validate the response against the
|
|
14
|
-
* matching schema from `src/model` before returning it. A validation failure is
|
|
15
|
-
* a version-skew error and is handled exactly like a transport error: the
|
|
16
|
-
* combined SDK drops the backend's contribution in `both` mode and rethrows in
|
|
17
|
-
* `offchain` mode.
|
|
18
8
|
**/
|
|
19
|
-
declare class OffchainOpportunities {
|
|
9
|
+
declare class OffchainOpportunities extends AbstractOffchainNamespace {
|
|
20
10
|
#private;
|
|
21
11
|
constructor(options?: GearboxAPIOptions);
|
|
22
|
-
/**
|
|
23
|
-
* Base URL the client will call once the transport is implemented.
|
|
24
|
-
**/
|
|
25
|
-
get baseUrl(): string | undefined;
|
|
26
12
|
/**
|
|
27
13
|
* All opportunities the backend knows about, optionally narrowed by
|
|
28
14
|
* {@link OpportunityFilter}.
|
|
29
|
-
*
|
|
30
|
-
* @returns An empty list until the backend client is implemented.
|
|
31
15
|
**/
|
|
32
16
|
list(filter?: OpportunityFilter): Promise<OffchainResult<Opportunity[]>>;
|
|
33
17
|
/**
|
|
34
18
|
* Detailed view of one pool opportunity.
|
|
35
|
-
*
|
|
36
|
-
* @throws {@link OffchainNotImplementedError} until the backend client is
|
|
37
|
-
* implemented.
|
|
38
19
|
**/
|
|
39
20
|
getPool(key: PoolOpportunityKey): Promise<OffchainResult<PoolOpportunityDetail>>;
|
|
40
21
|
/**
|
|
41
22
|
* Detailed view of one strategy opportunity.
|
|
42
|
-
*
|
|
43
|
-
* @throws {@link OffchainNotImplementedError} until the backend client is
|
|
44
|
-
* implemented.
|
|
45
23
|
**/
|
|
46
24
|
getStrategy(key: StrategyOpportunityKey): Promise<OffchainResult<StrategyOpportunityDetail>>;
|
|
47
25
|
/**
|
|
48
|
-
* One historical series of one opportunity
|
|
49
|
-
* rebuilding it from the chain would mean an archive read per point.
|
|
50
|
-
*
|
|
51
|
-
* The requested metric types the response, so a caller asking for one metric
|
|
52
|
-
* does not have to narrow the union back down. When the transport lands,
|
|
53
|
-
* validation is what upholds it: a response carrying a different metric than
|
|
54
|
-
* the one asked for is a version-skew error like any other.
|
|
55
|
-
*
|
|
56
|
-
* @returns An empty series until the backend client is implemented.
|
|
26
|
+
* One historical series of one opportunity
|
|
57
27
|
**/
|
|
58
28
|
getHistory<M extends HistoryMetric>(query: OpportunityHistoryQuery<M>): Promise<OffchainResult<HistorySeries<M>>>;
|
|
59
29
|
}
|
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
import { Position, PositionFilter } from "../../model/positions.js";
|
|
2
2
|
import { HistorySeries, PositionHistoryMetric, PositionHistoryQuery } from "../../model/history.js";
|
|
3
3
|
import { GearboxAPIOptions, OffchainResult } from "../types.js";
|
|
4
|
+
import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
4
5
|
import { Address } from "viem";
|
|
5
6
|
//#region src/offchain/positions/OffchainPositions.d.ts
|
|
6
7
|
/**
|
|
7
8
|
* Backend counterpart of the `positions` namespace.
|
|
8
|
-
*
|
|
9
|
-
* This is a stub: the HTTP client is not written yet, so reads answer with an
|
|
10
|
-
* empty payload. Every signature is already the final one, because the backend
|
|
11
|
-
* returns the read model types directly — there is no wire DTO and no mapper
|
|
12
|
-
* between the two.
|
|
13
|
-
*
|
|
14
|
-
* When the transport lands, each method will validate the response against the
|
|
15
|
-
* matching schema from `src/model` before returning it. A validation failure is
|
|
16
|
-
* a version-skew error and is handled exactly like a transport error: the
|
|
17
|
-
* combined SDK drops the backend's contribution in `both` mode and rethrows in
|
|
18
|
-
* `offchain` mode.
|
|
19
9
|
**/
|
|
20
|
-
declare class OffchainPositions {
|
|
21
|
-
#private;
|
|
10
|
+
declare class OffchainPositions extends AbstractOffchainNamespace {
|
|
22
11
|
constructor(options?: GearboxAPIOptions);
|
|
23
|
-
/**
|
|
24
|
-
* Base URL the client will call once the transport is implemented.
|
|
25
|
-
**/
|
|
26
|
-
get baseUrl(): string | undefined;
|
|
27
12
|
/**
|
|
28
13
|
* Everything a wallet holds, optionally narrowed by {@link PositionFilter}.
|
|
29
14
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ILogger } from "../sdk/types/logger.js";
|
|
2
|
+
import { z } from "zod/v4";
|
|
2
3
|
//#region src/offchain/types.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Outcome of the single request that serves a backend read. Unlike the
|
|
@@ -42,6 +43,47 @@ interface OffchainResult<T> {
|
|
|
42
43
|
declare class OffchainNotImplementedError extends Error {
|
|
43
44
|
constructor(endpoint: string);
|
|
44
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Thrown when a read is issued against a client that was never told where the
|
|
48
|
+
* backend is.
|
|
49
|
+
**/
|
|
50
|
+
declare class OffchainNotConfiguredError extends Error {
|
|
51
|
+
constructor(path: string);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Thrown when the backend could not be reached, or answered with a status
|
|
55
|
+
* outside the 2xx range.
|
|
56
|
+
**/
|
|
57
|
+
declare class OffchainTransportError extends Error {
|
|
58
|
+
/**
|
|
59
|
+
* URL that was requested, query included.
|
|
60
|
+
**/
|
|
61
|
+
readonly url: string;
|
|
62
|
+
/**
|
|
63
|
+
* Status the backend answered with, absent when the request never completed.
|
|
64
|
+
**/
|
|
65
|
+
readonly status?: number;
|
|
66
|
+
constructor(url: string, reason: string, status?: number);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Thrown when the backend answered, but with a payload the read model does not
|
|
70
|
+
* describe.
|
|
71
|
+
*
|
|
72
|
+
* This is version skew rather than a bad request, and it is deliberately
|
|
73
|
+
* handled like a transport error: the combined SDK drops the backend's
|
|
74
|
+
* contribution in `both` mode and fails the read in `offchain` mode.
|
|
75
|
+
**/
|
|
76
|
+
declare class OffchainValidationError extends Error {
|
|
77
|
+
/**
|
|
78
|
+
* URL whose payload failed to validate.
|
|
79
|
+
**/
|
|
80
|
+
readonly url: string;
|
|
81
|
+
/**
|
|
82
|
+
* What did not match, in the order zod reported it.
|
|
83
|
+
**/
|
|
84
|
+
readonly issues: readonly z.core.$ZodIssue[];
|
|
85
|
+
constructor(url: string, issues: readonly z.core.$ZodIssue[]);
|
|
86
|
+
}
|
|
45
87
|
/**
|
|
46
88
|
* Options for creating a {@link GearboxAPI} instance.
|
|
47
89
|
**/
|
|
@@ -52,10 +94,16 @@ interface GearboxAPIOptions {
|
|
|
52
94
|
* @example `"https://api.gearbox.fi"`
|
|
53
95
|
**/
|
|
54
96
|
baseUrl?: string;
|
|
97
|
+
/**
|
|
98
|
+
* How long a single request may take, in milliseconds.
|
|
99
|
+
*
|
|
100
|
+
* @defaultValue 30 seconds
|
|
101
|
+
**/
|
|
102
|
+
timeout?: number;
|
|
55
103
|
/**
|
|
56
104
|
* Logger used for transport and validation diagnostics.
|
|
57
105
|
**/
|
|
58
106
|
logger?: ILogger;
|
|
59
107
|
}
|
|
60
108
|
//#endregion
|
|
61
|
-
export { GearboxAPIOptions, OffchainNotImplementedError, OffchainResult, OffchainSourceMeta };
|
|
109
|
+
export { GearboxAPIOptions, OffchainNotConfiguredError, OffchainNotImplementedError, OffchainResult, OffchainSourceMeta, OffchainTransportError, OffchainValidationError };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/sdk",
|
|
3
|
-
"version": "14.12.0-next.
|
|
3
|
+
"version": "14.12.0-next.80",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"build": "tsdown",
|
|
84
84
|
"dev": "tsdown --watch",
|
|
85
85
|
"example": "tsx scripts/example.ts | pino-pretty",
|
|
86
|
+
"list-opportunities": "tsx scripts/list-opportunities.ts",
|
|
86
87
|
"test:watch": "vitest --project unit",
|
|
87
88
|
"test:unit": "vitest run --project unit",
|
|
88
89
|
"test:e2e": "vitest run --project e2e",
|