@bulletxyz/bullet-sdk 0.27.0-rc.5 → 0.27.1-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.
- package/dist/browser/index.js +148 -56
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +148 -56
- package/dist/node/index.js.map +2 -2
- package/dist/types/client.d.ts +4 -0
- package/dist/types/connection.d.ts +0 -1
- package/dist/types/exchange.d.ts +6 -3
- package/dist/types/rollupTypes.d.ts +31 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/types/zod-types/rest.d.ts +683 -21
- package/package.json +1 -1
package/dist/types/client.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export declare class Client {
|
|
|
56
56
|
side: "Bid" | "Ask";
|
|
57
57
|
market_id: number;
|
|
58
58
|
order_id: bigint;
|
|
59
|
+
client_order_id: bigint | null;
|
|
59
60
|
price: Decimal;
|
|
60
61
|
remaining_size: Decimal;
|
|
61
62
|
reduce_only: boolean;
|
|
@@ -113,6 +114,7 @@ export declare class Client {
|
|
|
113
114
|
side: "Bid" | "Ask";
|
|
114
115
|
market_id: number;
|
|
115
116
|
order_id: bigint;
|
|
117
|
+
client_order_id: bigint | null;
|
|
116
118
|
price: Decimal;
|
|
117
119
|
remaining_size: Decimal;
|
|
118
120
|
reduce_only: boolean;
|
|
@@ -167,6 +169,8 @@ export declare class Client {
|
|
|
167
169
|
amendOrder(options: AmendOrderOptions): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
168
170
|
cancelTpsls(tpslOrderIds: bigint[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
169
171
|
cancelOrder(orderId?: bigint, clientOrderId?: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
172
|
+
adminCancelOrders(address: Address, market: MarketName, orderId: string): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
173
|
+
adminCancelTpsls(address: Address, market: MarketName, tpslOrderId: string): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
170
174
|
cancelAllOrdersForMarket(market: MarketName): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
171
175
|
updateOraclePrices(pricesToUpdate: OraclePriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
172
176
|
updateMarkPrices(pricesToUpdate: MarkPriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
@@ -6,7 +6,6 @@ export declare class BaseConnection {
|
|
|
6
6
|
protected fetchBulkApiResource<T>(path: string, body: Record<string, unknown>, params?: Record<string, string>): Promise<T>;
|
|
7
7
|
}
|
|
8
8
|
export declare class Connection extends BaseConnection {
|
|
9
|
-
getNonce(address: Address): Promise<number>;
|
|
10
9
|
getTokenBalance(address: Address, token_id: TokenId): Promise<bigint>;
|
|
11
10
|
getTotalSupply(token_id: TokenId): Promise<bigint>;
|
|
12
11
|
}
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -3,9 +3,8 @@ import { type EquityType, type MarginType } from "./bullet-wasm";
|
|
|
3
3
|
import { BaseConnection } from "./connection";
|
|
4
4
|
import { type Endpoints } from "./constants";
|
|
5
5
|
import type { Orderbook } from "./orderbook";
|
|
6
|
-
import type { Address, AssetName, MarketName, Network } from "./types";
|
|
7
|
-
import type
|
|
8
|
-
import { type AccountAddresses, type AssetRegistry, type BorrowLendPools, type GlobalParameters, type MarginConfig, type MarketRegistry, type OraclePrices, type Order, type OrderbookL2, type PerpMarket, type PerpPrices, type TpslOrderIdsToExecute, type UsdcInsuranceFund, type UsdcPnlPool, type UserAccount } from "./zod-types/rest";
|
|
6
|
+
import type { Address, AssetName, MarketMetadata, MarketName, Network, OrderType, PlaceOrderArgs, Side } from "./types";
|
|
7
|
+
import { type AccountAddresses, type AssetRegistry, type BorrowLendPools, type GlobalParameters, type MarginConfig, type MarketRegistry, type OraclePrices, type Order, type OrderbookL2, type PerpMarket, type PerpPrices, type SpotMarket, type Tpsl, type TpslOrderIdsToExecute, type UsdcInsuranceFund, type UsdcPnlPool, type UserAccount } from "./zod-types/rest";
|
|
9
8
|
export declare class ExchangeConnection extends BaseConnection {
|
|
10
9
|
private wsManager?;
|
|
11
10
|
private assetRegistry?;
|
|
@@ -20,6 +19,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
20
19
|
private initializeAssetRegistry;
|
|
21
20
|
private initializeMarketRegistry;
|
|
22
21
|
getOrder(orderId: bigint): Promise<Order | null>;
|
|
22
|
+
getTpslOrder(tpslOrderId: bigint): Promise<Tpsl | null>;
|
|
23
23
|
getMarketRegistry(): Promise<MarketRegistry | null>;
|
|
24
24
|
getAssetRegistry(): Promise<AssetRegistry | null>;
|
|
25
25
|
private getAssetMapping;
|
|
@@ -27,6 +27,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
27
27
|
getAssetId(asset: AssetName): number;
|
|
28
28
|
getAssetName(assetId: number): AssetName;
|
|
29
29
|
getMarketId(market: MarketName): number;
|
|
30
|
+
getMarketMeta(market: MarketName): MarketMetadata;
|
|
30
31
|
getMarketName(marketId: number): string;
|
|
31
32
|
getOrderbookL2(market: MarketName, levels?: number): Promise<OrderbookL2>;
|
|
32
33
|
getOrderbookL2s(markets: MarketName[], levels?: number): Promise<Map<number, OrderbookL2>>;
|
|
@@ -40,6 +41,8 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
40
41
|
getBorrowLendMarkets(): Promise<BorrowLendPools>;
|
|
41
42
|
getPerpMarket(market: MarketName): Promise<PerpMarket>;
|
|
42
43
|
getPerpMarkets(markets: MarketName[]): Promise<Map<number, PerpMarket>>;
|
|
44
|
+
getSpotMarket(market: MarketName): Promise<SpotMarket>;
|
|
45
|
+
getSpotMarkets(markets: MarketName[]): Promise<Map<number, SpotMarket>>;
|
|
43
46
|
getMarginConfig(): Promise<MarginConfig | null>;
|
|
44
47
|
getTpslOrderIdsToExecute(market: MarketName): Promise<TpslOrderIdsToExecute | null>;
|
|
45
48
|
getGlobalParameters(): Promise<GlobalParameters | null>;
|
|
@@ -100,6 +100,18 @@ type ExchangeCallMessage = {
|
|
|
100
100
|
tpsl: PendingTriggerOrderArgs | null;
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
|
+
place_spot_order: {
|
|
104
|
+
args: {
|
|
105
|
+
market_id: MarketId;
|
|
106
|
+
price: number;
|
|
107
|
+
size: number;
|
|
108
|
+
side: string;
|
|
109
|
+
order_type: string;
|
|
110
|
+
reduce_only: boolean;
|
|
111
|
+
client_order_id: string | null;
|
|
112
|
+
tpsl: PendingTriggerOrderArgs | null;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
103
115
|
create_position_tpsl: {
|
|
104
116
|
market_id: MarketId;
|
|
105
117
|
args: {
|
|
@@ -131,6 +143,12 @@ type ExchangeCallMessage = {
|
|
|
131
143
|
client_order_id: string | null;
|
|
132
144
|
}[];
|
|
133
145
|
};
|
|
146
|
+
admin_cancel_orders: {
|
|
147
|
+
args: [Address, MarketId, string][];
|
|
148
|
+
};
|
|
149
|
+
admin_cancel_tpsls: {
|
|
150
|
+
args: [Address, MarketId, string][];
|
|
151
|
+
};
|
|
134
152
|
cancel_all_orders_for_market: {
|
|
135
153
|
market_id: MarketId;
|
|
136
154
|
};
|
|
@@ -159,6 +177,9 @@ type ExchangeCallMessage = {
|
|
|
159
177
|
process_perp_tpsl_buffer: {
|
|
160
178
|
market_id: MarketId;
|
|
161
179
|
};
|
|
180
|
+
process_spot_tpsl_buffer: {
|
|
181
|
+
market_id: MarketId;
|
|
182
|
+
};
|
|
162
183
|
update_funding: {
|
|
163
184
|
market_ids: MarketId[];
|
|
164
185
|
};
|
|
@@ -221,6 +242,16 @@ type ExchangeCallMessage = {
|
|
|
221
242
|
name: string;
|
|
222
243
|
};
|
|
223
244
|
};
|
|
245
|
+
update_spot_market: {
|
|
246
|
+
args: {
|
|
247
|
+
market_id: MarketId;
|
|
248
|
+
base_min_lot_size: number | null;
|
|
249
|
+
quote_min_lot_size: number | null;
|
|
250
|
+
max_orders_per_side: number | null;
|
|
251
|
+
taker_fees_tenth_bps: number[] | null;
|
|
252
|
+
maker_fees_tenth_bps: number[] | null;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
224
255
|
init_perp_market: {
|
|
225
256
|
args: {
|
|
226
257
|
market_id: MarketId;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -60,6 +60,12 @@ export type PlacePositionTpslArgs = {
|
|
|
60
60
|
sl?: TriggerOrderArgs;
|
|
61
61
|
size?: Decimal;
|
|
62
62
|
};
|
|
63
|
+
export type MarketMetadata = {
|
|
64
|
+
id: number;
|
|
65
|
+
kind: string;
|
|
66
|
+
baseAssetId: number;
|
|
67
|
+
name: string;
|
|
68
|
+
};
|
|
63
69
|
export declare class BulletError extends Error {
|
|
64
70
|
originalError?: Error | undefined;
|
|
65
71
|
code: string;
|