@gearbox-protocol/sdk 14.12.0-next.77 → 14.12.0-next.79
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 +20 -0
- package/dist/cjs/model/filters.schema.js +21 -0
- package/dist/cjs/model/index.js +6 -0
- package/dist/cjs/model/liquidations.js +10 -8
- package/dist/cjs/model/liquidations.schema.js +6 -5
- package/dist/cjs/model/opportunities.js +11 -9
- package/dist/cjs/model/opportunities.schema.js +7 -6
- package/dist/cjs/model/positions.js +10 -8
- package/dist/cjs/model/positions.schema.js +5 -4
- package/dist/cjs/model/primitives.schema.js +5 -4
- package/dist/cjs/preview/index.js +0 -1
- package/dist/cjs/preview/preview/buildDelayedPreview.js +4 -3
- package/dist/cjs/preview/preview/index.js +0 -1
- package/dist/cjs/preview/preview/previewAdjustCreditAccount.js +3 -2
- package/dist/cjs/preview/preview/types.js +0 -16
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +12 -38
- package/dist/cjs/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +1 -1
- package/dist/cjs/sdk/index.js +3 -0
- package/dist/cjs/sdk/market/MarketSuite.js +5 -3
- package/dist/cjs/sdk/market/credit/CreditFacadeV310Contract.js +10 -0
- package/dist/cjs/sdk/market/credit/expectedBalanceDeltas.js +25 -0
- package/dist/cjs/sdk/market/credit/index.js +2 -0
- package/dist/cjs/sdk/market/index.js +2 -0
- package/dist/cjs/sdk/opportunities/MultichainOpportunitiesService.js +5 -2
- package/dist/cjs/sdk/opportunities/OpportunitiesService.js +4 -1
- package/dist/cjs/sdk/positions/MultichainPositionsService.js +5 -2
- package/dist/cjs/sdk/positions/PositionsService.js +8 -4
- package/dist/cjs/sdk/utils/index.js +1 -0
- package/dist/cjs/sdk/utils/zod.js +36 -14
- package/dist/esm/model/filters.js +18 -0
- package/dist/esm/model/filters.schema.js +19 -0
- package/dist/esm/model/index.js +3 -1
- package/dist/esm/model/liquidations.js +10 -8
- package/dist/esm/model/liquidations.schema.js +6 -5
- package/dist/esm/model/opportunities.js +11 -9
- package/dist/esm/model/opportunities.schema.js +7 -6
- package/dist/esm/model/positions.js +10 -8
- package/dist/esm/model/positions.schema.js +5 -4
- package/dist/esm/model/primitives.schema.js +6 -5
- package/dist/esm/preview/index.js +2 -2
- package/dist/esm/preview/preview/buildDelayedPreview.js +5 -4
- package/dist/esm/preview/preview/index.js +2 -2
- package/dist/esm/preview/preview/previewAdjustCreditAccount.js +4 -3
- package/dist/esm/preview/preview/types.js +1 -16
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +12 -38
- package/dist/esm/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +1 -1
- package/dist/esm/sdk/index.js +3 -2
- package/dist/esm/sdk/market/MarketSuite.js +5 -3
- package/dist/esm/sdk/market/credit/CreditFacadeV310Contract.js +10 -0
- package/dist/esm/sdk/market/credit/expectedBalanceDeltas.js +24 -0
- package/dist/esm/sdk/market/credit/index.js +2 -1
- package/dist/esm/sdk/market/index.js +2 -1
- package/dist/esm/sdk/opportunities/MultichainOpportunitiesService.js +5 -2
- package/dist/esm/sdk/opportunities/OpportunitiesService.js +4 -1
- package/dist/esm/sdk/positions/MultichainPositionsService.js +5 -2
- package/dist/esm/sdk/positions/PositionsService.js +8 -4
- package/dist/esm/sdk/utils/index.js +2 -2
- package/dist/esm/sdk/utils/zod.js +36 -15
- package/dist/types/dev/AccountOpener.d.ts +1 -1
- package/dist/types/model/curators.schema.d.ts +1 -1
- package/dist/types/model/filters.d.ts +30 -0
- package/dist/types/model/filters.schema.d.ts +16 -0
- package/dist/types/model/history.schema.d.ts +6 -6
- package/dist/types/model/index.d.ts +3 -1
- package/dist/types/model/liquidations.d.ts +14 -10
- package/dist/types/model/liquidations.schema.d.ts +52 -52
- package/dist/types/model/opportunities.d.ts +15 -11
- package/dist/types/model/opportunities.schema.d.ts +107 -107
- package/dist/types/model/positions.d.ts +14 -10
- package/dist/types/model/positions.schema.d.ts +96 -96
- package/dist/types/model/primitives.d.ts +1 -0
- package/dist/types/model/primitives.schema.d.ts +9 -8
- package/dist/types/preview/index.d.ts +2 -2
- package/dist/types/preview/preview/index.d.ts +2 -2
- package/dist/types/preview/preview/types.d.ts +1 -16
- package/dist/types/sdk/OnchainSDK.d.ts +3 -3
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +8 -7
- package/dist/types/sdk/accounts/bots/types.d.ts +1 -1
- package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressor.d.ts +1 -1
- package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressorV310Contract.d.ts +1 -1
- package/dist/types/sdk/accounts/credit-account-compressor/types.d.ts +3 -3
- package/dist/types/sdk/accounts/index.d.ts +2 -2
- package/dist/types/sdk/accounts/intents/operations/repay-credit-account/index.d.ts +1 -2
- package/dist/types/sdk/accounts/liquidations/types.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +8 -78
- package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.d.ts +1 -1
- package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.d.ts +1 -1
- package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.d.ts +1 -1
- package/dist/types/sdk/base/index.d.ts +2 -2
- package/dist/types/sdk/base/types.d.ts +43 -2
- package/dist/types/sdk/index.d.ts +25 -24
- package/dist/types/sdk/market/MarketSuite.d.ts +1 -1
- package/dist/types/sdk/market/credit/CreditFacadeV310Contract.d.ts +6 -3
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +2 -2
- package/dist/types/sdk/market/credit/expectedBalanceDeltas.d.ts +39 -0
- package/dist/types/sdk/market/credit/index.d.ts +3 -2
- package/dist/types/sdk/market/credit/types.d.ts +26 -3
- package/dist/types/sdk/market/index.d.ts +4 -3
- package/dist/types/sdk/market/rwa/index.d.ts +2 -2
- package/dist/types/sdk/market/rwa/securitize/SecuritizeRWAFactory.d.ts +1 -2
- package/dist/types/sdk/market/rwa/types.d.ts +11 -2
- package/dist/types/sdk/options.d.ts +4 -4
- package/dist/types/sdk/pools/types.d.ts +1 -12
- package/dist/types/sdk/positions/PositionsService.d.ts +1 -1
- package/dist/types/sdk/utils/index.d.ts +2 -2
- package/dist/types/sdk/utils/zod.d.ts +7 -3
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AssetType, Bps, ChainId, Leverage, Token, TokenAmount } from "./primitives.js";
|
|
2
|
+
import { Filterable } from "./filters.js";
|
|
2
3
|
import { ApyBreakdown, PointsProgram } from "./opportunities.js";
|
|
3
4
|
import { DelayedReceivedAsset, LiquidationPosition } from "./liquidations.js";
|
|
4
5
|
import { Address } from "viem";
|
|
@@ -258,45 +259,48 @@ declare function positionId(position: Position): PositionId;
|
|
|
258
259
|
/**
|
|
259
260
|
* Optional narrowing of a positions list.
|
|
260
261
|
*
|
|
261
|
-
* Every
|
|
262
|
-
* filter is the same as no filter at all.
|
|
262
|
+
* Every condition is optional and an omitted one matches any value, so an
|
|
263
|
+
* empty filter is the same as no filter at all. A condition can also be set to
|
|
264
|
+
* `"all"` to say the same thing explicitly, which is what a UI whose state has
|
|
265
|
+
* an "any" option holds, see {@link Filterable}. Conditions combine with AND.
|
|
263
266
|
**/
|
|
264
267
|
interface PositionFilter {
|
|
265
268
|
/**
|
|
266
269
|
* Keep only positions of this kind.
|
|
267
270
|
**/
|
|
268
|
-
kind?: PositionKind
|
|
271
|
+
kind?: Filterable<PositionKind>;
|
|
269
272
|
/**
|
|
270
273
|
* Keep only credit accounts that carry no debt, or only the ones that do.
|
|
271
274
|
* Applicable only to {@link StrategyPosition}
|
|
272
275
|
**/
|
|
273
|
-
isZeroDebt?: boolean
|
|
276
|
+
isZeroDebt?: Filterable<boolean>;
|
|
274
277
|
/**
|
|
275
278
|
* Keep only positions on these chains.
|
|
276
279
|
**/
|
|
277
|
-
chainIds?: ChainId[]
|
|
280
|
+
chainIds?: Filterable<ChainId[]>;
|
|
278
281
|
/**
|
|
279
282
|
* Keep only positions whose underlying is of this class, which for an RWA
|
|
280
283
|
* market means the class of the token its wrapper holds.
|
|
281
284
|
*
|
|
282
285
|
* Not applicable to {@link LiquidationPosition}
|
|
283
286
|
**/
|
|
284
|
-
underlyingType?: AssetType
|
|
287
|
+
underlyingType?: Filterable<AssetType>;
|
|
285
288
|
}
|
|
286
289
|
/**
|
|
287
|
-
* Whether a position satisfies every
|
|
290
|
+
* Whether a position satisfies every condition of a filter.
|
|
288
291
|
*
|
|
289
|
-
* This is the single definition of what each
|
|
292
|
+
* This is the single definition of what each condition means: every source
|
|
290
293
|
* builds its rows first and runs them through here, so the chain and the
|
|
291
294
|
* backend cannot disagree on what a filter selects.
|
|
292
295
|
*
|
|
293
|
-
* A
|
|
296
|
+
* A condition that does not apply to a position's kind keeps the row rather
|
|
294
297
|
* than dropping it: `isZeroDebt` says nothing about a pool position, and
|
|
295
298
|
* `underlyingType` says nothing about a liquidation position, which is
|
|
296
299
|
* denominated in whatever its withdrawal pays out.
|
|
297
300
|
*
|
|
298
301
|
* @param position - Row to test.
|
|
299
|
-
* @param filter -
|
|
302
|
+
* @param filter - Conditions to test against. An absent filter matches
|
|
303
|
+
* anything.
|
|
300
304
|
**/
|
|
301
305
|
declare function matchesPositionFilter(position: Position, filter?: PositionFilter): boolean;
|
|
302
306
|
/**
|