@gearbox-protocol/sdk 14.12.0-next.81 → 14.12.0-next.82
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.js +0 -4
- package/dist/cjs/model/filters.schema.js +10 -1
- package/dist/cjs/model/index.js +3 -0
- package/dist/cjs/model/liquidations.js +1 -1
- package/dist/cjs/model/liquidations.schema.js +1 -1
- package/dist/cjs/model/opportunities.js +1 -1
- package/dist/cjs/model/opportunities.schema.js +6 -13
- package/dist/cjs/model/positions.js +1 -1
- package/dist/cjs/model/positions.schema.js +33 -1
- package/dist/cjs/model/response.schema.js +9 -6
- package/dist/cjs/new-sdk/AbstractNamespace.js +46 -128
- package/dist/cjs/new-sdk/GearboxSDK.js +55 -42
- package/dist/cjs/new-sdk/errors/AllSourcesFailedError.js +20 -0
- package/dist/cjs/new-sdk/errors/MissingSourceError.js +25 -0
- package/dist/cjs/new-sdk/errors/NoSourceServedError.js +20 -0
- package/dist/cjs/new-sdk/errors/SourceChainMismatchError.js +34 -0
- package/dist/cjs/new-sdk/errors/SourceUnavailableError.js +25 -0
- package/dist/cjs/new-sdk/errors/assertSameChains.js +12 -0
- package/dist/cjs/new-sdk/errors/everyChainFailed.js +11 -0
- package/dist/cjs/new-sdk/errors/index.js +15 -0
- package/dist/cjs/new-sdk/index.js +23 -3
- package/dist/cjs/new-sdk/opportunities/OpportunitiesNamespace.js +37 -89
- package/dist/cjs/new-sdk/positions/PositionsNamespace.js +27 -94
- package/dist/cjs/new-sdk/types.js +0 -21
- package/dist/cjs/new-sdk/utils/filterResponse.js +21 -0
- package/dist/cjs/new-sdk/utils/index.js +6 -0
- package/dist/cjs/new-sdk/utils/mergeChains.js +81 -0
- package/dist/cjs/new-sdk/utils/types.js +1 -0
- package/dist/cjs/offchain/AbstractOffchainNamespace.js +42 -65
- package/dist/cjs/offchain/GearboxAPI.js +12 -8
- package/dist/cjs/offchain/errors/OffchainInvalidJsonError.js +19 -0
- package/dist/cjs/offchain/errors/OffchainNotConfiguredError.js +20 -0
- package/dist/cjs/offchain/errors/OffchainNotImplementedError.js +19 -0
- package/dist/cjs/offchain/errors/OffchainRequestFailedError.js +24 -0
- package/dist/cjs/offchain/errors/OffchainStatusError.js +20 -0
- package/dist/cjs/offchain/errors/OffchainTransportError.js +31 -0
- package/dist/cjs/offchain/errors/OffchainValidationError.js +26 -0
- package/dist/cjs/offchain/errors/backendMessage.js +28 -0
- package/dist/cjs/offchain/errors/errorCause.js +12 -0
- package/dist/cjs/offchain/errors/index.js +21 -0
- package/dist/cjs/offchain/errors/readResponseBody.js +15 -0
- package/dist/cjs/offchain/index.js +22 -5
- package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +6 -3
- package/dist/cjs/offchain/positions/OffchainPositions.js +15 -21
- package/dist/cjs/offchain/types.js +0 -75
- package/dist/cjs/sdk/MultichainSDK.js +1 -1
- package/dist/cjs/sdk/OnchainSDK.js +1 -1
- package/dist/cjs/sdk/accounts/liquidations/MultichainLiquidationsService.js +38 -14
- package/dist/cjs/sdk/base/MultichainConstruct.js +73 -34
- package/dist/cjs/sdk/chain/chains.js +11 -0
- package/dist/cjs/sdk/chain/index.js +1 -0
- package/dist/cjs/sdk/core/index.js +1 -1
- package/dist/cjs/sdk/index.js +2 -1
- package/dist/cjs/sdk/opportunities/MultichainOpportunitiesService.js +18 -32
- package/dist/cjs/sdk/opportunities/OpportunitiesService.js +1 -4
- package/dist/cjs/sdk/positions/MultichainPositionsService.js +6 -29
- package/dist/cjs/sdk/positions/PositionsService.js +1 -2
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/model/filters.js +0 -4
- package/dist/esm/model/filters.schema.js +10 -2
- package/dist/esm/model/index.js +3 -3
- package/dist/esm/model/liquidations.js +1 -1
- package/dist/esm/model/liquidations.schema.js +1 -1
- package/dist/esm/model/opportunities.js +1 -1
- package/dist/esm/model/opportunities.schema.js +4 -11
- package/dist/esm/model/positions.js +1 -1
- package/dist/esm/model/positions.schema.js +33 -3
- package/dist/esm/model/response.schema.js +9 -6
- package/dist/esm/new-sdk/AbstractNamespace.js +46 -128
- package/dist/esm/new-sdk/GearboxSDK.js +55 -42
- package/dist/esm/new-sdk/errors/AllSourcesFailedError.js +19 -0
- package/dist/esm/new-sdk/errors/MissingSourceError.js +24 -0
- package/dist/esm/new-sdk/errors/NoSourceServedError.js +19 -0
- package/dist/esm/new-sdk/errors/SourceChainMismatchError.js +33 -0
- package/dist/esm/new-sdk/errors/SourceUnavailableError.js +24 -0
- package/dist/esm/new-sdk/errors/assertSameChains.js +11 -0
- package/dist/esm/new-sdk/errors/everyChainFailed.js +10 -0
- package/dist/esm/new-sdk/errors/index.js +8 -0
- package/dist/esm/new-sdk/index.js +13 -3
- package/dist/esm/new-sdk/opportunities/OpportunitiesNamespace.js +38 -90
- package/dist/esm/new-sdk/positions/PositionsNamespace.js +28 -95
- package/dist/esm/new-sdk/types.js +1 -21
- package/dist/esm/new-sdk/utils/filterResponse.js +20 -0
- package/dist/esm/new-sdk/utils/index.js +3 -1
- package/dist/esm/new-sdk/utils/mergeChains.js +78 -0
- package/dist/esm/new-sdk/utils/types.js +1 -0
- package/dist/esm/offchain/AbstractOffchainNamespace.js +41 -64
- package/dist/esm/offchain/GearboxAPI.js +12 -8
- package/dist/esm/offchain/errors/OffchainInvalidJsonError.js +18 -0
- package/dist/esm/offchain/errors/OffchainNotConfiguredError.js +19 -0
- package/dist/esm/offchain/errors/OffchainNotImplementedError.js +18 -0
- package/dist/esm/offchain/errors/OffchainRequestFailedError.js +23 -0
- package/dist/esm/offchain/errors/OffchainStatusError.js +19 -0
- package/dist/esm/offchain/errors/OffchainTransportError.js +30 -0
- package/dist/esm/offchain/errors/OffchainValidationError.js +25 -0
- package/dist/esm/offchain/errors/backendMessage.js +27 -0
- package/dist/esm/offchain/errors/errorCause.js +11 -0
- package/dist/esm/offchain/errors/index.js +11 -0
- package/dist/esm/offchain/errors/readResponseBody.js +14 -0
- package/dist/esm/offchain/index.js +13 -2
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +6 -3
- package/dist/esm/offchain/positions/OffchainPositions.js +15 -21
- package/dist/esm/offchain/types.js +1 -72
- 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/MultichainSDK.js +1 -1
- package/dist/esm/sdk/OnchainSDK.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/liquidations/MultichainLiquidationsService.js +38 -14
- 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/MultichainConstruct.js +73 -34
- package/dist/esm/sdk/base/TokensMeta.js +2 -2
- package/dist/esm/sdk/chain/chains.js +11 -1
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/chain/index.js +2 -2
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/core/index.js +1 -1
- package/dist/esm/sdk/index.js +3 -3
- 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/opportunities/MultichainOpportunitiesService.js +18 -32
- package/dist/esm/sdk/opportunities/OpportunitiesService.js +1 -4
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/positions/MultichainPositionsService.js +6 -29
- package/dist/esm/sdk/positions/PositionsService.js +1 -2
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/model/filters.d.ts +9 -3
- package/dist/types/model/filters.schema.d.ts +7 -1
- package/dist/types/model/index.d.ts +5 -5
- package/dist/types/model/liquidations.d.ts +2 -6
- package/dist/types/model/liquidations.schema.d.ts +1 -1
- package/dist/types/model/opportunities.d.ts +3 -7
- package/dist/types/model/opportunities.schema.d.ts +2 -2
- package/dist/types/model/positions.d.ts +2 -6
- package/dist/types/model/positions.schema.d.ts +32 -2
- package/dist/types/model/response.d.ts +7 -6
- package/dist/types/model/response.schema.d.ts +41 -32
- package/dist/types/new-sdk/AbstractNamespace.d.ts +33 -98
- package/dist/types/new-sdk/GearboxSDK.d.ts +10 -25
- package/dist/types/new-sdk/errors/AllSourcesFailedError.d.ts +11 -0
- package/dist/types/new-sdk/errors/MissingSourceError.d.ts +23 -0
- package/dist/types/new-sdk/errors/NoSourceServedError.d.ts +17 -0
- package/dist/types/new-sdk/errors/SourceChainMismatchError.d.ts +35 -0
- package/dist/types/new-sdk/errors/SourceUnavailableError.d.ts +22 -0
- package/dist/types/new-sdk/errors/assertSameChains.d.ts +11 -0
- package/dist/types/new-sdk/errors/everyChainFailed.d.ts +10 -0
- package/dist/types/new-sdk/errors/index.d.ts +8 -0
- package/dist/types/new-sdk/index.d.ts +17 -6
- package/dist/types/new-sdk/opportunities/OpportunitiesNamespace.d.ts +19 -40
- package/dist/types/new-sdk/opportunities/index.d.ts +2 -2
- package/dist/types/new-sdk/opportunities/types.d.ts +80 -26
- package/dist/types/new-sdk/positions/PositionsNamespace.d.ts +17 -38
- package/dist/types/new-sdk/positions/index.d.ts +2 -2
- package/dist/types/new-sdk/positions/types.d.ts +74 -24
- package/dist/types/new-sdk/types.d.ts +24 -77
- package/dist/types/new-sdk/utils/filterResponse.d.ts +16 -0
- package/dist/types/new-sdk/utils/history.d.ts +6 -36
- package/dist/types/new-sdk/utils/index.d.ts +5 -2
- package/dist/types/new-sdk/utils/mergeChains.d.ts +20 -0
- package/dist/types/new-sdk/utils/types.d.ts +11 -0
- package/dist/types/offchain/AbstractOffchainNamespace.d.ts +21 -28
- package/dist/types/offchain/GearboxAPI.d.ts +13 -9
- package/dist/types/offchain/errors/OffchainInvalidJsonError.d.ts +16 -0
- package/dist/types/offchain/errors/OffchainNotConfiguredError.d.ts +16 -0
- package/dist/types/offchain/errors/OffchainNotImplementedError.d.ts +15 -0
- package/dist/types/offchain/errors/OffchainRequestFailedError.d.ts +12 -0
- package/dist/types/offchain/errors/OffchainStatusError.d.ts +16 -0
- package/dist/types/offchain/errors/OffchainTransportError.d.ts +43 -0
- package/dist/types/offchain/errors/OffchainValidationError.d.ts +21 -0
- package/dist/types/offchain/errors/backendMessage.d.ts +9 -0
- package/dist/types/offchain/errors/errorCause.d.ts +22 -0
- package/dist/types/offchain/errors/index.d.ts +11 -0
- package/dist/types/offchain/errors/readResponseBody.d.ts +8 -0
- package/dist/types/offchain/index.d.ts +13 -2
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +9 -8
- package/dist/types/offchain/positions/OffchainPositions.d.ts +9 -15
- package/dist/types/offchain/types.d.ts +7 -88
- package/dist/types/sdk/accounts/index.d.ts +2 -2
- package/dist/types/sdk/accounts/liquidations/MultichainLiquidationsService.d.ts +15 -14
- package/dist/types/sdk/accounts/liquidations/index.d.ts +2 -2
- package/dist/types/sdk/accounts/liquidations/types.d.ts +9 -15
- package/dist/types/sdk/base/MultichainConstruct.d.ts +63 -14
- package/dist/types/sdk/base/index.d.ts +2 -2
- package/dist/types/sdk/chain/chains.d.ts +10 -2
- package/dist/types/sdk/chain/index.d.ts +2 -2
- package/dist/types/sdk/index.d.ts +5 -5
- package/dist/types/sdk/market/MarketSuite.d.ts +1 -1
- package/dist/types/sdk/opportunities/MultichainOpportunitiesService.d.ts +13 -16
- package/dist/types/sdk/positions/MultichainPositionsService.d.ts +2 -12
- package/dist/types/sdk/types/index.d.ts +2 -2
- package/dist/types/sdk/types/multichain.d.ts +8 -43
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Opportunity, OpportunityFilter, PoolOpportunityDetail, PoolOpportunityKey, StrategyOpportunityDetail, StrategyOpportunityKey } from "../../model/opportunities.js";
|
|
2
2
|
import { HistoryMetric, HistorySeries, OpportunityHistoryQuery } from "../../model/history.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DataResponse } from "../../model/response.js";
|
|
4
|
+
import { GearboxAPIOptions } from "../types.js";
|
|
4
5
|
import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
5
6
|
//#region src/offchain/opportunities/OffchainOpportunities.d.ts
|
|
6
7
|
/**
|
|
@@ -8,24 +9,24 @@ import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
|
8
9
|
**/
|
|
9
10
|
declare class OffchainOpportunities extends AbstractOffchainNamespace {
|
|
10
11
|
#private;
|
|
11
|
-
constructor(options
|
|
12
|
+
constructor(options: GearboxAPIOptions);
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
* {@link OpportunityFilter}.
|
|
14
|
+
* Opportunities of the chains this client covers, optionally narrowed further
|
|
15
|
+
* by {@link OpportunityFilter}.
|
|
15
16
|
**/
|
|
16
|
-
list(filter?: OpportunityFilter): Promise<
|
|
17
|
+
list(filter?: OpportunityFilter): Promise<DataResponse<Opportunity[]>>;
|
|
17
18
|
/**
|
|
18
19
|
* Detailed view of one pool opportunity.
|
|
19
20
|
**/
|
|
20
|
-
getPool(key: PoolOpportunityKey): Promise<
|
|
21
|
+
getPool(key: PoolOpportunityKey): Promise<DataResponse<PoolOpportunityDetail>>;
|
|
21
22
|
/**
|
|
22
23
|
* Detailed view of one strategy opportunity.
|
|
23
24
|
**/
|
|
24
|
-
getStrategy(key: StrategyOpportunityKey): Promise<
|
|
25
|
+
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
25
26
|
/**
|
|
26
27
|
* One historical series of one opportunity
|
|
27
28
|
**/
|
|
28
|
-
getHistory<M extends HistoryMetric>(query: OpportunityHistoryQuery<M>): Promise<
|
|
29
|
+
getHistory<M extends HistoryMetric>(query: OpportunityHistoryQuery<M>): Promise<DataResponse<HistorySeries<M>>>;
|
|
29
30
|
}
|
|
30
31
|
//#endregion
|
|
31
32
|
export { OffchainOpportunities };
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import { Position
|
|
1
|
+
import { Position } from "../../model/positions.js";
|
|
2
2
|
import { HistorySeries, PositionHistoryMetric, PositionHistoryQuery } from "../../model/history.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DataResponse } from "../../model/response.js";
|
|
4
|
+
import { ListPositionsPropsBase } from "../../sdk/positions/types.js";
|
|
5
|
+
import { GearboxAPIOptions } from "../types.js";
|
|
4
6
|
import { AbstractOffchainNamespace } from "../AbstractOffchainNamespace.js";
|
|
5
|
-
import { Address } from "viem";
|
|
6
7
|
//#region src/offchain/positions/OffchainPositions.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* Backend counterpart of the `positions` namespace.
|
|
9
10
|
**/
|
|
10
11
|
declare class OffchainPositions extends AbstractOffchainNamespace {
|
|
11
|
-
|
|
12
|
+
#private;
|
|
13
|
+
constructor(options: GearboxAPIOptions);
|
|
12
14
|
/**
|
|
13
15
|
* Everything a wallet holds, optionally narrowed by {@link PositionFilter}.
|
|
14
|
-
*
|
|
15
|
-
* @returns An empty list until the backend client is implemented.
|
|
16
16
|
**/
|
|
17
|
-
list(
|
|
17
|
+
list(props: ListPositionsPropsBase): Promise<DataResponse<Position[]>>;
|
|
18
18
|
/**
|
|
19
|
-
* One historical series of one position.
|
|
20
|
-
* it from the chain would mean an archive read per point.
|
|
21
|
-
*
|
|
22
|
-
* The requested metric types the response, so a caller asking for one metric
|
|
23
|
-
* does not have to narrow the union back down. When the transport lands,
|
|
24
|
-
* validation is what upholds it: a response carrying a different metric than
|
|
25
|
-
* the one asked for is a version-skew error like any other.
|
|
19
|
+
* One historical series of one position.
|
|
26
20
|
*
|
|
27
21
|
* @returns An empty series until the backend client is implemented.
|
|
28
22
|
**/
|
|
29
|
-
getHistory<M extends PositionHistoryMetric>(query: PositionHistoryQuery<M>): Promise<
|
|
23
|
+
getHistory<M extends PositionHistoryMetric>(query: PositionHistoryQuery<M>): Promise<DataResponse<HistorySeries<M>>>;
|
|
30
24
|
}
|
|
31
25
|
//#endregion
|
|
32
26
|
export { OffchainPositions };
|
|
@@ -1,93 +1,15 @@
|
|
|
1
1
|
import { ILogger } from "../sdk/types/logger.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ChainId } from "../model/primitives.js";
|
|
3
3
|
//#region src/offchain/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Outcome of the single request that serves a backend read. Unlike the
|
|
6
|
-
* on-chain source there is no per-chain breakdown here: one HTTP call covers
|
|
7
|
-
* every chain, so splitting it per chain would be fabricated.
|
|
8
|
-
**/
|
|
9
|
-
interface OffchainSourceMeta {
|
|
10
|
-
/**
|
|
11
|
-
* Whether the backend served the request.
|
|
12
|
-
**/
|
|
13
|
-
status: "success" | "error";
|
|
14
|
-
/**
|
|
15
|
-
* Rejection reason. Only set when {@link status} is `"error"`.
|
|
16
|
-
**/
|
|
17
|
-
error?: unknown;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* What every {@link GearboxAPI} read returns: the payload plus the outcome of
|
|
21
|
-
* the request that produced it, in the same shape the combined SDK exposes.
|
|
22
|
-
*
|
|
23
|
-
* @typeParam T - Payload type.
|
|
24
|
-
**/
|
|
25
|
-
interface OffchainResult<T> {
|
|
26
|
-
/**
|
|
27
|
-
* Requested payload.
|
|
28
|
-
**/
|
|
29
|
-
result: T;
|
|
30
|
-
/**
|
|
31
|
-
* Outcome of the backend request.
|
|
32
|
-
**/
|
|
33
|
-
meta: OffchainSourceMeta;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Thrown by the endpoints that have no stub answer, so that a caller in
|
|
37
|
-
* `offchain` mode fails loudly instead of reading an empty detail page as a
|
|
38
|
-
* missing entity.
|
|
39
|
-
*
|
|
40
|
-
* Lives here rather than in one namespace because every stubbed namespace
|
|
41
|
-
* throws it.
|
|
42
|
-
**/
|
|
43
|
-
declare class OffchainNotImplementedError extends Error {
|
|
44
|
-
constructor(endpoint: string);
|
|
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
|
-
}
|
|
87
4
|
/**
|
|
88
5
|
* Options for creating a {@link GearboxAPI} instance.
|
|
89
6
|
**/
|
|
90
7
|
interface GearboxAPIOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Chains this client reads, which every request names. A caller who thinks in
|
|
10
|
+
* network labels converts with {@link toChainIds}.
|
|
11
|
+
**/
|
|
12
|
+
chainIds: ChainId[];
|
|
91
13
|
/**
|
|
92
14
|
* Base URL of the Gearbox backend, without a trailing slash.
|
|
93
15
|
*
|
|
@@ -100,10 +22,7 @@ interface GearboxAPIOptions {
|
|
|
100
22
|
* @defaultValue 30 seconds
|
|
101
23
|
**/
|
|
102
24
|
timeout?: number;
|
|
103
|
-
/**
|
|
104
|
-
* Logger used for transport and validation diagnostics.
|
|
105
|
-
**/
|
|
106
25
|
logger?: ILogger;
|
|
107
26
|
}
|
|
108
27
|
//#endregion
|
|
109
|
-
export { GearboxAPIOptions
|
|
28
|
+
export { GearboxAPIOptions };
|
|
@@ -24,8 +24,8 @@ import { CreditAccountSlice, IntentPreviewResult } from "./intents/types.js";
|
|
|
24
24
|
import { primaryInstantOutput } from "./intents/operations/claim-delayed/index.js";
|
|
25
25
|
import { CreditAccountOperationsService } from "./intents/index.js";
|
|
26
26
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./liquidations/constants.js";
|
|
27
|
-
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps,
|
|
27
|
+
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, LoadRWALiquidatorsProps, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, RWALiquidatorInfo } from "./liquidations/types.js";
|
|
28
28
|
import { LiquidationsService } from "./liquidations/LiquidationsService.js";
|
|
29
29
|
import { MultichainLiquidationsService } from "./liquidations/MultichainLiquidationsService.js";
|
|
30
30
|
import "./liquidations/index.js";
|
|
31
|
-
export { AbstractWithdrawalCompressorContract, AccountBotsService, AccountToCheck, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, BotStatusCall, BotsDirectResponse, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, ClaimFarmRewardsProps, ClaimableWithdrawal, CloseCreditAccountResult, ConnectedBotsCall, ConnectedBotsPerAccount, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountDataCall, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditManagerFilter, CreditManagerOperationResult, CurrentWithdrawals, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, EncodableCreditAccountOperation, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps,
|
|
31
|
+
export { AbstractWithdrawalCompressorContract, AccountBotsService, AccountToCheck, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, BotStatusCall, BotsDirectResponse, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, ClaimFarmRewardsProps, ClaimableWithdrawal, CloseCreditAccountResult, ConnectedBotsCall, ConnectedBotsPerAccount, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountDataCall, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditManagerFilter, CreditManagerOperationResult, CurrentWithdrawals, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, EncodableCreditAccountOperation, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, GetWithdrawalRequestResultProps, ICreditAccountsService, IRedemptionLoggerContract, IWithdrawalCompressorContract, type IntentPreviewResult, InvalidDelayedIntentError, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LiquidationsService, ListStrategyPositionsProps, LoadRWALiquidatorsProps, MulticallWithFailure, MultichainLiquidationsService, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OpenCAProps, PartiallyLiquidateProps, PendingWithdrawal, PeripheryCompressorV310Contract, PreviewDelayedWithdrawalProps, RWALiquidatorInfo, RedemptionLog, RedemptionLoggerV310Contract, RequestableWithdrawal, Rewards, SetBotProps, SetBotResult, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, createRedemptionLogger, createWithdrawalCompressor, decodeDelayedIntent, encodeDelayedIntent, getWithdrawalCompressorAddress, iCreditAccountAbi, primaryInstantOutput, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal, toWithdrawalStatus };
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
import { TxCall } from "../../../model/primitives.js";
|
|
2
|
-
import { MultichainResult } from "../../types/multichain.js";
|
|
3
2
|
import { PluginsMap } from "../../plugins/types.js";
|
|
4
3
|
import "../../plugins/index.js";
|
|
5
4
|
import { LiquidatableAccount, LiquidationDetails, LiquidationPosition } from "../../../model/liquidations.js";
|
|
5
|
+
import { DataResponse } from "../../../model/response.js";
|
|
6
6
|
import "../../../model/index.js";
|
|
7
|
-
import "../../types/index.js";
|
|
8
7
|
import { MultichainConstruct } from "../../base/MultichainConstruct.js";
|
|
9
8
|
import "../../base/index.js";
|
|
10
9
|
import { BuildLiquidationTxProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationPositionsProps, LoadRWALiquidatorsProps } from "./types.js";
|
|
11
10
|
//#region src/sdk/accounts/liquidations/MultichainLiquidationsService.d.ts
|
|
12
11
|
/**
|
|
13
|
-
* Cross-chain counterpart of {@link LiquidationsService}.
|
|
14
|
-
*
|
|
15
|
-
* Fans out over all chains configured in {@link MultichainSDK} (optionally
|
|
16
|
-
* restricted via {@link MultichainNetworksProps.networks}). A failed chain is
|
|
17
|
-
* logged as a warning and skipped, so one dead RPC does not empty the whole
|
|
18
|
-
* list; its failure is reported in {@link MultichainResult.meta}. Networks that
|
|
19
|
-
* are not configured in the SDK are reported there the same way.
|
|
12
|
+
* Cross-chain counterpart of {@link LiquidationsService}. These reads are live,
|
|
13
|
+
* so each chain is pinned to its own freshly fetched head.
|
|
20
14
|
**/
|
|
21
15
|
declare class MultichainLiquidationsService<const Plugins extends PluginsMap = {}> extends MultichainConstruct<Plugins> {
|
|
22
16
|
/**
|
|
23
17
|
* Accounts of all queried chains, see
|
|
24
18
|
* {@link LiquidationsService.getLiquidatableAccounts}.
|
|
25
19
|
**/
|
|
26
|
-
getLiquidatableAccounts(props?: GetLiquidatableAccountsProps<true>): Promise<
|
|
20
|
+
getLiquidatableAccounts(props?: GetLiquidatableAccountsProps<true>): Promise<DataResponse<LiquidatableAccount[]>>;
|
|
27
21
|
/**
|
|
28
22
|
* {@inheritDoc LiquidationsService.getLiquidationDetails}
|
|
23
|
+
*
|
|
24
|
+
* Throws when the chain cannot answer.
|
|
29
25
|
**/
|
|
30
|
-
getLiquidationDetails(props: GetLiquidationDetailsProps<true>): Promise<LiquidationDetails
|
|
26
|
+
getLiquidationDetails(props: GetLiquidationDetailsProps<true>): Promise<DataResponse<LiquidationDetails>>;
|
|
31
27
|
/**
|
|
32
28
|
* {@inheritDoc LiquidationsService.buildLiquidationTx}
|
|
29
|
+
*
|
|
30
|
+
* The reported block is the one the transaction was built against.
|
|
33
31
|
**/
|
|
34
|
-
buildLiquidationTx(props: BuildLiquidationTxProps<true>): Promise<TxCall
|
|
32
|
+
buildLiquidationTx(props: BuildLiquidationTxProps<true>): Promise<DataResponse<TxCall>>;
|
|
35
33
|
/**
|
|
36
34
|
* Liquidation positions of all queried chains, see
|
|
37
35
|
* {@link LiquidationsService.getLiquidationPositions}.
|
|
38
36
|
**/
|
|
39
|
-
getLiquidationPositions(props: GetLiquidationPositionsProps<true>): Promise<
|
|
37
|
+
getLiquidationPositions(props: GetLiquidationPositionsProps<true>): Promise<DataResponse<LiquidationPosition[]>>;
|
|
40
38
|
/**
|
|
41
39
|
* Loads the liquidators of all queried chains, see
|
|
42
40
|
* {@link LiquidationsService.loadRWALiquidators}.
|
|
41
|
+
*
|
|
42
|
+
* Nothing consumes the block of a cache warm-up, so this one is left on the
|
|
43
|
+
* loaded snapshot.
|
|
43
44
|
**/
|
|
44
|
-
loadRWALiquidators(props?: LoadRWALiquidatorsProps<true>): Promise<
|
|
45
|
+
loadRWALiquidators(props?: LoadRWALiquidatorsProps<true>): Promise<DataResponse<void>>;
|
|
45
46
|
}
|
|
46
47
|
//#endregion
|
|
47
48
|
export { MultichainLiquidationsService };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./constants.js";
|
|
2
|
-
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps,
|
|
2
|
+
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, LoadRWALiquidatorsProps, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, RWALiquidatorInfo } from "./types.js";
|
|
3
3
|
import { LiquidationsService } from "./LiquidationsService.js";
|
|
4
4
|
import { MultichainLiquidationsService } from "./MultichainLiquidationsService.js";
|
|
5
|
-
export { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps,
|
|
5
|
+
export { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LiquidationsService, LoadRWALiquidatorsProps, MultichainLiquidationsService, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, RWALiquidatorInfo };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
2
|
-
import {
|
|
2
|
+
import { MultichainChainIdsProps, MultichainNetworkProps, WithBlock, WithMultichain } from "../../types/multichain.js";
|
|
3
3
|
import { LiquidatableAccountFilter } from "../../../model/liquidations.js";
|
|
4
4
|
import "../../../model/index.js";
|
|
5
5
|
import "../../types/index.js";
|
|
@@ -25,21 +25,15 @@ type OnchainLiquidationCall = OnchainLiquidationData["liquidationCall"];
|
|
|
25
25
|
**/
|
|
26
26
|
type RWALiquidatorInfo = ContractFunctionReturnType<typeof iLiquidationCompressorV313Abi, "view", "getRWALiquidators">[number];
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* `networks` by {@link MultichainNetworksProps} rather than as the model's
|
|
33
|
-
* `chainIds`, which is why it is omitted here.
|
|
34
|
-
**/
|
|
35
|
-
type GetLiquidatableAccountsPropsBase = Omit<LiquidatableAccountFilter, "chainIds">;
|
|
36
|
-
/**
|
|
37
|
-
* Props for {@link LiquidationsService.getLiquidatableAccounts}.
|
|
28
|
+
* Props for {@link LiquidationsService.getLiquidatableAccounts}: the read
|
|
29
|
+
* model's {@link LiquidatableAccountFilter}, whose
|
|
30
|
+
* {@link ChainScopedFilter.chainIds} also narrow which chains the fan-out
|
|
31
|
+
* queries.
|
|
38
32
|
*
|
|
39
33
|
* {@link BlockNumberProps.blockNumber} is only on the single-chain form: a
|
|
40
34
|
* height is not shared across the networks of the fan-out.
|
|
41
35
|
**/
|
|
42
|
-
type GetLiquidatableAccountsProps<Multichain extends boolean = false> =
|
|
36
|
+
type GetLiquidatableAccountsProps<Multichain extends boolean = false> = LiquidatableAccountFilter & WithBlock<Multichain>;
|
|
43
37
|
/**
|
|
44
38
|
* Chain-independent part of {@link GetLiquidationDetailsProps}.
|
|
45
39
|
**/
|
|
@@ -119,13 +113,13 @@ interface GetLiquidationPositionsPropsBase {
|
|
|
119
113
|
* {@link BlockNumberProps.blockNumber} is only on the single-chain form: a
|
|
120
114
|
* height is not shared across the networks of the fan-out.
|
|
121
115
|
**/
|
|
122
|
-
type GetLiquidationPositionsProps<Multichain extends boolean = false> = GetLiquidationPositionsPropsBase & WithBlock<Multichain> & WithMultichain<Multichain,
|
|
116
|
+
type GetLiquidationPositionsProps<Multichain extends boolean = false> = GetLiquidationPositionsPropsBase & WithBlock<Multichain> & WithMultichain<Multichain, MultichainChainIdsProps>;
|
|
123
117
|
/**
|
|
124
118
|
* Props for {@link LiquidationsService.loadRWALiquidators}.
|
|
125
119
|
*
|
|
126
120
|
* {@link BlockNumberProps.blockNumber} is only on the single-chain form: a
|
|
127
121
|
* height is not shared across the networks of the fan-out.
|
|
128
122
|
**/
|
|
129
|
-
type LoadRWALiquidatorsProps<Multichain extends boolean = false> = WithBlock<Multichain> & WithMultichain<Multichain,
|
|
123
|
+
type LoadRWALiquidatorsProps<Multichain extends boolean = false> = WithBlock<Multichain> & WithMultichain<Multichain, MultichainChainIdsProps>;
|
|
130
124
|
//#endregion
|
|
131
|
-
export { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps,
|
|
125
|
+
export { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, LoadRWALiquidatorsProps, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, RWALiquidatorInfo };
|
|
@@ -1,11 +1,32 @@
|
|
|
1
|
+
import { ChainId } from "../../model/primitives.js";
|
|
1
2
|
import { NetworkType } from "../chain/chains.js";
|
|
2
|
-
import { MultichainResult } from "../types/multichain.js";
|
|
3
3
|
import { PluginsMap } from "../plugins/types.js";
|
|
4
4
|
import "../plugins/index.js";
|
|
5
|
+
import { DataResponse } from "../../model/response.js";
|
|
6
|
+
import "../../model/index.js";
|
|
5
7
|
import { OnchainSDK } from "../OnchainSDK.js";
|
|
6
|
-
import "../types/index.js";
|
|
7
8
|
import { MultichainSDK } from "../MultichainSDK.js";
|
|
8
9
|
//#region src/sdk/base/MultichainConstruct.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Block one chain's data was read at, and is reported at.
|
|
12
|
+
**/
|
|
13
|
+
interface ChainBlock {
|
|
14
|
+
blockNumber: bigint;
|
|
15
|
+
/**
|
|
16
|
+
* Unix seconds of {@link blockNumber}.
|
|
17
|
+
**/
|
|
18
|
+
timestamp: bigint;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Where the block a request is read at comes from: the SDK's loaded snapshot,
|
|
22
|
+
* or a freshly fetched head.
|
|
23
|
+
**/
|
|
24
|
+
type ChainBlockSource = "state" | "latest";
|
|
25
|
+
/**
|
|
26
|
+
* {@link ChainBlockSource}, or an explicit height. Only single-chain requests
|
|
27
|
+
* accept a height.
|
|
28
|
+
**/
|
|
29
|
+
type ChainBlockPin = ChainBlockSource | bigint;
|
|
9
30
|
/**
|
|
10
31
|
* Describes a request that is sent to every queried chain.
|
|
11
32
|
*
|
|
@@ -14,27 +35,50 @@ import { MultichainSDK } from "../MultichainSDK.js";
|
|
|
14
35
|
**/
|
|
15
36
|
interface ChainQueryProps<T, Plugins extends PluginsMap = {}> {
|
|
16
37
|
/**
|
|
17
|
-
*
|
|
38
|
+
* Chains to query. All configured chains when omitted.
|
|
18
39
|
**/
|
|
19
|
-
|
|
40
|
+
chainIds?: ChainId[];
|
|
20
41
|
/**
|
|
21
42
|
* Action description used in warnings, e.g. `"get liquidatable accounts"`.
|
|
22
43
|
**/
|
|
23
44
|
label: string;
|
|
24
45
|
/**
|
|
25
|
-
*
|
|
46
|
+
* @defaultValue `"state"`
|
|
47
|
+
**/
|
|
48
|
+
block?: ChainBlockSource;
|
|
49
|
+
/**
|
|
50
|
+
* Request sent to a single chain, at the resolved block of that chain.
|
|
51
|
+
**/
|
|
52
|
+
run: (sdk: OnchainSDK<Plugins>, block: ChainBlock) => Promise<T>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Describes a request that is sent to exactly one chain.
|
|
56
|
+
*
|
|
57
|
+
* @typeParam T - Payload returned by the chain.
|
|
58
|
+
* @typeParam Plugins - Map of attached plugin types.
|
|
59
|
+
**/
|
|
60
|
+
interface ChainQueryOneProps<T, Plugins extends PluginsMap = {}> {
|
|
61
|
+
/**
|
|
62
|
+
* Chain to query, as a network label or a chain id.
|
|
26
63
|
**/
|
|
27
|
-
|
|
64
|
+
network: NetworkType | ChainId;
|
|
65
|
+
/**
|
|
66
|
+
* @defaultValue `"state"`
|
|
67
|
+
**/
|
|
68
|
+
block?: ChainBlockPin;
|
|
69
|
+
/**
|
|
70
|
+
* Request sent to the chain, at its resolved block.
|
|
71
|
+
**/
|
|
72
|
+
run: (sdk: OnchainSDK<Plugins>, block: ChainBlock) => Promise<T>;
|
|
28
73
|
}
|
|
29
74
|
/**
|
|
30
75
|
* @internal
|
|
31
76
|
* Base class for services that fan out over the chains of a
|
|
32
77
|
* {@link MultichainSDK}, the cross-chain counterpart of {@link SDKConstruct}.
|
|
33
78
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* reported in {@link MultichainResult.meta}.
|
|
79
|
+
* A fan-out soft-fails: a chain that rejects is logged as a warning and
|
|
80
|
+
* contributes no payload, while the remaining chains still return their rows.
|
|
81
|
+
* A single-chain request throws instead.
|
|
38
82
|
*
|
|
39
83
|
* @typeParam Plugins - Map of attached plugin types.
|
|
40
84
|
**/
|
|
@@ -46,12 +90,17 @@ declare abstract class MultichainConstruct<const Plugins extends PluginsMap = {}
|
|
|
46
90
|
* Fans out a request that returns a list, concatenating the lists of all
|
|
47
91
|
* chains that responded successfully.
|
|
48
92
|
**/
|
|
49
|
-
protected queryChains<T>(props: ChainQueryProps<T[], Plugins>): Promise<
|
|
93
|
+
protected queryChains<T>(props: ChainQueryProps<T[], Plugins>): Promise<DataResponse<T[]>>;
|
|
50
94
|
/**
|
|
51
95
|
* Fans out a request with no payload, reporting the outcome of every queried
|
|
52
|
-
* chain in
|
|
96
|
+
* chain in `meta.chains`.
|
|
97
|
+
**/
|
|
98
|
+
protected runChains(props: ChainQueryProps<void, Plugins>): Promise<DataResponse<void>>;
|
|
99
|
+
/**
|
|
100
|
+
* Runs a request against one chain and reports the block it was read at.
|
|
101
|
+
* Throws when the chain is not configured, not attached, or rejects the read.
|
|
53
102
|
**/
|
|
54
|
-
protected
|
|
103
|
+
protected queryChain<T>({ network, block, run }: ChainQueryOneProps<T, Plugins>): Promise<DataResponse<T>>;
|
|
55
104
|
}
|
|
56
105
|
//#endregion
|
|
57
|
-
export { ChainQueryProps, MultichainConstruct };
|
|
106
|
+
export { ChainBlock, ChainBlockPin, ChainBlockSource, ChainQueryOneProps, ChainQueryProps, MultichainConstruct };
|
|
@@ -5,7 +5,7 @@ import { ChainContractsRegister, ContractOrInterface } from "./ChainContractsReg
|
|
|
5
5
|
import { Construct, ConstructOptions } from "./Construct.js";
|
|
6
6
|
import { BaseContract, BaseContractArgs, ContractParseError, ContractParseErrorOptions } from "./BaseContract.js";
|
|
7
7
|
import { MissingSerializedParamsError } from "./errors.js";
|
|
8
|
-
import { ChainQueryProps, MultichainConstruct } from "./MultichainConstruct.js";
|
|
8
|
+
import { ChainBlock, ChainBlockPin, ChainBlockSource, ChainQueryOneProps, ChainQueryProps, MultichainConstruct } from "./MultichainConstruct.js";
|
|
9
9
|
import { PlaceholderContract } from "./PlaceholderContract.js";
|
|
10
10
|
import { SDKConstruct } from "./SDKConstruct.js";
|
|
11
|
-
export { AdapterData, AssertAssignable, Asset, BaseContract, BaseContractArgs, BaseParams, BaseState, ChainContractsRegister, ChainQueryProps, ConnectedBotData, Construct, ConstructOptions, ContractOrInterface, ContractParseError, ContractParseErrorOptions, CreditAccountData, CreditAccountDataPayload, CreditAccountTokensSlice, CreditConfiguratorState, CreditFacadeState, CreditManagerDebtParams, CreditManagerState, CreditSuiteState, FormatBNOptions, GaugeData, IBaseContract, LPMonopolizedPoolMeta, MarketData, MarketFilter, MissingSerializedParamsError, MultichainConstruct, PHANTOM_TOKEN_CONTRACT_TYPES, ParsedCall, ParsedCallArgs, ParsedCallV2, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PlaceholderContract, PoolState, PriceFeedAnswer, PriceFeedMapEntry, PriceFeedTreeNode, PriceOracleData, QuotaKeeperState, QuotaState, RWADefaultTokenMeta, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWATokenMeta, RWAUnderlyingContractType, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RateKeeperState, RelaxedBaseParams, RewardInfo, SDKConstruct, SimpleTokenMeta, TokenInfo, TokenMetaData, TokensMeta, Unarray, VotingContractStatus };
|
|
11
|
+
export { AdapterData, AssertAssignable, Asset, BaseContract, BaseContractArgs, BaseParams, BaseState, ChainBlock, ChainBlockPin, ChainBlockSource, ChainContractsRegister, ChainQueryOneProps, ChainQueryProps, ConnectedBotData, Construct, ConstructOptions, ContractOrInterface, ContractParseError, ContractParseErrorOptions, CreditAccountData, CreditAccountDataPayload, CreditAccountTokensSlice, CreditConfiguratorState, CreditFacadeState, CreditManagerDebtParams, CreditManagerState, CreditSuiteState, FormatBNOptions, GaugeData, IBaseContract, LPMonopolizedPoolMeta, MarketData, MarketFilter, MissingSerializedParamsError, MultichainConstruct, PHANTOM_TOKEN_CONTRACT_TYPES, ParsedCall, ParsedCallArgs, ParsedCallV2, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PlaceholderContract, PoolState, PriceFeedAnswer, PriceFeedMapEntry, PriceFeedTreeNode, PriceOracleData, QuotaKeeperState, QuotaState, RWADefaultTokenMeta, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWATokenMeta, RWAUnderlyingContractType, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RateKeeperState, RelaxedBaseParams, RewardInfo, SDKConstruct, SimpleTokenMeta, TokenInfo, TokenMetaData, TokensMeta, Unarray, VotingContractStatus };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { AssetType, ChainId } from "../../model/primitives.js";
|
|
1
2
|
import { CuratorName } from "../../model/curators.js";
|
|
2
|
-
import { AssetType } from "../../model/primitives.js";
|
|
3
3
|
import { Address, Chain } from "viem";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
5
|
//#region src/sdk/chain/chains.d.ts
|
|
@@ -128,6 +128,14 @@ declare function getChain(chainIdOrNetworkType: number | bigint | NetworkType):
|
|
|
128
128
|
* @throws If the chain ID does not correspond to a supported network.
|
|
129
129
|
**/
|
|
130
130
|
declare function getNetworkType(chainId: number | bigint): NetworkType;
|
|
131
|
+
/**
|
|
132
|
+
* Chain IDs of chains named as {@link NetworkType} labels or as IDs already,
|
|
133
|
+
* e.g. `sdk.opportunities.list({ chainIds: toChainIds(["Mainnet"]) })`.
|
|
134
|
+
*
|
|
135
|
+
* @param scope - Chains as labels, or already as IDs.
|
|
136
|
+
* @throws If any entry is not a supported network.
|
|
137
|
+
**/
|
|
138
|
+
declare function toChainIds(scope: NetworkType[] | ChainId[]): ChainId[];
|
|
131
139
|
/**
|
|
132
140
|
* Type guard that checks whether a chain ID belongs to a supported Gearbox network.
|
|
133
141
|
*
|
|
@@ -195,4 +203,4 @@ declare function isSunsetPool(pool: Address, network: NetworkType): boolean;
|
|
|
195
203
|
**/
|
|
196
204
|
declare function isSunsetStrategy(creditManager: Address, collateral: Address, network: NetworkType): boolean;
|
|
197
205
|
//#endregion
|
|
198
|
-
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork };
|
|
206
|
+
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork } from "./chains.js";
|
|
1
|
+
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chains.js";
|
|
2
2
|
import { detectNetwork } from "./detectNetwork.js";
|
|
3
|
-
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, detectNetwork, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork };
|
|
3
|
+
export { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, detectNetwork, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ILogger, LogFn } from "./types/logger.js";
|
|
2
|
-
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork } from "./chain/chains.js";
|
|
3
|
-
import { BlockNumberProps,
|
|
2
|
+
import { GearboxChain, NetworkType, SUPPORTED_NETWORKS, SunsetStrategy, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chain/chains.js";
|
|
3
|
+
import { BlockNumberProps, MultichainChainIdsProps, MultichainNetworkProps, WithBlock, WithMultichain } from "./types/multichain.js";
|
|
4
4
|
import { ClaimableWithdrawal, CurrentWithdrawals, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, GetExternalAccountCurrentWithdrawalsProps, GetWithdrawalRequestResultProps, IRedemptionLoggerContract, IWithdrawalCompressorContract, PendingWithdrawal, RedemptionLog, RequestableWithdrawal, WithdrawableAsset, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, toWithdrawalStatus } from "./accounts/withdrawal-compressor/types.js";
|
|
5
5
|
import { detectNetwork } from "./chain/detectNetwork.js";
|
|
6
6
|
import "./chain/index.js";
|
|
@@ -141,7 +141,7 @@ import "./types/index.js";
|
|
|
141
141
|
import { BaseContract, BaseContractArgs, ContractParseError, ContractParseErrorOptions } from "./base/BaseContract.js";
|
|
142
142
|
import { MissingSerializedParamsError } from "./base/errors.js";
|
|
143
143
|
import { ChainConfig, MultichainAttachOptions, MultichainHydrateOptions, MultichainSDK, MultichainSDKOptions, MultichainSyncStateOptions } from "./MultichainSDK.js";
|
|
144
|
-
import { ChainQueryProps, MultichainConstruct } from "./base/MultichainConstruct.js";
|
|
144
|
+
import { ChainBlock, ChainBlockPin, ChainBlockSource, ChainQueryOneProps, ChainQueryProps, MultichainConstruct } from "./base/MultichainConstruct.js";
|
|
145
145
|
import { PlaceholderContract } from "./base/PlaceholderContract.js";
|
|
146
146
|
import { SDKConstruct } from "./base/SDKConstruct.js";
|
|
147
147
|
import "./base/index.js";
|
|
@@ -167,9 +167,9 @@ import { CreditAccountSlice, IntentPreviewResult } from "./accounts/intents/type
|
|
|
167
167
|
import { primaryInstantOutput } from "./accounts/intents/operations/claim-delayed/index.js";
|
|
168
168
|
import { CreditAccountOperationsService } from "./accounts/intents/index.js";
|
|
169
169
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./accounts/liquidations/constants.js";
|
|
170
|
-
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps,
|
|
170
|
+
import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, LoadRWALiquidatorsProps, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, RWALiquidatorInfo } from "./accounts/liquidations/types.js";
|
|
171
171
|
import { LiquidationsService } from "./accounts/liquidations/LiquidationsService.js";
|
|
172
172
|
import { MultichainLiquidationsService } from "./accounts/liquidations/MultichainLiquidationsService.js";
|
|
173
173
|
import "./accounts/index.js";
|
|
174
174
|
import { SDKOptions, attachOptionsSchema, onchainSDKOptionsSchema } from "./options.js";
|
|
175
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountToCheck, AdapterData, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BigIntMath, type BlockNumberProps, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryProps, ClaimFarmRewardsProps, ClaimableWithdrawal, ClientOptions, CloseCreditAccountResult, ClosePathBalances, CompositePriceFeedContract, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CurrentWithdrawals, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, DelegatedMulticall, DepositMetadata, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, type FetchPythPayloadsOptions, type FetchRedstonePayloadsOptions, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidatableAccountsPropsBase, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, GetWithdrawalRequestResultProps, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTx, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, type IntentPreviewResult, type InterestRateModelStateHuman, InterestRateModelType, InvalidDelayedIntentError, IsDustOptions, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, LatestUpdate, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidationFees, LiquidationsService, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_UINT16, MAX_UINT256, MIN_INT96, MULTICALL_ADDRESS, MarketData, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, type MarketStateHuman, MarketSuite, MarketType, MellowLRTPriceFeedContract, Methods, MidasLiquidatorContract, MissingSerializedParamsError, type MultiCall, MulticallWithFailure, MultichainAttachOptions, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkMeta, type MultichainNetworkProps, type MultichainNetworksProps, MultichainOpportunitiesService, MultichainPositionsService, type MultichainResult, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenStrategyResult, OpportunitiesService, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, PendingWithdrawal, PendleTWAPPTPriceFeed, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PlaceholderAdapterContract, PlaceholderAdapterContractOptions, PlaceholderContract, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolService, PoolServiceCall, PoolServiceCallResult, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolV310Contract, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, QuotaKeeperState, type QuotaParamsHuman, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWALiquidatorInfo, RWAMissingOpenAccountRequirements, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, RelaxedBaseParams, RemoveLiquidityProps, RequestableWithdrawal, RetryOptions, RewardInfo, Rewards, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, StrategyRef, SunsetStrategy, SupportedValue, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenInfo, TokenMetaData, TokensMeta, type TumblerStateHuman, TypedObjectUtils, Unarray, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, VERSION_RANGE_310, VersionRange, VotingContractStatus, WAD, WAD_DECIMALS_POW, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, type WithBlock, type WithMultichain, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, additionalBorrowApyBps, assetsMap, attachOptionsSchema, borrowApyBps, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, decodeDelayedIntent, detectNetwork, dominantCollateral, encodeDelayedIntent, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, expectedBalanceDeltas, fetchPythPayloads, fetchRedstonePayloads, filterDust, filterDustUSD, findCuratorMarketConfigurator, fmtBinaryMask, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, healthFactorBps, hexEq, hydrateAddressProvider, iCreditAccountAbi, isDust, isLPPriceFeed, isPublicNetwork, isRWAFactory, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, json_parse, json_stringify, maxLeverage, minSeizedAmount, mustGetDominantCollateral, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, percentFmt, positionLeverage, primaryInstantOutput, rayToBps, rayToNumber, retry, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, toAddress, toBN, toBigInt, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toWithdrawalStatus, usdToNumber, utilizationBps, watchBlocksAsync };
|
|
175
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountToCheck, AdapterData, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BigIntMath, type BlockNumberProps, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, ClaimFarmRewardsProps, ClaimableWithdrawal, ClientOptions, CloseCreditAccountResult, ClosePathBalances, CompositePriceFeedContract, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CurrentWithdrawals, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedIntentExtended, DelayedWithdrawCollateralIntent, DelegatedMulticall, DepositMetadata, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, type FetchPythPayloadsOptions, type FetchRedstonePayloadsOptions, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, GetWithdrawalRequestResultProps, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTx, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, type IntentPreviewResult, type InterestRateModelStateHuman, InterestRateModelType, InvalidDelayedIntentError, IsDustOptions, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, LatestUpdate, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidationFees, LiquidationsService, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_UINT16, MAX_UINT256, MIN_INT96, MULTICALL_ADDRESS, MarketData, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, type MarketStateHuman, MarketSuite, MarketType, MellowLRTPriceFeedContract, Methods, MidasLiquidatorContract, MissingSerializedParamsError, type MultiCall, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenStrategyResult, OpportunitiesService, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, PendingWithdrawal, PendleTWAPPTPriceFeed, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PlaceholderAdapterContract, PlaceholderAdapterContractOptions, PlaceholderContract, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolService, PoolServiceCall, PoolServiceCallResult, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolV310Contract, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, QuotaKeeperState, type QuotaParamsHuman, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWALiquidatorInfo, RWAMissingOpenAccountRequirements, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, RelaxedBaseParams, RemoveLiquidityProps, RequestableWithdrawal, RetryOptions, RewardInfo, Rewards, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, StrategyRef, SunsetStrategy, SupportedValue, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenInfo, TokenMetaData, TokensMeta, type TumblerStateHuman, TypedObjectUtils, Unarray, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, VERSION_RANGE_310, VersionRange, VotingContractStatus, WAD, WAD_DECIMALS_POW, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, type WithBlock, type WithMultichain, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, additionalBorrowApyBps, assetsMap, attachOptionsSchema, borrowApyBps, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, decodeDelayedIntent, detectNetwork, dominantCollateral, encodeDelayedIntent, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, expectedBalanceDeltas, fetchPythPayloads, fetchRedstonePayloads, filterDust, filterDustUSD, findCuratorMarketConfigurator, fmtBinaryMask, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, healthFactorBps, hexEq, hydrateAddressProvider, iCreditAccountAbi, isDust, isLPPriceFeed, isPublicNetwork, isRWAFactory, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, json_parse, json_stringify, maxLeverage, minSeizedAmount, mustGetDominantCollateral, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, percentFmt, positionLeverage, primaryInstantOutput, rayToBps, rayToNumber, retry, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toWithdrawalStatus, usdToNumber, utilizationBps, watchBlocksAsync };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Curator } from "../../model/curators.js";
|
|
2
1
|
import { Token } from "../../model/primitives.js";
|
|
2
|
+
import { Curator } from "../../model/curators.js";
|
|
3
3
|
import { MarketData } from "../base/types.js";
|
|
4
4
|
import { Opportunity, OpportunityFilter, PoolOpportunity, PoolOpportunityDetail, PriceFeedSummary, QuotaAsset, StrategyOpportunityDetail } from "../../model/opportunities.js";
|
|
5
5
|
import "../../model/index.js";
|