@bulletxyz/bullet-sdk 0.16.1-rc.3 → 0.17.3-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.
@@ -9,4 +9,5 @@ export * from "./zod-types/wasm";
9
9
  export * from "./constants";
10
10
  export * from "./calc";
11
11
  export * from "./error";
12
+ export { MarginType, EquityType } from "./bullet-wasm";
12
13
  export { Wallet } from "./wallet";
@@ -1,5 +1,5 @@
1
1
  import { Asset, AssetId, Side } from "./types";
2
- import { MarginConfig, OrderbookData, Pricing, UserAccount } from "./zod-types/rest";
2
+ import { BorrowLendMarket, MarginConfig, OrderbookData, PerpMarket, Pricing, UserAccount } from "./zod-types/rest";
3
3
  import { EquityType, MarginType } from "./bullet-wasm";
4
4
  import Decimal from "decimal.js";
5
5
  export declare function calculateOrderbookMidpoint(orderbook: OrderbookData): Decimal | undefined;
@@ -22,3 +22,15 @@ export declare function simulateUsedMarginOnBorrow(assetId: AssetId, borrowAmoun
22
22
  current: Decimal;
23
23
  new: Decimal;
24
24
  };
25
+ export declare function calculatePositionsAdditionalMetadata(userAccount: UserAccount, marginContext: MarginContext, perpMarkets: Map<Asset, PerpMarket>): Map<number, {
26
+ projected_funding_payment: Decimal;
27
+ unrealized_pnl: Decimal;
28
+ liquidation_price: Decimal;
29
+ liquidation_risk_percentage: Decimal;
30
+ max_leverage_to_use: number;
31
+ }>;
32
+ export declare function calculateBorrowLendMarketAdditionalMetadata(borrowLendMarket: BorrowLendMarket): {
33
+ utilisation_rate: Decimal;
34
+ current_deposit_rate: Decimal;
35
+ current_borrow_rate: Decimal;
36
+ };
@@ -1,7 +1,7 @@
1
1
  import { BaseConnection } from "./connection";
2
2
  import { Orderbook } from "./orderbook";
3
3
  import { AssetId, Network } from "./types";
4
- import { Order, OrderbookData, EnrichedBorrowLendMarket, Pricing, PerpMarket, MarginConfig, UsdcPnlPool, UsdcInsuranceFund, UserAccount } from "./zod-types/rest";
4
+ import { Order, OrderbookData, BorrowLendMarket, Pricing, PerpMarket, MarginConfig, UsdcPnlPool, UsdcInsuranceFund, UserAccount } from "./zod-types/rest";
5
5
  export declare class ExchangeConnection extends BaseConnection {
6
6
  private wsManager;
7
7
  constructor(network: Network);
@@ -13,8 +13,8 @@ export declare class ExchangeConnection extends BaseConnection {
13
13
  getPricing(): Promise<Pricing | null>;
14
14
  getUsdcPnlPool(): Promise<UsdcPnlPool | null>;
15
15
  getUsdcInsuranceFund(): Promise<UsdcInsuranceFund | null>;
16
- getEnrichedBorrowLendMarket(asset_id: number): Promise<EnrichedBorrowLendMarket | null>;
17
- getPerpMarket(asset_id: number): Promise<PerpMarket | null>;
16
+ getBorrowLendMarkets(asset_ids: AssetId[]): Promise<Map<AssetId, BorrowLendMarket>>;
17
+ getPerpMarkets(asset_ids: AssetId[]): Promise<Map<AssetId, PerpMarket>>;
18
18
  getMarginConfig(): Promise<MarginConfig | null>;
19
19
  getPerpAssets(): Promise<Map<AssetId, string>>;
20
20
  getBorrowLendAssets(): Promise<Map<AssetId, string>>;
@@ -11,3 +11,4 @@ export * from "./constants";
11
11
  export * from "./wallet/nodeWallet";
12
12
  export * from "./calc";
13
13
  export * from "./error";
14
+ export { MarginType, EquityType } from "./bullet-wasm";
@@ -12,5 +12,6 @@ export declare const OrderId: z.ZodBigInt;
12
12
  export declare const Amount: z.ZodBigInt;
13
13
  export declare const UnixTimestampMillis: z.ZodBigInt;
14
14
  type MapKeySchema = z.ZodString | z.ZodNumber | z.ZodUnknown;
15
- export declare const createJsonMap: <K extends MapKeySchema, V extends z.ZodTypeAny>(keySchema: K, valueSchema: V) => z.ZodEffects<z.ZodRecord<z.ZodString, V>, Map<z.infer<K>, z.infer<V>>>;
15
+ export declare const createJsonMap: <K extends MapKeySchema, V extends z.ZodTypeAny, KeyType = z.infer<K>, // Explicitly infer key type
16
+ ValueType = z.infer<V>>(keySchema: K, valueSchema: V) => z.ZodEffects<z.ZodRecord<z.ZodString, V>, Map<KeyType, ValueType>, Record<string, V["_input"]>>;
16
17
  export {};