@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.
- package/dist/browser/index.js +20 -20
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +20 -20
- package/dist/node/index.js.map +2 -2
- package/dist/types/bullet-wasm/index.d.ts +4 -4
- package/dist/types/client.d.ts +22 -21
- package/dist/types/rollupTypes.d.ts +2 -2
- package/dist/types/types.d.ts +7 -6
- package/dist/types/zod-types/rest.d.ts +685 -664
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
type EquityType = "
|
|
4
|
-
type MarginType = "
|
|
5
|
-
type OrderType = "
|
|
6
|
-
type Side = "
|
|
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;
|
package/dist/types/client.d.ts
CHANGED
|
@@ -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
|
-
|
|
47
|
+
type: "master";
|
|
48
|
+
sub_account_indices: number[];
|
|
48
49
|
} | {
|
|
49
|
-
|
|
50
|
+
type: "sub";
|
|
50
51
|
} | {
|
|
51
|
-
|
|
52
|
+
type: "vault";
|
|
52
53
|
} | {
|
|
53
|
-
|
|
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: "
|
|
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: "
|
|
98
|
-
order_type: "
|
|
99
|
-
side: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
127
|
-
order_type: "
|
|
128
|
-
side: "
|
|
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: "
|
|
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, "
|
|
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: "
|
|
144
|
-
order_type: "
|
|
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: "
|
|
150
|
-
order_type: "
|
|
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:
|
|
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:
|
|
373
|
+
direction: SpotCollateralTransferDirection;
|
|
374
374
|
args: {
|
|
375
375
|
asset_id: AssetId;
|
|
376
376
|
amount: number;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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 = "
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
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?: {
|