@bulletxyz/bullet-sdk 0.28.2 → 0.28.3-rc.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Decimal from "decimal.js";
|
|
2
|
-
import type { OrderbookL2,
|
|
2
|
+
import type { OrderbookL2, PriceLevelL2 } from "./zod-types/rest";
|
|
3
3
|
import type { OrderbookUpdate } from "./zod-types/ws";
|
|
4
4
|
type Size = Decimal;
|
|
5
5
|
export declare class Orderbook {
|
|
@@ -11,8 +11,8 @@ export declare class Orderbook {
|
|
|
11
11
|
protected updateBid(price: string, size: Size): void;
|
|
12
12
|
protected updateAsk(price: string, size: Size): void;
|
|
13
13
|
applyDelta(delta: OrderbookUpdate): void;
|
|
14
|
-
getSortedBids(levels?: number):
|
|
15
|
-
getSortedAsks(levels?: number):
|
|
14
|
+
getSortedBids(levels?: number): PriceLevelL2[];
|
|
15
|
+
getSortedAsks(levels?: number): PriceLevelL2[];
|
|
16
16
|
static fromOrderbookL2(orderbook: OrderbookL2): Orderbook;
|
|
17
17
|
static toOrderbookL2(orderbook: Orderbook): OrderbookL2;
|
|
18
18
|
toDisplay(levels?: number): string;
|
|
@@ -88,7 +88,7 @@ export declare const BaseResponseSchemas: {
|
|
|
88
88
|
id: string;
|
|
89
89
|
}>;
|
|
90
90
|
};
|
|
91
|
-
declare const
|
|
91
|
+
declare const PriceLevelL2: z.ZodTuple<[z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>, z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>], null>;
|
|
92
92
|
declare const BorrowLendRiskConfig: z.ZodObject<{
|
|
93
93
|
liquidation_total_reward_ratio: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
94
94
|
liability_liquidation_limit_ratio: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
@@ -2026,7 +2026,6 @@ export declare const Schemas: {
|
|
|
2026
2026
|
min_lot_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
2027
2027
|
impact_margin: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
2028
2028
|
orderbook: z.ZodObject<{
|
|
2029
|
-
market_id: z.ZodNumber;
|
|
2030
2029
|
bids: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2031
2030
|
nodes: z.ZodArray<z.ZodObject<{
|
|
2032
2031
|
order_id: z.ZodBigInt;
|
|
@@ -2102,7 +2101,6 @@ export declare const Schemas: {
|
|
|
2102
2101
|
total_size: string | number;
|
|
2103
2102
|
}>>;
|
|
2104
2103
|
}, "strip", z.ZodTypeAny, {
|
|
2105
|
-
market_id: number;
|
|
2106
2104
|
bids: Map<string, {
|
|
2107
2105
|
nodes: {
|
|
2108
2106
|
order_id: bigint;
|
|
@@ -2118,7 +2116,6 @@ export declare const Schemas: {
|
|
|
2118
2116
|
total_size: import("decimal.js").Decimal;
|
|
2119
2117
|
}>;
|
|
2120
2118
|
}, {
|
|
2121
|
-
market_id: number;
|
|
2122
2119
|
bids: Record<string, {
|
|
2123
2120
|
nodes: {
|
|
2124
2121
|
order_id: bigint;
|
|
@@ -2144,7 +2141,6 @@ export declare const Schemas: {
|
|
|
2144
2141
|
min_lot_size: import("decimal.js").Decimal;
|
|
2145
2142
|
impact_margin: import("decimal.js").Decimal;
|
|
2146
2143
|
orderbook: {
|
|
2147
|
-
market_id: number;
|
|
2148
2144
|
bids: Map<string, {
|
|
2149
2145
|
nodes: {
|
|
2150
2146
|
order_id: bigint;
|
|
@@ -2170,7 +2166,6 @@ export declare const Schemas: {
|
|
|
2170
2166
|
min_lot_size: string | number;
|
|
2171
2167
|
impact_margin: string | number;
|
|
2172
2168
|
orderbook: {
|
|
2173
|
-
market_id: number;
|
|
2174
2169
|
bids: Record<string, {
|
|
2175
2170
|
nodes: {
|
|
2176
2171
|
order_id: bigint;
|
|
@@ -2199,7 +2194,6 @@ export declare const Schemas: {
|
|
|
2199
2194
|
quote_min_lot_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
2200
2195
|
max_orders_per_side: z.ZodNumber;
|
|
2201
2196
|
orderbook: z.ZodObject<{
|
|
2202
|
-
market_id: z.ZodNumber;
|
|
2203
2197
|
bids: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2204
2198
|
nodes: z.ZodArray<z.ZodObject<{
|
|
2205
2199
|
order_id: z.ZodBigInt;
|
|
@@ -2275,7 +2269,6 @@ export declare const Schemas: {
|
|
|
2275
2269
|
total_size: string | number;
|
|
2276
2270
|
}>>;
|
|
2277
2271
|
}, "strip", z.ZodTypeAny, {
|
|
2278
|
-
market_id: number;
|
|
2279
2272
|
bids: Map<string, {
|
|
2280
2273
|
nodes: {
|
|
2281
2274
|
order_id: bigint;
|
|
@@ -2291,7 +2284,6 @@ export declare const Schemas: {
|
|
|
2291
2284
|
total_size: import("decimal.js").Decimal;
|
|
2292
2285
|
}>;
|
|
2293
2286
|
}, {
|
|
2294
|
-
market_id: number;
|
|
2295
2287
|
bids: Record<string, {
|
|
2296
2288
|
nodes: {
|
|
2297
2289
|
order_id: bigint;
|
|
@@ -2314,7 +2306,6 @@ export declare const Schemas: {
|
|
|
2314
2306
|
market_id: number;
|
|
2315
2307
|
is_active: boolean;
|
|
2316
2308
|
orderbook: {
|
|
2317
|
-
market_id: number;
|
|
2318
2309
|
bids: Map<string, {
|
|
2319
2310
|
nodes: {
|
|
2320
2311
|
order_id: bigint;
|
|
@@ -2342,7 +2333,6 @@ export declare const Schemas: {
|
|
|
2342
2333
|
market_id: number;
|
|
2343
2334
|
is_active: boolean;
|
|
2344
2335
|
orderbook: {
|
|
2345
|
-
market_id: number;
|
|
2346
2336
|
bids: Record<string, {
|
|
2347
2337
|
nodes: {
|
|
2348
2338
|
order_id: bigint;
|
|
@@ -7090,7 +7080,6 @@ export declare const ResponseSchemas: {
|
|
|
7090
7080
|
min_lot_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
7091
7081
|
impact_margin: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
7092
7082
|
orderbook: z.ZodObject<{
|
|
7093
|
-
market_id: z.ZodNumber;
|
|
7094
7083
|
bids: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
7095
7084
|
nodes: z.ZodArray<z.ZodObject<{
|
|
7096
7085
|
order_id: z.ZodBigInt;
|
|
@@ -7166,7 +7155,6 @@ export declare const ResponseSchemas: {
|
|
|
7166
7155
|
total_size: string | number;
|
|
7167
7156
|
}>>;
|
|
7168
7157
|
}, "strip", z.ZodTypeAny, {
|
|
7169
|
-
market_id: number;
|
|
7170
7158
|
bids: Map<string, {
|
|
7171
7159
|
nodes: {
|
|
7172
7160
|
order_id: bigint;
|
|
@@ -7182,7 +7170,6 @@ export declare const ResponseSchemas: {
|
|
|
7182
7170
|
total_size: import("decimal.js").Decimal;
|
|
7183
7171
|
}>;
|
|
7184
7172
|
}, {
|
|
7185
|
-
market_id: number;
|
|
7186
7173
|
bids: Record<string, {
|
|
7187
7174
|
nodes: {
|
|
7188
7175
|
order_id: bigint;
|
|
@@ -7208,7 +7195,6 @@ export declare const ResponseSchemas: {
|
|
|
7208
7195
|
min_lot_size: import("decimal.js").Decimal;
|
|
7209
7196
|
impact_margin: import("decimal.js").Decimal;
|
|
7210
7197
|
orderbook: {
|
|
7211
|
-
market_id: number;
|
|
7212
7198
|
bids: Map<string, {
|
|
7213
7199
|
nodes: {
|
|
7214
7200
|
order_id: bigint;
|
|
@@ -7234,7 +7220,6 @@ export declare const ResponseSchemas: {
|
|
|
7234
7220
|
min_lot_size: string | number;
|
|
7235
7221
|
impact_margin: string | number;
|
|
7236
7222
|
orderbook: {
|
|
7237
|
-
market_id: number;
|
|
7238
7223
|
bids: Record<string, {
|
|
7239
7224
|
nodes: {
|
|
7240
7225
|
order_id: bigint;
|
|
@@ -7263,7 +7248,6 @@ export declare const ResponseSchemas: {
|
|
|
7263
7248
|
min_lot_size: import("decimal.js").Decimal;
|
|
7264
7249
|
impact_margin: import("decimal.js").Decimal;
|
|
7265
7250
|
orderbook: {
|
|
7266
|
-
market_id: number;
|
|
7267
7251
|
bids: Map<string, {
|
|
7268
7252
|
nodes: {
|
|
7269
7253
|
order_id: bigint;
|
|
@@ -7292,7 +7276,6 @@ export declare const ResponseSchemas: {
|
|
|
7292
7276
|
min_lot_size: string | number;
|
|
7293
7277
|
impact_margin: string | number;
|
|
7294
7278
|
orderbook: {
|
|
7295
|
-
market_id: number;
|
|
7296
7279
|
bids: Record<string, {
|
|
7297
7280
|
nodes: {
|
|
7298
7281
|
order_id: bigint;
|
|
@@ -7321,7 +7304,6 @@ export declare const ResponseSchemas: {
|
|
|
7321
7304
|
min_lot_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
7322
7305
|
impact_margin: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
7323
7306
|
orderbook: z.ZodObject<{
|
|
7324
|
-
market_id: z.ZodNumber;
|
|
7325
7307
|
bids: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
7326
7308
|
nodes: z.ZodArray<z.ZodObject<{
|
|
7327
7309
|
order_id: z.ZodBigInt;
|
|
@@ -7397,7 +7379,6 @@ export declare const ResponseSchemas: {
|
|
|
7397
7379
|
total_size: string | number;
|
|
7398
7380
|
}>>;
|
|
7399
7381
|
}, "strip", z.ZodTypeAny, {
|
|
7400
|
-
market_id: number;
|
|
7401
7382
|
bids: Map<string, {
|
|
7402
7383
|
nodes: {
|
|
7403
7384
|
order_id: bigint;
|
|
@@ -7413,7 +7394,6 @@ export declare const ResponseSchemas: {
|
|
|
7413
7394
|
total_size: import("decimal.js").Decimal;
|
|
7414
7395
|
}>;
|
|
7415
7396
|
}, {
|
|
7416
|
-
market_id: number;
|
|
7417
7397
|
bids: Record<string, {
|
|
7418
7398
|
nodes: {
|
|
7419
7399
|
order_id: bigint;
|
|
@@ -7439,7 +7419,6 @@ export declare const ResponseSchemas: {
|
|
|
7439
7419
|
min_lot_size: import("decimal.js").Decimal;
|
|
7440
7420
|
impact_margin: import("decimal.js").Decimal;
|
|
7441
7421
|
orderbook: {
|
|
7442
|
-
market_id: number;
|
|
7443
7422
|
bids: Map<string, {
|
|
7444
7423
|
nodes: {
|
|
7445
7424
|
order_id: bigint;
|
|
@@ -7465,7 +7444,6 @@ export declare const ResponseSchemas: {
|
|
|
7465
7444
|
min_lot_size: string | number;
|
|
7466
7445
|
impact_margin: string | number;
|
|
7467
7446
|
orderbook: {
|
|
7468
|
-
market_id: number;
|
|
7469
7447
|
bids: Record<string, {
|
|
7470
7448
|
nodes: {
|
|
7471
7449
|
order_id: bigint;
|
|
@@ -7491,7 +7469,6 @@ export declare const ResponseSchemas: {
|
|
|
7491
7469
|
min_lot_size: import("decimal.js").Decimal;
|
|
7492
7470
|
impact_margin: import("decimal.js").Decimal;
|
|
7493
7471
|
orderbook: {
|
|
7494
|
-
market_id: number;
|
|
7495
7472
|
bids: Map<string, {
|
|
7496
7473
|
nodes: {
|
|
7497
7474
|
order_id: bigint;
|
|
@@ -7517,7 +7494,6 @@ export declare const ResponseSchemas: {
|
|
|
7517
7494
|
min_lot_size: string | number;
|
|
7518
7495
|
impact_margin: string | number;
|
|
7519
7496
|
orderbook: {
|
|
7520
|
-
market_id: number;
|
|
7521
7497
|
bids: Record<string, {
|
|
7522
7498
|
nodes: {
|
|
7523
7499
|
order_id: bigint;
|
|
@@ -7546,7 +7522,6 @@ export declare const ResponseSchemas: {
|
|
|
7546
7522
|
min_lot_size: import("decimal.js").Decimal;
|
|
7547
7523
|
impact_margin: import("decimal.js").Decimal;
|
|
7548
7524
|
orderbook: {
|
|
7549
|
-
market_id: number;
|
|
7550
7525
|
bids: Map<string, {
|
|
7551
7526
|
nodes: {
|
|
7552
7527
|
order_id: bigint;
|
|
@@ -7575,7 +7550,6 @@ export declare const ResponseSchemas: {
|
|
|
7575
7550
|
min_lot_size: string | number;
|
|
7576
7551
|
impact_margin: string | number;
|
|
7577
7552
|
orderbook: {
|
|
7578
|
-
market_id: number;
|
|
7579
7553
|
bids: Record<string, {
|
|
7580
7554
|
nodes: {
|
|
7581
7555
|
order_id: bigint;
|
|
@@ -7608,7 +7582,6 @@ export declare const ResponseSchemas: {
|
|
|
7608
7582
|
quote_min_lot_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
7609
7583
|
max_orders_per_side: z.ZodNumber;
|
|
7610
7584
|
orderbook: z.ZodObject<{
|
|
7611
|
-
market_id: z.ZodNumber;
|
|
7612
7585
|
bids: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
7613
7586
|
nodes: z.ZodArray<z.ZodObject<{
|
|
7614
7587
|
order_id: z.ZodBigInt;
|
|
@@ -7684,7 +7657,6 @@ export declare const ResponseSchemas: {
|
|
|
7684
7657
|
total_size: string | number;
|
|
7685
7658
|
}>>;
|
|
7686
7659
|
}, "strip", z.ZodTypeAny, {
|
|
7687
|
-
market_id: number;
|
|
7688
7660
|
bids: Map<string, {
|
|
7689
7661
|
nodes: {
|
|
7690
7662
|
order_id: bigint;
|
|
@@ -7700,7 +7672,6 @@ export declare const ResponseSchemas: {
|
|
|
7700
7672
|
total_size: import("decimal.js").Decimal;
|
|
7701
7673
|
}>;
|
|
7702
7674
|
}, {
|
|
7703
|
-
market_id: number;
|
|
7704
7675
|
bids: Record<string, {
|
|
7705
7676
|
nodes: {
|
|
7706
7677
|
order_id: bigint;
|
|
@@ -7723,7 +7694,6 @@ export declare const ResponseSchemas: {
|
|
|
7723
7694
|
market_id: number;
|
|
7724
7695
|
is_active: boolean;
|
|
7725
7696
|
orderbook: {
|
|
7726
|
-
market_id: number;
|
|
7727
7697
|
bids: Map<string, {
|
|
7728
7698
|
nodes: {
|
|
7729
7699
|
order_id: bigint;
|
|
@@ -7751,7 +7721,6 @@ export declare const ResponseSchemas: {
|
|
|
7751
7721
|
market_id: number;
|
|
7752
7722
|
is_active: boolean;
|
|
7753
7723
|
orderbook: {
|
|
7754
|
-
market_id: number;
|
|
7755
7724
|
bids: Record<string, {
|
|
7756
7725
|
nodes: {
|
|
7757
7726
|
order_id: bigint;
|
|
@@ -7782,7 +7751,6 @@ export declare const ResponseSchemas: {
|
|
|
7782
7751
|
market_id: number;
|
|
7783
7752
|
is_active: boolean;
|
|
7784
7753
|
orderbook: {
|
|
7785
|
-
market_id: number;
|
|
7786
7754
|
bids: Map<string, {
|
|
7787
7755
|
nodes: {
|
|
7788
7756
|
order_id: bigint;
|
|
@@ -7813,7 +7781,6 @@ export declare const ResponseSchemas: {
|
|
|
7813
7781
|
market_id: number;
|
|
7814
7782
|
is_active: boolean;
|
|
7815
7783
|
orderbook: {
|
|
7816
|
-
market_id: number;
|
|
7817
7784
|
bids: Record<string, {
|
|
7818
7785
|
nodes: {
|
|
7819
7786
|
order_id: bigint;
|
|
@@ -7849,7 +7816,6 @@ export declare const ResponseSchemas: {
|
|
|
7849
7816
|
quote_min_lot_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
|
|
7850
7817
|
max_orders_per_side: z.ZodNumber;
|
|
7851
7818
|
orderbook: z.ZodObject<{
|
|
7852
|
-
market_id: z.ZodNumber;
|
|
7853
7819
|
bids: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
7854
7820
|
nodes: z.ZodArray<z.ZodObject<{
|
|
7855
7821
|
order_id: z.ZodBigInt;
|
|
@@ -7925,7 +7891,6 @@ export declare const ResponseSchemas: {
|
|
|
7925
7891
|
total_size: string | number;
|
|
7926
7892
|
}>>;
|
|
7927
7893
|
}, "strip", z.ZodTypeAny, {
|
|
7928
|
-
market_id: number;
|
|
7929
7894
|
bids: Map<string, {
|
|
7930
7895
|
nodes: {
|
|
7931
7896
|
order_id: bigint;
|
|
@@ -7941,7 +7906,6 @@ export declare const ResponseSchemas: {
|
|
|
7941
7906
|
total_size: import("decimal.js").Decimal;
|
|
7942
7907
|
}>;
|
|
7943
7908
|
}, {
|
|
7944
|
-
market_id: number;
|
|
7945
7909
|
bids: Record<string, {
|
|
7946
7910
|
nodes: {
|
|
7947
7911
|
order_id: bigint;
|
|
@@ -7964,7 +7928,6 @@ export declare const ResponseSchemas: {
|
|
|
7964
7928
|
market_id: number;
|
|
7965
7929
|
is_active: boolean;
|
|
7966
7930
|
orderbook: {
|
|
7967
|
-
market_id: number;
|
|
7968
7931
|
bids: Map<string, {
|
|
7969
7932
|
nodes: {
|
|
7970
7933
|
order_id: bigint;
|
|
@@ -7992,7 +7955,6 @@ export declare const ResponseSchemas: {
|
|
|
7992
7955
|
market_id: number;
|
|
7993
7956
|
is_active: boolean;
|
|
7994
7957
|
orderbook: {
|
|
7995
|
-
market_id: number;
|
|
7996
7958
|
bids: Record<string, {
|
|
7997
7959
|
nodes: {
|
|
7998
7960
|
order_id: bigint;
|
|
@@ -8020,7 +7982,6 @@ export declare const ResponseSchemas: {
|
|
|
8020
7982
|
market_id: number;
|
|
8021
7983
|
is_active: boolean;
|
|
8022
7984
|
orderbook: {
|
|
8023
|
-
market_id: number;
|
|
8024
7985
|
bids: Map<string, {
|
|
8025
7986
|
nodes: {
|
|
8026
7987
|
order_id: bigint;
|
|
@@ -8048,7 +8009,6 @@ export declare const ResponseSchemas: {
|
|
|
8048
8009
|
market_id: number;
|
|
8049
8010
|
is_active: boolean;
|
|
8050
8011
|
orderbook: {
|
|
8051
|
-
market_id: number;
|
|
8052
8012
|
bids: Record<string, {
|
|
8053
8013
|
nodes: {
|
|
8054
8014
|
order_id: bigint;
|
|
@@ -8079,7 +8039,6 @@ export declare const ResponseSchemas: {
|
|
|
8079
8039
|
market_id: number;
|
|
8080
8040
|
is_active: boolean;
|
|
8081
8041
|
orderbook: {
|
|
8082
|
-
market_id: number;
|
|
8083
8042
|
bids: Map<string, {
|
|
8084
8043
|
nodes: {
|
|
8085
8044
|
order_id: bigint;
|
|
@@ -8110,7 +8069,6 @@ export declare const ResponseSchemas: {
|
|
|
8110
8069
|
market_id: number;
|
|
8111
8070
|
is_active: boolean;
|
|
8112
8071
|
orderbook: {
|
|
8113
|
-
market_id: number;
|
|
8114
8072
|
bids: Record<string, {
|
|
8115
8073
|
nodes: {
|
|
8116
8074
|
order_id: bigint;
|
|
@@ -8387,7 +8345,7 @@ export declare const ResponseSchemas: {
|
|
|
8387
8345
|
export type DummyValue = z.infer<typeof Schemas.DummyValue>;
|
|
8388
8346
|
export type Order = z.infer<typeof Order>;
|
|
8389
8347
|
export type OrderbookL2 = z.infer<typeof Schemas.OrderbookL2>;
|
|
8390
|
-
export type
|
|
8348
|
+
export type PriceLevelL2 = z.infer<typeof PriceLevelL2>;
|
|
8391
8349
|
export type UserAccount = z.infer<typeof Schemas.UserAccount>;
|
|
8392
8350
|
export type OraclePrices = z.infer<typeof Schemas.OraclePrices>;
|
|
8393
8351
|
export type PerpPrices = z.infer<typeof Schemas.PerpPrices>;
|