@bulletxyz/bullet-sdk 0.26.2 → 0.26.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 +14 -16
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +14 -16
- package/dist/node/index.js.map +2 -2
- package/dist/types/client.d.ts +1 -1
- package/dist/types/exchange.d.ts +16 -16
- package/dist/types/rollupTypes.d.ts +2 -2
- package/dist/types/types.d.ts +0 -1
- package/dist/types/zod-types/rest.d.ts +0 -16
- package/package.json +1 -1
package/dist/types/client.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ export declare class Client {
|
|
|
165
165
|
placeOrder(placeOrderArgs: PlaceOrderArgs): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
166
166
|
createPositionTpsl(market: MarketName, tpslOrders: PlacePositionTpslArgs): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
167
167
|
amendOrder(options: AmendOrderOptions): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
168
|
-
|
|
168
|
+
cancelTpsls(tpslOrderIds: bigint[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
169
169
|
cancelOrder(orderId?: bigint, clientOrderId?: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
170
170
|
cancelAllOrdersForMarket(market: MarketName): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
171
171
|
updateOraclePrices(pricesToUpdate: OraclePriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
44
44
|
getTpslOrderIdsToExecute(market: MarketName): Promise<TpslOrderIdsToExecute | null>;
|
|
45
45
|
getGlobalParameters(): Promise<GlobalParameters | null>;
|
|
46
46
|
calculateOrderbookMidpoint(orderbook: OrderbookL2): Decimal | undefined;
|
|
47
|
-
calculateEntryPrice(market: MarketName, userAccount: UserAccount):
|
|
47
|
+
calculateEntryPrice(market: MarketName, userAccount: UserAccount): Decimal;
|
|
48
48
|
calculateTotalPerpUnrealizedPnl(userAccount: UserAccount, MarginCalculationState: {
|
|
49
49
|
oracle_prices: OraclePrices;
|
|
50
50
|
perp_prices: PerpPrices;
|
|
@@ -79,7 +79,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
79
79
|
oracle_prices: OraclePrices;
|
|
80
80
|
perp_prices: PerpPrices;
|
|
81
81
|
margin_config: MarginConfig;
|
|
82
|
-
}):
|
|
82
|
+
}): Decimal;
|
|
83
83
|
calculateLiquidationRiskPercentage(userAccount: UserAccount, MarginCalculationState: {
|
|
84
84
|
oracle_prices: OraclePrices;
|
|
85
85
|
perp_prices: PerpPrices;
|
|
@@ -94,64 +94,64 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
94
94
|
oracle_prices: OraclePrices;
|
|
95
95
|
perp_prices: PerpPrices;
|
|
96
96
|
margin_config: MarginConfig;
|
|
97
|
-
}):
|
|
97
|
+
}): Decimal;
|
|
98
98
|
calculateMaxOrderSize(market: MarketName, price: Decimal, side: Side, order_type: OrderType, reduce_only: boolean, userAccount: UserAccount, MarginCalculationState: {
|
|
99
99
|
oracle_prices: OraclePrices;
|
|
100
100
|
perp_prices: PerpPrices;
|
|
101
101
|
margin_config: MarginConfig;
|
|
102
|
-
}, orderbook: OrderbookL2, n_iterations?: number, error_tolerance?: Decimal):
|
|
102
|
+
}, orderbook: OrderbookL2, n_iterations?: number, error_tolerance?: Decimal): Decimal;
|
|
103
103
|
simulateUsedMarginOnBorrow(asset: AssetName, borrowAmount: Decimal, userAccount: UserAccount, marginType: MarginType, MarginCalculationState: {
|
|
104
104
|
oracle_prices: OraclePrices;
|
|
105
105
|
perp_prices: PerpPrices;
|
|
106
106
|
margin_config: MarginConfig;
|
|
107
|
-
}):
|
|
107
|
+
}): {
|
|
108
108
|
current: Decimal;
|
|
109
109
|
updated: Decimal;
|
|
110
|
-
}
|
|
110
|
+
};
|
|
111
111
|
simulateUsedMarginOnOrder(placeOrderArgs: PlaceOrderArgs, userAccount: UserAccount, MarginCalculationState: {
|
|
112
112
|
oracle_prices: OraclePrices;
|
|
113
113
|
perp_prices: PerpPrices;
|
|
114
114
|
margin_config: MarginConfig;
|
|
115
|
-
}, orderbook: OrderbookL2):
|
|
115
|
+
}, orderbook: OrderbookL2): {
|
|
116
116
|
current: Decimal;
|
|
117
117
|
updated: Decimal;
|
|
118
|
-
}
|
|
118
|
+
};
|
|
119
119
|
simulateEstimatedLiquidationPriceOnOrder(placeOrderArgs: PlaceOrderArgs, baseAsset: AssetName, userAccount: UserAccount, MarginCalculationState: {
|
|
120
120
|
oracle_prices: OraclePrices;
|
|
121
121
|
perp_prices: PerpPrices;
|
|
122
122
|
margin_config: MarginConfig;
|
|
123
|
-
}, orderbook: OrderbookL2):
|
|
123
|
+
}, orderbook: OrderbookL2): {
|
|
124
124
|
current: Decimal;
|
|
125
125
|
updated: Decimal;
|
|
126
|
-
}
|
|
126
|
+
};
|
|
127
127
|
calculatePositionsAdditionalMetadata(userAccount: UserAccount, MarginCalculationState: {
|
|
128
128
|
oracle_prices: OraclePrices;
|
|
129
129
|
perp_prices: PerpPrices;
|
|
130
130
|
margin_config: MarginConfig;
|
|
131
|
-
}):
|
|
131
|
+
}): Map<number, {
|
|
132
132
|
projected_funding_payment: Decimal;
|
|
133
133
|
unrealized_pnl: Decimal;
|
|
134
134
|
liquidation_price: Decimal;
|
|
135
135
|
liquidation_risk_percentage: Decimal;
|
|
136
136
|
max_leverage_to_use: number;
|
|
137
|
-
}
|
|
138
|
-
calculateBorrowLendMarketAdditionalMetadata(borrowLendMarkets: BorrowLendPools, asset: AssetName):
|
|
137
|
+
}>;
|
|
138
|
+
calculateBorrowLendMarketAdditionalMetadata(borrowLendMarkets: BorrowLendPools, asset: AssetName): {
|
|
139
139
|
utilisation_rate: Decimal;
|
|
140
140
|
current_deposit_rate: Decimal;
|
|
141
141
|
current_borrow_rate: Decimal;
|
|
142
|
-
}
|
|
142
|
+
};
|
|
143
143
|
calculateAccountSummaryBatch(userAccounts: UserAccount[], MarginCalculationState: {
|
|
144
144
|
oracle_prices: OraclePrices;
|
|
145
145
|
perp_prices: PerpPrices;
|
|
146
146
|
margin_config: MarginConfig;
|
|
147
|
-
}, useWeightedEquity?: boolean):
|
|
147
|
+
}, useWeightedEquity?: boolean): {
|
|
148
148
|
address: string;
|
|
149
149
|
unrealized_pnl: Decimal;
|
|
150
150
|
equity: Decimal;
|
|
151
151
|
available_initial_margin: Decimal;
|
|
152
152
|
available_maintenance_margin: Decimal;
|
|
153
153
|
leverage: Decimal;
|
|
154
|
-
}[]
|
|
154
|
+
}[];
|
|
155
155
|
private getWebSocketManager;
|
|
156
156
|
subscribeOrderbook(market: MarketName): AsyncIterable<Orderbook>;
|
|
157
157
|
unsubscribeOrderbook(market: MarketName): Promise<void>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export type AssetId = number;
|
|
|
9
9
|
export type MarketId = number;
|
|
10
10
|
export type OrderId = bigint;
|
|
11
11
|
export type ClientOrderId = bigint;
|
|
12
|
-
export type MarketKind = "Perp" | "Spot";
|
|
13
12
|
export type Side = "Bid" | "Ask";
|
|
14
13
|
export type TriggerDirection = "GreaterThanOrEqual" | "LessThanOrEqual";
|
|
15
14
|
export type TpslPriceCondition = "Mark" | "Oracle" | "LastTrade";
|
|
@@ -2186,42 +2186,35 @@ export declare const Schemas: {
|
|
|
2186
2186
|
readonly MarketRegistry: z.ZodObject<{
|
|
2187
2187
|
metas: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2188
2188
|
id: z.ZodNumber;
|
|
2189
|
-
kind: z.ZodEnum<["Perp", "Spot"]>;
|
|
2190
2189
|
base_asset_id: z.ZodNumber;
|
|
2191
2190
|
name: z.ZodString;
|
|
2192
2191
|
}, "strip", z.ZodTypeAny, {
|
|
2193
2192
|
id: number;
|
|
2194
2193
|
name: string;
|
|
2195
|
-
kind: "Perp" | "Spot";
|
|
2196
2194
|
base_asset_id: number;
|
|
2197
2195
|
}, {
|
|
2198
2196
|
id: number;
|
|
2199
2197
|
name: string;
|
|
2200
|
-
kind: "Perp" | "Spot";
|
|
2201
2198
|
base_asset_id: number;
|
|
2202
2199
|
}>>, Map<number, {
|
|
2203
2200
|
id: number;
|
|
2204
2201
|
name: string;
|
|
2205
|
-
kind: "Perp" | "Spot";
|
|
2206
2202
|
base_asset_id: number;
|
|
2207
2203
|
}>, Record<string, {
|
|
2208
2204
|
id: number;
|
|
2209
2205
|
name: string;
|
|
2210
|
-
kind: "Perp" | "Spot";
|
|
2211
2206
|
base_asset_id: number;
|
|
2212
2207
|
}>>;
|
|
2213
2208
|
}, "strip", z.ZodTypeAny, {
|
|
2214
2209
|
metas: Map<number, {
|
|
2215
2210
|
id: number;
|
|
2216
2211
|
name: string;
|
|
2217
|
-
kind: "Perp" | "Spot";
|
|
2218
2212
|
base_asset_id: number;
|
|
2219
2213
|
}>;
|
|
2220
2214
|
}, {
|
|
2221
2215
|
metas: Record<string, {
|
|
2222
2216
|
id: number;
|
|
2223
2217
|
name: string;
|
|
2224
|
-
kind: "Perp" | "Spot";
|
|
2225
2218
|
base_asset_id: number;
|
|
2226
2219
|
}>;
|
|
2227
2220
|
}>;
|
|
@@ -2914,42 +2907,35 @@ export declare const ResponseSchemas: {
|
|
|
2914
2907
|
value: z.ZodNullable<z.ZodObject<{
|
|
2915
2908
|
metas: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2916
2909
|
id: z.ZodNumber;
|
|
2917
|
-
kind: z.ZodEnum<["Perp", "Spot"]>;
|
|
2918
2910
|
base_asset_id: z.ZodNumber;
|
|
2919
2911
|
name: z.ZodString;
|
|
2920
2912
|
}, "strip", z.ZodTypeAny, {
|
|
2921
2913
|
id: number;
|
|
2922
2914
|
name: string;
|
|
2923
|
-
kind: "Perp" | "Spot";
|
|
2924
2915
|
base_asset_id: number;
|
|
2925
2916
|
}, {
|
|
2926
2917
|
id: number;
|
|
2927
2918
|
name: string;
|
|
2928
|
-
kind: "Perp" | "Spot";
|
|
2929
2919
|
base_asset_id: number;
|
|
2930
2920
|
}>>, Map<number, {
|
|
2931
2921
|
id: number;
|
|
2932
2922
|
name: string;
|
|
2933
|
-
kind: "Perp" | "Spot";
|
|
2934
2923
|
base_asset_id: number;
|
|
2935
2924
|
}>, Record<string, {
|
|
2936
2925
|
id: number;
|
|
2937
2926
|
name: string;
|
|
2938
|
-
kind: "Perp" | "Spot";
|
|
2939
2927
|
base_asset_id: number;
|
|
2940
2928
|
}>>;
|
|
2941
2929
|
}, "strip", z.ZodTypeAny, {
|
|
2942
2930
|
metas: Map<number, {
|
|
2943
2931
|
id: number;
|
|
2944
2932
|
name: string;
|
|
2945
|
-
kind: "Perp" | "Spot";
|
|
2946
2933
|
base_asset_id: number;
|
|
2947
2934
|
}>;
|
|
2948
2935
|
}, {
|
|
2949
2936
|
metas: Record<string, {
|
|
2950
2937
|
id: number;
|
|
2951
2938
|
name: string;
|
|
2952
|
-
kind: "Perp" | "Spot";
|
|
2953
2939
|
base_asset_id: number;
|
|
2954
2940
|
}>;
|
|
2955
2941
|
}>>;
|
|
@@ -2958,7 +2944,6 @@ export declare const ResponseSchemas: {
|
|
|
2958
2944
|
metas: Map<number, {
|
|
2959
2945
|
id: number;
|
|
2960
2946
|
name: string;
|
|
2961
|
-
kind: "Perp" | "Spot";
|
|
2962
2947
|
base_asset_id: number;
|
|
2963
2948
|
}>;
|
|
2964
2949
|
} | null;
|
|
@@ -2967,7 +2952,6 @@ export declare const ResponseSchemas: {
|
|
|
2967
2952
|
metas: Record<string, {
|
|
2968
2953
|
id: number;
|
|
2969
2954
|
name: string;
|
|
2970
|
-
kind: "Perp" | "Spot";
|
|
2971
2955
|
base_asset_id: number;
|
|
2972
2956
|
}>;
|
|
2973
2957
|
} | null;
|