@gearbox-protocol/sdk 16.0.0-next.20 → 16.0.0-next.21
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/offchain/opportunities/OffchainOpportunities.js +5 -6
- package/dist/cjs/offchain/opportunities/index.js +1 -0
- package/dist/cjs/offchain/opportunities/types.js +1 -0
- package/dist/cjs/offchain/positions/OffchainPositions.js +3 -3
- package/dist/cjs/offchain/positions/index.js +1 -0
- package/dist/cjs/offchain/positions/types.js +1 -0
- package/dist/cjs/onchain/opportunities/index.js +1 -0
- package/dist/cjs/onchain/opportunities/types.js +1 -0
- package/dist/cjs/sdk/execute/ExecuteApi.js +2 -2
- package/dist/cjs/sdk/execute/index.js +1 -0
- package/dist/cjs/sdk/execute/types.js +1 -0
- package/dist/cjs/sdk/liquidations/LiquidationsNamespace.js +5 -5
- package/dist/cjs/sdk/opportunities/OpportunitiesNamespace.js +9 -9
- package/dist/cjs/sdk/positions/PositionsNamespace.js +5 -5
- package/dist/cjs/sdk/prepare/PrepareApi.js +16 -16
- package/dist/cjs/sdk/preview/PreviewNamespace.js +2 -2
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +5 -6
- package/dist/esm/offchain/opportunities/index.js +1 -0
- package/dist/esm/offchain/opportunities/types.js +1 -0
- package/dist/esm/offchain/positions/OffchainPositions.js +3 -3
- package/dist/esm/offchain/positions/index.js +1 -0
- package/dist/esm/offchain/positions/types.js +1 -0
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/onchain/base/TokensMeta.js +3 -3
- package/dist/esm/onchain/chain/detectNetwork.js +1 -1
- package/dist/esm/onchain/core/createAddressProvider.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/onchain/opportunities/index.js +1 -0
- package/dist/esm/onchain/opportunities/types.js +1 -0
- package/dist/esm/onchain/pools/PoolService.js +1 -1
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.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/execute/ExecuteApi.js +2 -2
- package/dist/esm/sdk/execute/index.js +1 -0
- package/dist/esm/sdk/execute/types.js +1 -0
- package/dist/esm/sdk/liquidations/LiquidationsNamespace.js +5 -5
- package/dist/esm/sdk/opportunities/OpportunitiesNamespace.js +9 -9
- package/dist/esm/sdk/positions/PositionsNamespace.js +5 -5
- package/dist/esm/sdk/prepare/PrepareApi.js +16 -16
- package/dist/esm/sdk/preview/PreviewNamespace.js +2 -2
- package/dist/types/offchain/index.d.ts +3 -1
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +8 -12
- package/dist/types/offchain/opportunities/index.d.ts +2 -1
- package/dist/types/offchain/opportunities/types.d.ts +36 -0
- package/dist/types/offchain/positions/OffchainPositions.d.ts +6 -9
- package/dist/types/offchain/positions/index.d.ts +2 -1
- package/dist/types/offchain/positions/types.d.ts +30 -0
- package/dist/types/onchain/index.d.ts +3 -2
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +2 -1
- package/dist/types/onchain/opportunities/index.d.ts +2 -1
- package/dist/types/onchain/opportunities/types.d.ts +27 -0
- package/dist/types/onchain/positions/MultichainPositionsService.d.ts +2 -2
- package/dist/types/onchain/positions/index.d.ts +2 -2
- package/dist/types/onchain/positions/types.d.ts +12 -2
- package/dist/types/sdk/AbstractNamespace.d.ts +1 -1
- package/dist/types/sdk/GearboxSDK.d.ts +11 -11
- package/dist/types/sdk/execute/ExecuteApi.d.ts +5 -94
- package/dist/types/sdk/execute/index.d.ts +3 -2
- package/dist/types/sdk/execute/types.d.ts +96 -0
- package/dist/types/sdk/index.d.ts +12 -11
- package/dist/types/sdk/liquidations/LiquidationsNamespace.d.ts +7 -7
- package/dist/types/sdk/liquidations/index.d.ts +2 -2
- package/dist/types/sdk/liquidations/types.d.ts +5 -7
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +20 -20
- package/dist/types/sdk/opportunities/index.d.ts +2 -2
- package/dist/types/sdk/opportunities/types.d.ts +31 -40
- package/dist/types/sdk/positions/PositionsNamespace.d.ts +10 -10
- package/dist/types/sdk/positions/index.d.ts +2 -2
- package/dist/types/sdk/positions/types.d.ts +24 -33
- package/dist/types/sdk/prepare/PrepareApi.d.ts +18 -18
- package/dist/types/sdk/prepare/index.d.ts +2 -2
- package/dist/types/sdk/prepare/types.d.ts +8 -8
- package/dist/types/sdk/preview/PreviewNamespace.d.ts +4 -4
- package/dist/types/sdk/preview/index.d.ts +2 -2
- package/dist/types/sdk/preview/types.d.ts +5 -7
- package/dist/types/sdk/types.d.ts +65 -6
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import "../../model/index.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* On-chain preview of a raw operation calldata.
|
|
6
6
|
**/
|
|
7
|
-
interface
|
|
7
|
+
interface IPreview {
|
|
8
8
|
/**
|
|
9
9
|
* Decodes a raw operation and assembles an operation-specific,
|
|
10
10
|
* human-displayable preview. Throws when the operation is unsupported or
|
|
@@ -14,13 +14,11 @@ interface Preview {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* `sdk.preview` per mode: an on-chain read, absent when the SDK reads no chain.
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
17
|
**/
|
|
20
|
-
interface
|
|
21
|
-
onchain:
|
|
18
|
+
interface IPreviewByMode {
|
|
19
|
+
onchain: IPreview;
|
|
22
20
|
offchain: undefined;
|
|
23
|
-
both:
|
|
21
|
+
both: IPreview;
|
|
24
22
|
}
|
|
25
23
|
//#endregion
|
|
26
|
-
export {
|
|
24
|
+
export { IPreview, IPreviewByMode };
|
|
@@ -9,6 +9,10 @@ import "../onchain/index.js";
|
|
|
9
9
|
import { GearboxAPIOptions } from "../offchain/types.js";
|
|
10
10
|
import { GearboxAPI } from "../offchain/GearboxAPI.js";
|
|
11
11
|
import "../offchain/index.js";
|
|
12
|
+
import { ILiquidationsByMode } from "./liquidations/types.js";
|
|
13
|
+
import { IOpportunities } from "./opportunities/types.js";
|
|
14
|
+
import { IPositions } from "./positions/types.js";
|
|
15
|
+
import { IPreviewByMode } from "./preview/types.js";
|
|
12
16
|
//#region src/sdk/types.d.ts
|
|
13
17
|
/**
|
|
14
18
|
* Which sources a {@link GearboxSDK} reads from, and therefore which of its
|
|
@@ -106,15 +110,70 @@ interface OnchainByMode {
|
|
|
106
110
|
offchain: undefined;
|
|
107
111
|
both: MultichainSDK;
|
|
108
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* The banners the backend attaches to a pool opportunity or a strategy
|
|
115
|
+
* position, see {@link Notice}.
|
|
116
|
+
**/
|
|
117
|
+
interface INotices {
|
|
118
|
+
(subject: NoticeSubject): Promise<DataResponse<Notice[]>>;
|
|
119
|
+
}
|
|
109
120
|
/**
|
|
110
121
|
* `sdk.notices` per mode: a backend read, absent when the SDK reads no backend.
|
|
111
|
-
*
|
|
112
|
-
* @internal
|
|
113
122
|
**/
|
|
114
|
-
interface
|
|
123
|
+
interface INoticesByMode {
|
|
115
124
|
onchain: undefined;
|
|
116
|
-
offchain:
|
|
117
|
-
both:
|
|
125
|
+
offchain: INotices;
|
|
126
|
+
both: INotices;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Public contract of {@link GearboxSDK}: every namespace and sub-construction,
|
|
130
|
+
* gated by {@link Mode}. Escape hatches `onchain` and `offchain` are not part
|
|
131
|
+
* of this surface.
|
|
132
|
+
*
|
|
133
|
+
* @typeParam M - Mode the instance was built in.
|
|
134
|
+
**/
|
|
135
|
+
interface IGearboxSDK<M extends Mode = Mode> {
|
|
136
|
+
/**
|
|
137
|
+
* Sources this instance reads from.
|
|
138
|
+
**/
|
|
139
|
+
readonly mode: M;
|
|
140
|
+
/**
|
|
141
|
+
* Chains this instance covers, which every read is scoped to.
|
|
142
|
+
**/
|
|
143
|
+
readonly networks: readonly NetworkType[];
|
|
144
|
+
/**
|
|
145
|
+
* Whether the on-chain source is ready to be read from. Always `true` in
|
|
146
|
+
* `offchain` mode.
|
|
147
|
+
**/
|
|
148
|
+
readonly attached: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Attaches the on-chain SDK when this instance owns one; a no-op in
|
|
151
|
+
* `offchain` mode and when an already-attached SDK was injected.
|
|
152
|
+
**/
|
|
153
|
+
attach(): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Namespace for pool and strategy opportunities.
|
|
156
|
+
**/
|
|
157
|
+
readonly opportunities: IOpportunities<M>;
|
|
158
|
+
/**
|
|
159
|
+
* Namespace for the positions a wallet holds.
|
|
160
|
+
**/
|
|
161
|
+
readonly positions: IPositions<M>;
|
|
162
|
+
/**
|
|
163
|
+
* Namespace for liquidatable credit accounts and delayed-withdrawal
|
|
164
|
+
* positions a liquidator holds. Absent in `offchain` mode.
|
|
165
|
+
**/
|
|
166
|
+
readonly liquidations: ILiquidationsByMode[M];
|
|
167
|
+
/**
|
|
168
|
+
* Namespace for on-chain previews of raw operation calldata. Absent in
|
|
169
|
+
* `offchain` mode.
|
|
170
|
+
**/
|
|
171
|
+
readonly preview: IPreviewByMode[M];
|
|
172
|
+
/**
|
|
173
|
+
* The banners the backend attaches to a pool opportunity or a strategy
|
|
174
|
+
* position, see {@link Notice}. Absent in `onchain` mode.
|
|
175
|
+
**/
|
|
176
|
+
readonly notices: INoticesByMode[M];
|
|
118
177
|
}
|
|
119
178
|
/**
|
|
120
179
|
* Off-chain escape hatch per mode: absent when the SDK reads no backend.
|
|
@@ -127,4 +186,4 @@ interface OffchainByMode {
|
|
|
127
186
|
both: GearboxAPI;
|
|
128
187
|
}
|
|
129
188
|
//#endregion
|
|
130
|
-
export { EnsureFreshChains, GearboxSDKOptions, Mode, NamespaceOptions,
|
|
189
|
+
export { EnsureFreshChains, GearboxSDKOptions, IGearboxSDK, INotices, INoticesByMode, Mode, NamespaceOptions, OffchainByMode, OffchainSource, OnchainByMode, OnchainSource, PlainMultichainSDKOptions };
|