@bulletxyz/bullet-sdk 0.27.1 → 0.27.2-rc.1
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 +42 -16
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +42 -16
- package/dist/node/index.js.map +2 -2
- package/dist/types/client.d.ts +5 -2
- package/dist/types/connection.d.ts +0 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/exchange.d.ts +2 -1
- package/dist/types/rollupTypes.d.ts +6 -0
- package/dist/types/zod-types/rest.d.ts +155 -7
- package/package.json +1 -1
package/dist/types/client.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export interface TransactionOpts {
|
|
|
10
10
|
maxPriorityFeeBps: number;
|
|
11
11
|
maxFee: string;
|
|
12
12
|
gasLimit: number[] | null;
|
|
13
|
-
chainId: number;
|
|
14
13
|
}
|
|
15
14
|
type AmendOrderOptions = {
|
|
16
15
|
existingOrderId: bigint;
|
|
@@ -30,7 +29,7 @@ export declare class Client {
|
|
|
30
29
|
private queue;
|
|
31
30
|
private generationOverride;
|
|
32
31
|
private constructor();
|
|
33
|
-
static fromEndpoints(endpoints: Endpoints, wallet: Wallet, txOpts?: TransactionOpts): Promise<Client>;
|
|
32
|
+
static fromEndpoints(endpoints: Endpoints, wallet: Wallet, txOpts?: TransactionOpts, chainId?: number): Promise<Client>;
|
|
34
33
|
static fromNetwork(network: Network, wallet: Wallet, txOpts?: TransactionOpts): Promise<Client>;
|
|
35
34
|
static fromRestUrl(restUrl: string, wallet: Wallet, txOpts?: TransactionOpts): Promise<Client>;
|
|
36
35
|
setGenerationOverride(generation: (() => number) | undefined): void;
|
|
@@ -56,6 +55,7 @@ export declare class Client {
|
|
|
56
55
|
side: "Bid" | "Ask";
|
|
57
56
|
market_id: number;
|
|
58
57
|
order_id: bigint;
|
|
58
|
+
client_order_id: bigint | null;
|
|
59
59
|
price: Decimal;
|
|
60
60
|
remaining_size: Decimal;
|
|
61
61
|
reduce_only: boolean;
|
|
@@ -113,6 +113,7 @@ export declare class Client {
|
|
|
113
113
|
side: "Bid" | "Ask";
|
|
114
114
|
market_id: number;
|
|
115
115
|
order_id: bigint;
|
|
116
|
+
client_order_id: bigint | null;
|
|
116
117
|
price: Decimal;
|
|
117
118
|
remaining_size: Decimal;
|
|
118
119
|
reduce_only: boolean;
|
|
@@ -167,6 +168,8 @@ export declare class Client {
|
|
|
167
168
|
amendOrder(options: AmendOrderOptions): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
168
169
|
cancelTpsls(tpslOrderIds: bigint[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
169
170
|
cancelOrder(orderId?: bigint, clientOrderId?: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
171
|
+
adminCancelOrders(address: Address, market: MarketName, orderId: string): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
172
|
+
adminCancelTpsls(address: Address, market: MarketName, tpslOrderId: string): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
170
173
|
cancelAllOrdersForMarket(market: MarketName): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
171
174
|
updateOraclePrices(pricesToUpdate: OraclePriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
172
175
|
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
|
@@ -5,7 +5,7 @@ import { type Endpoints } from "./constants";
|
|
|
5
5
|
import type { Orderbook } from "./orderbook";
|
|
6
6
|
import type { Address, AssetName, MarketName, Network } from "./types";
|
|
7
7
|
import type { OrderType, PlaceOrderArgs, Side } from "./types";
|
|
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";
|
|
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 Tpsl, type TpslOrderIdsToExecute, type UsdcInsuranceFund, type UsdcPnlPool, type UserAccount } from "./zod-types/rest";
|
|
9
9
|
export declare class ExchangeConnection extends BaseConnection {
|
|
10
10
|
private wsManager?;
|
|
11
11
|
private assetRegistry?;
|
|
@@ -20,6 +20,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
20
20
|
private initializeAssetRegistry;
|
|
21
21
|
private initializeMarketRegistry;
|
|
22
22
|
getOrder(orderId: bigint): Promise<Order | null>;
|
|
23
|
+
getTpslOrder(tpslOrderId: bigint): Promise<Tpsl | null>;
|
|
23
24
|
getMarketRegistry(): Promise<MarketRegistry | null>;
|
|
24
25
|
getAssetRegistry(): Promise<AssetRegistry | null>;
|
|
25
26
|
private getAssetMapping;
|
|
@@ -131,6 +131,12 @@ type ExchangeCallMessage = {
|
|
|
131
131
|
client_order_id: string | null;
|
|
132
132
|
}[];
|
|
133
133
|
};
|
|
134
|
+
admin_cancel_orders: {
|
|
135
|
+
args: [Address, MarketId, string][];
|
|
136
|
+
};
|
|
137
|
+
admin_cancel_tpsls: {
|
|
138
|
+
args: [Address, MarketId, string][];
|
|
139
|
+
};
|
|
134
140
|
cancel_all_orders_for_market: {
|
|
135
141
|
market_id: MarketId;
|
|
136
142
|
};
|