@bulletxyz/bullet-sdk 0.18.0-rc.0 → 0.18.0-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 +1454 -1463
- package/dist/browser/index.js.map +4 -4
- package/dist/node/index.js +1466 -1475
- package/dist/node/index.js.map +4 -4
- package/dist/types/bullet-wasm/index.d.ts +5 -10
- package/dist/types/calc.d.ts +2 -2
- package/dist/types/types.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export enum MarginType {
|
|
9
|
-
Initial = 0,
|
|
10
|
-
Maintenance = 1,
|
|
11
|
-
}
|
|
3
|
+
type EquityType = "Unweighted" | "WeightedInitial" | "WeightedMaintenance";
|
|
4
|
+
type MarginType = "Initial" | "Maintenance";
|
|
5
|
+
type OrderType = "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
|
|
6
|
+
type Side = "Bid" | "Ask";
|
|
12
7
|
export class BulletWasm {
|
|
13
8
|
free(): void;
|
|
14
9
|
constructor();
|
|
@@ -29,7 +24,7 @@ export class BulletWasm {
|
|
|
29
24
|
* @param initial_liability_weight The initial liability weight for the market must be passed in separately since the user may not have a spot ledger for this asset yet
|
|
30
25
|
*/
|
|
31
26
|
static calculate_max_borrow_amount(asset_id: number, initial_liability_weight: string, user_account: any, margin_context: any): string;
|
|
32
|
-
static calculate_max_order_size(
|
|
27
|
+
static calculate_max_order_size(asset_id: number, price: string, side: Side, order_type: OrderType, reduce_only: boolean, user_account: any, margin_context: any, maker_book: any, n_iterations: number, error_tolerance: string): string;
|
|
33
28
|
static simulate_used_margin_on_borrow(asset_id: number, borrow_amount: string, user_account: any, margin_type: MarginType, margin_context: any): any;
|
|
34
29
|
static simulate_used_margin_on_order(place_order_args: any, user_account: any, margin_context: any, maker_book: any): any;
|
|
35
30
|
static simulate_estimated_liquidation_price_on_order(place_order_args: any, user_account: any, margin_context: any, maker_book: any): any;
|
package/dist/types/calc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Decimal from "decimal.js";
|
|
2
2
|
import { type EquityType, type MarginType } from "./bullet-wasm";
|
|
3
|
-
import type { Asset, AssetId, PlaceOrderArgs } from "./types";
|
|
3
|
+
import type { Asset, AssetId, OrderType, PlaceOrderArgs, Side } from "./types";
|
|
4
4
|
import type { BorrowLendMarket, MarginConfig, OrderbookData, PerpMarket, Pricing, UserAccount } from "./zod-types/rest";
|
|
5
5
|
export declare function calculateOrderbookMidpoint(orderbook: OrderbookData): Decimal | undefined;
|
|
6
6
|
export declare function calculateEntryPrice(asset: Asset, userAccount: UserAccount): Decimal;
|
|
@@ -18,7 +18,7 @@ export declare function calculateEstimatedLiquidationPrice(assetId: AssetId, use
|
|
|
18
18
|
export declare function calculateLiquidationRiskPercentage(userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
19
19
|
export declare function calculateForceCancelRiskPercentage(userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
20
20
|
export declare function calculateMaxBorrowAmount(assetId: AssetId, initialLiabilityWeight: Decimal, userAccount: UserAccount, marginContext: MarginContext): Decimal;
|
|
21
|
-
export declare function calculateMaxOrderSize(
|
|
21
|
+
export declare function calculateMaxOrderSize(asset_id: AssetId, price: Decimal, side: Side, order_type: OrderType, reduce_only: boolean, userAccount: UserAccount, marginContext: MarginContext, orderbook: OrderbookData, n_iterations?: number, error_tolerance?: Decimal): Decimal;
|
|
22
22
|
export declare function simulateUsedMarginOnBorrow(assetId: AssetId, borrowAmount: Decimal, userAccount: UserAccount, marginType: MarginType, marginContext: MarginContext): {
|
|
23
23
|
current: Decimal;
|
|
24
24
|
updated: Decimal;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { MarginType, EquityType } from "./bullet-wasm";
|
|
2
1
|
import type Decimal from "decimal.js";
|
|
3
2
|
export type PrivateKey = string;
|
|
4
3
|
export type PublicKey = string;
|
|
@@ -29,6 +28,8 @@ export type Side = "Bid" | "Ask";
|
|
|
29
28
|
export type TriggerDirection = "GreaterThanOrEqual" | "LessThanOrEqual";
|
|
30
29
|
export type TpslPriceCondition = "Mark" | "Oracle" | "LastTrade";
|
|
31
30
|
export type OrderType = "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
|
|
31
|
+
export type MarginType = "Initial" | "Maintenance";
|
|
32
|
+
export type EquityType = "Unweighted" | "WeightedInitial" | "WeightedMaintenance";
|
|
32
33
|
export type Network = "Localnet" | "Staging" | "Testnet" | "Mainnet";
|
|
33
34
|
export type PlaceOrderArgs = {
|
|
34
35
|
asset_id: AssetId;
|