@lifi/perps-types 18.0.0 → 19.0.0
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/account.d.ts +63 -62
- package/dist/cjs/account.d.ts.map +1 -1
- package/dist/cjs/action.d.ts +17 -16
- package/dist/cjs/action.d.ts.map +1 -1
- package/dist/cjs/asset.d.ts +2 -1
- package/dist/cjs/asset.d.ts.map +1 -1
- package/dist/cjs/decimal.d.ts +4 -0
- package/dist/cjs/decimal.d.ts.map +1 -0
- package/dist/cjs/decimal.js +9 -0
- package/dist/cjs/decimal.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/market.d.ts +24 -23
- package/dist/cjs/market.d.ts.map +1 -1
- package/dist/cjs/portfolioHistory.d.ts +5 -4
- package/dist/cjs/portfolioHistory.d.ts.map +1 -1
- package/dist/cjs/providers.d.ts +6 -5
- package/dist/cjs/providers.d.ts.map +1 -1
- package/dist/cjs/quote.d.ts +7 -6
- package/dist/cjs/quote.d.ts.map +1 -1
- package/dist/cjs/referral.d.ts +4 -3
- package/dist/cjs/referral.d.ts.map +1 -1
- package/dist/cjs/referral.js.map +1 -1
- package/dist/cjs/subscriptions.d.ts +3 -1
- package/dist/cjs/subscriptions.d.ts.map +1 -1
- package/dist/esm/account.d.ts +63 -62
- package/dist/esm/account.d.ts.map +1 -1
- package/dist/esm/action.d.ts +17 -16
- package/dist/esm/action.d.ts.map +1 -1
- package/dist/esm/asset.d.ts +2 -1
- package/dist/esm/asset.d.ts.map +1 -1
- package/dist/esm/decimal.d.ts +23 -0
- package/dist/esm/decimal.d.ts.map +1 -0
- package/dist/esm/decimal.js +17 -0
- package/dist/esm/decimal.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/market.d.ts +30 -30
- package/dist/esm/market.d.ts.map +1 -1
- package/dist/esm/portfolioHistory.d.ts +5 -4
- package/dist/esm/portfolioHistory.d.ts.map +1 -1
- package/dist/esm/providers.d.ts +24 -11
- package/dist/esm/providers.d.ts.map +1 -1
- package/dist/esm/quote.d.ts +7 -6
- package/dist/esm/quote.d.ts.map +1 -1
- package/dist/esm/referral.d.ts +4 -3
- package/dist/esm/referral.d.ts.map +1 -1
- package/dist/esm/referral.js.map +1 -1
- package/dist/esm/subscriptions.d.ts +5 -1
- package/dist/esm/subscriptions.d.ts.map +1 -1
- package/dist/types/account.d.ts +63 -62
- package/dist/types/account.d.ts.map +1 -1
- package/dist/types/action.d.ts +17 -16
- package/dist/types/action.d.ts.map +1 -1
- package/dist/types/asset.d.ts +2 -1
- package/dist/types/asset.d.ts.map +1 -1
- package/dist/types/decimal.d.ts +23 -0
- package/dist/types/decimal.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/market.d.ts +30 -30
- package/dist/types/market.d.ts.map +1 -1
- package/dist/types/portfolioHistory.d.ts +5 -4
- package/dist/types/portfolioHistory.d.ts.map +1 -1
- package/dist/types/providers.d.ts +24 -11
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/quote.d.ts +7 -6
- package/dist/types/quote.d.ts.map +1 -1
- package/dist/types/referral.d.ts +4 -3
- package/dist/types/referral.d.ts.map +1 -1
- package/dist/types/subscriptions.d.ts +5 -1
- package/dist/types/subscriptions.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/account.ts +63 -62
- package/src/action.ts +17 -16
- package/src/asset.ts +3 -1
- package/src/decimal.ts +26 -0
- package/src/index.ts +1 -0
- package/src/market.ts +30 -30
- package/src/portfolioHistory.ts +6 -4
- package/src/providers.ts +24 -11
- package/src/quote.ts +7 -6
- package/src/referral.ts +4 -3
- package/src/subscriptions.ts +4 -1
package/src/providers.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ActionParamsMap } from './action.js'
|
|
2
2
|
import type { Asset } from './asset.js'
|
|
3
|
+
import type { DecimalString } from './decimal.js'
|
|
3
4
|
import type {
|
|
4
5
|
ActionRelay,
|
|
5
6
|
ActionType,
|
|
@@ -179,25 +180,37 @@ export interface Provider {
|
|
|
179
180
|
* values. Absent when the provider has no settlement chain.
|
|
180
181
|
*/
|
|
181
182
|
chainId?: number
|
|
182
|
-
/** Absent means no minimum advertised. */
|
|
183
|
-
minDepositUsd?: number
|
|
184
183
|
/**
|
|
185
|
-
* Minimum
|
|
186
|
-
*
|
|
184
|
+
* Minimum deposit in USD, as a plain decimal string. Absent means no
|
|
185
|
+
* minimum advertised.
|
|
187
186
|
*/
|
|
188
|
-
|
|
187
|
+
minDepositUsd?: DecimalString
|
|
188
|
+
/**
|
|
189
|
+
* Minimum order notional value in USD, as a plain decimal string. Absent
|
|
190
|
+
* means no minimum advertised.
|
|
191
|
+
*/
|
|
192
|
+
minOrderValueUsd?: DecimalString
|
|
189
193
|
/**
|
|
190
194
|
* Minimum order notional value in USD for reduce-only orders, when the
|
|
191
195
|
* provider applies a lower floor than `minOrderValueUsd`. Absent means
|
|
192
196
|
* reduce-only orders use the same floor as `minOrderValueUsd`.
|
|
193
197
|
*/
|
|
194
198
|
minReduceOrderValueUsd?: number
|
|
195
|
-
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Minimum withdrawal notional in USD, as a plain decimal string. Absent
|
|
201
|
+
* means no minimum advertised.
|
|
202
|
+
*/
|
|
203
|
+
minWithdrawalUsd?: DecimalString
|
|
204
|
+
/**
|
|
205
|
+
* Flat deposit fee in USD the provider charges, as a plain decimal string.
|
|
206
|
+
* Absent means no fee advertised.
|
|
207
|
+
*/
|
|
208
|
+
depositFeeUsd?: DecimalString
|
|
209
|
+
/**
|
|
210
|
+
* Flat withdrawal fee in USD the provider charges, as a plain decimal
|
|
211
|
+
* string. Absent means no fee advertised.
|
|
212
|
+
*/
|
|
213
|
+
withdrawalFeeUsd?: DecimalString
|
|
201
214
|
/**
|
|
202
215
|
* Candle intervals this provider supports for OHLCV/chart requests, in
|
|
203
216
|
* ascending order. Drives the client's chart interval selector. Empty for
|
package/src/quote.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FeeTier } from './account.js'
|
|
2
|
+
import type { DecimalString } from './decimal.js'
|
|
2
3
|
import type { FundingInfo } from './market.js'
|
|
3
4
|
|
|
4
5
|
/** Side of the quoted market order, using lowercase wire values. @public */
|
|
@@ -26,20 +27,20 @@ export interface Quote {
|
|
|
26
27
|
type: TradeType
|
|
27
28
|
side: QuoteSide
|
|
28
29
|
/** Input notional in USD. */
|
|
29
|
-
sizeUsd:
|
|
30
|
+
sizeUsd: DecimalString
|
|
30
31
|
/** Base amount the book filled for `sizeUsd` (or the most obtainable when the book is too thin). */
|
|
31
|
-
baseSize:
|
|
32
|
-
markPrice:
|
|
32
|
+
baseSize: DecimalString
|
|
33
|
+
markPrice: DecimalString
|
|
33
34
|
/** Volume-weighted average fill price from the book walk. */
|
|
34
|
-
expectedFillPrice:
|
|
35
|
+
expectedFillPrice: DecimalString
|
|
35
36
|
/** VWAP deviation from `markPrice` in basis points; non-negative. */
|
|
36
|
-
priceImpactBps:
|
|
37
|
+
priceImpactBps: DecimalString
|
|
37
38
|
/** Base maker/taker fee fractions (not bps) for the public tier. */
|
|
38
39
|
feeTier: FeeTier
|
|
39
40
|
/** Always `true` in v1 — quotes use the public base tier, never a per-account tier. */
|
|
40
41
|
isDefaultFeeTier: boolean
|
|
41
42
|
/** Taker fee on the filled notional in USD: `filledNotional * feeTier.taker`. */
|
|
42
|
-
feeUsd:
|
|
43
|
+
feeUsd: DecimalString
|
|
43
44
|
/** Current funding for perps; `null` for spot. */
|
|
44
45
|
funding: FundingInfo | null
|
|
45
46
|
/** `true` when the book could not fill the full `sizeUsd` — `baseSize`/fill reflect the best obtainable. */
|
package/src/referral.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Pagination } from './account.js'
|
|
2
|
+
import type { DecimalString } from './decimal.js'
|
|
2
3
|
import type { Address } from './primitives.js'
|
|
3
4
|
import type { PerpsTypedData, TypedDataParameter } from './typedData.js'
|
|
4
5
|
|
|
@@ -71,9 +72,9 @@ export interface OwnedReferralCodeEligibility {
|
|
|
71
72
|
* Executed notional the address must reach, as a decimal string in the
|
|
72
73
|
* backend's reporting currency. Absent when the backend does not disclose it.
|
|
73
74
|
*/
|
|
74
|
-
requiredNotional?:
|
|
75
|
+
requiredNotional?: DecimalString
|
|
75
76
|
/** The address's executed notional so far, in the same units as `requiredNotional`. */
|
|
76
|
-
currentNotional?:
|
|
77
|
+
currentNotional?: DecimalString
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
/**
|
|
@@ -125,7 +126,7 @@ export interface ReferralActivityItem {
|
|
|
125
126
|
* Executed notional recorded against this attachment, as a decimal string in
|
|
126
127
|
* the backend's reporting currency.
|
|
127
128
|
*/
|
|
128
|
-
notional:
|
|
129
|
+
notional: DecimalString
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
/**
|
package/src/subscriptions.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
Order,
|
|
7
7
|
Position,
|
|
8
8
|
} from './account.js'
|
|
9
|
+
import type { DecimalString } from './decimal.js'
|
|
9
10
|
import type {
|
|
10
11
|
Candle,
|
|
11
12
|
MarketContext,
|
|
@@ -148,11 +149,13 @@ export type PositionsEvent = { channel: 'positions'; data: Position[] }
|
|
|
148
149
|
/**
|
|
149
150
|
* Spot holdings as typed {@link Balance}s, each carrying the venue-locked
|
|
150
151
|
* portion (`locked` = reserved against open orders; `available = units − locked`).
|
|
152
|
+
* `transferable` is required here, so a live frame always carries the figure
|
|
153
|
+
* a REST snapshot carries.
|
|
151
154
|
* @public
|
|
152
155
|
*/
|
|
153
156
|
export type SpotBalancesEvent = {
|
|
154
157
|
channel: 'spotBalances'
|
|
155
|
-
data: (Balance & { locked:
|
|
158
|
+
data: (Balance & { locked: DecimalString; transferable: DecimalString })[]
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
/**
|