@bulletxyz/bullet-sdk 0.26.0-rc.1 → 0.26.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.
@@ -15,7 +15,7 @@ export class BulletWasm {
15
15
  static calculate_account_leverage(user_account: any, margin_calculation_state: any): string;
16
16
  static calculate_available_margin(user_account: any, conservative: boolean, margin_type: MarginType, margin_calculation_state: any): string;
17
17
  static calculate_used_margin(user_account: any, withdrawal: boolean, margin_type: MarginType, margin_calculation_state: any): string;
18
- static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_calculation_state: any): string;
18
+ static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_calculation_state: any, asset_registry: any): string;
19
19
  static calculate_estimated_liquidation_price(user_account: any, market_id: number, base_asset_id: number, margin_calculation_state: any): string;
20
20
  static calculate_liquidation_risk_percentage(user_account: any, margin_calculation_state: any): string;
21
21
  static calculate_force_cancel_risk_percentage(user_account: any, margin_calculation_state: any): string;
@@ -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 BorrowLendMarkets, 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 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?;
@@ -37,7 +37,7 @@ export declare class ExchangeConnection extends BaseConnection {
37
37
  getPerpPrices(): Promise<PerpPrices | null>;
38
38
  getUsdcPnlPool(): Promise<UsdcPnlPool | null>;
39
39
  getUsdcInsuranceFund(): Promise<UsdcInsuranceFund | null>;
40
- getBorrowLendMarkets(): Promise<BorrowLendMarkets>;
40
+ getBorrowLendMarkets(): Promise<BorrowLendPools>;
41
41
  getPerpMarket(market: MarketName): Promise<PerpMarket>;
42
42
  getPerpMarkets(markets: MarketName[]): Promise<Map<number, PerpMarket>>;
43
43
  getMarginConfig(): Promise<MarginConfig | null>;
@@ -135,7 +135,7 @@ export declare class ExchangeConnection extends BaseConnection {
135
135
  liquidation_risk_percentage: Decimal;
136
136
  max_leverage_to_use: number;
137
137
  }>>;
138
- calculateBorrowLendMarketAdditionalMetadata(borrowLendMarkets: BorrowLendMarkets, asset: AssetName): Promise<{
138
+ calculateBorrowLendMarketAdditionalMetadata(borrowLendMarkets: BorrowLendPools, asset: AssetName): Promise<{
139
139
  utilisation_rate: Decimal;
140
140
  current_deposit_rate: Decimal;
141
141
  current_borrow_rate: Decimal;
@@ -55,27 +55,28 @@ type PendingTriggerOrderArgs = {
55
55
  pending_sl: TriggerOrderArgs | null;
56
56
  dynamic_size: boolean;
57
57
  };
58
- type PlacePositionTpslArgs = {
59
- tp: TriggerOrderArgs | null;
60
- sl: TriggerOrderArgs | null;
61
- size: number | null;
62
- };
63
58
  type ExchangeCallMessage = {
64
59
  set_value: number;
65
60
  deposit: {
66
- asset_id: AssetId;
67
- amount: number;
61
+ args: {
62
+ asset_id: AssetId;
63
+ amount: number;
64
+ };
68
65
  };
69
66
  withdraw: {
70
- asset_id: AssetId;
71
- amount: number;
67
+ args: {
68
+ asset_id: AssetId;
69
+ amount: number;
70
+ };
72
71
  };
73
72
  borrow_spot: {
74
- asset_id: AssetId;
75
- amount: number;
73
+ args: {
74
+ asset_id: AssetId;
75
+ amount: number;
76
+ };
76
77
  };
77
78
  place_order: {
78
- order_args: {
79
+ args: {
79
80
  market_id: MarketId;
80
81
  price: number;
81
82
  size: number;
@@ -88,12 +89,16 @@ type ExchangeCallMessage = {
88
89
  };
89
90
  create_position_tpsl: {
90
91
  market_id: MarketId;
91
- tpsl: PlacePositionTpslArgs;
92
+ args: {
93
+ tp: TriggerOrderArgs | null;
94
+ sl: TriggerOrderArgs | null;
95
+ size: number | null;
96
+ };
92
97
  };
93
98
  amend_order: {
94
99
  existing_order_id: string | null;
95
100
  existing_client_order_id: string | null;
96
- order_args: {
101
+ args: {
97
102
  market_id: MarketId;
98
103
  price: number;
99
104
  size: number;
@@ -107,9 +112,11 @@ type ExchangeCallMessage = {
107
112
  cancel_tpsl: {
108
113
  tpsl_order_id: string;
109
114
  };
110
- cancel_order: {
111
- order_id: string | null;
112
- client_order_id: string | null;
115
+ cancel_orders: {
116
+ args: {
117
+ order_id: string | null;
118
+ client_order_id: string | null;
119
+ }[];
113
120
  };
114
121
  cancel_all_orders_for_market: {
115
122
  market_id: MarketId;
@@ -136,7 +143,7 @@ type ExchangeCallMessage = {
136
143
  update_premium_indexes: {
137
144
  market_ids: MarketId[];
138
145
  };
139
- process_tpsl_buffer_for_market: {
146
+ process_tpsl_buffer: {
140
147
  market_id: MarketId;
141
148
  };
142
149
  update_funding: {