@bulletxyz/bullet-sdk 0.26.0-rc.0 → 0.26.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 +328 -456
- package/dist/browser/index.js.map +2 -2
- package/dist/node/index.js +329 -457
- package/dist/node/index.js.map +2 -2
- package/dist/types/bullet-wasm/index.d.ts +1 -1
- package/dist/types/client.d.ts +14 -14
- package/dist/types/exchange.d.ts +28 -25
- package/dist/types/orderbook.d.ts +1 -1
- package/dist/types/rollupTypes.d.ts +47 -18
- package/dist/types/types.d.ts +5 -3
- package/dist/types/zod-types/rest.d.ts +3109 -4278
- package/dist/types/zod-types/ws.d.ts +4 -4
- package/package.json +84 -84
|
@@ -15,7 +15,7 @@ export class BulletWasm {
|
|
|
15
15
|
static calculate_account_leverage(user_account: any, margin_calculation_state: any): string;
|
|
16
16
|
static calculate_available_margin(user_account: any, conservative: boolean, margin_type: MarginType, margin_calculation_state: any): string;
|
|
17
17
|
static calculate_used_margin(user_account: any, withdrawal: boolean, margin_type: MarginType, margin_calculation_state: any): string;
|
|
18
|
-
static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_calculation_state: any): string;
|
|
18
|
+
static calculate_withdrawable_amount_of_asset(user_account: any, asset_id: number, margin_calculation_state: any, asset_registry: any): string;
|
|
19
19
|
static calculate_estimated_liquidation_price(user_account: any, market_id: number, base_asset_id: number, margin_calculation_state: any): string;
|
|
20
20
|
static calculate_liquidation_risk_percentage(user_account: any, margin_calculation_state: any): string;
|
|
21
21
|
static calculate_force_cancel_risk_percentage(user_account: any, margin_calculation_state: any): string;
|
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 MarkPriceUpdateArgs, type Network, type OraclePriceUpdateArgs, type PlaceOrderArgs, type PlacePositionTpslArgs, type TokenId } from "./types";
|
|
7
|
+
import { type Address, type AssetName, type MarkPriceUpdateArgs, type MarketName, type Network, type OraclePriceUpdateArgs, type PlaceOrderArgs, type PlacePositionTpslArgs, type TokenId } from "./types";
|
|
8
8
|
import type { Wallet } from "./wallet";
|
|
9
9
|
export interface TransactionOpts {
|
|
10
10
|
maxPriorityFeeBps: number;
|
|
@@ -111,33 +111,33 @@ export declare class Client {
|
|
|
111
111
|
submitTransaction(runtimeCall: RuntimeCall): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
112
112
|
transfer(to: Address, amount: bigint, tokenId: TokenId): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
113
113
|
mint(to: Address, amount: bigint, tokenId: TokenId): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
114
|
-
deposit(asset:
|
|
115
|
-
withdraw(asset:
|
|
116
|
-
borrowSpot(asset:
|
|
114
|
+
deposit(asset: AssetName, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
115
|
+
withdraw(asset: AssetName, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
116
|
+
borrowSpot(asset: AssetName, amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
117
117
|
placeOrder(placeOrderArgs: PlaceOrderArgs): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
118
|
-
createPositionTpsl(market:
|
|
118
|
+
createPositionTpsl(market: MarketName, tpslOrders: PlacePositionTpslArgs): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
119
119
|
amendOrder(options: AmendOrderOptions): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
120
120
|
cancelTpsl(tpslOrderId: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
121
121
|
cancelOrder(orderId?: bigint, clientOrderId?: bigint): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
122
|
-
cancelAllOrdersForMarket(market:
|
|
122
|
+
cancelAllOrdersForMarket(market: MarketName): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
123
123
|
updateOraclePrices(pricesToUpdate: OraclePriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
124
124
|
updateMarkPrices(pricesToUpdate: MarkPriceUpdateArgs[], publishTimestamp?: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
125
|
-
updateMaxLeverageForMarket(market:
|
|
126
|
-
updatePremiumIndexes(markets:
|
|
127
|
-
processTpslBufferForMarket(market:
|
|
128
|
-
updateFunding(markets:
|
|
125
|
+
updateMaxLeverageForMarket(market: MarketName, maxLeverage: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
126
|
+
updatePremiumIndexes(markets: MarketName[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
127
|
+
processTpslBufferForMarket(market: MarketName): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
128
|
+
updateFunding(markets: MarketName[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
129
129
|
applyFunding(addresses: Address[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
130
130
|
forceCancelOrders(address: Address): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
131
131
|
forceClosePositions(address: Address): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
132
132
|
liquidatePerpPositions(address: Address, positions?: {
|
|
133
|
-
market:
|
|
133
|
+
market: MarketName;
|
|
134
134
|
size: Decimal;
|
|
135
135
|
}[]): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
136
|
-
liquidateSpotLiability(address: Address, liabilityAssetId:
|
|
136
|
+
liquidateSpotLiability(address: Address, liabilityAssetId: AssetName, collateralAssetId: AssetName, liabilityAmount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
137
137
|
depositToUsdcPnlPool(amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
138
138
|
depositToInsuranceFund(amount: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
139
139
|
initAssetMetadata(asset_id: number, assetName: string, tokenId: TokenId, decimals: number): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
140
|
-
initBorrowLendMarket(asset:
|
|
141
|
-
updateBorrowLendMarket(asset:
|
|
140
|
+
initBorrowLendMarket(asset: AssetName, optimalUtilisationRate: Decimal, minBorrowRate: Decimal, maxBorrowRate: Decimal, optimalBorrowRate: Decimal, assetWeight: Decimal, initialLiabilityWeight: Decimal, maintenanceLiabilityWeight: Decimal, depositLimit: Decimal, borrowLimit: Decimal, liquidationRewardRatio: Decimal, liabilityLiquidationLimitRatio: Decimal): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
141
|
+
updateBorrowLendMarket(asset: AssetName, optimalUtilisationRate: Decimal | null, minBorrowRate: Decimal | null, maxBorrowRate: Decimal | null, optimalBorrowRate: Decimal | null, assetWeight: Decimal | null, initialLiabilityWeight: Decimal | null, maintenanceLiabilityWeight: Decimal | null, depositLimit: Decimal | null, borrowLimit: Decimal | null, liquidationRewardRatio: Decimal | null, liabilityLiquidationLimitRatio: Decimal | null): Promise<TransactionResult<Transaction<RuntimeCall>>>;
|
|
142
142
|
}
|
|
143
143
|
export {};
|
package/dist/types/exchange.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { type EquityType, type MarginType } from "./bullet-wasm";
|
|
|
3
3
|
import { BaseConnection } from "./connection";
|
|
4
4
|
import { type Endpoints } from "./constants";
|
|
5
5
|
import type { Orderbook } from "./orderbook";
|
|
6
|
-
import type { Address, Network } from "./types";
|
|
6
|
+
import type { Address, AssetName, MarketName, Network } from "./types";
|
|
7
7
|
import type { OrderType, PlaceOrderArgs, Side } from "./types";
|
|
8
|
-
import { type AccountAddresses, type AssetRegistry, type
|
|
8
|
+
import { type AccountAddresses, type AssetRegistry, type BorrowLendPools as BorrowLendPools, type GlobalParameters, type MarginConfig, type MarketRegistry, type OraclePrices, type Order, type OrderbookL2, type PerpMarket, type PerpPrices, type TpslOrderIdsToExecute, type UsdcInsuranceFund, type UsdcPnlPool, type UserAccount } from "./zod-types/rest";
|
|
9
9
|
export declare class ExchangeConnection extends BaseConnection {
|
|
10
10
|
private wsManager?;
|
|
11
11
|
private assetRegistry?;
|
|
@@ -13,20 +13,23 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
13
13
|
private marketRegistry?;
|
|
14
14
|
private marketRegistryReverse?;
|
|
15
15
|
private constructor();
|
|
16
|
-
static fromEndpoints(endpoints: Endpoints): ExchangeConnection
|
|
17
|
-
static fromNetwork(network: Network): ExchangeConnection
|
|
18
|
-
static fromRestUrl(restUrl: string): ExchangeConnection
|
|
16
|
+
static fromEndpoints(endpoints: Endpoints): Promise<ExchangeConnection>;
|
|
17
|
+
static fromNetwork(network: Network): Promise<ExchangeConnection>;
|
|
18
|
+
static fromRestUrl(restUrl: string): Promise<ExchangeConnection>;
|
|
19
|
+
private initializeRegistries;
|
|
20
|
+
private initializeAssetRegistry;
|
|
21
|
+
private initializeMarketRegistry;
|
|
19
22
|
getOrder(orderId: bigint): Promise<Order | null>;
|
|
20
23
|
getMarketRegistry(): Promise<MarketRegistry | null>;
|
|
21
24
|
getAssetRegistry(): Promise<AssetRegistry | null>;
|
|
22
25
|
private getAssetMapping;
|
|
23
26
|
private getMarketMapping;
|
|
24
|
-
getAssetId(asset:
|
|
25
|
-
getAssetName(assetId: number):
|
|
26
|
-
getMarketId(market:
|
|
27
|
-
getMarketName(marketId: number):
|
|
28
|
-
getOrderbookL2(market:
|
|
29
|
-
getOrderbookL2s(markets:
|
|
27
|
+
getAssetId(asset: AssetName): number;
|
|
28
|
+
getAssetName(assetId: number): AssetName;
|
|
29
|
+
getMarketId(market: MarketName): number;
|
|
30
|
+
getMarketName(marketId: number): string;
|
|
31
|
+
getOrderbookL2(market: MarketName, levels?: number): Promise<OrderbookL2>;
|
|
32
|
+
getOrderbookL2s(markets: MarketName[], levels?: number): Promise<Map<number, OrderbookL2>>;
|
|
30
33
|
getUserAccountAddresses(offset?: number, limit?: number): Promise<AccountAddresses>;
|
|
31
34
|
getUserAccount(address: Address): Promise<UserAccount>;
|
|
32
35
|
getUserAccounts(addresses: Address[]): Promise<Map<string, UserAccount>>;
|
|
@@ -34,14 +37,14 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
34
37
|
getPerpPrices(): Promise<PerpPrices | null>;
|
|
35
38
|
getUsdcPnlPool(): Promise<UsdcPnlPool | null>;
|
|
36
39
|
getUsdcInsuranceFund(): Promise<UsdcInsuranceFund | null>;
|
|
37
|
-
getBorrowLendMarkets(): Promise<
|
|
38
|
-
getPerpMarket(market:
|
|
39
|
-
getPerpMarkets(markets:
|
|
40
|
+
getBorrowLendMarkets(): Promise<BorrowLendPools>;
|
|
41
|
+
getPerpMarket(market: MarketName): Promise<PerpMarket>;
|
|
42
|
+
getPerpMarkets(markets: MarketName[]): Promise<Map<number, PerpMarket>>;
|
|
40
43
|
getMarginConfig(): Promise<MarginConfig | null>;
|
|
41
|
-
getTpslOrderIdsToExecute(market:
|
|
44
|
+
getTpslOrderIdsToExecute(market: MarketName): Promise<TpslOrderIdsToExecute | null>;
|
|
42
45
|
getGlobalParameters(): Promise<GlobalParameters | null>;
|
|
43
46
|
calculateOrderbookMidpoint(orderbook: OrderbookL2): Decimal | undefined;
|
|
44
|
-
calculateEntryPrice(market:
|
|
47
|
+
calculateEntryPrice(market: MarketName, userAccount: UserAccount): Promise<Decimal>;
|
|
45
48
|
calculateTotalPerpUnrealizedPnl(userAccount: UserAccount, MarginCalculationState: {
|
|
46
49
|
oracle_prices: OraclePrices;
|
|
47
50
|
perp_prices: PerpPrices;
|
|
@@ -67,12 +70,12 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
67
70
|
perp_prices: PerpPrices;
|
|
68
71
|
margin_config: MarginConfig;
|
|
69
72
|
}): Decimal;
|
|
70
|
-
calculateWithdrawableAmountOfAsset(asset:
|
|
73
|
+
calculateWithdrawableAmountOfAsset(asset: AssetName, userAccount: UserAccount, MarginCalculationState: {
|
|
71
74
|
oracle_prices: OraclePrices;
|
|
72
75
|
perp_prices: PerpPrices;
|
|
73
76
|
margin_config: MarginConfig;
|
|
74
77
|
}): Promise<Decimal>;
|
|
75
|
-
calculateEstimatedLiquidationPrice(market:
|
|
78
|
+
calculateEstimatedLiquidationPrice(market: MarketName, asset: AssetName, userAccount: UserAccount, MarginCalculationState: {
|
|
76
79
|
oracle_prices: OraclePrices;
|
|
77
80
|
perp_prices: PerpPrices;
|
|
78
81
|
margin_config: MarginConfig;
|
|
@@ -87,17 +90,17 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
87
90
|
perp_prices: PerpPrices;
|
|
88
91
|
margin_config: MarginConfig;
|
|
89
92
|
}): Decimal;
|
|
90
|
-
calculateMaxBorrowAmount(asset:
|
|
93
|
+
calculateMaxBorrowAmount(asset: AssetName, userAccount: UserAccount, MarginCalculationState: {
|
|
91
94
|
oracle_prices: OraclePrices;
|
|
92
95
|
perp_prices: PerpPrices;
|
|
93
96
|
margin_config: MarginConfig;
|
|
94
97
|
}): Promise<Decimal>;
|
|
95
|
-
calculateMaxOrderSize(market:
|
|
98
|
+
calculateMaxOrderSize(market: MarketName, price: Decimal, side: Side, order_type: OrderType, reduce_only: boolean, userAccount: UserAccount, MarginCalculationState: {
|
|
96
99
|
oracle_prices: OraclePrices;
|
|
97
100
|
perp_prices: PerpPrices;
|
|
98
101
|
margin_config: MarginConfig;
|
|
99
102
|
}, orderbook: OrderbookL2, n_iterations?: number, error_tolerance?: Decimal): Promise<Decimal>;
|
|
100
|
-
simulateUsedMarginOnBorrow(asset:
|
|
103
|
+
simulateUsedMarginOnBorrow(asset: AssetName, borrowAmount: Decimal, userAccount: UserAccount, marginType: MarginType, MarginCalculationState: {
|
|
101
104
|
oracle_prices: OraclePrices;
|
|
102
105
|
perp_prices: PerpPrices;
|
|
103
106
|
margin_config: MarginConfig;
|
|
@@ -113,7 +116,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
113
116
|
current: Decimal;
|
|
114
117
|
updated: Decimal;
|
|
115
118
|
}>;
|
|
116
|
-
simulateEstimatedLiquidationPriceOnOrder(placeOrderArgs: PlaceOrderArgs, baseAsset:
|
|
119
|
+
simulateEstimatedLiquidationPriceOnOrder(placeOrderArgs: PlaceOrderArgs, baseAsset: AssetName, userAccount: UserAccount, MarginCalculationState: {
|
|
117
120
|
oracle_prices: OraclePrices;
|
|
118
121
|
perp_prices: PerpPrices;
|
|
119
122
|
margin_config: MarginConfig;
|
|
@@ -132,7 +135,7 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
132
135
|
liquidation_risk_percentage: Decimal;
|
|
133
136
|
max_leverage_to_use: number;
|
|
134
137
|
}>>;
|
|
135
|
-
calculateBorrowLendMarketAdditionalMetadata(borrowLendMarkets:
|
|
138
|
+
calculateBorrowLendMarketAdditionalMetadata(borrowLendMarkets: BorrowLendPools, asset: AssetName): Promise<{
|
|
136
139
|
utilisation_rate: Decimal;
|
|
137
140
|
current_deposit_rate: Decimal;
|
|
138
141
|
current_borrow_rate: Decimal;
|
|
@@ -150,6 +153,6 @@ export declare class ExchangeConnection extends BaseConnection {
|
|
|
150
153
|
leverage: Decimal;
|
|
151
154
|
}[]>;
|
|
152
155
|
private getWebSocketManager;
|
|
153
|
-
subscribeOrderbook(market:
|
|
154
|
-
unsubscribeOrderbook(market:
|
|
156
|
+
subscribeOrderbook(market: MarketName): AsyncIterable<Orderbook>;
|
|
157
|
+
unsubscribeOrderbook(market: MarketName): Promise<void>;
|
|
155
158
|
}
|
|
@@ -5,7 +5,7 @@ type Size = Decimal;
|
|
|
5
5
|
export declare class Orderbook {
|
|
6
6
|
bids: Map<string, Size>;
|
|
7
7
|
asks: Map<string, Size>;
|
|
8
|
-
|
|
8
|
+
marketId: number;
|
|
9
9
|
lastUpdated: number;
|
|
10
10
|
constructor(marketId: number, snapshot?: OrderbookUpdate);
|
|
11
11
|
protected updateBid(price: string, size: Size): void;
|
|
@@ -22,6 +22,27 @@ type BankCallMessage = {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
type WarpCallMessage = {
|
|
26
|
+
Register: {
|
|
27
|
+
admin: {
|
|
28
|
+
InsecureOwner: Address;
|
|
29
|
+
};
|
|
30
|
+
ism: {
|
|
31
|
+
MessageIdMultisig: {
|
|
32
|
+
threshold: number;
|
|
33
|
+
validators: string[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
token_source: {
|
|
37
|
+
Synthetic: {
|
|
38
|
+
remote_token_id: string;
|
|
39
|
+
local_decimals: number;
|
|
40
|
+
remote_decimals: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
remote_routers: [number, string][];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
25
46
|
type TriggerOrderArgs = {
|
|
26
47
|
order_price: number;
|
|
27
48
|
trigger_price: number;
|
|
@@ -34,27 +55,28 @@ type PendingTriggerOrderArgs = {
|
|
|
34
55
|
pending_sl: TriggerOrderArgs | null;
|
|
35
56
|
dynamic_size: boolean;
|
|
36
57
|
};
|
|
37
|
-
type PlacePositionTpslArgs = {
|
|
38
|
-
tp: TriggerOrderArgs | null;
|
|
39
|
-
sl: TriggerOrderArgs | null;
|
|
40
|
-
size: number | null;
|
|
41
|
-
};
|
|
42
58
|
type ExchangeCallMessage = {
|
|
43
59
|
set_value: number;
|
|
44
60
|
deposit: {
|
|
45
|
-
|
|
46
|
-
|
|
61
|
+
args: {
|
|
62
|
+
asset_id: AssetId;
|
|
63
|
+
amount: number;
|
|
64
|
+
};
|
|
47
65
|
};
|
|
48
66
|
withdraw: {
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
args: {
|
|
68
|
+
asset_id: AssetId;
|
|
69
|
+
amount: number;
|
|
70
|
+
};
|
|
51
71
|
};
|
|
52
72
|
borrow_spot: {
|
|
53
|
-
|
|
54
|
-
|
|
73
|
+
args: {
|
|
74
|
+
asset_id: AssetId;
|
|
75
|
+
amount: number;
|
|
76
|
+
};
|
|
55
77
|
};
|
|
56
78
|
place_order: {
|
|
57
|
-
|
|
79
|
+
args: {
|
|
58
80
|
market_id: MarketId;
|
|
59
81
|
price: number;
|
|
60
82
|
size: number;
|
|
@@ -67,12 +89,16 @@ type ExchangeCallMessage = {
|
|
|
67
89
|
};
|
|
68
90
|
create_position_tpsl: {
|
|
69
91
|
market_id: MarketId;
|
|
70
|
-
|
|
92
|
+
args: {
|
|
93
|
+
tp: TriggerOrderArgs | null;
|
|
94
|
+
sl: TriggerOrderArgs | null;
|
|
95
|
+
size: number | null;
|
|
96
|
+
};
|
|
71
97
|
};
|
|
72
98
|
amend_order: {
|
|
73
99
|
existing_order_id: string | null;
|
|
74
100
|
existing_client_order_id: string | null;
|
|
75
|
-
|
|
101
|
+
args: {
|
|
76
102
|
market_id: MarketId;
|
|
77
103
|
price: number;
|
|
78
104
|
size: number;
|
|
@@ -86,9 +112,11 @@ type ExchangeCallMessage = {
|
|
|
86
112
|
cancel_tpsl: {
|
|
87
113
|
tpsl_order_id: string;
|
|
88
114
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
115
|
+
cancel_orders: {
|
|
116
|
+
args: {
|
|
117
|
+
order_id: string | null;
|
|
118
|
+
client_order_id: string | null;
|
|
119
|
+
}[];
|
|
92
120
|
};
|
|
93
121
|
cancel_all_orders_for_market: {
|
|
94
122
|
market_id: MarketId;
|
|
@@ -115,7 +143,7 @@ type ExchangeCallMessage = {
|
|
|
115
143
|
update_premium_indexes: {
|
|
116
144
|
market_ids: MarketId[];
|
|
117
145
|
};
|
|
118
|
-
|
|
146
|
+
process_tpsl_buffer: {
|
|
119
147
|
market_id: MarketId;
|
|
120
148
|
};
|
|
121
149
|
update_funding: {
|
|
@@ -193,5 +221,6 @@ type ExchangeCallMessage = {
|
|
|
193
221
|
export type RuntimeCall = ExactlyOne<{
|
|
194
222
|
exchange: ExactlyOne<ExchangeCallMessage>;
|
|
195
223
|
bank: ExactlyOne<BankCallMessage>;
|
|
224
|
+
warp: ExactlyOne<WarpCallMessage>;
|
|
196
225
|
}>;
|
|
197
226
|
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type PrivateKey = string;
|
|
|
3
3
|
export type PublicKey = string;
|
|
4
4
|
export type Address = string;
|
|
5
5
|
export type TokenId = string;
|
|
6
|
+
export type AssetName = string;
|
|
7
|
+
export type MarketName = string;
|
|
6
8
|
export type AssetId = number;
|
|
7
9
|
export type MarketId = number;
|
|
8
10
|
export type OrderId = bigint;
|
|
@@ -16,7 +18,7 @@ export type MarginType = "Initial" | "Maintenance";
|
|
|
16
18
|
export type EquityType = "Unweighted" | "WeightedInitial" | "WeightedMaintenance";
|
|
17
19
|
export type Network = "Localnet" | "Staging" | "Testnet" | "Mainnet";
|
|
18
20
|
export type PlaceOrderArgs = {
|
|
19
|
-
market:
|
|
21
|
+
market: MarketName;
|
|
20
22
|
price: Decimal;
|
|
21
23
|
size: Decimal;
|
|
22
24
|
side: Side;
|
|
@@ -26,11 +28,11 @@ export type PlaceOrderArgs = {
|
|
|
26
28
|
tpsl?: PendingTriggerOrderArgs;
|
|
27
29
|
};
|
|
28
30
|
export type OraclePriceUpdateArgs = {
|
|
29
|
-
asset:
|
|
31
|
+
asset: AssetName;
|
|
30
32
|
oraclePrice: Decimal;
|
|
31
33
|
};
|
|
32
34
|
export type MarkPriceUpdateArgs = {
|
|
33
|
-
market:
|
|
35
|
+
market: MarketName;
|
|
34
36
|
medianCexPrice: Decimal;
|
|
35
37
|
diffEma: Decimal;
|
|
36
38
|
};
|