@n1xyz/nord-ts 0.1.7 → 0.1.8
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/actions.js +39 -82
- package/dist/bundle.js +79181 -0
- package/dist/client/Nord.d.ts +2 -2
- package/dist/client/Nord.js +46 -78
- package/dist/client/NordAdmin.d.ts +2 -2
- package/dist/client/NordAdmin.js +57 -89
- package/dist/client/NordUser.js +118 -147
- package/dist/const.js +5 -8
- package/dist/error.js +7 -5
- package/dist/gen/nord_pb.js +88 -92
- package/dist/gen/openapi.d.ts +5 -6
- package/dist/gen/openapi.js +1 -2
- package/dist/index.js +10 -49
- package/dist/types.d.ts +1 -0
- package/dist/types.js +21 -60
- package/dist/utils.js +38 -86
- package/dist/websocket/NordWebSocketClient.js +12 -17
- package/dist/websocket/Subscriber.js +6 -7
- package/dist/websocket/events.js +1 -2
- package/dist/websocket/index.js +10 -15
- package/package.json +2 -3
- package/dist/api/client.d.ts +0 -14
- package/dist/api/client.js +0 -45
- package/dist/bridge/client.d.ts +0 -151
- package/dist/bridge/client.js +0 -434
- package/dist/bridge/const.d.ts +0 -23
- package/dist/bridge/const.js +0 -47
- package/dist/bridge/index.d.ts +0 -4
- package/dist/bridge/index.js +0 -23
- package/dist/bridge/types.d.ts +0 -120
- package/dist/bridge/types.js +0 -18
- package/dist/bridge/utils.d.ts +0 -64
- package/dist/bridge/utils.js +0 -131
- package/dist/gen/common.d.ts +0 -68
- package/dist/gen/common.js +0 -215
- package/dist/gen/nord.d.ts +0 -882
- package/dist/gen/nord.js +0 -6520
- package/dist/idl/bridge.d.ts +0 -569
- package/dist/idl/bridge.js +0 -8
- package/dist/idl/bridge.json +0 -1506
- package/dist/idl/index.d.ts +0 -607
- package/dist/idl/index.js +0 -8
- package/dist/nord/api/actions.d.ts +0 -126
- package/dist/nord/api/actions.js +0 -397
- package/dist/nord/api/core.d.ts +0 -16
- package/dist/nord/api/core.js +0 -81
- package/dist/nord/api/market.d.ts +0 -36
- package/dist/nord/api/market.js +0 -96
- package/dist/nord/api/metrics.d.ts +0 -67
- package/dist/nord/api/metrics.js +0 -229
- package/dist/nord/api/queries.d.ts +0 -46
- package/dist/nord/api/queries.js +0 -109
- package/dist/nord/api/triggers.d.ts +0 -7
- package/dist/nord/api/triggers.js +0 -38
- package/dist/nord/client/Nord.d.ts +0 -396
- package/dist/nord/client/Nord.js +0 -747
- package/dist/nord/client/NordAdmin.d.ts +0 -259
- package/dist/nord/client/NordAdmin.js +0 -395
- package/dist/nord/client/NordClient.d.ts +0 -33
- package/dist/nord/client/NordClient.js +0 -45
- package/dist/nord/client/NordUser.d.ts +0 -362
- package/dist/nord/client/NordUser.js +0 -781
- package/dist/nord/index.d.ts +0 -11
- package/dist/nord/index.js +0 -36
- package/dist/nord/models/Subscriber.d.ts +0 -37
- package/dist/nord/models/Subscriber.js +0 -25
- package/dist/nord/utils/NordError.d.ts +0 -35
- package/dist/nord/utils/NordError.js +0 -49
- package/src/actions.ts +0 -333
- package/src/client/Nord.ts +0 -934
- package/src/client/NordAdmin.ts +0 -484
- package/src/client/NordUser.ts +0 -1122
- package/src/const.ts +0 -34
- package/src/error.ts +0 -76
- package/src/gen/.gitkeep +0 -0
- package/src/gen/nord_pb.ts +0 -5053
- package/src/gen/openapi.ts +0 -2904
- package/src/index.ts +0 -11
- package/src/types.ts +0 -327
- package/src/utils.ts +0 -266
- package/src/websocket/NordWebSocketClient.ts +0 -316
- package/src/websocket/Subscriber.ts +0 -56
- package/src/websocket/events.ts +0 -31
- package/src/websocket/index.ts +0 -105
package/dist/gen/nord.d.ts
DELETED
|
@@ -1,882 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "nord";
|
|
3
|
-
export declare enum Side {
|
|
4
|
-
ASK = 0,
|
|
5
|
-
BID = 1
|
|
6
|
-
}
|
|
7
|
-
export declare function sideFromJSON(object: any): Side;
|
|
8
|
-
export declare function sideToJSON(object: Side): string;
|
|
9
|
-
export declare enum TriggerKind {
|
|
10
|
-
STOP_LOSS = 0,
|
|
11
|
-
TAKE_PROFIT = 1
|
|
12
|
-
}
|
|
13
|
-
export declare function triggerKindFromJSON(object: any): TriggerKind;
|
|
14
|
-
export declare function triggerKindToJSON(object: TriggerKind): string;
|
|
15
|
-
export declare enum FillMode {
|
|
16
|
-
LIMIT = 0,
|
|
17
|
-
POST_ONLY = 1,
|
|
18
|
-
IMMEDIATE_OR_CANCEL = 2,
|
|
19
|
-
FILL_OR_KILL = 3
|
|
20
|
-
}
|
|
21
|
-
export declare function fillModeFromJSON(object: any): FillMode;
|
|
22
|
-
export declare function fillModeToJSON(object: FillMode): string;
|
|
23
|
-
export declare enum MarketType {
|
|
24
|
-
SPOT = 0,
|
|
25
|
-
PERPETUALS = 1
|
|
26
|
-
}
|
|
27
|
-
export declare function marketTypeFromJSON(object: any): MarketType;
|
|
28
|
-
export declare function marketTypeToJSON(object: MarketType): string;
|
|
29
|
-
/**
|
|
30
|
-
* Error codes returned by the engine.
|
|
31
|
-
* Some errors has 5bit prefix about error source and 3 bit suffix specifier.
|
|
32
|
-
* Error source prefix indicates were too look into to fix error.
|
|
33
|
-
* For example if order has bad input, it would be order relevant prefix.
|
|
34
|
-
* But if order cannot apply results to balance, it would be balance relevant
|
|
35
|
-
* prefix.
|
|
36
|
-
*/
|
|
37
|
-
export declare enum Error {
|
|
38
|
-
DUPLICATE = 0,
|
|
39
|
-
DECODE_FAILURE = 2,
|
|
40
|
-
INVALID_SIGNATURE = 3,
|
|
41
|
-
MARKET_NOT_FOUND = 4,
|
|
42
|
-
TOKEN_NOT_FOUND = 5,
|
|
43
|
-
USER_NOT_FOUND = 6,
|
|
44
|
-
SESSION_NOT_FOUND = 7,
|
|
45
|
-
ORDER_NOT_FOUND = 8,
|
|
46
|
-
ORDER_SIZE_ZERO = 9,
|
|
47
|
-
ARITHMETIC_OVERFLOW = 11,
|
|
48
|
-
RISK_TOO_HIGH = 12,
|
|
49
|
-
INVALID_ORDER_OWNER = 14,
|
|
50
|
-
KEY_ALREADY_REGISTERED = 15,
|
|
51
|
-
EXPIRY_TIMESTAMP_IN_PAST = 16,
|
|
52
|
-
UPDATE_TIMESTAMP_IN_PAST = 17,
|
|
53
|
-
TOO_MANY_OPEN_ORDERS = 18,
|
|
54
|
-
INVALID_ACTION_NONCE = 20,
|
|
55
|
-
WITHDRAW_AMOUNT_TOO_SMALL = 21,
|
|
56
|
-
PYTH_FEED_NOT_ADDED = 93,
|
|
57
|
-
PYTH_FEED_MISSING = 94,
|
|
58
|
-
PYTH_FEED_ALREADY_ADDED = 95,
|
|
59
|
-
PYTH_GUARDIAN_SET_UNINITIALIZED = 96,
|
|
60
|
-
PYTH_GUARDIAN_SET_INVALID = 97,
|
|
61
|
-
PYTH_FEED_DECIMALS_OUT_OF_RANGE = 98,
|
|
62
|
-
PYTH_FEED_PRICE_OUT_OF_RANGE = 99,
|
|
63
|
-
PYTH_FEED_VARIANCE_OUT_OF_RANGE = 100,
|
|
64
|
-
PYTH_GUARDIAN_SET_AND_PYTH_SIGNATURE_DO_NOT_MATCH = 126,
|
|
65
|
-
INVALID_TOKEN_PARAMETERS = 101,
|
|
66
|
-
INDEX_PRICE_OUT_OF_RANGE = 103,
|
|
67
|
-
INDEX_DECIMALS_OUT_OF_RANGE = 104,
|
|
68
|
-
INVALID_STATE_VERSION = 105,
|
|
69
|
-
INVALID_MARGINS = 107,
|
|
70
|
-
/** ACTION_CANNOT_BE_DELEGATED - means that user cannot execute proposed action on behalf of different user */
|
|
71
|
-
ACTION_CANNOT_BE_DELEGATED = 108,
|
|
72
|
-
/**
|
|
73
|
-
* MARKET_DECIMALS_EXCEED_LIMITS - Market's decimal parameters exceed either "quote limit" or "base limit"
|
|
74
|
-
* Two mentioned limits were deduced empirically and ensure
|
|
75
|
-
* that certain overflow errors don't happen when value rescaling is performed
|
|
76
|
-
* during order placement.
|
|
77
|
-
*
|
|
78
|
-
* For both perpetuals and spot markets,
|
|
79
|
-
* `quote_token.decimals - market.size_decimals - market.price_decimals` must
|
|
80
|
-
* be within range `[-19; 4]` For spot market, `base_token.decimals -
|
|
81
|
-
* market.size_decimals` must be within range `[-19; 23]`
|
|
82
|
-
*/
|
|
83
|
-
MARKET_DECIMALS_EXCEED_LIMITS = 109,
|
|
84
|
-
TOO_MANY_TOKENS = 110,
|
|
85
|
-
FUNDING_OVERFLOW = 123,
|
|
86
|
-
/**
|
|
87
|
-
* CAN_REDUCE_POSITION_ONLY_IF_ALL_ORDERS_ARE_CANCELED - If there is order to cancel for position, it should be canceled first
|
|
88
|
-
* before reducing position
|
|
89
|
-
*/
|
|
90
|
-
CAN_REDUCE_POSITION_ONLY_IF_ALL_ORDERS_ARE_CANCELED = 124,
|
|
91
|
-
/** UNEXPECTED_TOKEN_ID - Token was found, but not expected to be used in action context */
|
|
92
|
-
UNEXPECTED_TOKEN_ID = 127,
|
|
93
|
-
/**
|
|
94
|
-
* TOKEN_NOT_READY - happens in some situation when token misses some relevant information
|
|
95
|
-
* needed for operation, for example index price
|
|
96
|
-
*/
|
|
97
|
-
TOKEN_NOT_READY = 130,
|
|
98
|
-
/** TOKEN_ALREADY_REGISTERED - Token with specified blockchain address already registered */
|
|
99
|
-
TOKEN_ALREADY_REGISTERED = 112,
|
|
100
|
-
OMF_LESS_THAN_OR_EQUAL_IMF = 131,
|
|
101
|
-
ORDER_ON_UNHEALTHY_ACCOUNT_CAN_ONLY_IMPROVE = 132,
|
|
102
|
-
IMMEDIATE_ORDER_GOT_NO_FILLS = 133,
|
|
103
|
-
/** FAILED_TO_FILL_LIMIT - In case there's no price, error if failed to fill at least one of limits */
|
|
104
|
-
FAILED_TO_FILL_LIMIT = 134,
|
|
105
|
-
POST_ONLY_MUST_NOT_FILL_ANY_OPPOSITE_ORDERS = 135,
|
|
106
|
-
INVALID = 136,
|
|
107
|
-
MAINTENANCE = 137,
|
|
108
|
-
MINIMUM_SIZE_DECIMALS = 138,
|
|
109
|
-
PARAMETERS_WILL_CREATE_NON_OPERATIONAL_MARKET = 139,
|
|
110
|
-
ONLY_IMMEDIATE_ORDERS_ALLOWED = 140,
|
|
111
|
-
TOO_MANY_USER_ACCOUNTS = 141,
|
|
112
|
-
/** ACCOUNT_NOT_FOUND - There's no such account with specified id, */
|
|
113
|
-
ACCOUNT_NOT_FOUND = 142,
|
|
114
|
-
/** ACCOUNT_INVALID_OWNER - Account doesn't belong to user designated by public key or session id */
|
|
115
|
-
ACCOUNT_INVALID_OWNER = 143,
|
|
116
|
-
/**
|
|
117
|
-
* DUST_ACCOUNT - Operation cannot be made on account because to small amount will be
|
|
118
|
-
* retained on account
|
|
119
|
-
*/
|
|
120
|
-
DUST_ACCOUNT = 145,
|
|
121
|
-
/** BALANCE - 10100_000 */
|
|
122
|
-
BALANCE = 160,
|
|
123
|
-
/** BALANCE_DEPOSIT_OVERFLOW - 10100_001 */
|
|
124
|
-
BALANCE_DEPOSIT_OVERFLOW = 161,
|
|
125
|
-
/** BALANCE_CHANGE_OVERFLOW - 10100_010 */
|
|
126
|
-
BALANCE_CHANGE_OVERFLOW = 162,
|
|
127
|
-
/** BALANCE_CHANGE_LIMIT_EXCEEDED - 10100_011 */
|
|
128
|
-
BALANCE_CHANGE_LIMIT_EXCEEDED = 163,
|
|
129
|
-
/**
|
|
130
|
-
* BALANCE_INSUFFICIENT - Happens when account balances has no sufficient token amount to perform
|
|
131
|
-
* action.
|
|
132
|
-
* 10100_100
|
|
133
|
-
*/
|
|
134
|
-
BALANCE_INSUFFICIENT = 164,
|
|
135
|
-
/**
|
|
136
|
-
* UNAUTHENTICATED_L1_ACTION - Happens when an action is meant to come from the settlement contract,
|
|
137
|
-
* but is not authenticated, instead coming from the user channels.
|
|
138
|
-
*/
|
|
139
|
-
UNAUTHENTICATED_L1_ACTION = 165,
|
|
140
|
-
/**
|
|
141
|
-
* ENCODED_ACTION_TOO_LARGE - Happens when an encoded action is too large. This is to mitigate dos
|
|
142
|
-
* attacks due to excessive padding.
|
|
143
|
-
*/
|
|
144
|
-
ENCODED_ACTION_TOO_LARGE = 166,
|
|
145
|
-
/** TRIGGER - 10101_000 */
|
|
146
|
-
TRIGGER = 168,
|
|
147
|
-
/**
|
|
148
|
-
* TRIGGER_INVALID_PRICE - Happens when:
|
|
149
|
-
* * Trigger price is "less or equal" to its corresponding pair trigger price
|
|
150
|
-
* * Trigger rice is "less" than market's current index price
|
|
151
|
-
*
|
|
152
|
-
* Binary pattern: 10101_001
|
|
153
|
-
*/
|
|
154
|
-
TRIGGER_INVALID_PRICE = 169,
|
|
155
|
-
TRIGGER_NOT_FOUND = 170,
|
|
156
|
-
/** TIMESTAMP - 10110_000 */
|
|
157
|
-
TIMESTAMP = 176,
|
|
158
|
-
/** TIMESTAMP_OUT_OF_THRESHOLD - 10110_001 */
|
|
159
|
-
TIMESTAMP_OUT_OF_THRESHOLD = 177,
|
|
160
|
-
TIMESTAMP_STALE = 178,
|
|
161
|
-
/** BANKRUPTCY - 10111_000 */
|
|
162
|
-
BANKRUPTCY = 184,
|
|
163
|
-
/** BANKRUPTCY_INSUFFICIENT_COVERAGE - 10111_001 */
|
|
164
|
-
BANKRUPTCY_INSUFFICIENT_COVERAGE = 185,
|
|
165
|
-
/**
|
|
166
|
-
* BANKRUPTCY_NOT_FOUND - 10111_010
|
|
167
|
-
* Account is not in bankruptcy state.
|
|
168
|
-
*/
|
|
169
|
-
BANKRUPTCY_NOT_FOUND = 186,
|
|
170
|
-
/**
|
|
171
|
-
* MARKET_NOT_READY - 11000_000
|
|
172
|
-
* Happens when market is not read to handle orders
|
|
173
|
-
*/
|
|
174
|
-
MARKET_NOT_READY = 192,
|
|
175
|
-
MARKET_FROZEN = 193,
|
|
176
|
-
/** POSITION - 11001_000 */
|
|
177
|
-
POSITION = 200,
|
|
178
|
-
/** POSITION_NOT_FOUND - Position not found for specific entity in specific market */
|
|
179
|
-
POSITION_NOT_FOUND = 201,
|
|
180
|
-
POSITION_STATE_ORDER = 202,
|
|
181
|
-
POSITION_STATE_ORDER_PRICE = 203,
|
|
182
|
-
POSITION_STATE_ORDER_SIZE = 204,
|
|
183
|
-
POSITION_STATE_ORDER_SIDE = 205,
|
|
184
|
-
/** POSITION_SIZE_LIMIT - 1100_1110 */
|
|
185
|
-
POSITION_SIZE_LIMIT = 206,
|
|
186
|
-
PRICE = 209,
|
|
187
|
-
SIGNATURE_VERIFICATION = 217,
|
|
188
|
-
SIGNATURE_VERIFICATION_MALFORMED_PUBLIC_KEY = 218,
|
|
189
|
-
SIGNATURE_VERIFICATION_INVALID_LENGTH = 219,
|
|
190
|
-
/** ORDER_EXECUTION - 1111_0000 = 240 -- 4 bit suffix */
|
|
191
|
-
ORDER_EXECUTION = 240,
|
|
192
|
-
ORDER_EXECUTION_EMPTY = 241,
|
|
193
|
-
ORDER_EXECUTION_FILL_OR_KILL = 242,
|
|
194
|
-
/** ORDER_EXECUTION_MISSING_LIMITS - Order requires some of its limits specified according to fill mode */
|
|
195
|
-
ORDER_EXECUTION_MISSING_LIMITS = 243,
|
|
196
|
-
ORDER_EXECUTION_MISSING_PRICE = 244,
|
|
197
|
-
ORDER_EXECUTION_SIZE_LIMIT = 245,
|
|
198
|
-
/** ORDER_EXECUTION_LIMIT_PRICE - 111_0110 */
|
|
199
|
-
ORDER_EXECUTION_LIMIT_PRICE = 246,
|
|
200
|
-
/**
|
|
201
|
-
* ORDER_REDUCE_IS_POST_ONLY - Reduce orders can only be post only.
|
|
202
|
-
* 01111_0111 = 247
|
|
203
|
-
*/
|
|
204
|
-
ORDER_REDUCE_IS_POST_ONLY = 247,
|
|
205
|
-
/**
|
|
206
|
-
* ORDER_EXECUTION_SELL_PRICE - Order was rejected, because it planned under proposed price
|
|
207
|
-
* 01111_1000 = 248
|
|
208
|
-
*/
|
|
209
|
-
ORDER_EXECUTION_SELL_PRICE = 248,
|
|
210
|
-
/** ATOMICS_TRADES_CANNOT_FOLLOW_PLACES - 10000_0000 */
|
|
211
|
-
ATOMICS_TRADES_CANNOT_FOLLOW_PLACES = 256,
|
|
212
|
-
/** ATOMICS_CANCELS_CANNOT_FOLLOW_TRADES_PLACES - 10000_0001 */
|
|
213
|
-
ATOMICS_CANCELS_CANNOT_FOLLOW_TRADES_PLACES = 257,
|
|
214
|
-
NOT_IMPLEMENTED = 500,
|
|
215
|
-
Dropped = 999
|
|
216
|
-
}
|
|
217
|
-
export declare function errorFromJSON(object: any): Error;
|
|
218
|
-
export declare function errorToJSON(object: Error): string;
|
|
219
|
-
export declare enum SpecialAccount {
|
|
220
|
-
FeeVault = 0
|
|
221
|
-
}
|
|
222
|
-
export declare function specialAccountFromJSON(object: any): SpecialAccount;
|
|
223
|
-
export declare function specialAccountToJSON(object: SpecialAccount): string;
|
|
224
|
-
export interface Market {
|
|
225
|
-
marketId: number;
|
|
226
|
-
priceDecimals: number;
|
|
227
|
-
sizeDecimals: number;
|
|
228
|
-
baseTokenId: number;
|
|
229
|
-
marketType: MarketType;
|
|
230
|
-
imfBps: number;
|
|
231
|
-
cmfBps: number;
|
|
232
|
-
mmfBps: number;
|
|
233
|
-
viewSymbol: string;
|
|
234
|
-
}
|
|
235
|
-
export interface Token {
|
|
236
|
-
tokenId: number;
|
|
237
|
-
/** / See CreateToken for details. */
|
|
238
|
-
tokenDecimals: number;
|
|
239
|
-
weightBps: number;
|
|
240
|
-
viewSymbol: string;
|
|
241
|
-
}
|
|
242
|
-
export interface QuoteSize {
|
|
243
|
-
size: bigint;
|
|
244
|
-
price: bigint;
|
|
245
|
-
}
|
|
246
|
-
export interface OrderLimit {
|
|
247
|
-
price: bigint;
|
|
248
|
-
size: bigint;
|
|
249
|
-
quoteSize: QuoteSize | undefined;
|
|
250
|
-
}
|
|
251
|
-
export interface OrderType {
|
|
252
|
-
side: Side;
|
|
253
|
-
fillMode: FillMode;
|
|
254
|
-
isReduceOnly: boolean;
|
|
255
|
-
}
|
|
256
|
-
export interface TradeOrPlace {
|
|
257
|
-
marketId: number;
|
|
258
|
-
orderType: OrderType | undefined;
|
|
259
|
-
limit: OrderLimit | undefined;
|
|
260
|
-
clientOrderId?: bigint | undefined;
|
|
261
|
-
}
|
|
262
|
-
export interface CancelOrder {
|
|
263
|
-
orderId: bigint;
|
|
264
|
-
}
|
|
265
|
-
export interface Action {
|
|
266
|
-
/**
|
|
267
|
-
* Must be within 60s of the engine's current logical time, which
|
|
268
|
-
* should be within a few seconds of real time.
|
|
269
|
-
*
|
|
270
|
-
* Ignored for the `PythPriceFeedUpdate` action as that action updates
|
|
271
|
-
* the timestamp. Should be set to 0 in that case to omit it.
|
|
272
|
-
*/
|
|
273
|
-
currentTimestamp: bigint;
|
|
274
|
-
/**
|
|
275
|
-
* Optional nonce to handle if user wants several identical transactions to be
|
|
276
|
-
* executed with `current_timestamp`. Sending exactly same transaction twice
|
|
277
|
-
* is rejected. In order to change signature of transaction(execute it once
|
|
278
|
-
* more time), nonce should be changed(incremented).
|
|
279
|
-
*/
|
|
280
|
-
nonce: number;
|
|
281
|
-
kind?: {
|
|
282
|
-
$case: "createSession";
|
|
283
|
-
value: Action_CreateSession;
|
|
284
|
-
} | {
|
|
285
|
-
$case: "createToken";
|
|
286
|
-
value: Action_CreateToken;
|
|
287
|
-
} | {
|
|
288
|
-
$case: "createMarket";
|
|
289
|
-
value: Action_CreateMarket;
|
|
290
|
-
} | {
|
|
291
|
-
$case: "placeOrder";
|
|
292
|
-
value: Action_PlaceOrder;
|
|
293
|
-
} | {
|
|
294
|
-
$case: "cancelOrderById";
|
|
295
|
-
value: Action_CancelOrderById;
|
|
296
|
-
} | {
|
|
297
|
-
$case: "deposit";
|
|
298
|
-
value: Action_Deposit;
|
|
299
|
-
} | {
|
|
300
|
-
$case: "withdraw";
|
|
301
|
-
value: Action_Withdraw;
|
|
302
|
-
} | {
|
|
303
|
-
$case: "pythSetWormholeGuardians";
|
|
304
|
-
value: Action_PythSetWormholeGuardians;
|
|
305
|
-
} | {
|
|
306
|
-
$case: "pythSetSymbolFeed";
|
|
307
|
-
value: Action_PythSetSymbolFeed;
|
|
308
|
-
} | {
|
|
309
|
-
$case: "pythPriceFeedUpdate";
|
|
310
|
-
value: Action_PythPriceFeedUpdate;
|
|
311
|
-
} | {
|
|
312
|
-
$case: "liquidate";
|
|
313
|
-
value: Action_Liquidate;
|
|
314
|
-
} | {
|
|
315
|
-
$case: "revokeSession";
|
|
316
|
-
value: Action_RevokeSession;
|
|
317
|
-
} | {
|
|
318
|
-
$case: "pause";
|
|
319
|
-
value: Action_Pause;
|
|
320
|
-
} | {
|
|
321
|
-
$case: "unpause";
|
|
322
|
-
value: Action_Unpause;
|
|
323
|
-
} | {
|
|
324
|
-
$case: "transfer";
|
|
325
|
-
value: Action_Transfer;
|
|
326
|
-
} | {
|
|
327
|
-
$case: "addTrigger";
|
|
328
|
-
value: Action_AddTrigger;
|
|
329
|
-
} | {
|
|
330
|
-
$case: "removeTrigger";
|
|
331
|
-
value: Action_RemoveTrigger;
|
|
332
|
-
} | {
|
|
333
|
-
$case: "takePosition";
|
|
334
|
-
value: Action_TakePosition;
|
|
335
|
-
} | {
|
|
336
|
-
$case: "atomic";
|
|
337
|
-
value: Atomic;
|
|
338
|
-
} | undefined;
|
|
339
|
-
}
|
|
340
|
-
export interface Action_CreateSession {
|
|
341
|
-
/**
|
|
342
|
-
* User's SECP256K1 registration public key, 33 bytes long;
|
|
343
|
-
* user must be previously registered with that key
|
|
344
|
-
*/
|
|
345
|
-
userPubkey: Uint8Array;
|
|
346
|
-
/** MUST be 32 bytes. */
|
|
347
|
-
blstPubkey: Uint8Array;
|
|
348
|
-
expiryTimestamp: bigint;
|
|
349
|
-
}
|
|
350
|
-
export interface Action_CreateToken {
|
|
351
|
-
/**
|
|
352
|
-
* / Example:
|
|
353
|
-
* / Settlement 1 ETH is 10**18 value.
|
|
354
|
-
* / With `token_decimals` of `10`, engine balance will have 1 ETH = 10**10
|
|
355
|
-
* / value. Rollup sends to engine and expects from engine 10**10 as 1 ETH
|
|
356
|
-
* / value. So if user has on balance 10**9 of ETH, it means he has 0.1 ETH
|
|
357
|
-
* / on engine balance and in settlement, but in settlement it will be
|
|
358
|
-
* / represented as 10**17 value. As consequence, if oracle gives index_price
|
|
359
|
-
* / of 1 ETH as it is in Ethereum, we must divide balance by
|
|
360
|
-
* / `10**token_decimals` and multiply by price to get USD value (do not
|
|
361
|
-
* / forget allow for rounding sub USD values). As for market price, to trade
|
|
362
|
-
* / 0.1 ETH,
|
|
363
|
-
* need to 1/10 / 10**token_decimals * 10**Market.size_decimals
|
|
364
|
-
*/
|
|
365
|
-
tokenDecimals: number;
|
|
366
|
-
weightBps: number;
|
|
367
|
-
viewSymbol: string;
|
|
368
|
-
/** / Used to bind to relevant oracle feed */
|
|
369
|
-
oracleSymbol: string;
|
|
370
|
-
/** On chain id for the wrapped asset on the rollup */
|
|
371
|
-
solAddr: Uint8Array;
|
|
372
|
-
}
|
|
373
|
-
export interface Action_CreateMarket {
|
|
374
|
-
sizeDecimals: number;
|
|
375
|
-
priceDecimals: number;
|
|
376
|
-
imfBps: number;
|
|
377
|
-
cmfBps: number;
|
|
378
|
-
mmfBps: number;
|
|
379
|
-
marketType: MarketType;
|
|
380
|
-
/**
|
|
381
|
-
* Arbitrary human-readable market symbol, not to be confused with token's
|
|
382
|
-
* symbol
|
|
383
|
-
*/
|
|
384
|
-
viewSymbol: string;
|
|
385
|
-
/**
|
|
386
|
-
* Oracle symbol which references specific price feed. Must be
|
|
387
|
-
* `oracle_symbol` of registered price feed
|
|
388
|
-
*/
|
|
389
|
-
oracleSymbol: string;
|
|
390
|
-
/**
|
|
391
|
-
* One of registered `token_id`'s.
|
|
392
|
-
*
|
|
393
|
-
* Base token for `MarketType::Spot`.
|
|
394
|
-
*
|
|
395
|
-
* Same as quote token id for `MarketType::Perpetual`. `oracle_symbol`
|
|
396
|
-
* identifies relevant price feed.
|
|
397
|
-
*/
|
|
398
|
-
baseTokenId: number;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Note on order size.
|
|
402
|
-
* Any order being placed has absolute maximum size, which is 2^48-1.
|
|
403
|
-
* Although, this limit is applied not to initial order being placed
|
|
404
|
-
* but to final order being added to market's orderbook.
|
|
405
|
-
* This behavior exists because order can be limited by quote size,
|
|
406
|
-
* which converts to order size in a non-linear manner.
|
|
407
|
-
*
|
|
408
|
-
* Some orders can be executed immediately, in this no order will be added to
|
|
409
|
-
* orderbook, no order id created. Consider using `client_order_id` to track
|
|
410
|
-
* execution of such orders.
|
|
411
|
-
*
|
|
412
|
-
* Example: User posts order with size 2^48+100_000. Order fills counter
|
|
413
|
-
* orders and its size is reduced to 2^48-1_000_000 in process. This order
|
|
414
|
-
* will be added to orderbook successfully despite its initial size is above
|
|
415
|
-
* limit.
|
|
416
|
-
*/
|
|
417
|
-
export interface Action_PlaceOrder {
|
|
418
|
-
sessionId: bigint;
|
|
419
|
-
marketId: number;
|
|
420
|
-
side: Side;
|
|
421
|
-
fillMode: FillMode;
|
|
422
|
-
/**
|
|
423
|
-
* A reduce-only order only reduces your current position, as opposed to
|
|
424
|
-
* increasing it. It means you can only use it to close a position. In
|
|
425
|
-
* contrast, non-reduce-only orders can reduce or increase your position.
|
|
426
|
-
* Reduce is handled by dynamically reducing or adjusting limit order's
|
|
427
|
-
* contract quantity
|
|
428
|
-
* / to match the contract size of the open position.
|
|
429
|
-
*/
|
|
430
|
-
isReduceOnly: boolean;
|
|
431
|
-
/**
|
|
432
|
-
* Raw integral value of order limit price.
|
|
433
|
-
* `1` here equals to market's `10^-price_decimals`
|
|
434
|
-
* When used in token balances and reward computations, shifted by market's
|
|
435
|
-
* `price_decimals`. Optional, treated as not set if 0.
|
|
436
|
-
*/
|
|
437
|
-
price: bigint;
|
|
438
|
-
/**
|
|
439
|
-
* Raw integral value of order size limit.
|
|
440
|
-
* For spot markers measured in base size,
|
|
441
|
-
* for perpetuals in contract token.
|
|
442
|
-
* So using base as default naming in codebase.
|
|
443
|
-
* `1` here equals to market's `10^-size_decimals`
|
|
444
|
-
* When used in token balances and reward computations, shifted by market's
|
|
445
|
-
* `size_decimals`. Optional, treated as not set if 0.
|
|
446
|
-
*/
|
|
447
|
-
size: bigint;
|
|
448
|
-
/**
|
|
449
|
-
* Raw integral value of order quote size limit.
|
|
450
|
-
* `1` here equals to market's `10^-(size_decimals + price_decimals)`
|
|
451
|
-
* When used in token balances and reward computations, shifted by market's
|
|
452
|
-
* `size_decimals + price_decimals`. Optional, treated as not set if 0.
|
|
453
|
-
*/
|
|
454
|
-
quoteSize: QuoteSize | undefined;
|
|
455
|
-
/**
|
|
456
|
-
* Optional account on behalf of whom the order should be placed.
|
|
457
|
-
* Executed only if sender has delegated authority to do so,
|
|
458
|
-
* like admin user or liquidator bot.
|
|
459
|
-
* # Delegation allowed if:
|
|
460
|
-
* - trigger
|
|
461
|
-
* - reduce bad position
|
|
462
|
-
* - sell at good price to reduce if cannot cover bad position
|
|
463
|
-
*/
|
|
464
|
-
delegatorAccountId?: number | undefined;
|
|
465
|
-
/**
|
|
466
|
-
* Caller provided opaque order identifier up to 8 bytes.
|
|
467
|
-
* Not used by engine, but can be used by client to track orders.
|
|
468
|
-
*/
|
|
469
|
-
clientOrderId?: bigint | undefined;
|
|
470
|
-
/**
|
|
471
|
-
* Account id which performs operation;
|
|
472
|
-
* if not specified, first account of session's owner user is picked
|
|
473
|
-
*/
|
|
474
|
-
senderAccountId?: number | undefined;
|
|
475
|
-
/**
|
|
476
|
-
* Opaque identifier chosen by the sender to be able to correlate this
|
|
477
|
-
* place order requests with the corresponding fill and place order events.
|
|
478
|
-
*/
|
|
479
|
-
senderTrackingId?: bigint | undefined;
|
|
480
|
-
}
|
|
481
|
-
export interface Action_CancelOrderById {
|
|
482
|
-
sessionId: bigint;
|
|
483
|
-
orderId: bigint;
|
|
484
|
-
delegatorAccountId?: number | undefined;
|
|
485
|
-
senderAccountId?: number | undefined;
|
|
486
|
-
}
|
|
487
|
-
export interface Action_Deposit {
|
|
488
|
-
/** used for integration of rollup with nord app */
|
|
489
|
-
actionNonce: bigint;
|
|
490
|
-
tokenAddr: Uint8Array;
|
|
491
|
-
/** Shifted by the token's decimals. */
|
|
492
|
-
amount: bigint;
|
|
493
|
-
/** User's SECP256K1 registration public key, 33 bytes long */
|
|
494
|
-
userPubkey: Uint8Array;
|
|
495
|
-
}
|
|
496
|
-
/** todo(n1): when gate will be here, remove or replace internals with message */
|
|
497
|
-
export interface Action_Withdraw {
|
|
498
|
-
tokenId: number;
|
|
499
|
-
sessionId: bigint;
|
|
500
|
-
/** Shifted by the token's decimals. */
|
|
501
|
-
amount: bigint;
|
|
502
|
-
}
|
|
503
|
-
export interface Action_PythSetWormholeGuardians {
|
|
504
|
-
/**
|
|
505
|
-
* See
|
|
506
|
-
* https://docs.wormhole.com/wormhole/reference/api-docs/swagger#v1-guardianset-current
|
|
507
|
-
*/
|
|
508
|
-
guardianSetIndex: number;
|
|
509
|
-
/**
|
|
510
|
-
* Each address is 20 bytes, consisting of the last 20 bytes
|
|
511
|
-
* of the keccak256 hash of the public key of the guardian.
|
|
512
|
-
*/
|
|
513
|
-
addresses: Uint8Array[];
|
|
514
|
-
}
|
|
515
|
-
/** Associate a oracle symbol to a Pyth Feed ID. */
|
|
516
|
-
export interface Action_PythSetSymbolFeed {
|
|
517
|
-
oracleSymbol: string;
|
|
518
|
-
/** MUST be 32 bytes. */
|
|
519
|
-
priceFeedId: Uint8Array;
|
|
520
|
-
}
|
|
521
|
-
export interface Action_PythPriceFeedUpdate {
|
|
522
|
-
/** See https://hermes.pyth.network/docs/#/rest/latest_price_updates */
|
|
523
|
-
rawPythnetData: Uint8Array;
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* Perform final account liquidation procedure.
|
|
527
|
-
* Can be executed only accounts with AV < 0 (bankrupt).
|
|
528
|
-
* After execution, `liquidatee_account_id` is removed from state.
|
|
529
|
-
* See MARKETS.md `Bankruptcy` for details.
|
|
530
|
-
*/
|
|
531
|
-
export interface Action_Liquidate {
|
|
532
|
-
liquidatorSessionId: bigint;
|
|
533
|
-
liquidateeAccountId: number;
|
|
534
|
-
liquidatorAccountId?: number | undefined;
|
|
535
|
-
}
|
|
536
|
-
export interface Action_RevokeSession {
|
|
537
|
-
sessionId: bigint;
|
|
538
|
-
}
|
|
539
|
-
/** The engine fails with a maintenance error while paused. */
|
|
540
|
-
export interface Action_Pause {
|
|
541
|
-
}
|
|
542
|
-
export interface Action_Unpause {
|
|
543
|
-
}
|
|
544
|
-
/** Transfers tokens to specified account. */
|
|
545
|
-
export interface Action_Transfer {
|
|
546
|
-
sessionId: bigint;
|
|
547
|
-
fromAccountId: number;
|
|
548
|
-
tokenId: number;
|
|
549
|
-
amount: bigint;
|
|
550
|
-
/** If target account id isn't specified, new account is created. */
|
|
551
|
-
toAccountId?: number | undefined;
|
|
552
|
-
/**
|
|
553
|
-
* If specified, than `to_account_id` must be none.
|
|
554
|
-
* Transfer funds to accounts, for example to cover bankruptcies.
|
|
555
|
-
*/
|
|
556
|
-
specialAccount?: SpecialAccount | undefined;
|
|
557
|
-
}
|
|
558
|
-
export interface Action_AddTrigger {
|
|
559
|
-
sessionId: bigint;
|
|
560
|
-
marketId: number;
|
|
561
|
-
kind: TriggerKind;
|
|
562
|
-
side: Side;
|
|
563
|
-
/** Same price format as when placing order */
|
|
564
|
-
price: bigint;
|
|
565
|
-
accountId?: number | undefined;
|
|
566
|
-
}
|
|
567
|
-
export interface Action_RemoveTrigger {
|
|
568
|
-
sessionId: bigint;
|
|
569
|
-
marketId: number;
|
|
570
|
-
kind: TriggerKind;
|
|
571
|
-
side: Side;
|
|
572
|
-
accountId?: number | undefined;
|
|
573
|
-
}
|
|
574
|
-
export interface Action_TakePosition {
|
|
575
|
-
sessionId: bigint;
|
|
576
|
-
marketId: number;
|
|
577
|
-
/** Amount to take. */
|
|
578
|
-
size: bigint;
|
|
579
|
-
/**
|
|
580
|
-
* Account id which performs operation;
|
|
581
|
-
* if not specified, first account of session's owner user is picked
|
|
582
|
-
*/
|
|
583
|
-
senderAccountId?: number | undefined;
|
|
584
|
-
/**
|
|
585
|
-
* If set, then it is take action.
|
|
586
|
-
* If price not so good as in field, take will fail.
|
|
587
|
-
*
|
|
588
|
-
* If not set,
|
|
589
|
-
* will do fill-or-kill order as per liquidation trade rule.
|
|
590
|
-
*/
|
|
591
|
-
price?: bigint | undefined;
|
|
592
|
-
}
|
|
593
|
-
export interface AtomicSubactionKind {
|
|
594
|
-
inner?: {
|
|
595
|
-
$case: "tradeOrPlace";
|
|
596
|
-
value: TradeOrPlace;
|
|
597
|
-
} | {
|
|
598
|
-
$case: "cancelOrder";
|
|
599
|
-
value: CancelOrder;
|
|
600
|
-
} | undefined;
|
|
601
|
-
}
|
|
602
|
-
export interface Atomic {
|
|
603
|
-
sessionId: bigint;
|
|
604
|
-
accountId?: number | undefined;
|
|
605
|
-
actions: AtomicSubactionKind[];
|
|
606
|
-
}
|
|
607
|
-
export interface Receipt {
|
|
608
|
-
/**
|
|
609
|
-
* Action id which was run to produce this receipt.
|
|
610
|
-
* In case of error it was next action id which did not incremented because of
|
|
611
|
-
* error.
|
|
612
|
-
*/
|
|
613
|
-
actionId: bigint;
|
|
614
|
-
kind?: {
|
|
615
|
-
$case: "err";
|
|
616
|
-
value: Error;
|
|
617
|
-
} | {
|
|
618
|
-
$case: "createSessionResult";
|
|
619
|
-
value: Receipt_CreateSessionResult;
|
|
620
|
-
} | {
|
|
621
|
-
$case: "placeOrderResult";
|
|
622
|
-
value: Receipt_PlaceOrderResult;
|
|
623
|
-
} | {
|
|
624
|
-
$case: "cancelOrderResult";
|
|
625
|
-
value: Receipt_CancelOrderResult;
|
|
626
|
-
} | {
|
|
627
|
-
$case: "depositResult";
|
|
628
|
-
value: Receipt_DepositResult;
|
|
629
|
-
} | {
|
|
630
|
-
$case: "insertTokenResult";
|
|
631
|
-
value: Receipt_InsertTokenResult;
|
|
632
|
-
} | {
|
|
633
|
-
$case: "insertMarketResult";
|
|
634
|
-
value: Receipt_InsertMarketResult;
|
|
635
|
-
} | {
|
|
636
|
-
$case: "withdrawResult";
|
|
637
|
-
value: Receipt_WithdrawResult;
|
|
638
|
-
} | {
|
|
639
|
-
$case: "oracleSymbolFeedResult";
|
|
640
|
-
value: Receipt_OracleSymbolFeedResult;
|
|
641
|
-
} | {
|
|
642
|
-
$case: "oracleUpdateResult";
|
|
643
|
-
value: Receipt_OracleUpdateResult;
|
|
644
|
-
} | {
|
|
645
|
-
$case: "updateGuardianSetResult";
|
|
646
|
-
value: Receipt_UpdateGuardianSetResult;
|
|
647
|
-
} | {
|
|
648
|
-
$case: "liquidated";
|
|
649
|
-
value: Receipt_AccountLiquidated;
|
|
650
|
-
} | {
|
|
651
|
-
$case: "sessionRevoked";
|
|
652
|
-
value: Receipt_SessionRevoked;
|
|
653
|
-
} | {
|
|
654
|
-
$case: "paused";
|
|
655
|
-
value: Receipt_Paused;
|
|
656
|
-
} | {
|
|
657
|
-
$case: "unpaused";
|
|
658
|
-
value: Receipt_Unpaused;
|
|
659
|
-
} | {
|
|
660
|
-
$case: "transferred";
|
|
661
|
-
value: Receipt_Transferred;
|
|
662
|
-
} | {
|
|
663
|
-
$case: "triggerAdded";
|
|
664
|
-
value: Receipt_TriggerAdded;
|
|
665
|
-
} | {
|
|
666
|
-
$case: "triggerRemoved";
|
|
667
|
-
value: Receipt_TriggerRemoved;
|
|
668
|
-
} | {
|
|
669
|
-
$case: "positionTakenOrTraded";
|
|
670
|
-
value: Receipt_PositionTakenOrTradedResult;
|
|
671
|
-
} | {
|
|
672
|
-
$case: "atomic";
|
|
673
|
-
value: Receipt_AtomicResult;
|
|
674
|
-
} | undefined;
|
|
675
|
-
}
|
|
676
|
-
export interface Receipt_Posted {
|
|
677
|
-
side: Side;
|
|
678
|
-
marketId: number;
|
|
679
|
-
price: bigint;
|
|
680
|
-
size: bigint;
|
|
681
|
-
orderId: bigint;
|
|
682
|
-
accountId: number;
|
|
683
|
-
}
|
|
684
|
-
export interface Receipt_Trade {
|
|
685
|
-
orderId: bigint;
|
|
686
|
-
/** non zero */
|
|
687
|
-
price: bigint;
|
|
688
|
-
size: bigint;
|
|
689
|
-
accountId: number;
|
|
690
|
-
}
|
|
691
|
-
export interface Receipt_CreateSessionResult {
|
|
692
|
-
sessionId: bigint;
|
|
693
|
-
}
|
|
694
|
-
export interface Receipt_PlaceOrderResult {
|
|
695
|
-
posted?: Receipt_Posted | undefined;
|
|
696
|
-
fills: Receipt_Trade[];
|
|
697
|
-
clientOrderId?: bigint | undefined;
|
|
698
|
-
senderTrackingId?: bigint | undefined;
|
|
699
|
-
}
|
|
700
|
-
export interface Receipt_TakenResult {
|
|
701
|
-
pnl: bigint;
|
|
702
|
-
size: bigint;
|
|
703
|
-
takerAccountId: number;
|
|
704
|
-
}
|
|
705
|
-
export interface Receipt_PositionTakenOrTradedResult {
|
|
706
|
-
marketId: number;
|
|
707
|
-
PositionTakenOrTradedKind?: {
|
|
708
|
-
$case: "taken";
|
|
709
|
-
value: Receipt_TakenResult;
|
|
710
|
-
} | //
|
|
711
|
-
/** non empty if trade immediately */
|
|
712
|
-
{
|
|
713
|
-
$case: "traded";
|
|
714
|
-
value: Receipt_PlaceOrderResult;
|
|
715
|
-
} | undefined;
|
|
716
|
-
}
|
|
717
|
-
export interface Receipt_CancelOrderResult {
|
|
718
|
-
orderId: bigint;
|
|
719
|
-
/** Account from which order was cancelled */
|
|
720
|
-
accountId: number;
|
|
721
|
-
}
|
|
722
|
-
export interface Receipt_DepositResult {
|
|
723
|
-
tokenId: number;
|
|
724
|
-
amount: bigint;
|
|
725
|
-
/** Default account of newly created or existing user */
|
|
726
|
-
accountId: number;
|
|
727
|
-
userCreated: boolean;
|
|
728
|
-
userPubkey: Uint8Array;
|
|
729
|
-
}
|
|
730
|
-
export interface Receipt_InsertTokenResult {
|
|
731
|
-
chainAddr: Uint8Array;
|
|
732
|
-
token: Token | undefined;
|
|
733
|
-
}
|
|
734
|
-
export interface Receipt_InsertMarketResult {
|
|
735
|
-
market: Market | undefined;
|
|
736
|
-
}
|
|
737
|
-
export interface Receipt_WithdrawResult {
|
|
738
|
-
tokenId: number;
|
|
739
|
-
amount: bigint;
|
|
740
|
-
balance: bigint;
|
|
741
|
-
accountId: number;
|
|
742
|
-
fee: bigint;
|
|
743
|
-
userPubkey: Uint8Array;
|
|
744
|
-
}
|
|
745
|
-
/** pyth receipts are not user facing, so they can be terse and optional */
|
|
746
|
-
export interface Receipt_OracleSymbolFeedResult {
|
|
747
|
-
oracleSymbol: string;
|
|
748
|
-
feedId: Uint8Array;
|
|
749
|
-
}
|
|
750
|
-
export interface Receipt_OracleUpdateResult {
|
|
751
|
-
timestamp: bigint;
|
|
752
|
-
}
|
|
753
|
-
export interface Receipt_UpdateGuardianSetResult {
|
|
754
|
-
guardianSetIndex: number;
|
|
755
|
-
addresses: Uint8Array[];
|
|
756
|
-
}
|
|
757
|
-
export interface Receipt_PerpPosition {
|
|
758
|
-
marketId: number;
|
|
759
|
-
baseSize: bigint;
|
|
760
|
-
price: bigint;
|
|
761
|
-
}
|
|
762
|
-
/** / Result of bankruptcy liquidation. */
|
|
763
|
-
export interface Receipt_AccountLiquidated {
|
|
764
|
-
liquidatorAccountId: number;
|
|
765
|
-
liquidateeAccountId: number;
|
|
766
|
-
cancelledOrders: bigint[];
|
|
767
|
-
removedPerps: Receipt_PerpPosition[];
|
|
768
|
-
}
|
|
769
|
-
export interface Receipt_SessionRevoked {
|
|
770
|
-
}
|
|
771
|
-
export interface Receipt_Paused {
|
|
772
|
-
}
|
|
773
|
-
export interface Receipt_Unpaused {
|
|
774
|
-
}
|
|
775
|
-
export interface Receipt_Transferred {
|
|
776
|
-
fromAccountId: number;
|
|
777
|
-
toUserAccount?: number | undefined;
|
|
778
|
-
tokenId: number;
|
|
779
|
-
amount: bigint;
|
|
780
|
-
accountCreated: boolean;
|
|
781
|
-
toSpecialAccount?: SpecialAccount | undefined;
|
|
782
|
-
}
|
|
783
|
-
export interface Receipt_TriggerAdded {
|
|
784
|
-
}
|
|
785
|
-
export interface Receipt_TriggerRemoved {
|
|
786
|
-
}
|
|
787
|
-
export interface Receipt_AtomicSubactionResultKind {
|
|
788
|
-
inner?: //
|
|
789
|
-
/**
|
|
790
|
-
* reusing existing messages -> way less code to change in nord, with some
|
|
791
|
-
* duplication of data unlike input, which is required to be very specific
|
|
792
|
-
* to be correct, receipts can be same to easy ingested into view and hist
|
|
793
|
-
*/
|
|
794
|
-
{
|
|
795
|
-
$case: "placeOrderResult";
|
|
796
|
-
value: Receipt_PlaceOrderResult;
|
|
797
|
-
} | {
|
|
798
|
-
$case: "cancelOrder";
|
|
799
|
-
value: Receipt_CancelOrderResult;
|
|
800
|
-
} | undefined;
|
|
801
|
-
}
|
|
802
|
-
export interface Receipt_AtomicResult {
|
|
803
|
-
results: Receipt_AtomicSubactionResultKind[];
|
|
804
|
-
}
|
|
805
|
-
export declare const Market: MessageFns<Market>;
|
|
806
|
-
export declare const Token: MessageFns<Token>;
|
|
807
|
-
export declare const QuoteSize: MessageFns<QuoteSize>;
|
|
808
|
-
export declare const OrderLimit: MessageFns<OrderLimit>;
|
|
809
|
-
export declare const OrderType: MessageFns<OrderType>;
|
|
810
|
-
export declare const TradeOrPlace: MessageFns<TradeOrPlace>;
|
|
811
|
-
export declare const CancelOrder: MessageFns<CancelOrder>;
|
|
812
|
-
export declare const Action: MessageFns<Action>;
|
|
813
|
-
export declare const Action_CreateSession: MessageFns<Action_CreateSession>;
|
|
814
|
-
export declare const Action_CreateToken: MessageFns<Action_CreateToken>;
|
|
815
|
-
export declare const Action_CreateMarket: MessageFns<Action_CreateMarket>;
|
|
816
|
-
export declare const Action_PlaceOrder: MessageFns<Action_PlaceOrder>;
|
|
817
|
-
export declare const Action_CancelOrderById: MessageFns<Action_CancelOrderById>;
|
|
818
|
-
export declare const Action_Deposit: MessageFns<Action_Deposit>;
|
|
819
|
-
export declare const Action_Withdraw: MessageFns<Action_Withdraw>;
|
|
820
|
-
export declare const Action_PythSetWormholeGuardians: MessageFns<Action_PythSetWormholeGuardians>;
|
|
821
|
-
export declare const Action_PythSetSymbolFeed: MessageFns<Action_PythSetSymbolFeed>;
|
|
822
|
-
export declare const Action_PythPriceFeedUpdate: MessageFns<Action_PythPriceFeedUpdate>;
|
|
823
|
-
export declare const Action_Liquidate: MessageFns<Action_Liquidate>;
|
|
824
|
-
export declare const Action_RevokeSession: MessageFns<Action_RevokeSession>;
|
|
825
|
-
export declare const Action_Pause: MessageFns<Action_Pause>;
|
|
826
|
-
export declare const Action_Unpause: MessageFns<Action_Unpause>;
|
|
827
|
-
export declare const Action_Transfer: MessageFns<Action_Transfer>;
|
|
828
|
-
export declare const Action_AddTrigger: MessageFns<Action_AddTrigger>;
|
|
829
|
-
export declare const Action_RemoveTrigger: MessageFns<Action_RemoveTrigger>;
|
|
830
|
-
export declare const Action_TakePosition: MessageFns<Action_TakePosition>;
|
|
831
|
-
export declare const AtomicSubactionKind: MessageFns<AtomicSubactionKind>;
|
|
832
|
-
export declare const Atomic: MessageFns<Atomic>;
|
|
833
|
-
export declare const Receipt: MessageFns<Receipt>;
|
|
834
|
-
export declare const Receipt_Posted: MessageFns<Receipt_Posted>;
|
|
835
|
-
export declare const Receipt_Trade: MessageFns<Receipt_Trade>;
|
|
836
|
-
export declare const Receipt_CreateSessionResult: MessageFns<Receipt_CreateSessionResult>;
|
|
837
|
-
export declare const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult>;
|
|
838
|
-
export declare const Receipt_TakenResult: MessageFns<Receipt_TakenResult>;
|
|
839
|
-
export declare const Receipt_PositionTakenOrTradedResult: MessageFns<Receipt_PositionTakenOrTradedResult>;
|
|
840
|
-
export declare const Receipt_CancelOrderResult: MessageFns<Receipt_CancelOrderResult>;
|
|
841
|
-
export declare const Receipt_DepositResult: MessageFns<Receipt_DepositResult>;
|
|
842
|
-
export declare const Receipt_InsertTokenResult: MessageFns<Receipt_InsertTokenResult>;
|
|
843
|
-
export declare const Receipt_InsertMarketResult: MessageFns<Receipt_InsertMarketResult>;
|
|
844
|
-
export declare const Receipt_WithdrawResult: MessageFns<Receipt_WithdrawResult>;
|
|
845
|
-
export declare const Receipt_OracleSymbolFeedResult: MessageFns<Receipt_OracleSymbolFeedResult>;
|
|
846
|
-
export declare const Receipt_OracleUpdateResult: MessageFns<Receipt_OracleUpdateResult>;
|
|
847
|
-
export declare const Receipt_UpdateGuardianSetResult: MessageFns<Receipt_UpdateGuardianSetResult>;
|
|
848
|
-
export declare const Receipt_PerpPosition: MessageFns<Receipt_PerpPosition>;
|
|
849
|
-
export declare const Receipt_AccountLiquidated: MessageFns<Receipt_AccountLiquidated>;
|
|
850
|
-
export declare const Receipt_SessionRevoked: MessageFns<Receipt_SessionRevoked>;
|
|
851
|
-
export declare const Receipt_Paused: MessageFns<Receipt_Paused>;
|
|
852
|
-
export declare const Receipt_Unpaused: MessageFns<Receipt_Unpaused>;
|
|
853
|
-
export declare const Receipt_Transferred: MessageFns<Receipt_Transferred>;
|
|
854
|
-
export declare const Receipt_TriggerAdded: MessageFns<Receipt_TriggerAdded>;
|
|
855
|
-
export declare const Receipt_TriggerRemoved: MessageFns<Receipt_TriggerRemoved>;
|
|
856
|
-
export declare const Receipt_AtomicSubactionResultKind: MessageFns<Receipt_AtomicSubactionResultKind>;
|
|
857
|
-
export declare const Receipt_AtomicResult: MessageFns<Receipt_AtomicResult>;
|
|
858
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
859
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
860
|
-
$case: string;
|
|
861
|
-
value: unknown;
|
|
862
|
-
} ? {
|
|
863
|
-
$case: T["$case"];
|
|
864
|
-
value?: DeepPartial<T["value"]>;
|
|
865
|
-
} : T extends {} ? {
|
|
866
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
867
|
-
} : Partial<T>;
|
|
868
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
869
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
870
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
871
|
-
} & {
|
|
872
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
873
|
-
};
|
|
874
|
-
export interface MessageFns<T> {
|
|
875
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
876
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
877
|
-
fromJSON(object: any): T;
|
|
878
|
-
toJSON(message: T): unknown;
|
|
879
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
880
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
881
|
-
}
|
|
882
|
-
export {};
|