@bulletxyz/bullet-sdk 0.31.0-rc.1 → 0.31.0-rc.2

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.
@@ -1,9 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
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";
3
+ type EquityType = "unweighted" | "weighted_initial" | "weighted_maintenance";
4
+ type MarginType = "initial" | "maintenance";
5
+ type OrderType = "limit" | "post_only" | "fill_or_kill" | "immediate_or_cancel" | "post_only_slide" | "post_only_front";
6
+ type Side = "bid" | "ask";
7
7
  export class BulletWasm {
8
8
  free(): void;
9
9
  [Symbol.dispose](): void;
@@ -4,7 +4,7 @@ import { Connection } from "./connection";
4
4
  import { type Endpoints } from "./constants";
5
5
  import { ExchangeConnection } from "./exchange";
6
6
  import type { RuntimeCall } from "./rollupTypes";
7
- import { type Address, type AssetId, type AssetName, type MarkPriceUpdateArgs, type MarketName, type Network, type NewOrderArgs, type OraclePriceUpdateArgs, type TokenId, type TpslPair } from "./types";
7
+ import { type Address, type AssetId, type AssetName, type MarkPriceUpdateArgs, type MarketName, type Network, type NewOrderArgs, type OraclePriceUpdateArgs, SpotCollateralTransferDirection, type TokenId, type TpslPair } from "./types";
8
8
  import type { Wallet } from "./wallet";
9
9
  export interface TransactionOpts {
10
10
  maxPriorityFeeBps: number;
@@ -44,13 +44,14 @@ export declare class Client {
44
44
  getTokenBalance(tokenId: string): Promise<bigint>;
45
45
  getUserAccount(): Promise<{
46
46
  account_variant: {
47
- Master: number[];
47
+ type: "master";
48
+ sub_account_indices: number[];
48
49
  } | {
49
- Sub: null;
50
+ type: "sub";
50
51
  } | {
51
- Vault: null;
52
+ type: "vault";
52
53
  } | {
53
- ProtocolVault: null;
54
+ type: "protocol_vault";
54
55
  };
55
56
  address: string;
56
57
  usdc_ledger: {
@@ -68,7 +69,7 @@ export declare class Client {
68
69
  }>;
69
70
  perp_ledgers: Map<number, {
70
71
  orders: Map<bigint, {
71
- side: "Bid" | "Ask";
72
+ side: "bid" | "ask";
72
73
  market_id: number;
73
74
  order_id: bigint;
74
75
  client_order_id: bigint | null;
@@ -94,20 +95,20 @@ export declare class Client {
94
95
  size: Decimal | null;
95
96
  order_price: Decimal;
96
97
  trigger_price: Decimal;
97
- price_condition: "Mark" | "Oracle" | "LastTrade";
98
- order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
99
- side: "Bid" | "Ask";
98
+ price_condition: "mark" | "oracle" | "last_trade";
99
+ order_type: "limit" | "post_only" | "fill_or_kill" | "immediate_or_cancel" | "post_only_slide" | "post_only_front";
100
+ side: "bid" | "ask";
100
101
  market_id: number;
101
102
  owner: string;
102
103
  trigger_order_id: bigint;
103
- trigger_direction: "GreaterThanOrEqual" | "LessThanOrEqual";
104
+ trigger_direction: "greater_than_or_equal" | "less_than_or_equal";
104
105
  last_update_timestamp: bigint;
105
106
  linked_trigger_order_id: bigint | null;
106
107
  }>;
107
108
  }>;
108
109
  spot_ledgers: Map<number, {
109
110
  orders: Map<bigint, {
110
- side: "Bid" | "Ask";
111
+ side: "bid" | "ask";
111
112
  market_id: number;
112
113
  order_id: bigint;
113
114
  client_order_id: bigint | null;
@@ -123,31 +124,31 @@ export declare class Client {
123
124
  size: Decimal | null;
124
125
  order_price: Decimal;
125
126
  trigger_price: Decimal;
126
- price_condition: "Mark" | "Oracle" | "LastTrade";
127
- order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
128
- side: "Bid" | "Ask";
127
+ price_condition: "mark" | "oracle" | "last_trade";
128
+ order_type: "limit" | "post_only" | "fill_or_kill" | "immediate_or_cancel" | "post_only_slide" | "post_only_front";
129
+ side: "bid" | "ask";
129
130
  market_id: number;
130
131
  owner: string;
131
132
  trigger_order_id: bigint;
132
- trigger_direction: "GreaterThanOrEqual" | "LessThanOrEqual";
133
+ trigger_direction: "greater_than_or_equal" | "less_than_or_equal";
133
134
  last_update_timestamp: bigint;
134
135
  linked_trigger_order_id: bigint | null;
135
136
  }>;
136
137
  }>;
137
- fee_tiers: Map<number, "Tier0" | "Tier1" | "Tier2" | "Tier3" | "Tier4">;
138
+ fee_tiers: Map<number, "tier0" | "tier1" | "tier2" | "tier3" | "tier4">;
138
139
  pending_tpsl_pairs: Map<string, {
139
140
  tpsl_pair: {
140
141
  tp: {
141
142
  order_price: Decimal;
142
143
  trigger_price: Decimal;
143
- price_condition: "Mark" | "Oracle" | "LastTrade";
144
- order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
144
+ price_condition: "mark" | "oracle" | "last_trade";
145
+ order_type: "limit" | "post_only" | "fill_or_kill" | "immediate_or_cancel" | "post_only_slide" | "post_only_front";
145
146
  } | null;
146
147
  sl: {
147
148
  order_price: Decimal;
148
149
  trigger_price: Decimal;
149
- price_condition: "Mark" | "Oracle" | "LastTrade";
150
- order_type: "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
150
+ price_condition: "mark" | "oracle" | "last_trade";
151
+ order_type: "limit" | "post_only" | "fill_or_kill" | "immediate_or_cancel" | "post_only_slide" | "post_only_front";
151
152
  } | null;
152
153
  };
153
154
  dynamic_size: boolean;
@@ -162,7 +163,7 @@ export declare class Client {
162
163
  borrowSpot(asset: AssetName, amount: Decimal, subAccountIndex?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
163
164
  depositSpotCollateral(asset: AssetName, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
164
165
  withdrawSpotCollateral(asset: AssetName, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
165
- transferSpotCollateral(direction: "MarginToSpot" | "SpotToMargin", asset: AssetName, amount: Decimal, subAccountIndex?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
166
+ transferSpotCollateral(direction: SpotCollateralTransferDirection, asset: AssetName, amount: Decimal, subAccountIndex?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
166
167
  placeOrders(market: MarketName, newOrders: NewOrderArgs[], replace?: boolean, subAccountIndex?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
167
168
  createPerpPositionTpsl(market: MarketName, tpslPair: TpslPair, size?: Decimal, subAccountIndex?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
168
169
  amendOrders(market: MarketName, options: AmendOrderOptions[], subAccountIndex?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
@@ -1,4 +1,4 @@
1
- import type { Address, AssetId, MarketId, TokenId } from "./types";
1
+ import type { Address, AssetId, MarketId, SpotCollateralTransferDirection, TokenId } from "./types";
2
2
  type ExactlyOne<T, Keys extends keyof T = keyof T> = {
3
3
  [K in Keys]: {
4
4
  [P in K]: T[P];
@@ -370,7 +370,7 @@ type ExchangeCallMessage = {
370
370
  };
371
371
  };
372
372
  transfer_spot_collateral: {
373
- direction: "MarginToSpot" | "SpotToMargin";
373
+ direction: SpotCollateralTransferDirection;
374
374
  args: {
375
375
  asset_id: AssetId;
376
376
  amount: number;
@@ -10,12 +10,13 @@ export type MarketId = number;
10
10
  export type OrderId = bigint;
11
11
  export type ClientOrderId = bigint;
12
12
  export type MarketKind = "perp" | "spot";
13
- export type Side = "Bid" | "Ask";
14
- export type TriggerDirection = "GreaterThanOrEqual" | "LessThanOrEqual";
15
- export type TriggerPriceCondition = "Mark" | "Oracle" | "LastTrade";
16
- export type OrderType = "Limit" | "PostOnly" | "FillOrKill" | "ImmediateOrCancel" | "PostOnlySlide" | "PostOnlyFront";
17
- export type MarginType = "Initial" | "Maintenance";
18
- export type EquityType = "Unweighted" | "WeightedInitial" | "WeightedMaintenance";
13
+ export type Side = "bid" | "ask";
14
+ export type SpotCollateralTransferDirection = "margin_to_spot" | "spot_to_margin";
15
+ export type TriggerDirection = "greater_than_or_equal" | "less_than_or_equal";
16
+ export type TriggerPriceCondition = "mark" | "oracle" | "last_trade";
17
+ export type OrderType = "limit" | "post_only" | "fill_or_kill" | "immediate_or_cancel" | "post_only_slide" | "post_only_front";
18
+ export type MarginType = "initial" | "maintenance";
19
+ export type EquityType = "unweighted" | "weighted_initial" | "weighted_maintenance";
19
20
  export type Network = "Localnet" | "Staging" | "Testnet" | "Mainnet";
20
21
  export type RollupErrorStructure = {
21
22
  error?: {