@bulletxyz/bullet-sdk 0.17.3-rc.4 → 0.17.3-rc.6

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,5 +9,4 @@ 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";
13
12
  export { Wallet } from "./wallet";
@@ -21,7 +21,7 @@ export declare function calculateMaxBorrowAmount(assetId: AssetId, userAccount:
21
21
  export declare function calculateMaxOrderSize(assetId: AssetId, side: Side, price: Decimal, reduceOnly: boolean, userAccount: UserAccount, marginContext: MarginContext, makerBook: 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
- new: Decimal;
24
+ updated: Decimal;
25
25
  };
26
26
  export declare function calculatePositionsAdditionalMetadata(userAccount: UserAccount, marginContext: MarginContext, perpMarkets: Map<Asset, PerpMarket>): Map<number, {
27
27
  projected_funding_payment: Decimal;
@@ -11,4 +11,3 @@ 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";
@@ -1,6 +1,4 @@
1
1
  import Decimal from "decimal.js";
2
- import { MarginType } from "./bullet-wasm";
3
- export { MarginType };
4
2
  export type CallMessage = {
5
3
  [module: string]: {
6
4
  [instruction: string]: string | number | object;
@@ -44,6 +42,15 @@ export type TpslOrder = {
44
42
  size: Decimal;
45
43
  orderType: OrderType;
46
44
  };
45
+ export declare enum EquityType {
46
+ Unweighted = 0,
47
+ WeightedInitial = 1,
48
+ WeightedMaintenance = 2
49
+ }
50
+ export declare enum MarginType {
51
+ Initial = 0,
52
+ Maintenance = 1
53
+ }
47
54
  export declare class BulletError extends Error {
48
55
  originalError?: Error | undefined;
49
56
  code: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -362,6 +362,43 @@ export declare const BaseResponseSchemas: {
362
362
  meta?: Record<string, unknown> | undefined;
363
363
  }>;
364
364
  };
365
+ declare const StrippedTpsl: z.ZodObject<{
366
+ side: z.ZodEnum<["Bid", "Ask"]>;
367
+ tpsl_order_id: z.ZodBigInt;
368
+ order_price: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
369
+ trigger_price: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
370
+ trigger_direction: z.ZodEnum<["GreaterThanOrEqual", "LessThanOrEqual"]>;
371
+ tpsl_price_condition: z.ZodEnum<["Mark", "Oracle", "LastTrade"]>;
372
+ active_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
373
+ full_size: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
374
+ order_type: z.ZodEnum<["Limit", "PostOnly", "FillOrKill", "ImmediateOrCancel", "PostOnlySlide", "PostOnlyFront"]>;
375
+ parent_order_id: z.ZodOptional<z.ZodBigInt>;
376
+ linked_tpsl_order_ids: z.ZodArray<z.ZodBigInt, "many">;
377
+ }, "strip", z.ZodTypeAny, {
378
+ side: "Bid" | "Ask";
379
+ tpsl_order_id: bigint;
380
+ order_price: import("decimal.js").Decimal;
381
+ trigger_price: import("decimal.js").Decimal;
382
+ trigger_direction: "GreaterThanOrEqual" | "LessThanOrEqual";
383
+ tpsl_price_condition: "Mark" | "Oracle" | "LastTrade";
384
+ active_size: import("decimal.js").Decimal;
385
+ full_size: import("decimal.js").Decimal;
386
+ order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
387
+ linked_tpsl_order_ids: bigint[];
388
+ parent_order_id?: bigint | undefined;
389
+ }, {
390
+ side: "Bid" | "Ask";
391
+ tpsl_order_id: bigint;
392
+ order_price: string | number;
393
+ trigger_price: string | number;
394
+ trigger_direction: "GreaterThanOrEqual" | "LessThanOrEqual";
395
+ tpsl_price_condition: "Mark" | "Oracle" | "LastTrade";
396
+ active_size: string | number;
397
+ full_size: string | number;
398
+ order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
399
+ linked_tpsl_order_ids: bigint[];
400
+ parent_order_id?: bigint | undefined;
401
+ }>;
365
402
  export declare const Schemas: {
366
403
  readonly DummyValue: z.ZodNumber;
367
404
  readonly Order: z.ZodObject<{
@@ -2880,3 +2917,5 @@ export type BorrowLendMarket = z.infer<typeof Schemas.BorrowLendMarket>;
2880
2917
  export type PerpMarket = z.infer<typeof Schemas.PerpMarket>;
2881
2918
  export type MarginConfig = z.infer<typeof Schemas.MarginConfig>;
2882
2919
  export type Assets = z.infer<typeof Schemas.Assets>;
2920
+ export type StrippedTpsl = z.infer<typeof StrippedTpsl>;
2921
+ export {};
@@ -2,13 +2,13 @@ import { z } from "zod";
2
2
  export declare const WasmResponseSchemas: {
3
3
  SimulationResultSchema: z.ZodObject<{
4
4
  current: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
5
- new: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
5
+ updated: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
6
6
  }, "strip", z.ZodTypeAny, {
7
7
  current: import("decimal.js").Decimal;
8
- new: import("decimal.js").Decimal;
8
+ updated: import("decimal.js").Decimal;
9
9
  }, {
10
10
  current: string | number;
11
- new: string | number;
11
+ updated: string | number;
12
12
  }>;
13
13
  PositionAdditionalMetadataSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
14
14
  projected_funding_payment: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("decimal.js").Decimal, string | number>;
@@ -55,3 +55,4 @@ export declare const WasmResponseSchemas: {
55
55
  current_borrow_rate: string | number;
56
56
  }>;
57
57
  };
58
+ export type PositionAdditionalMetadata = z.infer<typeof WasmResponseSchemas.PositionAdditionalMetadataSchema>;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/zetamarkets/bullet-sdk.git"
6
6
  },
7
- "version": "0.17.3-rc.4",
7
+ "version": "0.17.3-rc.6",
8
8
  "description": "Bullet SDK",
9
9
  "author": "@bulletxyz",
10
10
  "license": "Apache-2.0",