@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
|
@@ -9,7 +9,7 @@ import "../../onchain/index.js";
|
|
|
9
9
|
* On-chain discovery of liquidatable credit accounts and delayed-withdrawal
|
|
10
10
|
* positions a liquidator wallet holds.
|
|
11
11
|
**/
|
|
12
|
-
interface
|
|
12
|
+
interface ILiquidations {
|
|
13
13
|
/**
|
|
14
14
|
* All liquidatable credit accounts: health factor below 1 plus accounts of
|
|
15
15
|
* expired credit managers with outstanding debt. Optionally narrowed.
|
|
@@ -34,13 +34,11 @@ interface Liquidations {
|
|
|
34
34
|
/**
|
|
35
35
|
* `sdk.liquidations` per mode: an on-chain read, absent when the SDK reads no
|
|
36
36
|
* chain.
|
|
37
|
-
*
|
|
38
|
-
* @internal
|
|
39
37
|
**/
|
|
40
|
-
interface
|
|
41
|
-
onchain:
|
|
38
|
+
interface ILiquidationsByMode {
|
|
39
|
+
onchain: ILiquidations;
|
|
42
40
|
offchain: undefined;
|
|
43
|
-
both:
|
|
41
|
+
both: ILiquidations;
|
|
44
42
|
}
|
|
45
43
|
//#endregion
|
|
46
|
-
export {
|
|
44
|
+
export { ILiquidations, ILiquidationsByMode };
|
|
@@ -6,57 +6,57 @@ import { MultichainSDK } from "../../onchain/MultichainSDK.js";
|
|
|
6
6
|
import "../../onchain/index.js";
|
|
7
7
|
import { GearboxAPI } from "../../offchain/GearboxAPI.js";
|
|
8
8
|
import "../../offchain/index.js";
|
|
9
|
-
import {
|
|
9
|
+
import { IOpportunitiesPrepare } from "../prepare/types.js";
|
|
10
|
+
import "../prepare/index.js";
|
|
11
|
+
import { IOpportunitiesExecute } from "../execute/types.js";
|
|
12
|
+
import "../execute/index.js";
|
|
10
13
|
import { FilterResult } from "../utils/types.js";
|
|
11
14
|
import "../utils/index.js";
|
|
15
|
+
import { IOpportunitiesBase, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunityMergers } from "./types.js";
|
|
16
|
+
import { NamespaceOptions } from "../types.js";
|
|
12
17
|
import { AbstractNamespace } from "../AbstractNamespace.js";
|
|
13
|
-
import { OpportunitiesPrepare } from "../prepare/types.js";
|
|
14
|
-
import "../prepare/index.js";
|
|
15
|
-
import { OpportunitiesExecute } from "../execute/ExecuteApi.js";
|
|
16
|
-
import "../execute/index.js";
|
|
17
|
-
import { OpportunitiesBase, OpportunitiesOffchainOnly, OpportunitiesOnchainOnly, OpportunityMergers } from "./types.js";
|
|
18
18
|
//#region src/sdk/opportunities/OpportunitiesNamespace.d.ts
|
|
19
19
|
/**
|
|
20
20
|
* The `opportunities` namespace of a {@link GearboxSDK}, see
|
|
21
|
-
* {@link
|
|
21
|
+
* {@link IOpportunitiesByMode} for what each mode offers.
|
|
22
22
|
**/
|
|
23
|
-
declare class OpportunitiesNamespace extends AbstractNamespace<MultichainSDK["opportunities"], GearboxAPI["opportunities"]> implements
|
|
23
|
+
declare class OpportunitiesNamespace extends AbstractNamespace<MultichainSDK["opportunities"], GearboxAPI["opportunities"]> implements IOpportunitiesBase, IOpportunitiesOffchainOnly, IOpportunitiesOnchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOffchainBranch {
|
|
24
24
|
#private;
|
|
25
25
|
/**
|
|
26
|
-
* {@inheritDoc
|
|
26
|
+
* {@inheritDoc IOpportunitiesBase.merge}
|
|
27
27
|
**/
|
|
28
|
-
readonly merge:
|
|
28
|
+
readonly merge: IOpportunityMergers;
|
|
29
29
|
constructor(onchain: MultichainSDK | undefined, offchain: GearboxAPI | undefined, options: NamespaceOptions);
|
|
30
30
|
/**
|
|
31
|
-
* {@inheritDoc
|
|
31
|
+
* {@inheritDoc IOpportunitiesOnchainOnly.prepare}
|
|
32
32
|
**/
|
|
33
|
-
get prepare():
|
|
33
|
+
get prepare(): IOpportunitiesPrepare;
|
|
34
34
|
/**
|
|
35
|
-
* {@inheritDoc
|
|
35
|
+
* {@inheritDoc IOpportunitiesOnchainOnly.execute}
|
|
36
36
|
**/
|
|
37
|
-
get execute():
|
|
37
|
+
get execute(): IOpportunitiesExecute;
|
|
38
38
|
/**
|
|
39
|
-
* {@inheritDoc
|
|
39
|
+
* {@inheritDoc IOpportunitiesBase.list}
|
|
40
40
|
**/
|
|
41
41
|
list(filter?: OpportunityFilter): Promise<DataResponse<Opportunity[]>>;
|
|
42
42
|
/**
|
|
43
|
-
* {@inheritDoc
|
|
43
|
+
* {@inheritDoc IOpportunitiesBase.getPool}
|
|
44
44
|
**/
|
|
45
45
|
getPool(key: PoolOpportunityKey): Promise<DataResponse<PoolOpportunityDetail>>;
|
|
46
46
|
/**
|
|
47
|
-
* {@inheritDoc
|
|
47
|
+
* {@inheritDoc IOpportunitiesBase.getStrategy}
|
|
48
48
|
**/
|
|
49
49
|
getStrategy(key: StrategyOpportunityKey): Promise<DataResponse<StrategyOpportunityDetail>>;
|
|
50
50
|
/**
|
|
51
|
-
* {@inheritDoc
|
|
51
|
+
* {@inheritDoc IOpportunitiesBase.filter}
|
|
52
52
|
**/
|
|
53
53
|
filter<R extends DataResponse<Opportunity[]> | undefined>(response: R, filter?: OpportunityFilter): FilterResult<R, Opportunity>;
|
|
54
54
|
/**
|
|
55
|
-
* {@inheritDoc
|
|
55
|
+
* {@inheritDoc IOpportunitiesOffchainOnly.totals}
|
|
56
56
|
**/
|
|
57
57
|
totals(): Promise<DataResponse<OpportunityTotals>>;
|
|
58
58
|
/**
|
|
59
|
-
* {@inheritDoc
|
|
59
|
+
* {@inheritDoc IOpportunitiesOffchainOnly.charts}
|
|
60
60
|
**/
|
|
61
61
|
charts<const Metrics extends readonly PoolOpportunityChartMetric[]>(key: PoolOpportunityRef, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
62
62
|
charts<const Metrics extends readonly StrategyOpportunityChartMetric[]>(key: StrategyOpportunityRef, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IOpportunities, IOpportunitiesBase, IOpportunitiesByMode, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunityMergers } from "./types.js";
|
|
2
2
|
import { OpportunitiesNamespace } from "./OpportunitiesNamespace.js";
|
|
3
|
-
export {
|
|
3
|
+
export { IOpportunities, IOpportunitiesBase, IOpportunitiesByMode, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunityMergers, OpportunitiesNamespace };
|
|
@@ -2,26 +2,26 @@ import { ChartBundle, ChartRange, PoolOpportunityChartMetric, StrategyOpportunit
|
|
|
2
2
|
import { Opportunity, OpportunityFilter, OpportunityTotals, PoolOpportunityDetail, PoolOpportunityKey, PoolOpportunityRef, StrategyOpportunityDetail, StrategyOpportunityKey, StrategyOpportunityRef } from "../../model/opportunities.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
4
|
import "../../model/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { IMultichainOpportunitiesService } from "../../onchain/opportunities/types.js";
|
|
6
6
|
import "../../onchain/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { IOffchainOpportunities } from "../../offchain/opportunities/types.js";
|
|
8
8
|
import "../../offchain/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import { EntityMerger, FilterResult, ListMerger } from "../utils/types.js";
|
|
11
|
-
import "../utils/index.js";
|
|
12
|
-
import { OpportunitiesPrepare } from "../prepare/types.js";
|
|
9
|
+
import { IOpportunitiesPrepare } from "../prepare/types.js";
|
|
13
10
|
import "../prepare/index.js";
|
|
14
|
-
import {
|
|
11
|
+
import { IOpportunitiesExecute } from "../execute/types.js";
|
|
15
12
|
import "../execute/index.js";
|
|
13
|
+
import { EntityMerger, FilterResult, ListMerger } from "../utils/types.js";
|
|
14
|
+
import "../utils/index.js";
|
|
15
|
+
import { Mode } from "../types.js";
|
|
16
16
|
//#region src/sdk/opportunities/types.d.ts
|
|
17
17
|
/**
|
|
18
18
|
* What the `opportunities` namespace offers in every mode.
|
|
19
19
|
**/
|
|
20
|
-
interface
|
|
20
|
+
interface IOpportunitiesBase {
|
|
21
21
|
/**
|
|
22
22
|
* All pool and strategy opportunities, optionally narrowed. In `both` mode
|
|
23
23
|
* each chain is served by whichever source is fresh enough, see
|
|
24
|
-
* {@link
|
|
24
|
+
* {@link IOpportunityMergers}.
|
|
25
25
|
**/
|
|
26
26
|
list(filter?: OpportunityFilter): Promise<DataResponse<Opportunity[]>>;
|
|
27
27
|
/**
|
|
@@ -38,26 +38,16 @@ interface OpportunitiesBase {
|
|
|
38
38
|
* narrows to a list.
|
|
39
39
|
**/
|
|
40
40
|
filter<R extends DataResponse<Opportunity[]> | undefined>(response: R, filter?: OpportunityFilter): FilterResult<R, Opportunity>;
|
|
41
|
-
/**
|
|
42
|
-
* The chain on its own, for a consumer that shows each source as it arrives.
|
|
43
|
-
* Throws in `offchain` mode.
|
|
44
|
-
**/
|
|
45
|
-
readonly onchain: MultichainOpportunitiesService;
|
|
46
|
-
/**
|
|
47
|
-
* The backend on its own, see {@link OpportunitiesBase.onchain}. Throws in
|
|
48
|
-
* `onchain` mode.
|
|
49
|
-
**/
|
|
50
|
-
readonly offchain: OffchainOpportunities;
|
|
51
41
|
/**
|
|
52
42
|
* Merge policy of each read, for a consumer combining the two branches
|
|
53
|
-
* itself, see {@link
|
|
43
|
+
* itself, see {@link IOpportunityMergers}.
|
|
54
44
|
**/
|
|
55
|
-
readonly merge:
|
|
45
|
+
readonly merge: IOpportunityMergers;
|
|
56
46
|
}
|
|
57
47
|
/**
|
|
58
48
|
* Reads only a backend can answer.
|
|
59
49
|
**/
|
|
60
|
-
interface
|
|
50
|
+
interface IOpportunitiesOffchainOnly {
|
|
61
51
|
/**
|
|
62
52
|
* Protocol-wide totals across every opportunity: the TVL, total borrowed and
|
|
63
53
|
* total supplied the landing page shows.
|
|
@@ -80,7 +70,7 @@ interface OpportunitiesOffchainOnly {
|
|
|
80
70
|
/**
|
|
81
71
|
* Reads only the chain can answer.
|
|
82
72
|
**/
|
|
83
|
-
interface
|
|
73
|
+
interface IOpportunitiesOnchainOnly {
|
|
84
74
|
/**
|
|
85
75
|
* Simulations of what a deposit, withdrawal or leverage change would do.
|
|
86
76
|
*
|
|
@@ -88,32 +78,33 @@ interface OpportunitiesOnchainOnly {
|
|
|
88
78
|
* state, and the strategy flows additionally need the pathfinder for real swap
|
|
89
79
|
* paths, so there is nothing the backend could answer with.
|
|
90
80
|
**/
|
|
91
|
-
readonly prepare:
|
|
81
|
+
readonly prepare: IOpportunitiesPrepare;
|
|
92
82
|
/**
|
|
93
83
|
* The transaction a prepared operation stands for, see
|
|
94
|
-
* {@link
|
|
84
|
+
* {@link IOpportunitiesExecute.buildTx}. Absent in `offchain` mode for the
|
|
95
85
|
* same reason as {@link prepare}: it encodes against live chain state.
|
|
96
86
|
**/
|
|
97
|
-
readonly execute:
|
|
87
|
+
readonly execute: IOpportunitiesExecute;
|
|
98
88
|
}
|
|
99
89
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
90
|
+
* The chain on its own, for a consumer that shows each source as it arrives.
|
|
91
|
+
* Absent in `offchain` mode.
|
|
102
92
|
**/
|
|
103
|
-
interface
|
|
104
|
-
readonly onchain:
|
|
93
|
+
interface IOpportunitiesOnchainBranch {
|
|
94
|
+
readonly onchain: IMultichainOpportunitiesService;
|
|
105
95
|
}
|
|
106
96
|
/**
|
|
107
|
-
* The backend on its own, see {@link
|
|
97
|
+
* The backend on its own, see {@link IOpportunitiesOnchainBranch}. Absent in
|
|
98
|
+
* `onchain` mode.
|
|
108
99
|
**/
|
|
109
|
-
interface
|
|
110
|
-
readonly offchain:
|
|
100
|
+
interface IOpportunitiesOffchainBranch {
|
|
101
|
+
readonly offchain: IOffchainOpportunities;
|
|
111
102
|
}
|
|
112
103
|
/**
|
|
113
104
|
* Merge policy of each read, exposed so that a consumer reading the two
|
|
114
105
|
* branches itself combines them exactly as `both` mode would.
|
|
115
106
|
**/
|
|
116
|
-
interface
|
|
107
|
+
interface IOpportunityMergers {
|
|
117
108
|
list: ListMerger<Opportunity[]>;
|
|
118
109
|
pool: EntityMerger<PoolOpportunityDetail>;
|
|
119
110
|
strategy: EntityMerger<StrategyOpportunityDetail>;
|
|
@@ -121,14 +112,14 @@ interface OpportunityMergers {
|
|
|
121
112
|
/**
|
|
122
113
|
* Which methods the `opportunities` namespace has in each mode.
|
|
123
114
|
**/
|
|
124
|
-
interface
|
|
125
|
-
onchain:
|
|
126
|
-
offchain:
|
|
127
|
-
both:
|
|
115
|
+
interface IOpportunitiesByMode {
|
|
116
|
+
onchain: IOpportunitiesBase & IOpportunitiesOnchainOnly & IOpportunitiesOnchainBranch;
|
|
117
|
+
offchain: IOpportunitiesBase & IOpportunitiesOffchainOnly & IOpportunitiesOffchainBranch;
|
|
118
|
+
both: IOpportunitiesBase & IOpportunitiesOnchainOnly & IOpportunitiesOffchainOnly & IOpportunitiesOnchainBranch & IOpportunitiesOffchainBranch;
|
|
128
119
|
}
|
|
129
120
|
/**
|
|
130
121
|
* The `opportunities` namespace of a {@link GearboxSDK} in mode `M`.
|
|
131
122
|
**/
|
|
132
|
-
type
|
|
123
|
+
type IOpportunities<M extends Mode = Mode> = IOpportunitiesByMode[M];
|
|
133
124
|
//#endregion
|
|
134
|
-
export {
|
|
125
|
+
export { IOpportunities, IOpportunitiesBase, IOpportunitiesByMode, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunityMergers };
|
|
@@ -6,37 +6,37 @@ import { MultichainSDK } from "../../onchain/MultichainSDK.js";
|
|
|
6
6
|
import "../../onchain/index.js";
|
|
7
7
|
import { GearboxAPI } from "../../offchain/GearboxAPI.js";
|
|
8
8
|
import "../../offchain/index.js";
|
|
9
|
-
import { NamespaceOptions } from "../types.js";
|
|
10
9
|
import { FilterResult } from "../utils/types.js";
|
|
11
10
|
import "../utils/index.js";
|
|
11
|
+
import { IPositionMergers, IPositionsBase, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch } from "./types.js";
|
|
12
|
+
import { NamespaceOptions } from "../types.js";
|
|
12
13
|
import { AbstractNamespace } from "../AbstractNamespace.js";
|
|
13
|
-
import { PositionMergers, PositionsBase, PositionsOffchainOnly } from "./types.js";
|
|
14
14
|
import { Address } from "viem";
|
|
15
15
|
//#region src/sdk/positions/PositionsNamespace.d.ts
|
|
16
16
|
/**
|
|
17
17
|
* The `positions` namespace of a {@link GearboxSDK}, see
|
|
18
|
-
* {@link
|
|
18
|
+
* {@link IPositionsByMode} for what each mode offers.
|
|
19
19
|
**/
|
|
20
|
-
declare class PositionsNamespace extends AbstractNamespace<MultichainSDK["positions"], GearboxAPI["positions"]> implements
|
|
20
|
+
declare class PositionsNamespace extends AbstractNamespace<MultichainSDK["positions"], GearboxAPI["positions"]> implements IPositionsBase, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOffchainBranch {
|
|
21
21
|
/**
|
|
22
|
-
* {@inheritDoc
|
|
22
|
+
* {@inheritDoc IPositionsBase.merge}
|
|
23
23
|
**/
|
|
24
|
-
readonly merge:
|
|
24
|
+
readonly merge: IPositionMergers;
|
|
25
25
|
constructor(onchain: MultichainSDK | undefined, offchain: GearboxAPI | undefined, options: NamespaceOptions);
|
|
26
26
|
/**
|
|
27
|
-
* {@inheritDoc
|
|
27
|
+
* {@inheritDoc IPositionsBase.list}
|
|
28
28
|
**/
|
|
29
29
|
list(wallet: Address, filter?: PositionFilter): Promise<DataResponse<Position[]>>;
|
|
30
30
|
/**
|
|
31
|
-
* {@inheritDoc
|
|
31
|
+
* {@inheritDoc IPositionsBase.filter}
|
|
32
32
|
**/
|
|
33
33
|
filter<R extends DataResponse<Position[]> | undefined>(response: R, filter?: PositionFilter): FilterResult<R, Position>;
|
|
34
34
|
/**
|
|
35
|
-
* {@inheritDoc
|
|
35
|
+
* {@inheritDoc IPositionsOffchainOnly.totals}
|
|
36
36
|
**/
|
|
37
37
|
totals(wallet: Address): Promise<DataResponse<PositionsTotals>>;
|
|
38
38
|
/**
|
|
39
|
-
* {@inheritDoc
|
|
39
|
+
* {@inheritDoc IPositionsOffchainOnly.charts}
|
|
40
40
|
**/
|
|
41
41
|
charts<const Metrics extends readonly PoolPositionChartMetric[]>(key: PoolPositionRef, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
42
42
|
charts<const Metrics extends readonly StrategyPositionChartMetric[]>(key: StrategyPositionRef, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPositionMergers, IPositions, IPositionsBase, IPositionsByMode, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOnchainOnly } from "./types.js";
|
|
2
2
|
import { PositionsNamespace } from "./PositionsNamespace.js";
|
|
3
|
-
export {
|
|
3
|
+
export { IPositionMergers, IPositions, IPositionsBase, IPositionsByMode, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOnchainOnly, PositionsNamespace };
|
|
@@ -2,24 +2,24 @@ import { ChartBundle, ChartRange, PoolPositionChartMetric, StrategyPositionChart
|
|
|
2
2
|
import { PoolPositionRef, Position, PositionFilter, PositionsTotals, StrategyPositionRef } from "../../model/positions.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
4
|
import "../../model/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { IMultichainPositionsService } from "../../onchain/positions/types.js";
|
|
6
6
|
import "../../onchain/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { IOffchainPositions } from "../../offchain/positions/types.js";
|
|
8
8
|
import "../../offchain/index.js";
|
|
9
|
-
import { Mode } from "../types.js";
|
|
10
9
|
import { FilterResult, ListMerger } from "../utils/types.js";
|
|
11
10
|
import "../utils/index.js";
|
|
11
|
+
import { Mode } from "../types.js";
|
|
12
12
|
import { Address } from "viem";
|
|
13
13
|
//#region src/sdk/positions/types.d.ts
|
|
14
14
|
/**
|
|
15
15
|
* What the `positions` namespace offers in every mode.
|
|
16
16
|
**/
|
|
17
|
-
interface
|
|
17
|
+
interface IPositionsBase {
|
|
18
18
|
/**
|
|
19
19
|
* Everything a wallet holds: its pool shares, its credit accounts and the
|
|
20
20
|
* delayed withdrawals it took over by liquidating, optionally narrowed. In
|
|
21
21
|
* `both` mode each chain is served by whichever source is fresh enough, see
|
|
22
|
-
* {@link
|
|
22
|
+
* {@link IPositionMergers}.
|
|
23
23
|
**/
|
|
24
24
|
list(wallet: Address, filter?: PositionFilter): Promise<DataResponse<Position[]>>;
|
|
25
25
|
/**
|
|
@@ -28,26 +28,16 @@ interface PositionsBase {
|
|
|
28
28
|
* narrows to a list.
|
|
29
29
|
**/
|
|
30
30
|
filter<R extends DataResponse<Position[]> | undefined>(response: R, filter?: PositionFilter): FilterResult<R, Position>;
|
|
31
|
-
/**
|
|
32
|
-
* The chain on its own, for a consumer that shows each source as it arrives.
|
|
33
|
-
* Throws in `offchain` mode.
|
|
34
|
-
**/
|
|
35
|
-
readonly onchain: MultichainPositionsService;
|
|
36
|
-
/**
|
|
37
|
-
* The backend on its own, see {@link PositionsBase.onchain}. Throws in
|
|
38
|
-
* `onchain` mode.
|
|
39
|
-
**/
|
|
40
|
-
readonly offchain: OffchainPositions;
|
|
41
31
|
/**
|
|
42
32
|
* Merge policy of each read, for a consumer combining the two branches
|
|
43
|
-
* itself, see {@link
|
|
33
|
+
* itself, see {@link IPositionMergers}.
|
|
44
34
|
**/
|
|
45
|
-
readonly merge:
|
|
35
|
+
readonly merge: IPositionMergers;
|
|
46
36
|
}
|
|
47
37
|
/**
|
|
48
38
|
* Reads only a backend can answer.
|
|
49
39
|
**/
|
|
50
|
-
interface
|
|
40
|
+
interface IPositionsOffchainOnly {
|
|
51
41
|
/**
|
|
52
42
|
* Aggregate over everything a wallet holds: the list screen's badges, see
|
|
53
43
|
* {@link PositionsTotals}.
|
|
@@ -70,38 +60,39 @@ interface PositionsOffchainOnly {
|
|
|
70
60
|
/**
|
|
71
61
|
* Reads only the chain can answer. Empty for now.
|
|
72
62
|
**/
|
|
73
|
-
interface
|
|
63
|
+
interface IPositionsOnchainOnly {}
|
|
74
64
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
65
|
+
* The chain on its own, for a consumer that shows each source as it arrives.
|
|
66
|
+
* Absent in `offchain` mode.
|
|
77
67
|
**/
|
|
78
|
-
interface
|
|
79
|
-
readonly onchain:
|
|
68
|
+
interface IPositionsOnchainBranch {
|
|
69
|
+
readonly onchain: IMultichainPositionsService;
|
|
80
70
|
}
|
|
81
71
|
/**
|
|
82
|
-
* The backend on its own, see {@link
|
|
72
|
+
* The backend on its own, see {@link IPositionsOnchainBranch}. Absent in
|
|
73
|
+
* `onchain` mode.
|
|
83
74
|
**/
|
|
84
|
-
interface
|
|
85
|
-
readonly offchain:
|
|
75
|
+
interface IPositionsOffchainBranch {
|
|
76
|
+
readonly offchain: IOffchainPositions;
|
|
86
77
|
}
|
|
87
78
|
/**
|
|
88
79
|
* Merge policy of each read, exposed so that a consumer reading the two
|
|
89
80
|
* branches itself combines them exactly as `both` mode would.
|
|
90
81
|
**/
|
|
91
|
-
interface
|
|
82
|
+
interface IPositionMergers {
|
|
92
83
|
list: ListMerger<Position[]>;
|
|
93
84
|
}
|
|
94
85
|
/**
|
|
95
86
|
* Which methods the `positions` namespace has in each mode.
|
|
96
87
|
**/
|
|
97
|
-
interface
|
|
98
|
-
onchain:
|
|
99
|
-
offchain:
|
|
100
|
-
both:
|
|
88
|
+
interface IPositionsByMode {
|
|
89
|
+
onchain: IPositionsBase & IPositionsOnchainOnly & IPositionsOnchainBranch;
|
|
90
|
+
offchain: IPositionsBase & IPositionsOffchainOnly & IPositionsOffchainBranch;
|
|
91
|
+
both: IPositionsBase & IPositionsOnchainOnly & IPositionsOffchainOnly & IPositionsOnchainBranch & IPositionsOffchainBranch;
|
|
101
92
|
}
|
|
102
93
|
/**
|
|
103
94
|
* The `positions` namespace of a {@link GearboxSDK} in mode `M`.
|
|
104
95
|
**/
|
|
105
|
-
type
|
|
96
|
+
type IPositions<M extends Mode = Mode> = IPositionsByMode[M];
|
|
106
97
|
//#endregion
|
|
107
|
-
export {
|
|
98
|
+
export { IPositionMergers, IPositions, IPositionsBase, IPositionsByMode, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOnchainOnly };
|
|
@@ -7,8 +7,8 @@ import { MultichainSDK } from "../../onchain/MultichainSDK.js";
|
|
|
7
7
|
import { ChainQueryOneProps, MultichainConstruct } from "../../onchain/base/MultichainConstruct.js";
|
|
8
8
|
import { LeverageBand } from "../../onchain/accounts/intents/leverage-band.js";
|
|
9
9
|
import "../../onchain/index.js";
|
|
10
|
+
import { AddCollateralParams, AdjustLeverageParams, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, PoolInput, PositionInput, RepayStrategyParams, StrategyInput, StrategyRoutesSimulate, StrategySimulate, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
|
|
10
11
|
import { EnsureFreshChains } from "../types.js";
|
|
11
|
-
import { AddCollateralParams, AdjustLeverageParams, DepositStrategyParams, FinalizeParams, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, OpportunitiesPrepare, PoolInput, PositionInput, RepayStrategyParams, StrategyInput, StrategyRoutesSimulate, StrategySimulate, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
|
|
12
12
|
import { Address } from "viem";
|
|
13
13
|
//#region src/sdk/prepare/PrepareApi.d.ts
|
|
14
14
|
/**
|
|
@@ -20,7 +20,7 @@ import { Address } from "viem";
|
|
|
20
20
|
**/
|
|
21
21
|
type ChainOf = (chainId: ChainId) => OnchainSDK;
|
|
22
22
|
/**
|
|
23
|
-
* {@inheritDoc
|
|
23
|
+
* {@inheritDoc IOpportunitiesPrepare}
|
|
24
24
|
*
|
|
25
25
|
* Holds no state of its own: it owns the mapping from the public,
|
|
26
26
|
* read-model-shaped request to the engine's intent, and nothing else. All
|
|
@@ -32,68 +32,68 @@ type ChainOf = (chainId: ChainId) => OnchainSDK;
|
|
|
32
32
|
* to, hence a chain the SDK does not cover, or one that fails the read, throws
|
|
33
33
|
* rather than answering with empty metadata.
|
|
34
34
|
**/
|
|
35
|
-
declare class PrepareApi extends MultichainConstruct implements
|
|
35
|
+
declare class PrepareApi extends MultichainConstruct implements IOpportunitiesPrepare {
|
|
36
36
|
#private;
|
|
37
37
|
constructor(sdk: MultichainSDK, ensureFresh?: EnsureFreshChains);
|
|
38
38
|
protected queryChain<T>(props: ChainQueryOneProps<T>): Promise<DataResponse<T>>;
|
|
39
39
|
/**
|
|
40
|
-
* {@inheritDoc
|
|
40
|
+
* {@inheritDoc IOpportunitiesPrepare.finalize}
|
|
41
41
|
**/
|
|
42
42
|
finalize(position: PositionInput, params: FinalizeParams): Promise<DataResponse<StrategySimulate>>;
|
|
43
43
|
/**
|
|
44
|
-
* {@inheritDoc
|
|
44
|
+
* {@inheritDoc IOpportunitiesPrepare.deposit}
|
|
45
45
|
**/
|
|
46
46
|
deposit(pool: PoolInput, params: LpParams): LpSimulate;
|
|
47
47
|
/**
|
|
48
|
-
* {@inheritDoc
|
|
48
|
+
* {@inheritDoc IOpportunitiesPrepare.withdraw}
|
|
49
49
|
**/
|
|
50
50
|
withdraw(pool: PoolInput, params: LpParams): LpSimulate;
|
|
51
51
|
/**
|
|
52
|
-
* {@inheritDoc
|
|
52
|
+
* {@inheritDoc IOpportunitiesPrepare.redeem}
|
|
53
53
|
**/
|
|
54
54
|
redeem(pool: PoolInput, params: LpRedeemParams): LpSimulate;
|
|
55
55
|
/**
|
|
56
|
-
* {@inheritDoc
|
|
56
|
+
* {@inheritDoc IOpportunitiesPrepare.openNewStrategy}
|
|
57
57
|
**/
|
|
58
58
|
openNewStrategy(strategy: StrategyInput, params: OpenStrategyParams): Promise<DataResponse<OpenStrategySimulate>>;
|
|
59
59
|
/**
|
|
60
|
-
* {@inheritDoc
|
|
60
|
+
* {@inheritDoc IOpportunitiesPrepare.depositStrategy}
|
|
61
61
|
**/
|
|
62
62
|
depositStrategy(position: PositionInput, params: DepositStrategyParams): Promise<DataResponse<StrategySimulate>>;
|
|
63
63
|
/**
|
|
64
|
-
* {@inheritDoc
|
|
64
|
+
* {@inheritDoc IOpportunitiesPrepare.withdrawStrategy}
|
|
65
65
|
**/
|
|
66
66
|
withdrawStrategy(position: PositionInput, params: WithdrawStrategyParams): Promise<DataResponse<StrategyRoutesSimulate>>;
|
|
67
67
|
/**
|
|
68
|
-
* {@inheritDoc
|
|
68
|
+
* {@inheritDoc IOpportunitiesPrepare.maxWithdraw}
|
|
69
69
|
**/
|
|
70
70
|
maxWithdraw(position: PositionInput): Promise<DataResponse<bigint>>;
|
|
71
71
|
/**
|
|
72
|
-
* {@inheritDoc
|
|
72
|
+
* {@inheritDoc IOpportunitiesPrepare.repayStrategy}
|
|
73
73
|
**/
|
|
74
74
|
repayStrategy(position: PositionInput, params: RepayStrategyParams): Promise<DataResponse<StrategySimulate>>;
|
|
75
75
|
/**
|
|
76
|
-
* {@inheritDoc
|
|
76
|
+
* {@inheritDoc IOpportunitiesPrepare.maxRepay}
|
|
77
77
|
**/
|
|
78
78
|
maxRepay(position: PositionInput): Promise<DataResponse<bigint>>;
|
|
79
79
|
/**
|
|
80
|
-
* {@inheritDoc
|
|
80
|
+
* {@inheritDoc IOpportunitiesPrepare.adjustLeverage}
|
|
81
81
|
**/
|
|
82
82
|
adjustLeverage(position: PositionInput, params: AdjustLeverageParams): Promise<DataResponse<StrategyRoutesSimulate>>;
|
|
83
83
|
/**
|
|
84
|
-
* {@inheritDoc
|
|
84
|
+
* {@inheritDoc IOpportunitiesPrepare.addCollateral}
|
|
85
85
|
**/
|
|
86
86
|
addCollateral(position: PositionInput, params: AddCollateralParams): Promise<DataResponse<StrategySimulate>>;
|
|
87
87
|
/**
|
|
88
|
-
* {@inheritDoc
|
|
88
|
+
* {@inheritDoc IOpportunitiesPrepare.withdrawCollateral}
|
|
89
89
|
**/
|
|
90
90
|
withdrawCollateral(position: PositionInput, params: WithdrawCollateralParams): Promise<DataResponse<StrategySimulate>>;
|
|
91
91
|
/**
|
|
92
|
-
* {@inheritDoc
|
|
92
|
+
* {@inheritDoc IOpportunitiesPrepare.leverageBand}
|
|
93
93
|
**/
|
|
94
94
|
leverageBand(strategy: StrategyInput, collateral: readonly Asset[], targetHF?: Bps): LeverageBand | undefined;
|
|
95
95
|
/**
|
|
96
|
-
* {@inheritDoc
|
|
96
|
+
* {@inheritDoc IOpportunitiesPrepare.maxWithdrawCollateral}
|
|
97
97
|
**/
|
|
98
98
|
maxWithdrawCollateral(position: PositionInput, token: Address, targetHF?: bigint): Promise<DataResponse<bigint>>;
|
|
99
99
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BorrowLimitBinding, IntentPreviewError, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewRefusal, raise, refuse } from "../../onchain/validation/refusal.js";
|
|
2
2
|
import { LeverageBand } from "../../onchain/accounts/intents/leverage-band.js";
|
|
3
3
|
import { OperationState, PathLossRate } from "../../onchain/accounts/intents/types.js";
|
|
4
|
-
import { AddCollateralParams, AdjustLeverageParams, DelayedStrategySimulate, DepositStrategyParams, FinalizeParams, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate,
|
|
4
|
+
import { AddCollateralParams, AdjustLeverageParams, DelayedStrategySimulate, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, PoolInput, PositionInput, PrepareOptions, RepayStrategyParams, StrategyInput, StrategyRoutesSimulate, StrategySimulate, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
|
|
5
5
|
import { ChainOf, PrepareApi } from "./PrepareApi.js";
|
|
6
|
-
export { AddCollateralParams, AdjustLeverageParams, BorrowLimitBinding, ChainOf, DelayedStrategySimulate, DepositStrategyParams, FinalizeParams, IntentPreviewError, type LeverageBand, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, type OperationState,
|
|
6
|
+
export { AddCollateralParams, AdjustLeverageParams, BorrowLimitBinding, ChainOf, DelayedStrategySimulate, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, IntentPreviewError, type LeverageBand, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, type OperationState, type PathLossRate, PoolInput, PositionInput, PrepareApi, PrepareOptions, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewRefusal, RepayStrategyParams, StrategyInput, StrategyRoutesSimulate, StrategySimulate, WithdrawCollateralParams, WithdrawStrategyParams, raise, refuse };
|
|
@@ -106,8 +106,8 @@ type DelayedStrategySimulate = {
|
|
|
106
106
|
} | PreviewRefusal;
|
|
107
107
|
/**
|
|
108
108
|
* What one of the two flows that sell a position asset —
|
|
109
|
-
* {@link
|
|
110
|
-
* {@link
|
|
109
|
+
* {@link IOpportunitiesPrepare.withdrawStrategy} and
|
|
110
|
+
* {@link IOpportunitiesPrepare.adjustLeverage} — would yield each way it can be
|
|
111
111
|
* served.
|
|
112
112
|
*
|
|
113
113
|
* Whether the account can sell that asset on the router, redeem it through its
|
|
@@ -127,7 +127,7 @@ type StrategyRoutesSimulate = {
|
|
|
127
127
|
}> | undefined;
|
|
128
128
|
/**
|
|
129
129
|
* The request half of the redemption route, which
|
|
130
|
-
* {@link
|
|
130
|
+
* {@link IOpportunitiesPrepare.finalize} completes once it matures.
|
|
131
131
|
* `undefined` when the route does not exist — no redemption venue for the
|
|
132
132
|
* asset, or a request that settles at once anyway — see `refused.delayed`.
|
|
133
133
|
**/
|
|
@@ -210,7 +210,7 @@ interface WithdrawStrategyParams extends PrepareOptions {
|
|
|
210
210
|
/**
|
|
211
211
|
* Amount the wallet receives, denominated in `tokenOut`. `MAX_UINT256`, or
|
|
212
212
|
* anything at or above the account's net value, turns the flow into an exit,
|
|
213
|
-
* see {@link
|
|
213
|
+
* see {@link IOpportunitiesPrepare.withdrawStrategy}.
|
|
214
214
|
**/
|
|
215
215
|
amount: bigint;
|
|
216
216
|
/** Wallet receiving the payout. */
|
|
@@ -237,7 +237,7 @@ interface RepayStrategyParams extends PrepareOptions {
|
|
|
237
237
|
* Amount taken from the wallet. Anything above the outstanding debt settles
|
|
238
238
|
* it in full and stays on the account as collateral, so a caller clearing the
|
|
239
239
|
* account can add a buffer for the interest that accrues before the
|
|
240
|
-
* transaction lands, see {@link
|
|
240
|
+
* transaction lands, see {@link IOpportunitiesPrepare.maxRepay}.
|
|
241
241
|
* `MAX_UINT256` settles the debt and sizes that buffer itself.
|
|
242
242
|
**/
|
|
243
243
|
amount: bigint;
|
|
@@ -309,7 +309,7 @@ interface LpParams {
|
|
|
309
309
|
tokenOut?: Address;
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
312
|
-
* Same shape as {@link LpParams}, but {@link
|
|
312
|
+
* Same shape as {@link LpParams}, but {@link IOpportunitiesPrepare.redeem}
|
|
313
313
|
* treats `amount` as the pool shares to burn rather than the underlying to
|
|
314
314
|
* receive.
|
|
315
315
|
**/
|
|
@@ -346,7 +346,7 @@ interface FinalizeParams extends PrepareOptions {
|
|
|
346
346
|
* Not to be confused with `src/preview/simulate`, which goes the other way: it
|
|
347
347
|
* takes calldata that already exists and reports what it would do.
|
|
348
348
|
**/
|
|
349
|
-
interface
|
|
349
|
+
interface IOpportunitiesPrepare {
|
|
350
350
|
/**
|
|
351
351
|
* Depositing into a pool: underlying in, shares out.
|
|
352
352
|
*
|
|
@@ -517,4 +517,4 @@ interface OpportunitiesPrepare {
|
|
|
517
517
|
finalize(position: PositionInput, params: FinalizeParams): Promise<DataResponse<StrategySimulate>>;
|
|
518
518
|
}
|
|
519
519
|
//#endregion
|
|
520
|
-
export { AddCollateralParams, AdjustLeverageParams, BorrowLimitBinding, DelayedStrategySimulate, DepositStrategyParams, FinalizeParams, IntentPreviewError, type LeverageBand, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, type OperationState,
|
|
520
|
+
export { AddCollateralParams, AdjustLeverageParams, BorrowLimitBinding, DelayedStrategySimulate, DepositStrategyParams, FinalizeParams, IOpportunitiesPrepare, IntentPreviewError, type LeverageBand, LpParams, LpRedeemParams, LpSimulate, OpenStrategyParams, OpenStrategySimulate, type OperationState, type PathLossRate, PoolInput, PositionInput, PrepareOptions, PreviewErrorDetails, PreviewErrorReason, PreviewIssue, PreviewRefusal, RepayStrategyParams, StrategyInput, StrategyRoutesSimulate, StrategySimulate, WithdrawCollateralParams, WithdrawStrategyParams, raise, refuse };
|
|
@@ -2,17 +2,17 @@ import { OperationPreview, PreviewOperationInput, PreviewOperationOptions } from
|
|
|
2
2
|
import "../../model/index.js";
|
|
3
3
|
import { MultichainSDK } from "../../onchain/MultichainSDK.js";
|
|
4
4
|
import "../../onchain/index.js";
|
|
5
|
+
import { IPreview } from "./types.js";
|
|
5
6
|
import { NamespaceOptions } from "../types.js";
|
|
6
|
-
import { Preview } from "./types.js";
|
|
7
7
|
//#region src/sdk/preview/PreviewNamespace.d.ts
|
|
8
8
|
/**
|
|
9
|
-
* {@inheritDoc
|
|
9
|
+
* {@inheritDoc IPreview}
|
|
10
10
|
**/
|
|
11
|
-
declare class PreviewNamespace implements
|
|
11
|
+
declare class PreviewNamespace implements IPreview {
|
|
12
12
|
#private;
|
|
13
13
|
constructor(onchain: MultichainSDK, options: NamespaceOptions);
|
|
14
14
|
/**
|
|
15
|
-
* {@inheritDoc
|
|
15
|
+
* {@inheritDoc IPreview.previewOperation}
|
|
16
16
|
**/
|
|
17
17
|
previewOperation(input: PreviewOperationInput, options?: PreviewOperationOptions): Promise<OperationPreview>;
|
|
18
18
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPreview, IPreviewByMode } from "./types.js";
|
|
2
2
|
import { PreviewNamespace } from "./PreviewNamespace.js";
|
|
3
|
-
export {
|
|
3
|
+
export { IPreview, IPreviewByMode, PreviewNamespace };
|