@crypticdot/defituna-api 1.10.10 → 1.10.12
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/README.md +7 -1
- package/dist/index.d.mts +816 -421
- package/dist/index.d.ts +816 -421
- package/dist/index.js +350 -378
- package/dist/index.mjs +340 -368
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -40,8 +40,6 @@ __export(schemas_exports, {
|
|
|
40
40
|
NotificationEntitySchema: () => NotificationEntitySchema,
|
|
41
41
|
OrderBook: () => OrderBook,
|
|
42
42
|
OrderBookEntry: () => OrderBookEntry,
|
|
43
|
-
OrderBookNotification: () => OrderBookNotification,
|
|
44
|
-
OrderBookNotificationMeta: () => OrderBookNotificationMeta,
|
|
45
43
|
OrderHistoryEntry: () => OrderHistoryEntry,
|
|
46
44
|
OrderHistoryEntryNotification: () => OrderHistoryEntryNotification,
|
|
47
45
|
OrderHistoryOrderType: () => OrderHistoryOrderType,
|
|
@@ -104,7 +102,6 @@ __export(schemas_exports, {
|
|
|
104
102
|
TunaLpPositionTransfer: () => TunaLpPositionTransfer,
|
|
105
103
|
TunaLpPositionValue: () => TunaLpPositionValue,
|
|
106
104
|
TunaPositionLegacy: () => TunaPositionLegacy,
|
|
107
|
-
TunaPositionPoolSchema: () => TunaPositionPoolSchema,
|
|
108
105
|
TunaPositionPoolToken: () => TunaPositionPoolToken,
|
|
109
106
|
TunaPositionPoolTokenSchema: () => TunaPositionPoolTokenSchema,
|
|
110
107
|
TunaPositionState: () => TunaPositionState,
|
|
@@ -120,7 +117,7 @@ __export(schemas_exports, {
|
|
|
120
117
|
WalletSubscriptionTopic: () => WalletSubscriptionTopic,
|
|
121
118
|
WalletSubscriptionTopicSchema: () => WalletSubscriptionTopicSchema
|
|
122
119
|
});
|
|
123
|
-
import { z as
|
|
120
|
+
import { z as z10 } from "zod";
|
|
124
121
|
|
|
125
122
|
// src/client/schemas/basic.ts
|
|
126
123
|
import { z } from "zod";
|
|
@@ -139,61 +136,62 @@ var UsdPnlSchema = z.object({
|
|
|
139
136
|
amount: z.number(),
|
|
140
137
|
rate: z.number()
|
|
141
138
|
});
|
|
139
|
+
|
|
140
|
+
// src/client/schemas/pool.ts
|
|
141
|
+
import z3 from "zod";
|
|
142
|
+
|
|
143
|
+
// src/client/schemas/mint.ts
|
|
144
|
+
import { z as z2 } from "zod";
|
|
145
|
+
var Mint = z2.object({
|
|
146
|
+
address: z2.string(),
|
|
147
|
+
symbol: z2.string(),
|
|
148
|
+
name: z2.string(),
|
|
149
|
+
logo: z2.string(),
|
|
150
|
+
decimals: z2.number()
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// src/client/schemas/pool.ts
|
|
142
154
|
var PoolProvider = {
|
|
143
155
|
ORCA: "orca",
|
|
144
156
|
FUSION: "fusion"
|
|
145
157
|
};
|
|
146
|
-
var PoolProviderSchema =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
var PoolProviderSchema = z3.enum([PoolProvider.ORCA, ...Object.values(PoolProvider)]);
|
|
159
|
+
var Pool = z3.object({
|
|
160
|
+
address: z3.string(),
|
|
161
|
+
provider: PoolProviderSchema,
|
|
162
|
+
mintA: Mint,
|
|
163
|
+
mintB: Mint,
|
|
164
|
+
tokenAVault: z3.string(),
|
|
165
|
+
tokenBVault: z3.string(),
|
|
166
|
+
tickSpacing: z3.number(),
|
|
167
|
+
feeRate: z3.number(),
|
|
168
|
+
protocolFeeRate: z3.number(),
|
|
169
|
+
olpFeeRate: z3.nullable(z3.number()),
|
|
170
|
+
liquidity: z3.coerce.bigint(),
|
|
171
|
+
sqrtPrice: z3.coerce.bigint(),
|
|
172
|
+
price: z3.number(),
|
|
173
|
+
tickCurrentIndex: z3.number(),
|
|
174
|
+
stats: z3.optional(
|
|
175
|
+
z3.nullable(
|
|
176
|
+
z3.object({
|
|
177
|
+
tvlUsd: z3.coerce.number(),
|
|
178
|
+
groups: z3.object({
|
|
179
|
+
"24h": z3.object({
|
|
180
|
+
volumeUsd: z3.number(),
|
|
181
|
+
feesUsd: z3.number(),
|
|
182
|
+
priceChange: z3.number()
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
)
|
|
187
|
+
)
|
|
165
188
|
});
|
|
166
189
|
|
|
167
190
|
// src/client/schemas/state_snapshot.ts
|
|
168
|
-
import
|
|
169
|
-
|
|
170
|
-
// src/client/schemas/limit_orders.ts
|
|
171
|
-
import { z as z5 } from "zod";
|
|
172
|
-
|
|
173
|
-
// src/client/schemas/mint.ts
|
|
174
|
-
import { z as z3 } from "zod";
|
|
175
|
-
var Mint = z3.object({
|
|
176
|
-
mint: z3.string(),
|
|
177
|
-
symbol: z3.string(),
|
|
178
|
-
name: z3.string(),
|
|
179
|
-
logo: z3.string(),
|
|
180
|
-
decimals: z3.number()
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
// src/client/schemas/positions_shared.ts
|
|
184
|
-
import z4 from "zod";
|
|
185
|
-
var TunaPositionPoolSchema = z4.object({
|
|
186
|
-
addr: z4.string(),
|
|
187
|
-
price: z4.number(),
|
|
188
|
-
tickSpacing: z4.number()
|
|
189
|
-
});
|
|
190
|
-
var TunaPositionPoolToken = {
|
|
191
|
-
A: "a",
|
|
192
|
-
B: "b"
|
|
193
|
-
};
|
|
194
|
-
var TunaPositionPoolTokenSchema = z4.enum(Object.values(TunaPositionPoolToken));
|
|
191
|
+
import z9 from "zod";
|
|
195
192
|
|
|
196
193
|
// src/client/schemas/limit_orders.ts
|
|
194
|
+
import { z as z4 } from "zod";
|
|
197
195
|
var LimitOrderState = {
|
|
198
196
|
OPEN: "open",
|
|
199
197
|
PARTIALLY_FILLED: "partially_filled",
|
|
@@ -201,27 +199,36 @@ var LimitOrderState = {
|
|
|
201
199
|
COMPLETE: "complete",
|
|
202
200
|
CANCELLED: "cancelled"
|
|
203
201
|
};
|
|
204
|
-
var LimitOrderStateSchema =
|
|
205
|
-
var LimitOrder =
|
|
206
|
-
address:
|
|
207
|
-
orderMint:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
pool: TunaPositionPoolSchema,
|
|
202
|
+
var LimitOrderStateSchema = z4.enum([LimitOrderState.OPEN, ...Object.values(LimitOrderState)]);
|
|
203
|
+
var LimitOrder = z4.object({
|
|
204
|
+
address: z4.string(),
|
|
205
|
+
orderMint: z4.string(),
|
|
206
|
+
authority: z4.string(),
|
|
207
|
+
pool: Pool,
|
|
211
208
|
state: LimitOrderStateSchema,
|
|
212
|
-
aToB:
|
|
213
|
-
tickIndex:
|
|
214
|
-
fillRatio:
|
|
215
|
-
openTxSignature:
|
|
216
|
-
closeTxSignature:
|
|
209
|
+
aToB: z4.boolean(),
|
|
210
|
+
tickIndex: z4.number(),
|
|
211
|
+
fillRatio: z4.number(),
|
|
212
|
+
openTxSignature: z4.string(),
|
|
213
|
+
closeTxSignature: z4.nullable(z4.string()),
|
|
217
214
|
amountIn: AmountWithUsdSchema,
|
|
218
215
|
amountOut: AmountWithUsdSchema,
|
|
219
|
-
openedAt:
|
|
220
|
-
closedAt:
|
|
216
|
+
openedAt: z4.coerce.date(),
|
|
217
|
+
closedAt: z4.nullable(z4.coerce.date())
|
|
221
218
|
});
|
|
222
219
|
|
|
223
220
|
// src/client/schemas/lp_positions.ts
|
|
224
221
|
import z6 from "zod";
|
|
222
|
+
|
|
223
|
+
// src/client/schemas/positions_shared.ts
|
|
224
|
+
import z5 from "zod";
|
|
225
|
+
var TunaPositionPoolToken = {
|
|
226
|
+
A: "a",
|
|
227
|
+
B: "b"
|
|
228
|
+
};
|
|
229
|
+
var TunaPositionPoolTokenSchema = z5.enum(Object.values(TunaPositionPoolToken));
|
|
230
|
+
|
|
231
|
+
// src/client/schemas/lp_positions.ts
|
|
225
232
|
var LpPositionLimitOrderSwap = {
|
|
226
233
|
NO_SWAP: "no_swap",
|
|
227
234
|
SWAP_TO_TOKEN_A: "swap_to_token_a",
|
|
@@ -293,9 +300,7 @@ var TunaLpPositionDtoSchema = z6.object({
|
|
|
293
300
|
upperLimitOrderPrice: z6.number(),
|
|
294
301
|
entryPrice: z6.number(),
|
|
295
302
|
flags: TunaLpPositionFlagsSchema,
|
|
296
|
-
|
|
297
|
-
mintB: Mint,
|
|
298
|
-
pool: TunaPositionPoolSchema,
|
|
303
|
+
pool: Pool,
|
|
299
304
|
marketMaker: PoolProviderSchema,
|
|
300
305
|
depositedCollateralA: AmountWithUsdSchema,
|
|
301
306
|
depositedCollateralB: AmountWithUsdSchema,
|
|
@@ -507,27 +512,45 @@ var TunaLpPositionAction = z6.object({
|
|
|
507
512
|
})
|
|
508
513
|
});
|
|
509
514
|
|
|
515
|
+
// src/client/schemas/order_book.ts
|
|
516
|
+
import z7 from "zod";
|
|
517
|
+
var OrderBookEntry = z7.object({
|
|
518
|
+
concentratedAmount: z7.coerce.bigint(),
|
|
519
|
+
concentratedAmountQuote: z7.coerce.bigint(),
|
|
520
|
+
concentratedTotal: z7.coerce.bigint(),
|
|
521
|
+
concentratedTotalQuote: z7.coerce.bigint(),
|
|
522
|
+
limitAmount: z7.coerce.bigint(),
|
|
523
|
+
limitAmountQuote: z7.coerce.bigint(),
|
|
524
|
+
limitTotal: z7.coerce.bigint(),
|
|
525
|
+
limitTotalQuote: z7.coerce.bigint(),
|
|
526
|
+
price: z7.number(),
|
|
527
|
+
askSide: z7.boolean()
|
|
528
|
+
});
|
|
529
|
+
var OrderBook = z7.object({
|
|
530
|
+
entries: OrderBookEntry.array(),
|
|
531
|
+
poolPrice: z7.number(),
|
|
532
|
+
poolAddress: z7.string()
|
|
533
|
+
});
|
|
534
|
+
|
|
510
535
|
// src/client/schemas/spot_positions.ts
|
|
511
|
-
import { z as
|
|
536
|
+
import { z as z8 } from "zod";
|
|
512
537
|
var TunaSpotPositionState = {
|
|
513
538
|
OPEN: "open",
|
|
514
539
|
CLOSED: "closed"
|
|
515
540
|
};
|
|
516
|
-
var TunaSpotPositionStateSchema =
|
|
541
|
+
var TunaSpotPositionStateSchema = z8.enum([
|
|
517
542
|
TunaSpotPositionState.OPEN,
|
|
518
543
|
...Object.values(TunaSpotPositionState)
|
|
519
544
|
]);
|
|
520
|
-
var TunaSpotPosition =
|
|
521
|
-
address:
|
|
522
|
-
authority:
|
|
523
|
-
version:
|
|
545
|
+
var TunaSpotPosition = z8.object({
|
|
546
|
+
address: z8.string(),
|
|
547
|
+
authority: z8.string(),
|
|
548
|
+
version: z8.number(),
|
|
524
549
|
state: TunaSpotPositionStateSchema,
|
|
525
|
-
lowerLimitOrderPrice:
|
|
526
|
-
upperLimitOrderPrice:
|
|
527
|
-
entryPrice:
|
|
528
|
-
|
|
529
|
-
mintB: Mint,
|
|
530
|
-
pool: TunaPositionPoolSchema,
|
|
550
|
+
lowerLimitOrderPrice: z8.number(),
|
|
551
|
+
upperLimitOrderPrice: z8.number(),
|
|
552
|
+
entryPrice: z8.number(),
|
|
553
|
+
pool: Pool,
|
|
531
554
|
positionToken: TunaPositionPoolTokenSchema,
|
|
532
555
|
collateralToken: TunaPositionPoolTokenSchema,
|
|
533
556
|
marketMaker: PoolProviderSchema,
|
|
@@ -535,97 +558,93 @@ var TunaSpotPosition = z7.object({
|
|
|
535
558
|
initialDebt: AmountWithUsdSchema,
|
|
536
559
|
currentDebt: AmountWithUsdSchema,
|
|
537
560
|
total: AmountWithUsdSchema,
|
|
538
|
-
leverage:
|
|
539
|
-
maxLeverage:
|
|
540
|
-
liquidationPrice:
|
|
561
|
+
leverage: z8.number(),
|
|
562
|
+
maxLeverage: z8.number(),
|
|
563
|
+
liquidationPrice: z8.number(),
|
|
541
564
|
pnlUsd: UsdPnlSchema,
|
|
542
|
-
openedAt:
|
|
543
|
-
closedAt:
|
|
565
|
+
openedAt: z8.coerce.date(),
|
|
566
|
+
closedAt: z8.nullable(z8.coerce.date())
|
|
544
567
|
});
|
|
545
|
-
var IncreaseSpotPositionQuote =
|
|
568
|
+
var IncreaseSpotPositionQuote = z8.object({
|
|
546
569
|
/** Required collateral amount */
|
|
547
|
-
collateralAmount:
|
|
570
|
+
collateralAmount: z8.coerce.bigint(),
|
|
548
571
|
/** Required amount to borrow */
|
|
549
|
-
borrowAmount:
|
|
572
|
+
borrowAmount: z8.coerce.bigint(),
|
|
550
573
|
/** Estimated position size in the position token. */
|
|
551
|
-
estimatedAmount:
|
|
574
|
+
estimatedAmount: z8.coerce.bigint(),
|
|
552
575
|
/** Swap input amount. */
|
|
553
|
-
swapInputAmount:
|
|
576
|
+
swapInputAmount: z8.coerce.bigint(),
|
|
554
577
|
/** Minimum swap output amount according to the provided slippage. */
|
|
555
|
-
minSwapOutputAmount:
|
|
578
|
+
minSwapOutputAmount: z8.coerce.bigint(),
|
|
556
579
|
/** Protocol fee in token A */
|
|
557
|
-
protocolFeeA:
|
|
580
|
+
protocolFeeA: z8.coerce.bigint(),
|
|
558
581
|
/** Protocol fee in token B */
|
|
559
|
-
protocolFeeB:
|
|
582
|
+
protocolFeeB: z8.coerce.bigint(),
|
|
560
583
|
/** Price impact in percents */
|
|
561
|
-
priceImpact:
|
|
584
|
+
priceImpact: z8.number(),
|
|
562
585
|
/** Liquidation price */
|
|
563
|
-
liquidationPrice:
|
|
586
|
+
liquidationPrice: z8.number()
|
|
564
587
|
});
|
|
565
|
-
var DecreaseSpotPositionQuote =
|
|
588
|
+
var DecreaseSpotPositionQuote = z8.object({
|
|
566
589
|
/** Confirmed position decrease percentage (100% = 1.0) */
|
|
567
|
-
decreasePercent:
|
|
590
|
+
decreasePercent: z8.number(),
|
|
568
591
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
569
592
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
570
593
|
*/
|
|
571
|
-
requiredSwapAmount:
|
|
594
|
+
requiredSwapAmount: z8.coerce.bigint(),
|
|
572
595
|
/** Estimated total amount of the adjusted position */
|
|
573
|
-
estimatedAmount:
|
|
596
|
+
estimatedAmount: z8.coerce.bigint(),
|
|
574
597
|
/** Estimated amount of the withdrawn collateral */
|
|
575
|
-
estimatedWithdrawnCollateral:
|
|
598
|
+
estimatedWithdrawnCollateral: z8.coerce.bigint(),
|
|
576
599
|
/** Price impact in percents */
|
|
577
|
-
priceImpact:
|
|
600
|
+
priceImpact: z8.number(),
|
|
578
601
|
/** Liquidation price */
|
|
579
|
-
liquidationPrice:
|
|
602
|
+
liquidationPrice: z8.number()
|
|
580
603
|
});
|
|
581
|
-
var CloseSpotPositionQuote =
|
|
604
|
+
var CloseSpotPositionQuote = z8.object({
|
|
582
605
|
/** Position decrease percentage */
|
|
583
|
-
decreasePercent:
|
|
606
|
+
decreasePercent: z8.number(),
|
|
584
607
|
/** The maximum acceptable swap input amount for position decrease according to the provided slippage
|
|
585
608
|
* (if collateral_token == position_token) OR the minimum swap output amount (if collateral_token != position_token).
|
|
586
609
|
*/
|
|
587
|
-
requiredSwapAmount:
|
|
610
|
+
requiredSwapAmount: z8.coerce.bigint(),
|
|
588
611
|
/** Estimated amount of the withdrawn collateral */
|
|
589
|
-
estimatedWithdrawnCollateral:
|
|
612
|
+
estimatedWithdrawnCollateral: z8.coerce.bigint(),
|
|
590
613
|
/** Price impact in percents */
|
|
591
|
-
priceImpact:
|
|
614
|
+
priceImpact: z8.number()
|
|
592
615
|
});
|
|
593
616
|
|
|
594
617
|
// src/client/schemas/state_snapshot.ts
|
|
595
|
-
var PoolSnapshot =
|
|
596
|
-
liquidity:
|
|
597
|
-
tickCurrentIndex:
|
|
598
|
-
price:
|
|
599
|
-
sqrtPrice:
|
|
600
|
-
tvl:
|
|
601
|
-
priceChange24H:
|
|
602
|
-
volume24H:
|
|
603
|
-
fees24H:
|
|
618
|
+
var PoolSnapshot = z9.object({
|
|
619
|
+
liquidity: z9.coerce.bigint(),
|
|
620
|
+
tickCurrentIndex: z9.number(),
|
|
621
|
+
price: z9.number(),
|
|
622
|
+
sqrtPrice: z9.coerce.bigint(),
|
|
623
|
+
tvl: z9.number(),
|
|
624
|
+
priceChange24H: z9.number(),
|
|
625
|
+
volume24H: z9.number(),
|
|
626
|
+
fees24H: z9.number(),
|
|
604
627
|
borrowedFundsA: AmountWithUsdSchema,
|
|
605
628
|
borrowedFundsB: AmountWithUsdSchema,
|
|
606
629
|
borrowLimitA: AmountWithUsdSchema,
|
|
607
630
|
borrowLimitB: AmountWithUsdSchema
|
|
608
631
|
});
|
|
609
|
-
var StateSnapshot =
|
|
610
|
-
slot:
|
|
611
|
-
blockTime:
|
|
612
|
-
pools:
|
|
613
|
-
tunaSpotPositions:
|
|
614
|
-
tunaLpPositions:
|
|
615
|
-
fusionLimitOrders:
|
|
616
|
-
orderBooks:
|
|
632
|
+
var StateSnapshot = z9.object({
|
|
633
|
+
slot: z9.coerce.bigint(),
|
|
634
|
+
blockTime: z9.coerce.date(),
|
|
635
|
+
pools: z9.optional(z9.record(z9.string(), PoolSnapshot)),
|
|
636
|
+
tunaSpotPositions: z9.optional(z9.array(TunaSpotPosition)),
|
|
637
|
+
tunaLpPositions: z9.optional(z9.array(TunaLpPositionDtoSchema)),
|
|
638
|
+
fusionLimitOrders: z9.optional(z9.array(LimitOrder)),
|
|
639
|
+
orderBooks: z9.optional(z9.record(z9.string(), OrderBook))
|
|
617
640
|
});
|
|
618
641
|
|
|
619
642
|
// src/client/schemas.ts
|
|
620
643
|
var NotificationEntity = {
|
|
621
644
|
POOL_SWAP: "pool_swap",
|
|
622
|
-
POOL_PRICE: "pool_price",
|
|
623
|
-
ORDER_BOOK: "order_book",
|
|
624
|
-
TUNA_POSITION: "tuna_position",
|
|
625
|
-
TUNA_SPOT_POSITION: "tuna_spot_position",
|
|
626
645
|
LENDING_POSITION: "lending_position",
|
|
627
646
|
STAKING_POSITION: "staking_position",
|
|
628
|
-
|
|
647
|
+
MARKET: "market",
|
|
629
648
|
TRADE_HISTORY_ENTRY: "trade_history_entry",
|
|
630
649
|
ORDER_HISTORY_ENTRY: "order_history_entry",
|
|
631
650
|
STATE_SNAPSHOT: "state_snapshot"
|
|
@@ -693,85 +712,81 @@ var WalletSubscriptionTopic = {
|
|
|
693
712
|
TRADE_HISTORY: "trade_history",
|
|
694
713
|
ORDER_HISTORY: "order_history"
|
|
695
714
|
};
|
|
696
|
-
var NotificationEntitySchema =
|
|
697
|
-
var NotificationActionSchema =
|
|
698
|
-
var TradeHistoryActionSchema =
|
|
699
|
-
var TradeHistoryUIDirectionSchema =
|
|
715
|
+
var NotificationEntitySchema = z10.enum([NotificationEntity.POOL_SWAP, ...Object.values(NotificationEntity)]);
|
|
716
|
+
var NotificationActionSchema = z10.enum([NotificationAction.CREATE, ...Object.values(NotificationAction)]);
|
|
717
|
+
var TradeHistoryActionSchema = z10.enum([TradeHistoryAction.SWAP, ...Object.values(TradeHistoryAction)]);
|
|
718
|
+
var TradeHistoryUIDirectionSchema = z10.enum([
|
|
700
719
|
TradeHistoryUIDirection.BUY,
|
|
701
720
|
...Object.values(TradeHistoryUIDirection)
|
|
702
721
|
]);
|
|
703
|
-
var OrderHistoryOrderTypeSchema =
|
|
722
|
+
var OrderHistoryOrderTypeSchema = z10.enum([
|
|
704
723
|
OrderHistoryOrderType.MARKET,
|
|
705
724
|
...Object.values(OrderHistoryOrderType)
|
|
706
725
|
]);
|
|
707
|
-
var OrderHistoryStatusSchema =
|
|
708
|
-
var OrderHistoryUIDirectionSchema =
|
|
726
|
+
var OrderHistoryStatusSchema = z10.enum([OrderHistoryStatus.OPEN, ...Object.values(OrderHistoryStatus)]);
|
|
727
|
+
var OrderHistoryUIDirectionSchema = z10.enum([
|
|
709
728
|
OrderHistoryUIDirection.BUY,
|
|
710
729
|
...Object.values(OrderHistoryUIDirection)
|
|
711
730
|
]);
|
|
712
|
-
var StakingPositionHistoryActionTypeSchema =
|
|
731
|
+
var StakingPositionHistoryActionTypeSchema = z10.enum([
|
|
713
732
|
StakingPositionHistoryActionType.STAKE,
|
|
714
733
|
...Object.values(StakingPositionHistoryActionType)
|
|
715
734
|
]);
|
|
716
|
-
var PoolSubscriptionTopicSchema =
|
|
735
|
+
var PoolSubscriptionTopicSchema = z10.enum([
|
|
717
736
|
PoolSubscriptionTopic.ORDER_BOOK,
|
|
718
737
|
...Object.values(PoolSubscriptionTopic)
|
|
719
738
|
]);
|
|
720
|
-
var WalletSubscriptionTopicSchema =
|
|
739
|
+
var WalletSubscriptionTopicSchema = z10.enum([
|
|
721
740
|
WalletSubscriptionTopic.TUNA_POSITIONS,
|
|
722
741
|
...Object.values(WalletSubscriptionTopic)
|
|
723
742
|
]);
|
|
724
|
-
var PaginationMeta =
|
|
725
|
-
total:
|
|
743
|
+
var PaginationMeta = z10.object({
|
|
744
|
+
total: z10.number()
|
|
726
745
|
});
|
|
727
|
-
var Market =
|
|
728
|
-
address:
|
|
729
|
-
addressLookupTable:
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
liquidationFee: z9.number(),
|
|
739
|
-
liquidationThreshold: z9.number(),
|
|
740
|
-
oraclePriceDeviationThreshold: z9.number(),
|
|
741
|
-
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
742
|
-
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
746
|
+
var Market = z10.object({
|
|
747
|
+
address: z10.string(),
|
|
748
|
+
addressLookupTable: z10.string(),
|
|
749
|
+
maxLeverage: z10.number(),
|
|
750
|
+
maxSwapSlippage: z10.number(),
|
|
751
|
+
protocolFee: z10.number(),
|
|
752
|
+
protocolFeeOnCollateral: z10.number(),
|
|
753
|
+
liquidationFee: z10.number(),
|
|
754
|
+
liquidationThreshold: z10.number(),
|
|
755
|
+
oraclePriceDeviationThreshold: z10.number(),
|
|
756
|
+
rebalanceProtocolFee: z10.number(),
|
|
743
757
|
borrowedFundsA: AmountWithUsdSchema,
|
|
744
758
|
borrowedFundsB: AmountWithUsdSchema,
|
|
745
|
-
availableBorrowA: AmountWithUsdSchema,
|
|
746
|
-
availableBorrowB: AmountWithUsdSchema,
|
|
747
759
|
borrowLimitA: AmountWithUsdSchema,
|
|
748
760
|
borrowLimitB: AmountWithUsdSchema,
|
|
749
|
-
|
|
750
|
-
|
|
761
|
+
maxSpotPositionSizeA: AmountWithUsdSchema,
|
|
762
|
+
maxSpotPositionSizeB: AmountWithUsdSchema,
|
|
763
|
+
pool: Pool,
|
|
764
|
+
disabled: z10.boolean(),
|
|
765
|
+
createdAt: z10.coerce.date()
|
|
751
766
|
});
|
|
752
|
-
var TokenOraclePrice =
|
|
753
|
-
mint:
|
|
754
|
-
price:
|
|
755
|
-
decimals:
|
|
756
|
-
time:
|
|
767
|
+
var TokenOraclePrice = z10.object({
|
|
768
|
+
mint: z10.string(),
|
|
769
|
+
price: z10.coerce.bigint(),
|
|
770
|
+
decimals: z10.number(),
|
|
771
|
+
time: z10.coerce.date()
|
|
757
772
|
});
|
|
758
|
-
var Vault =
|
|
759
|
-
address:
|
|
760
|
-
mint:
|
|
773
|
+
var Vault = z10.object({
|
|
774
|
+
address: z10.string(),
|
|
775
|
+
mint: z10.string(),
|
|
761
776
|
depositedFunds: AmountWithUsdSchema,
|
|
762
777
|
borrowedFunds: AmountWithUsdSchema,
|
|
763
778
|
supplyLimit: AmountWithUsdSchema,
|
|
764
|
-
borrowedShares:
|
|
765
|
-
depositedShares:
|
|
766
|
-
supplyApy:
|
|
767
|
-
borrowApy:
|
|
768
|
-
interestRate:
|
|
769
|
-
utilization:
|
|
770
|
-
pythOracleFeedId:
|
|
771
|
-
pythOraclePriceUpdate:
|
|
779
|
+
borrowedShares: z10.coerce.bigint(),
|
|
780
|
+
depositedShares: z10.coerce.bigint(),
|
|
781
|
+
supplyApy: z10.number(),
|
|
782
|
+
borrowApy: z10.number(),
|
|
783
|
+
interestRate: z10.coerce.bigint(),
|
|
784
|
+
utilization: z10.number(),
|
|
785
|
+
pythOracleFeedId: z10.string(),
|
|
786
|
+
pythOraclePriceUpdate: z10.string()
|
|
772
787
|
});
|
|
773
|
-
var VaultHistoricalStats =
|
|
774
|
-
date:
|
|
788
|
+
var VaultHistoricalStats = z10.object({
|
|
789
|
+
date: z10.preprocess((val, ctx) => {
|
|
775
790
|
if (typeof val === "string") {
|
|
776
791
|
const [year, month, day] = val.split("-").map(Number);
|
|
777
792
|
return new Date(year, month - 1, day);
|
|
@@ -780,259 +795,216 @@ var VaultHistoricalStats = z9.object({
|
|
|
780
795
|
code: "custom",
|
|
781
796
|
message: "Not a valid date string"
|
|
782
797
|
});
|
|
783
|
-
return
|
|
784
|
-
},
|
|
798
|
+
return z10.NEVER;
|
|
799
|
+
}, z10.date()),
|
|
785
800
|
supply: AmountWithUsdSchema,
|
|
786
801
|
borrow: AmountWithUsdSchema,
|
|
787
|
-
supplyApy:
|
|
788
|
-
borrowApr:
|
|
789
|
-
});
|
|
790
|
-
var Pool = z9.object({
|
|
791
|
-
address: z9.string(),
|
|
792
|
-
provider: PoolProviderSchema,
|
|
793
|
-
tokenAMint: z9.string(),
|
|
794
|
-
tokenBMint: z9.string(),
|
|
795
|
-
tokenAVault: z9.string(),
|
|
796
|
-
tokenBVault: z9.string(),
|
|
797
|
-
tvlUsdc: z9.coerce.number(),
|
|
798
|
-
priceChange24H: z9.number(),
|
|
799
|
-
tickSpacing: z9.number(),
|
|
800
|
-
feeRate: z9.number(),
|
|
801
|
-
olpFeeRate: z9.nullable(z9.number()),
|
|
802
|
-
protocolFeeRate: z9.number(),
|
|
803
|
-
liquidity: z9.coerce.bigint(),
|
|
804
|
-
sqrtPrice: z9.coerce.bigint(),
|
|
805
|
-
tickCurrentIndex: z9.number(),
|
|
806
|
-
stats: z9.object({
|
|
807
|
-
"24h": z9.object({
|
|
808
|
-
volume: z9.coerce.number(),
|
|
809
|
-
fees: z9.coerce.number(),
|
|
810
|
-
rewards: z9.coerce.number(),
|
|
811
|
-
yieldOverTvl: z9.coerce.number()
|
|
812
|
-
}),
|
|
813
|
-
"7d": z9.object({
|
|
814
|
-
volume: z9.coerce.number(),
|
|
815
|
-
fees: z9.coerce.number(),
|
|
816
|
-
rewards: z9.coerce.number(),
|
|
817
|
-
yieldOverTvl: z9.coerce.number()
|
|
818
|
-
}),
|
|
819
|
-
"30d": z9.object({
|
|
820
|
-
volume: z9.coerce.number(),
|
|
821
|
-
fees: z9.coerce.number(),
|
|
822
|
-
rewards: z9.coerce.number(),
|
|
823
|
-
yieldOverTvl: z9.coerce.number()
|
|
824
|
-
})
|
|
825
|
-
})
|
|
802
|
+
supplyApy: z10.number(),
|
|
803
|
+
borrowApr: z10.number()
|
|
826
804
|
});
|
|
827
|
-
var Tick =
|
|
828
|
-
index:
|
|
829
|
-
liquidity:
|
|
805
|
+
var Tick = z10.object({
|
|
806
|
+
index: z10.number(),
|
|
807
|
+
liquidity: z10.coerce.bigint()
|
|
830
808
|
});
|
|
831
|
-
var PoolTicks =
|
|
832
|
-
tickSpacing:
|
|
809
|
+
var PoolTicks = z10.object({
|
|
810
|
+
tickSpacing: z10.number(),
|
|
833
811
|
ticks: Tick.array()
|
|
834
812
|
});
|
|
835
|
-
var LendingPosition =
|
|
836
|
-
address:
|
|
837
|
-
authority:
|
|
838
|
-
mint:
|
|
839
|
-
vault:
|
|
840
|
-
shares:
|
|
813
|
+
var LendingPosition = z10.object({
|
|
814
|
+
address: z10.string(),
|
|
815
|
+
authority: z10.string(),
|
|
816
|
+
mint: z10.string(),
|
|
817
|
+
vault: z10.string(),
|
|
818
|
+
shares: z10.coerce.bigint(),
|
|
841
819
|
funds: AmountWithUsdSchema,
|
|
842
820
|
earned: AmountWithUsdSchema
|
|
843
821
|
});
|
|
844
|
-
var PoolSwap =
|
|
845
|
-
id:
|
|
846
|
-
amountIn:
|
|
847
|
-
amountOut:
|
|
848
|
-
amountUsd:
|
|
849
|
-
aToB:
|
|
850
|
-
pool:
|
|
851
|
-
time:
|
|
822
|
+
var PoolSwap = z10.object({
|
|
823
|
+
id: z10.string(),
|
|
824
|
+
amountIn: z10.coerce.bigint(),
|
|
825
|
+
amountOut: z10.coerce.bigint(),
|
|
826
|
+
amountUsd: z10.number(),
|
|
827
|
+
aToB: z10.boolean(),
|
|
828
|
+
pool: z10.string(),
|
|
829
|
+
time: z10.coerce.date()
|
|
852
830
|
});
|
|
853
|
-
var TradeHistoryEntry =
|
|
831
|
+
var TradeHistoryEntry = z10.object({
|
|
854
832
|
// Internal entry ID
|
|
855
|
-
id:
|
|
856
|
-
pool:
|
|
857
|
-
authority:
|
|
858
|
-
aToB:
|
|
833
|
+
id: z10.string(),
|
|
834
|
+
pool: Pool,
|
|
835
|
+
authority: z10.string(),
|
|
836
|
+
aToB: z10.boolean(),
|
|
859
837
|
// Trade action which created entry
|
|
860
838
|
action: TradeHistoryActionSchema,
|
|
861
839
|
// Trade direction formatted for ui display
|
|
862
840
|
uiDirection: TradeHistoryUIDirectionSchema,
|
|
863
841
|
// Trade price formatted for ui display
|
|
864
|
-
uiPrice:
|
|
842
|
+
uiPrice: z10.number(),
|
|
865
843
|
baseToken: AmountWithUsdSchema,
|
|
866
844
|
quoteToken: AmountWithUsdSchema,
|
|
867
845
|
fee: AmountWithUsdSchema,
|
|
868
|
-
pnl:
|
|
869
|
-
|
|
870
|
-
usd:
|
|
871
|
-
bps:
|
|
846
|
+
pnl: z10.nullable(
|
|
847
|
+
z10.object({
|
|
848
|
+
usd: z10.number(),
|
|
849
|
+
bps: z10.number()
|
|
872
850
|
})
|
|
873
851
|
),
|
|
874
|
-
txSignature:
|
|
875
|
-
positionAddress:
|
|
876
|
-
slot:
|
|
877
|
-
ts:
|
|
852
|
+
txSignature: z10.nullable(z10.string()),
|
|
853
|
+
positionAddress: z10.nullable(z10.string()),
|
|
854
|
+
slot: z10.coerce.bigint(),
|
|
855
|
+
ts: z10.coerce.date()
|
|
878
856
|
});
|
|
879
|
-
var OrderHistoryEntry =
|
|
857
|
+
var OrderHistoryEntry = z10.object({
|
|
880
858
|
// Internal entry ID
|
|
881
|
-
id:
|
|
882
|
-
pool:
|
|
883
|
-
authority:
|
|
859
|
+
id: z10.string(),
|
|
860
|
+
pool: Pool,
|
|
861
|
+
authority: z10.string(),
|
|
884
862
|
orderType: OrderHistoryOrderTypeSchema,
|
|
885
|
-
isReduceOnly:
|
|
886
|
-
aToB:
|
|
863
|
+
isReduceOnly: z10.nullable(z10.boolean()),
|
|
864
|
+
aToB: z10.boolean(),
|
|
887
865
|
uiDirection: OrderHistoryUIDirectionSchema,
|
|
888
|
-
uiPrice:
|
|
889
|
-
uiExecutionPrice:
|
|
866
|
+
uiPrice: z10.nullable(z10.number()),
|
|
867
|
+
uiExecutionPrice: z10.nullable(z10.number()),
|
|
890
868
|
status: OrderHistoryStatusSchema,
|
|
891
869
|
baseToken: AmountWithUsdSchema,
|
|
892
870
|
quoteToken: AmountWithUsdSchema,
|
|
893
|
-
baseTokenConsumedAmount:
|
|
894
|
-
quoteTokenFilledAmount:
|
|
895
|
-
txSignature:
|
|
896
|
-
positionAddress:
|
|
897
|
-
slot:
|
|
898
|
-
ts:
|
|
871
|
+
baseTokenConsumedAmount: z10.nullable(AmountWithUsdSchema),
|
|
872
|
+
quoteTokenFilledAmount: z10.nullable(AmountWithUsdSchema),
|
|
873
|
+
txSignature: z10.nullable(z10.string()),
|
|
874
|
+
positionAddress: z10.nullable(z10.string()),
|
|
875
|
+
slot: z10.coerce.bigint(),
|
|
876
|
+
ts: z10.coerce.date()
|
|
899
877
|
});
|
|
900
|
-
var StakingTreasury =
|
|
901
|
-
address:
|
|
902
|
-
stakedTokenMint:
|
|
903
|
-
rewardTokenMint:
|
|
904
|
-
apy:
|
|
905
|
-
uniqueStakers:
|
|
878
|
+
var StakingTreasury = z10.object({
|
|
879
|
+
address: z10.string(),
|
|
880
|
+
stakedTokenMint: z10.string(),
|
|
881
|
+
rewardTokenMint: z10.string(),
|
|
882
|
+
apy: z10.number(),
|
|
883
|
+
uniqueStakers: z10.number(),
|
|
906
884
|
totalStaked: AmountWithUsdSchema,
|
|
907
885
|
totalReward: AmountWithUsdSchema,
|
|
908
|
-
unstakeCooldownSeconds:
|
|
909
|
-
isStakingEnabled:
|
|
910
|
-
isUnstakingEnabled:
|
|
911
|
-
isWithdrawEnabled:
|
|
886
|
+
unstakeCooldownSeconds: z10.number(),
|
|
887
|
+
isStakingEnabled: z10.boolean(),
|
|
888
|
+
isUnstakingEnabled: z10.boolean(),
|
|
889
|
+
isWithdrawEnabled: z10.boolean()
|
|
912
890
|
});
|
|
913
|
-
var StakingPosition =
|
|
914
|
-
address:
|
|
915
|
-
owner:
|
|
891
|
+
var StakingPosition = z10.object({
|
|
892
|
+
address: z10.string(),
|
|
893
|
+
owner: z10.string(),
|
|
916
894
|
staked: AmountWithUsdSchema,
|
|
917
895
|
unstaked: AmountWithUsdSchema,
|
|
918
896
|
claimedReward: AmountWithUsdSchema,
|
|
919
897
|
unclaimedReward: AmountWithUsdSchema,
|
|
920
|
-
rank:
|
|
921
|
-
vesting:
|
|
898
|
+
rank: z10.nullable(z10.number()),
|
|
899
|
+
vesting: z10.object({
|
|
922
900
|
locked: AmountWithUsdSchema,
|
|
923
901
|
unlocked: AmountWithUsdSchema,
|
|
924
|
-
unlockRate:
|
|
925
|
-
unlockEverySeconds:
|
|
926
|
-
unlockCliffSeconds:
|
|
927
|
-
lockedAt:
|
|
902
|
+
unlockRate: z10.coerce.bigint(),
|
|
903
|
+
unlockEverySeconds: z10.number(),
|
|
904
|
+
unlockCliffSeconds: z10.number(),
|
|
905
|
+
lockedAt: z10.nullable(z10.coerce.date())
|
|
928
906
|
}),
|
|
929
|
-
lastUnstakedAt:
|
|
930
|
-
withdrawAvailableAt:
|
|
907
|
+
lastUnstakedAt: z10.nullable(z10.coerce.date()),
|
|
908
|
+
withdrawAvailableAt: z10.nullable(z10.coerce.date())
|
|
931
909
|
});
|
|
932
|
-
var StakingLeaderboardPosition =
|
|
933
|
-
rank:
|
|
934
|
-
address:
|
|
935
|
-
owner:
|
|
910
|
+
var StakingLeaderboardPosition = z10.object({
|
|
911
|
+
rank: z10.number(),
|
|
912
|
+
address: z10.string(),
|
|
913
|
+
owner: z10.string(),
|
|
936
914
|
staked: AmountWithUsdSchema
|
|
937
915
|
});
|
|
938
|
-
var StakingLeaderboardPage =
|
|
916
|
+
var StakingLeaderboardPage = z10.object({
|
|
939
917
|
data: StakingLeaderboardPosition.array(),
|
|
940
918
|
meta: PaginationMeta
|
|
941
919
|
});
|
|
942
|
-
var StakingPositionHistoryAction =
|
|
943
|
-
position:
|
|
920
|
+
var StakingPositionHistoryAction = z10.object({
|
|
921
|
+
position: z10.string(),
|
|
944
922
|
action: StakingPositionHistoryActionTypeSchema,
|
|
945
|
-
txSignature:
|
|
946
|
-
amount:
|
|
947
|
-
time:
|
|
923
|
+
txSignature: z10.string(),
|
|
924
|
+
amount: z10.coerce.bigint(),
|
|
925
|
+
time: z10.coerce.date()
|
|
948
926
|
});
|
|
949
|
-
var PoolPriceCandle =
|
|
950
|
-
time:
|
|
951
|
-
open:
|
|
952
|
-
close:
|
|
953
|
-
high:
|
|
954
|
-
low:
|
|
955
|
-
volume:
|
|
927
|
+
var PoolPriceCandle = z10.object({
|
|
928
|
+
time: z10.number(),
|
|
929
|
+
open: z10.number(),
|
|
930
|
+
close: z10.number(),
|
|
931
|
+
high: z10.number(),
|
|
932
|
+
low: z10.number(),
|
|
933
|
+
volume: z10.number()
|
|
956
934
|
});
|
|
957
|
-
var FeesStatsGroup =
|
|
958
|
-
time:
|
|
959
|
-
addLiquidityFees:
|
|
960
|
-
limitOrderFees:
|
|
961
|
-
yieldCompoundingFees:
|
|
962
|
-
liquidationFees:
|
|
963
|
-
totalLiquidationsNetworkFees:
|
|
964
|
-
totalLimitOrdersNetworkFees:
|
|
965
|
-
totalYieldCompoundingNetworkFees:
|
|
966
|
-
failedNetworkFees:
|
|
967
|
-
processedNetworkFees:
|
|
968
|
-
totalCollectedFees:
|
|
969
|
-
totalNetworkFees:
|
|
970
|
-
jitoLiquidationFees:
|
|
971
|
-
jitoLimitOrderFees:
|
|
972
|
-
jitoYieldCompoundingFees:
|
|
973
|
-
runningAddLiquidityFees:
|
|
974
|
-
runningLimitOrderFees:
|
|
975
|
-
runningYieldCompoundingFees:
|
|
976
|
-
runningLiquidationFees:
|
|
977
|
-
runningTotalLiquidationsNetworkFees:
|
|
978
|
-
runningTotalLimitOrdersNetworkFees:
|
|
979
|
-
runningTotalYieldCompoundingNetworkFees:
|
|
980
|
-
runningFailedNetworkFees:
|
|
981
|
-
runningProcessedNetworkFees:
|
|
982
|
-
runningJitoLiquidationFees:
|
|
983
|
-
runningJitoLimitOrderFees:
|
|
984
|
-
runningJitoYieldCompoundingFees:
|
|
985
|
-
runningTotalCollectedFees:
|
|
986
|
-
runningTotalNetworkFees:
|
|
935
|
+
var FeesStatsGroup = z10.object({
|
|
936
|
+
time: z10.coerce.date(),
|
|
937
|
+
addLiquidityFees: z10.number(),
|
|
938
|
+
limitOrderFees: z10.number(),
|
|
939
|
+
yieldCompoundingFees: z10.number(),
|
|
940
|
+
liquidationFees: z10.number(),
|
|
941
|
+
totalLiquidationsNetworkFees: z10.number(),
|
|
942
|
+
totalLimitOrdersNetworkFees: z10.number(),
|
|
943
|
+
totalYieldCompoundingNetworkFees: z10.number(),
|
|
944
|
+
failedNetworkFees: z10.number(),
|
|
945
|
+
processedNetworkFees: z10.number(),
|
|
946
|
+
totalCollectedFees: z10.number(),
|
|
947
|
+
totalNetworkFees: z10.number(),
|
|
948
|
+
jitoLiquidationFees: z10.number(),
|
|
949
|
+
jitoLimitOrderFees: z10.number(),
|
|
950
|
+
jitoYieldCompoundingFees: z10.number(),
|
|
951
|
+
runningAddLiquidityFees: z10.number(),
|
|
952
|
+
runningLimitOrderFees: z10.number(),
|
|
953
|
+
runningYieldCompoundingFees: z10.number(),
|
|
954
|
+
runningLiquidationFees: z10.number(),
|
|
955
|
+
runningTotalLiquidationsNetworkFees: z10.number(),
|
|
956
|
+
runningTotalLimitOrdersNetworkFees: z10.number(),
|
|
957
|
+
runningTotalYieldCompoundingNetworkFees: z10.number(),
|
|
958
|
+
runningFailedNetworkFees: z10.number(),
|
|
959
|
+
runningProcessedNetworkFees: z10.number(),
|
|
960
|
+
runningJitoLiquidationFees: z10.number(),
|
|
961
|
+
runningJitoLimitOrderFees: z10.number(),
|
|
962
|
+
runningJitoYieldCompoundingFees: z10.number(),
|
|
963
|
+
runningTotalCollectedFees: z10.number(),
|
|
964
|
+
runningTotalNetworkFees: z10.number()
|
|
987
965
|
});
|
|
988
|
-
var StakingRevenueStatsGroup =
|
|
989
|
-
time:
|
|
990
|
-
totalDepositsUsd:
|
|
991
|
-
totalDepositsSol:
|
|
992
|
-
runningTotalDepositsUsd:
|
|
993
|
-
runningTotalDepositsSol:
|
|
966
|
+
var StakingRevenueStatsGroup = z10.object({
|
|
967
|
+
time: z10.coerce.date(),
|
|
968
|
+
totalDepositsUsd: z10.number(),
|
|
969
|
+
totalDepositsSol: z10.coerce.bigint(),
|
|
970
|
+
runningTotalDepositsUsd: z10.number(),
|
|
971
|
+
runningTotalDepositsSol: z10.coerce.bigint()
|
|
994
972
|
});
|
|
995
|
-
var SwapQuoteByInput =
|
|
996
|
-
estimatedAmountOut:
|
|
997
|
-
minAmountOut:
|
|
998
|
-
feeAmount:
|
|
999
|
-
feeUsd:
|
|
973
|
+
var SwapQuoteByInput = z10.object({
|
|
974
|
+
estimatedAmountOut: z10.coerce.bigint(),
|
|
975
|
+
minAmountOut: z10.coerce.bigint(),
|
|
976
|
+
feeAmount: z10.coerce.bigint(),
|
|
977
|
+
feeUsd: z10.number(),
|
|
1000
978
|
/** Price impact in percents */
|
|
1001
|
-
priceImpact:
|
|
979
|
+
priceImpact: z10.number()
|
|
1002
980
|
});
|
|
1003
|
-
var SwapQuoteByOutput =
|
|
1004
|
-
estimatedAmountIn:
|
|
1005
|
-
maxAmountIn:
|
|
1006
|
-
feeAmount:
|
|
1007
|
-
feeUsd:
|
|
981
|
+
var SwapQuoteByOutput = z10.object({
|
|
982
|
+
estimatedAmountIn: z10.coerce.bigint(),
|
|
983
|
+
maxAmountIn: z10.coerce.bigint(),
|
|
984
|
+
feeAmount: z10.coerce.bigint(),
|
|
985
|
+
feeUsd: z10.number(),
|
|
1008
986
|
/** Price impact in percents */
|
|
1009
|
-
priceImpact:
|
|
987
|
+
priceImpact: z10.number()
|
|
1010
988
|
});
|
|
1011
|
-
var LimitOrderQuoteByInput =
|
|
1012
|
-
amountOut:
|
|
989
|
+
var LimitOrderQuoteByInput = z10.object({
|
|
990
|
+
amountOut: z10.coerce.bigint()
|
|
1013
991
|
});
|
|
1014
|
-
var LimitOrderQuoteByOutput =
|
|
1015
|
-
amountIn:
|
|
992
|
+
var LimitOrderQuoteByOutput = z10.object({
|
|
993
|
+
amountIn: z10.coerce.bigint()
|
|
1016
994
|
});
|
|
1017
995
|
var TradableAmount = AmountWithUsdSchema;
|
|
1018
|
-
var UpdateStreamSubscriptionResult =
|
|
1019
|
-
status:
|
|
996
|
+
var UpdateStreamSubscriptionResult = z10.object({
|
|
997
|
+
status: z10.string()
|
|
1020
998
|
});
|
|
1021
|
-
var createNotificationSchema = (dataSchema, metaSchema) =>
|
|
999
|
+
var createNotificationSchema = (dataSchema, metaSchema) => z10.object({
|
|
1022
1000
|
entity: NotificationEntitySchema,
|
|
1023
1001
|
action: NotificationActionSchema,
|
|
1024
1002
|
data: dataSchema,
|
|
1025
|
-
id:
|
|
1026
|
-
authority:
|
|
1027
|
-
...metaSchema ? { meta: metaSchema } : { meta:
|
|
1028
|
-
});
|
|
1029
|
-
var OrderBookNotificationMeta = z9.object({
|
|
1030
|
-
pool: z9.string(),
|
|
1031
|
-
priceStep: z9.number(),
|
|
1032
|
-
inverted: z9.boolean()
|
|
1003
|
+
id: z10.string(),
|
|
1004
|
+
authority: z10.nullish(z10.string()),
|
|
1005
|
+
...metaSchema ? { meta: metaSchema } : { meta: z10.undefined().nullable() }
|
|
1033
1006
|
});
|
|
1034
1007
|
var PoolSwapNotification = createNotificationSchema(PoolSwap);
|
|
1035
|
-
var OrderBookNotification = createNotificationSchema(OrderBook, OrderBookNotificationMeta);
|
|
1036
1008
|
var LendingPositionNotification = createNotificationSchema(LendingPosition);
|
|
1037
1009
|
var TradeHistoryEntryNotification = createNotificationSchema(TradeHistoryEntry);
|
|
1038
1010
|
var OrderHistoryEntryNotification = createNotificationSchema(OrderHistoryEntry);
|