@bulletxyz/bullet-sdk 0.27.2-rc.3 → 0.27.2

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.
@@ -29,9 +29,9 @@ export declare class Client {
29
29
  private queue;
30
30
  private generationOverride;
31
31
  private constructor();
32
- static fromEndpoints(endpoints: Endpoints, wallet: Wallet, txOpts?: TransactionOpts, chainId?: number): Promise<Client>;
32
+ static fromEndpoints(endpoints: Endpoints, wallet: Wallet, txOpts?: TransactionOpts): Promise<Client>;
33
33
  static fromNetwork(network: Network, wallet: Wallet, txOpts?: TransactionOpts): Promise<Client>;
34
- static fromRestUrl(restUrl: string, wallet: Wallet, network: Network, txOpts?: TransactionOpts): Promise<Client>;
34
+ static fromRestUrl(restUrl: string, wallet: Wallet, txOpts?: TransactionOpts): Promise<Client>;
35
35
  setGenerationOverride(generation: (() => number) | undefined): void;
36
36
  getNonce(): Promise<import("@sovereign-sdk/web3").Dedup>;
37
37
  getTokenBalance(tokenId: string): Promise<bigint>;
@@ -24,5 +24,4 @@ export interface Endpoints {
24
24
  ws?: string;
25
25
  }
26
26
  export declare const NETWORKS: Record<Network, Endpoints>;
27
- export declare const CHAIN_IDS: Record<Network, number>;
28
27
  export declare const GLOBAL_DEFAULT_MAX_LEVERAGE = 1000;
@@ -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 { 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 Tpsl, 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?;
@@ -28,9 +27,11 @@ export declare class ExchangeConnection extends BaseConnection {
28
27
  getAssetId(asset: AssetName): number;
29
28
  getAssetName(assetId: number): AssetName;
30
29
  getMarketId(market: MarketName): number;
30
+ getMarketMeta(market: MarketName): MarketMetadata;
31
31
  getMarketName(marketId: number): string;
32
32
  getOrderbookL2(market: MarketName, levels?: number): Promise<OrderbookL2>;
33
33
  getOrderbookL2s(markets: MarketName[], levels?: number): Promise<Map<number, OrderbookL2>>;
34
+ getChainId(): Promise<number>;
34
35
  getUserAccountAddresses(offset?: number, limit?: number): Promise<AccountAddresses>;
35
36
  getUserAccount(address: Address): Promise<UserAccount>;
36
37
  getUserAccounts(addresses: Address[]): Promise<Map<string, UserAccount>>;
@@ -41,6 +42,8 @@ export declare class ExchangeConnection extends BaseConnection {
41
42
  getBorrowLendMarkets(): Promise<BorrowLendPools>;
42
43
  getPerpMarket(market: MarketName): Promise<PerpMarket>;
43
44
  getPerpMarkets(markets: MarketName[]): Promise<Map<number, PerpMarket>>;
45
+ getSpotMarket(market: MarketName): Promise<SpotMarket>;
46
+ getSpotMarkets(markets: MarketName[]): Promise<Map<number, SpotMarket>>;
44
47
  getMarginConfig(): Promise<MarginConfig | null>;
45
48
  getTpslOrderIdsToExecute(market: MarketName): Promise<TpslOrderIdsToExecute | null>;
46
49
  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: {
@@ -165,6 +177,9 @@ type ExchangeCallMessage = {
165
177
  process_perp_tpsl_buffer: {
166
178
  market_id: MarketId;
167
179
  };
180
+ process_spot_tpsl_buffer: {
181
+ market_id: MarketId;
182
+ };
168
183
  update_funding: {
169
184
  market_ids: MarketId[];
170
185
  };
@@ -227,6 +242,16 @@ type ExchangeCallMessage = {
227
242
  name: string;
228
243
  };
229
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
+ };
230
255
  init_perp_market: {
231
256
  args: {
232
257
  market_id: MarketId;
@@ -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;
@@ -3,8 +3,7 @@ import type { PrivateKey, PublicKey } from "../types";
3
3
  import { Wallet } from "./wallet";
4
4
  export declare class NodeWallet extends Wallet {
5
5
  private privateKey;
6
- chainId: number;
7
- constructor(privateKey: PrivateKey, publicKey: PublicKey, chainId?: number);
6
+ constructor(privateKey: PrivateKey, publicKey: PublicKey);
8
7
  static fromPrivateKeyBytes(privateKeyBytes: Uint8Array): Promise<NodeWallet>;
9
8
  static fromLocalSolanaWallet(filePath?: string): NodeWallet;
10
9
  static fromLocalSovWallet(filePath: string): Promise<NodeWallet>;
@@ -3,7 +3,6 @@ import type { Address, PublicKey } from "../types";
3
3
  export declare abstract class Wallet {
4
4
  address: Address;
5
5
  publicKey: PublicKey;
6
- chainId: number;
7
- constructor(publicKey: PublicKey, chainId?: number);
6
+ constructor(publicKey: PublicKey);
8
7
  abstract getSigner(): Signer;
9
8
  }