@bulletxyz/bullet-sdk 0.23.1-rc.3 → 0.23.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 +6 -5
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +6 -5
- package/dist/node/index.js.map +2 -2
- package/dist/types/calc.d.ts +1 -0
- package/dist/types/client.d.ts +1 -1
- package/dist/types/exchange.d.ts +2 -2
- package/dist/types/utils.d.ts +2 -2
- package/dist/types/zod-types/wasm.d.ts +3 -0
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -7058,13 +7058,13 @@ var Orderbook = class _Orderbook {
|
|
|
7058
7058
|
}
|
|
7059
7059
|
// TODO: eventually ideal to move to data structure like btree map (https://www.npmjs.com/package/sorted-btree)
|
|
7060
7060
|
// Get bids sorted by price descending
|
|
7061
|
-
getSortedBids(levels =
|
|
7061
|
+
getSortedBids(levels = Number.POSITIVE_INFINITY) {
|
|
7062
7062
|
return Array.from(this.bids.entries()).map(([price, size]) => [new decimal_default(price), size]).sort(
|
|
7063
7063
|
(priceLevel1, priceLevel2) => priceLevel2[0].minus(priceLevel1[0]).toNumber()
|
|
7064
7064
|
).slice(0, levels);
|
|
7065
7065
|
}
|
|
7066
7066
|
// Get asks sorted by price ascending
|
|
7067
|
-
getSortedAsks(levels =
|
|
7067
|
+
getSortedAsks(levels = Number.POSITIVE_INFINITY) {
|
|
7068
7068
|
return Array.from(this.asks.entries()).map(([price, size]) => [new decimal_default(price), size]).sort(
|
|
7069
7069
|
(priceLevel1, priceLevel2) => priceLevel1[0].minus(priceLevel2[0]).toNumber()
|
|
7070
7070
|
).slice(0, levels);
|
|
@@ -7082,8 +7082,8 @@ var Orderbook = class _Orderbook {
|
|
|
7082
7082
|
static toOrderbookL2(orderbook) {
|
|
7083
7083
|
return {
|
|
7084
7084
|
asset_id: orderbook.asset,
|
|
7085
|
-
bids: orderbook.getSortedBids(
|
|
7086
|
-
asks: orderbook.getSortedAsks(
|
|
7085
|
+
bids: orderbook.getSortedBids(Number.POSITIVE_INFINITY),
|
|
7086
|
+
asks: orderbook.getSortedAsks(Number.POSITIVE_INFINITY)
|
|
7087
7087
|
};
|
|
7088
7088
|
}
|
|
7089
7089
|
toDisplay(levels = 10) {
|
|
@@ -7350,7 +7350,7 @@ var ExchangeConnection = class _ExchangeConnection extends BaseConnection {
|
|
|
7350
7350
|
return parsed.data.found;
|
|
7351
7351
|
}
|
|
7352
7352
|
async getUserAccountAddresses(offset, limit) {
|
|
7353
|
-
const path =
|
|
7353
|
+
const path = "/modules/exchange/api/v1/account/addresses";
|
|
7354
7354
|
const response = await this.fetchApiResource(path, {
|
|
7355
7355
|
offset: offset?.toString(),
|
|
7356
7356
|
limit: limit?.toString()
|
|
@@ -9487,6 +9487,7 @@ var WasmResponseSchemas = {
|
|
|
9487
9487
|
}),
|
|
9488
9488
|
AccountSummaryBatchSchema: z.array(
|
|
9489
9489
|
z.object({
|
|
9490
|
+
address: Base58Address,
|
|
9490
9491
|
equity: DecimalSchema,
|
|
9491
9492
|
unrealized_pnl: DecimalSchema,
|
|
9492
9493
|
available_initial_margin: DecimalSchema,
|