@bulletxyz/bullet-sdk 0.16.1-rc.3 → 0.17.3-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 +132 -32
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +132 -32
- package/dist/node/index.js.map +2 -2
- package/dist/types/browser.d.ts +1 -0
- package/dist/types/calc.d.ts +13 -1
- package/dist/types/exchange.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/zod-types/index.d.ts +2 -1
- package/dist/types/zod-types/rest.d.ts +334 -493
- package/dist/types/zod-types/wasm.d.ts +44 -0
- package/package.json +1 -1
package/dist/types/browser.d.ts
CHANGED
package/dist/types/calc.d.ts
CHANGED
|
@@ -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
|
+
};
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
17
|
-
|
|
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>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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
|
|
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 {};
|