@n1xyz/nord-ts 0.0.1 → 0.0.4
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/.eslintrc.js +11 -0
- package/README.md +148 -65
- package/dist/bridge/NordUser.d.ts +78 -0
- package/dist/bridge/NordUser.js +196 -0
- package/dist/bridge/client.d.ts +150 -0
- package/dist/bridge/client.js +394 -0
- package/dist/bridge/const.d.ts +23 -0
- package/dist/bridge/const.js +47 -0
- package/dist/bridge/index.d.ts +5 -0
- package/dist/bridge/index.js +23 -0
- package/dist/bridge/types.d.ts +118 -0
- package/dist/bridge/types.js +16 -0
- package/dist/bridge/utils.d.ts +64 -0
- package/dist/bridge/utils.js +131 -0
- package/dist/client.d.ts +70 -0
- package/dist/client.js +129 -0
- package/dist/const.d.ts +2 -5
- package/dist/const.js +18 -22
- package/dist/constants/endpoints.d.ts +65 -0
- package/dist/constants/endpoints.js +68 -0
- package/dist/gen/common.d.ts +6 -1
- package/dist/gen/common.js +19 -9
- package/dist/gen/nord.d.ts +75 -17
- package/dist/gen/nord.js +987 -423
- package/dist/idl/bridge.d.ts +2 -0
- package/dist/idl/bridge.js +703 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +18 -2
- package/dist/models/account.d.ts +58 -0
- package/dist/models/account.js +6 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +28 -0
- package/dist/models/market.d.ts +137 -0
- package/dist/models/market.js +6 -0
- package/dist/models/order.d.ts +211 -0
- package/dist/models/order.js +6 -0
- package/dist/models/token.d.ts +50 -0
- package/dist/models/token.js +6 -0
- package/dist/nord/Nord.d.ts +222 -49
- package/dist/nord/Nord.js +290 -278
- package/dist/nord/NordError.d.ts +23 -0
- package/dist/nord/NordError.js +48 -0
- package/dist/nord/NordImpl.d.ts +6 -2
- package/dist/nord/NordImpl.js +21 -1
- package/dist/nord/NordUser.d.ts +208 -42
- package/dist/nord/NordUser.js +389 -157
- package/dist/nord/Subscriber.d.ts +37 -0
- package/dist/nord/Subscriber.js +29 -0
- package/dist/nord/api/actions.d.ts +101 -0
- package/dist/nord/api/actions.js +250 -0
- package/dist/nord/api/core.d.ts +49 -0
- package/dist/nord/api/core.js +121 -0
- package/dist/nord/api/index.d.ts +1 -0
- package/dist/nord/api/index.js +17 -0
- package/dist/nord/api/market.d.ts +36 -0
- package/dist/nord/api/market.js +98 -0
- package/dist/nord/api/metrics.d.ts +67 -0
- package/dist/nord/api/metrics.js +132 -0
- package/dist/nord/api/orderFunctions.d.ts +168 -0
- package/dist/nord/api/orderFunctions.js +133 -0
- package/dist/nord/api/queries.d.ts +81 -0
- package/dist/nord/api/queries.js +187 -0
- package/dist/nord/client/Nord.d.ts +335 -0
- package/dist/nord/client/Nord.js +532 -0
- package/dist/nord/client/NordUser.d.ts +320 -0
- package/dist/nord/client/NordUser.js +701 -0
- package/dist/nord/core.d.ts +48 -0
- package/dist/nord/core.js +97 -0
- package/dist/nord/index.d.ts +9 -2
- package/dist/nord/index.js +30 -6
- package/dist/nord/market.d.ts +36 -0
- package/dist/nord/market.js +90 -0
- package/dist/nord/metrics.d.ts +67 -0
- package/dist/nord/metrics.js +124 -0
- package/dist/nord/models/Subscriber.d.ts +37 -0
- package/dist/nord/models/Subscriber.js +29 -0
- package/dist/nord/queries.d.ts +81 -0
- package/dist/nord/queries.js +181 -0
- package/dist/nord/types.d.ts +88 -0
- package/dist/nord/types.js +2 -0
- package/dist/nord/utils/NordError.d.ts +35 -0
- package/dist/nord/utils/NordError.js +46 -0
- package/dist/nord/websocket.d.ts +49 -0
- package/dist/nord/websocket.js +107 -0
- package/dist/operations/account.d.ts +58 -0
- package/dist/operations/account.js +112 -0
- package/dist/operations/market.d.ts +65 -0
- package/dist/operations/market.js +131 -0
- package/dist/operations/orders.d.ts +57 -0
- package/dist/operations/orders.js +129 -0
- package/dist/solana/NordUser.d.ts +78 -0
- package/dist/solana/NordUser.js +196 -0
- package/dist/solana/client.d.ts +139 -0
- package/dist/solana/client.js +360 -0
- package/dist/solana/const.d.ts +23 -0
- package/dist/solana/const.js +47 -0
- package/dist/solana/index.d.ts +5 -0
- package/dist/solana/index.js +23 -0
- package/dist/solana/types.d.ts +118 -0
- package/dist/solana/types.js +16 -0
- package/dist/solana/utils.d.ts +64 -0
- package/dist/solana/utils.js +131 -0
- package/dist/types/api.d.ts +152 -0
- package/dist/types/api.js +6 -0
- package/dist/types/config.d.ts +34 -0
- package/dist/types/config.js +6 -0
- package/dist/types.d.ts +144 -87
- package/dist/types.js +13 -2
- package/dist/utils/errors.d.ts +96 -0
- package/dist/utils/errors.js +132 -0
- package/dist/utils/http.d.ts +35 -0
- package/dist/utils/http.js +105 -0
- package/dist/utils.d.ts +14 -5
- package/dist/utils.js +26 -7
- package/dist/websocket/NordWebSocketClient.d.ts +71 -0
- package/dist/websocket/NordWebSocketClient.js +343 -0
- package/dist/websocket/client.d.ts +93 -0
- package/dist/websocket/client.js +222 -0
- package/dist/websocket/events.d.ts +19 -0
- package/dist/websocket/events.js +2 -0
- package/dist/websocket/index.d.ts +2 -0
- package/dist/websocket/index.js +5 -0
- package/dist/websocket.d.ts +55 -0
- package/dist/websocket.js +211 -0
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Nord.html +2 -15
- package/docs/classes/NordUser.html +4 -4
- package/docs/enums/FillMode.html +2 -2
- package/docs/enums/KeyType.html +2 -2
- package/docs/enums/PeakTpsPeriodUnit.html +2 -2
- package/docs/enums/Side.html +2 -2
- package/docs/functions/assert.html +1 -1
- package/docs/functions/bigIntToProtoU128.html +1 -1
- package/docs/functions/checkPubKeyLength.html +1 -1
- package/docs/functions/checkedFetch.html +1 -1
- package/docs/functions/decodeLengthDelimited.html +1 -1
- package/docs/functions/encodeLengthDelimited.html +1 -1
- package/docs/functions/fillModeToProtoFillMode.html +1 -1
- package/docs/functions/findMarket.html +1 -1
- package/docs/functions/findToken.html +1 -1
- package/docs/functions/makeWalletSignFn.html +1 -1
- package/docs/functions/optExpect.html +1 -1
- package/docs/functions/optMap.html +1 -1
- package/docs/functions/optUnwrap.html +1 -1
- package/docs/functions/panic.html +1 -1
- package/docs/functions/signAction.html +1 -1
- package/docs/functions/toScaledU128.html +1 -1
- package/docs/functions/toScaledU64.html +1 -1
- package/docs/interfaces/Account.html +2 -2
- package/docs/interfaces/ActionInfo.html +2 -2
- package/docs/interfaces/ActionQuery.html +2 -2
- package/docs/interfaces/ActionResponse.html +2 -2
- package/docs/interfaces/ActionsExtendedInfo.html +2 -2
- package/docs/interfaces/ActionsQuery.html +2 -2
- package/docs/interfaces/ActionsResponse.html +2 -2
- package/docs/interfaces/AggregateMetrics.html +2 -2
- package/docs/interfaces/BlockQuery.html +2 -2
- package/docs/interfaces/BlockResponse.html +2 -2
- package/docs/interfaces/BlockSummary.html +2 -2
- package/docs/interfaces/BlockSummaryResponse.html +2 -2
- package/docs/interfaces/DeltaEvent.html +2 -2
- package/docs/interfaces/ERC20TokenInfo.html +2 -2
- package/docs/interfaces/Info.html +2 -2
- package/docs/interfaces/Market.html +2 -2
- package/docs/interfaces/MarketStats.html +2 -2
- package/docs/interfaces/MarketsStatsResponse.html +2 -2
- package/docs/interfaces/NordConfig.html +2 -2
- package/docs/interfaces/Order.html +2 -2
- package/docs/interfaces/OrderInfo.html +2 -2
- package/docs/interfaces/PerpMarketStats.html +2 -2
- package/docs/interfaces/RollmanActionExtendedInfo.html +2 -2
- package/docs/interfaces/RollmanActionInfo.html +2 -2
- package/docs/interfaces/RollmanActionResponse.html +2 -2
- package/docs/interfaces/RollmanActionsResponse.html +2 -2
- package/docs/interfaces/RollmanBlockResponse.html +2 -2
- package/docs/interfaces/SubscriberConfig.html +2 -2
- package/docs/interfaces/Token.html +2 -2
- package/docs/interfaces/Trade.html +2 -2
- package/docs/interfaces/Trades.html +2 -2
- package/docs/modules.html +0 -7
- package/docs/types/BigIntValue.html +1 -1
- package/docs/variables/DEBUG_KEYS.html +1 -1
- package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +1 -1
- package/docs/variables/DEV_CONTRACT_ADDRESS.html +1 -1
- package/docs/variables/DEV_TOKEN_INFOS.html +1 -1
- package/docs/variables/DEV_URL.html +1 -1
- package/docs/variables/ERC20_ABI.html +1 -1
- package/docs/variables/EVM_DEV_URL.html +1 -1
- package/docs/variables/FAUCET_PRIVATE_ADDRESS.html +1 -1
- package/docs/variables/MAX_BUFFER_LEN.html +1 -1
- package/docs/variables/NORD_GETTERS_FACET_ABI.html +1 -1
- package/docs/variables/NORD_RAMP_FACET_ABI.html +1 -1
- package/docs/variables/SESSION_TTL.html +1 -1
- package/docs/variables/WEBSERVER_DEV_URL.html +1 -1
- package/docs/variables/ZERO_DECIMAL.html +1 -1
- package/package.json +10 -12
- package/src/bridge/client.ts +487 -0
- package/src/bridge/const.ts +53 -0
- package/src/bridge/index.ts +7 -0
- package/src/bridge/types.ts +127 -0
- package/src/bridge/utils.ts +140 -0
- package/src/const.ts +20 -25
- package/src/gen/common.ts +27 -10
- package/src/gen/nord.ts +1044 -483
- package/src/idl/bridge.ts +702 -0
- package/src/index.ts +24 -5
- package/src/nord/{actions.ts → api/actions.ts} +33 -37
- package/src/nord/api/core.ts +130 -0
- package/src/nord/api/market.ts +125 -0
- package/src/nord/api/metrics.ts +154 -0
- package/src/nord/api/queries.ts +236 -0
- package/src/nord/client/Nord.ts +652 -0
- package/src/nord/client/NordUser.ts +1105 -0
- package/src/nord/index.ts +16 -2
- package/src/nord/models/Subscriber.ts +57 -0
- package/src/nord/utils/NordError.ts +72 -0
- package/src/types.ts +170 -99
- package/src/utils.ts +40 -19
- package/src/websocket/NordWebSocketClient.ts +432 -0
- package/src/websocket/events.ts +31 -0
- package/src/websocket/index.ts +2 -0
- package/tests/utils.spec.ts +24 -24
- package/docs/classes/Subscriber.html +0 -6
- package/docs/functions/createWebSocketSubscription.html +0 -12
- package/docs/interfaces/OrderbookOrder.html +0 -6
- package/docs/interfaces/OrderbookResponse.html +0 -10
- package/docs/interfaces/TradeInfo.html +0 -20
- package/docs/interfaces/TradesQueryParams.html +0 -10
- package/docs/interfaces/TradesResponse.html +0 -12
- package/src/abis/ERC20_ABI.ts +0 -310
- package/src/abis/NORD_GETTERS_FACET_ABI.ts +0 -192
- package/src/abis/NORD_RAMP_FACET_ABI.ts +0 -141
- package/src/abis/index.ts +0 -3
- package/src/nord/Nord.ts +0 -504
- package/src/nord/NordImpl.ts +0 -8
- package/src/nord/NordUser.ts +0 -469
package/src/gen/nord.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
-
// protoc
|
|
3
|
+
// protoc-gen-ts_proto v2.6.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
5
|
// source: nord.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
@@ -148,7 +148,6 @@ export function marketTypeToJSON(object: MarketType): string {
|
|
|
148
148
|
*/
|
|
149
149
|
export enum Error {
|
|
150
150
|
DUPLICATE = 0,
|
|
151
|
-
TIMESTAMP_STALE = 1,
|
|
152
151
|
DECODE_FAILURE = 2,
|
|
153
152
|
INVALID_SIGNATURE = 3,
|
|
154
153
|
MARKET_NOT_FOUND = 4,
|
|
@@ -178,7 +177,6 @@ export enum Error {
|
|
|
178
177
|
INDEX_PRICE_OUT_OF_RANGE = 103,
|
|
179
178
|
INDEX_DECIMALS_OUT_OF_RANGE = 104,
|
|
180
179
|
INVALID_STATE_VERSION = 105,
|
|
181
|
-
POSITION_STATE_IS_WRONG_FOR_ORDER = 106,
|
|
182
180
|
INVALID_MARGINS = 107,
|
|
183
181
|
/** ACTION_CANNOT_BE_DELEGATED - means that user cannot execute proposed action on behalf of different user */
|
|
184
182
|
ACTION_CANNOT_BE_DELEGATED = 108,
|
|
@@ -195,9 +193,6 @@ export enum Error {
|
|
|
195
193
|
*/
|
|
196
194
|
MARKET_DECIMALS_EXCEED_LIMITS = 109,
|
|
197
195
|
TOO_MANY_TOKENS = 110,
|
|
198
|
-
BANKRUPTCY = 111,
|
|
199
|
-
/** TOKEN_ALREADY_REGISTERED - Token with specified blockchain address already registered */
|
|
200
|
-
TOKEN_ALREADY_REGISTERED = 112,
|
|
201
196
|
FUNDING_OVERFLOW = 123,
|
|
202
197
|
/**
|
|
203
198
|
* CAN_REDUCE_POSITION_ONLY_IF_ALL_ORDERS_ARE_CANCELED - If there is order to cancel for position, it should be canceled first
|
|
@@ -208,13 +203,13 @@ export enum Error {
|
|
|
208
203
|
/** UNEXPECTED_TOKEN_ID - Token was found, but not expected to be used in action context */
|
|
209
204
|
UNEXPECTED_TOKEN_ID = 127,
|
|
210
205
|
SIGNATURE_VERIFICATION = 128,
|
|
211
|
-
/** MARKET_NOT_READY - Happens when market is not read to handle orders */
|
|
212
|
-
MARKET_NOT_READY = 129,
|
|
213
206
|
/**
|
|
214
207
|
* TOKEN_NOT_READY - happens in some situation when token misses some relevant information
|
|
215
|
-
* needed for operation
|
|
208
|
+
* needed for operation, for example index price
|
|
216
209
|
*/
|
|
217
210
|
TOKEN_NOT_READY = 130,
|
|
211
|
+
/** TOKEN_ALREADY_REGISTERED - Token with specified blockchain address already registered */
|
|
212
|
+
TOKEN_ALREADY_REGISTERED = 112,
|
|
218
213
|
OMF_LESS_THAN_OR_EQUAL_IMF = 131,
|
|
219
214
|
ORDER_ON_UNHEALTHY_ACCOUNT_CAN_ONLY_IMPROVE = 132,
|
|
220
215
|
IMMEDIATE_ORDER_GOT_NO_FILLS = 133,
|
|
@@ -251,6 +246,11 @@ export enum Error {
|
|
|
251
246
|
ORDER_EXECUTION_MISSING_PRICE = 156,
|
|
252
247
|
/** ORDER_EXECUTION_SIZE_LIMIT - 10011_101; */
|
|
253
248
|
ORDER_EXECUTION_SIZE_LIMIT = 157,
|
|
249
|
+
/**
|
|
250
|
+
* ORDER_REDUCE_IS_POST_ONLY - 10011_110;
|
|
251
|
+
* Reduce orders can only be post only.
|
|
252
|
+
*/
|
|
253
|
+
ORDER_REDUCE_IS_POST_ONLY = 158,
|
|
254
254
|
/** BALANCE - 10100_000 */
|
|
255
255
|
BALANCE = 160,
|
|
256
256
|
/** BALANCE_DEPOSIT_OVERFLOW - 10100_001 */
|
|
@@ -285,6 +285,33 @@ export enum Error {
|
|
|
285
285
|
* Binary pattern: 10101_001
|
|
286
286
|
*/
|
|
287
287
|
TRIGGER_INVALID_PRICE = 169,
|
|
288
|
+
/** TIMESTAMP - 10110_000 */
|
|
289
|
+
TIMESTAMP = 176,
|
|
290
|
+
/** TIMESTAMP_OUT_OF_THRESHOLD - 10110_001 */
|
|
291
|
+
TIMESTAMP_OUT_OF_THRESHOLD = 177,
|
|
292
|
+
TIMESTAMP_STALE = 178,
|
|
293
|
+
/** BANKRUPTCY - 10111_000 */
|
|
294
|
+
BANKRUPTCY = 184,
|
|
295
|
+
/** BANKRUPTCY_INSUFFICIENT_COVERAGE - 10111_001 */
|
|
296
|
+
BANKRUPTCY_INSUFFICIENT_COVERAGE = 185,
|
|
297
|
+
/**
|
|
298
|
+
* BANKRUPTCY_NOT_FOUND - 10111_010
|
|
299
|
+
* Account is not in bankruptcy state.
|
|
300
|
+
*/
|
|
301
|
+
BANKRUPTCY_NOT_FOUND = 186,
|
|
302
|
+
/**
|
|
303
|
+
* MARKET_NOT_READY - 11000_000
|
|
304
|
+
* Happens when market is not read to handle orders
|
|
305
|
+
*/
|
|
306
|
+
MARKET_NOT_READY = 192,
|
|
307
|
+
MARKET_FROZEN = 193,
|
|
308
|
+
/** POSITION - 11001_000 */
|
|
309
|
+
POSITION = 200,
|
|
310
|
+
POSITION_STATE_ORDER = 202,
|
|
311
|
+
POSITION_STATE_ORDER_PRICE = 203,
|
|
312
|
+
POSITION_STATE_ORDER_SIZE = 204,
|
|
313
|
+
POSITION_STATE_ORDER_SIDE = 205,
|
|
314
|
+
POSITION_SIZE_LIMIT = 206,
|
|
288
315
|
Dropped = 999,
|
|
289
316
|
}
|
|
290
317
|
|
|
@@ -293,9 +320,6 @@ export function errorFromJSON(object: any): Error {
|
|
|
293
320
|
case 0:
|
|
294
321
|
case "DUPLICATE":
|
|
295
322
|
return Error.DUPLICATE;
|
|
296
|
-
case 1:
|
|
297
|
-
case "TIMESTAMP_STALE":
|
|
298
|
-
return Error.TIMESTAMP_STALE;
|
|
299
323
|
case 2:
|
|
300
324
|
case "DECODE_FAILURE":
|
|
301
325
|
return Error.DECODE_FAILURE;
|
|
@@ -380,9 +404,6 @@ export function errorFromJSON(object: any): Error {
|
|
|
380
404
|
case 105:
|
|
381
405
|
case "INVALID_STATE_VERSION":
|
|
382
406
|
return Error.INVALID_STATE_VERSION;
|
|
383
|
-
case 106:
|
|
384
|
-
case "POSITION_STATE_IS_WRONG_FOR_ORDER":
|
|
385
|
-
return Error.POSITION_STATE_IS_WRONG_FOR_ORDER;
|
|
386
407
|
case 107:
|
|
387
408
|
case "INVALID_MARGINS":
|
|
388
409
|
return Error.INVALID_MARGINS;
|
|
@@ -395,12 +416,6 @@ export function errorFromJSON(object: any): Error {
|
|
|
395
416
|
case 110:
|
|
396
417
|
case "TOO_MANY_TOKENS":
|
|
397
418
|
return Error.TOO_MANY_TOKENS;
|
|
398
|
-
case 111:
|
|
399
|
-
case "BANKRUPTCY":
|
|
400
|
-
return Error.BANKRUPTCY;
|
|
401
|
-
case 112:
|
|
402
|
-
case "TOKEN_ALREADY_REGISTERED":
|
|
403
|
-
return Error.TOKEN_ALREADY_REGISTERED;
|
|
404
419
|
case 123:
|
|
405
420
|
case "FUNDING_OVERFLOW":
|
|
406
421
|
return Error.FUNDING_OVERFLOW;
|
|
@@ -416,12 +431,12 @@ export function errorFromJSON(object: any): Error {
|
|
|
416
431
|
case 128:
|
|
417
432
|
case "SIGNATURE_VERIFICATION":
|
|
418
433
|
return Error.SIGNATURE_VERIFICATION;
|
|
419
|
-
case 129:
|
|
420
|
-
case "MARKET_NOT_READY":
|
|
421
|
-
return Error.MARKET_NOT_READY;
|
|
422
434
|
case 130:
|
|
423
435
|
case "TOKEN_NOT_READY":
|
|
424
436
|
return Error.TOKEN_NOT_READY;
|
|
437
|
+
case 112:
|
|
438
|
+
case "TOKEN_ALREADY_REGISTERED":
|
|
439
|
+
return Error.TOKEN_ALREADY_REGISTERED;
|
|
425
440
|
case 131:
|
|
426
441
|
case "OMF_LESS_THAN_OR_EQUAL_IMF":
|
|
427
442
|
return Error.OMF_LESS_THAN_OR_EQUAL_IMF;
|
|
@@ -482,6 +497,9 @@ export function errorFromJSON(object: any): Error {
|
|
|
482
497
|
case 157:
|
|
483
498
|
case "ORDER_EXECUTION_SIZE_LIMIT":
|
|
484
499
|
return Error.ORDER_EXECUTION_SIZE_LIMIT;
|
|
500
|
+
case 158:
|
|
501
|
+
case "ORDER_REDUCE_IS_POST_ONLY":
|
|
502
|
+
return Error.ORDER_REDUCE_IS_POST_ONLY;
|
|
485
503
|
case 160:
|
|
486
504
|
case "BALANCE":
|
|
487
505
|
return Error.BALANCE;
|
|
@@ -509,6 +527,48 @@ export function errorFromJSON(object: any): Error {
|
|
|
509
527
|
case 169:
|
|
510
528
|
case "TRIGGER_INVALID_PRICE":
|
|
511
529
|
return Error.TRIGGER_INVALID_PRICE;
|
|
530
|
+
case 176:
|
|
531
|
+
case "TIMESTAMP":
|
|
532
|
+
return Error.TIMESTAMP;
|
|
533
|
+
case 177:
|
|
534
|
+
case "TIMESTAMP_OUT_OF_THRESHOLD":
|
|
535
|
+
return Error.TIMESTAMP_OUT_OF_THRESHOLD;
|
|
536
|
+
case 178:
|
|
537
|
+
case "TIMESTAMP_STALE":
|
|
538
|
+
return Error.TIMESTAMP_STALE;
|
|
539
|
+
case 184:
|
|
540
|
+
case "BANKRUPTCY":
|
|
541
|
+
return Error.BANKRUPTCY;
|
|
542
|
+
case 185:
|
|
543
|
+
case "BANKRUPTCY_INSUFFICIENT_COVERAGE":
|
|
544
|
+
return Error.BANKRUPTCY_INSUFFICIENT_COVERAGE;
|
|
545
|
+
case 186:
|
|
546
|
+
case "BANKRUPTCY_NOT_FOUND":
|
|
547
|
+
return Error.BANKRUPTCY_NOT_FOUND;
|
|
548
|
+
case 192:
|
|
549
|
+
case "MARKET_NOT_READY":
|
|
550
|
+
return Error.MARKET_NOT_READY;
|
|
551
|
+
case 193:
|
|
552
|
+
case "MARKET_FROZEN":
|
|
553
|
+
return Error.MARKET_FROZEN;
|
|
554
|
+
case 200:
|
|
555
|
+
case "POSITION":
|
|
556
|
+
return Error.POSITION;
|
|
557
|
+
case 202:
|
|
558
|
+
case "POSITION_STATE_ORDER":
|
|
559
|
+
return Error.POSITION_STATE_ORDER;
|
|
560
|
+
case 203:
|
|
561
|
+
case "POSITION_STATE_ORDER_PRICE":
|
|
562
|
+
return Error.POSITION_STATE_ORDER_PRICE;
|
|
563
|
+
case 204:
|
|
564
|
+
case "POSITION_STATE_ORDER_SIZE":
|
|
565
|
+
return Error.POSITION_STATE_ORDER_SIZE;
|
|
566
|
+
case 205:
|
|
567
|
+
case "POSITION_STATE_ORDER_SIDE":
|
|
568
|
+
return Error.POSITION_STATE_ORDER_SIDE;
|
|
569
|
+
case 206:
|
|
570
|
+
case "POSITION_SIZE_LIMIT":
|
|
571
|
+
return Error.POSITION_SIZE_LIMIT;
|
|
512
572
|
case 999:
|
|
513
573
|
case "Dropped":
|
|
514
574
|
return Error.Dropped;
|
|
@@ -521,8 +581,6 @@ export function errorToJSON(object: Error): string {
|
|
|
521
581
|
switch (object) {
|
|
522
582
|
case Error.DUPLICATE:
|
|
523
583
|
return "DUPLICATE";
|
|
524
|
-
case Error.TIMESTAMP_STALE:
|
|
525
|
-
return "TIMESTAMP_STALE";
|
|
526
584
|
case Error.DECODE_FAILURE:
|
|
527
585
|
return "DECODE_FAILURE";
|
|
528
586
|
case Error.INVALID_SIGNATURE:
|
|
@@ -579,8 +637,6 @@ export function errorToJSON(object: Error): string {
|
|
|
579
637
|
return "INDEX_DECIMALS_OUT_OF_RANGE";
|
|
580
638
|
case Error.INVALID_STATE_VERSION:
|
|
581
639
|
return "INVALID_STATE_VERSION";
|
|
582
|
-
case Error.POSITION_STATE_IS_WRONG_FOR_ORDER:
|
|
583
|
-
return "POSITION_STATE_IS_WRONG_FOR_ORDER";
|
|
584
640
|
case Error.INVALID_MARGINS:
|
|
585
641
|
return "INVALID_MARGINS";
|
|
586
642
|
case Error.ACTION_CANNOT_BE_DELEGATED:
|
|
@@ -589,10 +645,6 @@ export function errorToJSON(object: Error): string {
|
|
|
589
645
|
return "MARKET_DECIMALS_EXCEED_LIMITS";
|
|
590
646
|
case Error.TOO_MANY_TOKENS:
|
|
591
647
|
return "TOO_MANY_TOKENS";
|
|
592
|
-
case Error.BANKRUPTCY:
|
|
593
|
-
return "BANKRUPTCY";
|
|
594
|
-
case Error.TOKEN_ALREADY_REGISTERED:
|
|
595
|
-
return "TOKEN_ALREADY_REGISTERED";
|
|
596
648
|
case Error.FUNDING_OVERFLOW:
|
|
597
649
|
return "FUNDING_OVERFLOW";
|
|
598
650
|
case Error.CAN_REDUCE_POSITION_ONLY_IF_ALL_ORDERS_ARE_CANCELED:
|
|
@@ -603,10 +655,10 @@ export function errorToJSON(object: Error): string {
|
|
|
603
655
|
return "UNEXPECTED_TOKEN_ID";
|
|
604
656
|
case Error.SIGNATURE_VERIFICATION:
|
|
605
657
|
return "SIGNATURE_VERIFICATION";
|
|
606
|
-
case Error.MARKET_NOT_READY:
|
|
607
|
-
return "MARKET_NOT_READY";
|
|
608
658
|
case Error.TOKEN_NOT_READY:
|
|
609
659
|
return "TOKEN_NOT_READY";
|
|
660
|
+
case Error.TOKEN_ALREADY_REGISTERED:
|
|
661
|
+
return "TOKEN_ALREADY_REGISTERED";
|
|
610
662
|
case Error.OMF_LESS_THAN_OR_EQUAL_IMF:
|
|
611
663
|
return "OMF_LESS_THAN_OR_EQUAL_IMF";
|
|
612
664
|
case Error.ORDER_ON_UNHEALTHY_ACCOUNT_CAN_ONLY_IMPROVE:
|
|
@@ -647,6 +699,8 @@ export function errorToJSON(object: Error): string {
|
|
|
647
699
|
return "ORDER_EXECUTION_MISSING_PRICE";
|
|
648
700
|
case Error.ORDER_EXECUTION_SIZE_LIMIT:
|
|
649
701
|
return "ORDER_EXECUTION_SIZE_LIMIT";
|
|
702
|
+
case Error.ORDER_REDUCE_IS_POST_ONLY:
|
|
703
|
+
return "ORDER_REDUCE_IS_POST_ONLY";
|
|
650
704
|
case Error.BALANCE:
|
|
651
705
|
return "BALANCE";
|
|
652
706
|
case Error.BALANCE_DEPOSIT_OVERFLOW:
|
|
@@ -665,6 +719,34 @@ export function errorToJSON(object: Error): string {
|
|
|
665
719
|
return "TRIGGER";
|
|
666
720
|
case Error.TRIGGER_INVALID_PRICE:
|
|
667
721
|
return "TRIGGER_INVALID_PRICE";
|
|
722
|
+
case Error.TIMESTAMP:
|
|
723
|
+
return "TIMESTAMP";
|
|
724
|
+
case Error.TIMESTAMP_OUT_OF_THRESHOLD:
|
|
725
|
+
return "TIMESTAMP_OUT_OF_THRESHOLD";
|
|
726
|
+
case Error.TIMESTAMP_STALE:
|
|
727
|
+
return "TIMESTAMP_STALE";
|
|
728
|
+
case Error.BANKRUPTCY:
|
|
729
|
+
return "BANKRUPTCY";
|
|
730
|
+
case Error.BANKRUPTCY_INSUFFICIENT_COVERAGE:
|
|
731
|
+
return "BANKRUPTCY_INSUFFICIENT_COVERAGE";
|
|
732
|
+
case Error.BANKRUPTCY_NOT_FOUND:
|
|
733
|
+
return "BANKRUPTCY_NOT_FOUND";
|
|
734
|
+
case Error.MARKET_NOT_READY:
|
|
735
|
+
return "MARKET_NOT_READY";
|
|
736
|
+
case Error.MARKET_FROZEN:
|
|
737
|
+
return "MARKET_FROZEN";
|
|
738
|
+
case Error.POSITION:
|
|
739
|
+
return "POSITION";
|
|
740
|
+
case Error.POSITION_STATE_ORDER:
|
|
741
|
+
return "POSITION_STATE_ORDER";
|
|
742
|
+
case Error.POSITION_STATE_ORDER_PRICE:
|
|
743
|
+
return "POSITION_STATE_ORDER_PRICE";
|
|
744
|
+
case Error.POSITION_STATE_ORDER_SIZE:
|
|
745
|
+
return "POSITION_STATE_ORDER_SIZE";
|
|
746
|
+
case Error.POSITION_STATE_ORDER_SIDE:
|
|
747
|
+
return "POSITION_STATE_ORDER_SIDE";
|
|
748
|
+
case Error.POSITION_SIZE_LIMIT:
|
|
749
|
+
return "POSITION_SIZE_LIMIT";
|
|
668
750
|
case Error.Dropped:
|
|
669
751
|
return "Dropped";
|
|
670
752
|
default:
|
|
@@ -672,6 +754,29 @@ export function errorToJSON(object: Error): string {
|
|
|
672
754
|
}
|
|
673
755
|
}
|
|
674
756
|
|
|
757
|
+
export enum SpecialAccount {
|
|
758
|
+
FeeVault = 0,
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export function specialAccountFromJSON(object: any): SpecialAccount {
|
|
762
|
+
switch (object) {
|
|
763
|
+
case 0:
|
|
764
|
+
case "FeeVault":
|
|
765
|
+
return SpecialAccount.FeeVault;
|
|
766
|
+
default:
|
|
767
|
+
throw new globalThis.Error("Unrecognized enum value " + object + " for enum SpecialAccount");
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export function specialAccountToJSON(object: SpecialAccount): string {
|
|
772
|
+
switch (object) {
|
|
773
|
+
case SpecialAccount.FeeVault:
|
|
774
|
+
return "FeeVault";
|
|
775
|
+
default:
|
|
776
|
+
throw new globalThis.Error("Unrecognized enum value " + object + " for enum SpecialAccount");
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
|
|
675
780
|
/** Emulation of 128-bit integers since Protobuf doesn't have native support */
|
|
676
781
|
export interface U128 {
|
|
677
782
|
/** Low 64-bit word */
|
|
@@ -770,9 +875,7 @@ export interface Action_CreateToken {
|
|
|
770
875
|
/** / Used to bind to relevant oracle feed */
|
|
771
876
|
oracleSymbol: string;
|
|
772
877
|
/** On chain id for the wrapped asset on the rollup */
|
|
773
|
-
|
|
774
|
-
/** Minimum amount to withdraw per action to disincentivize spam. */
|
|
775
|
-
minWithdrawAmount: bigint;
|
|
878
|
+
solAddr: Uint8Array;
|
|
776
879
|
}
|
|
777
880
|
|
|
778
881
|
export interface Action_CreateMarket {
|
|
@@ -811,6 +914,10 @@ export interface Action_CreateMarket {
|
|
|
811
914
|
* This behavior exists because order can be limited by quote size,
|
|
812
915
|
* which converts to order size in a non-linear manner.
|
|
813
916
|
*
|
|
917
|
+
* Some orders can be executed immediately, in this no order will be added to
|
|
918
|
+
* orderbook, no order id created. Consider using `client_order_id` to track
|
|
919
|
+
* execution of such orders.
|
|
920
|
+
*
|
|
814
921
|
* Example: User posts order with size 2^48+100_000. Order fills counter
|
|
815
922
|
* orders and its size is reduced to 2^48-1_000_000 in process. This order
|
|
816
923
|
* will be added to orderbook successfully despite its initial size is above
|
|
@@ -935,6 +1042,12 @@ export interface Action_PythPriceFeedUpdate {
|
|
|
935
1042
|
rawPythnetData: Uint8Array;
|
|
936
1043
|
}
|
|
937
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* Perform final account liquidation procedure.
|
|
1047
|
+
* Can be executed only accounts with AV < 0 (bankrupt).
|
|
1048
|
+
* After execution, `liquidatee_account_id` is removed from state.
|
|
1049
|
+
* See MARKETS.md `Bankruptcy` for details.
|
|
1050
|
+
*/
|
|
938
1051
|
export interface Action_Liquidate {
|
|
939
1052
|
liquidatorSessionId: bigint;
|
|
940
1053
|
liquidateeAccountId: number;
|
|
@@ -952,13 +1065,21 @@ export interface Action_Pause {
|
|
|
952
1065
|
export interface Action_Unpause {
|
|
953
1066
|
}
|
|
954
1067
|
|
|
1068
|
+
/** Transfers tokens to specified account. */
|
|
955
1069
|
export interface Action_Transfer {
|
|
956
1070
|
sessionId: bigint;
|
|
957
1071
|
fromAccountId: number;
|
|
958
1072
|
tokenId: number;
|
|
959
1073
|
amount: bigint;
|
|
960
|
-
/** If target account id isn't specified, new account is created */
|
|
961
|
-
toAccountId?:
|
|
1074
|
+
/** If target account id isn't specified, new account is created. */
|
|
1075
|
+
toAccountId?:
|
|
1076
|
+
| number
|
|
1077
|
+
| undefined;
|
|
1078
|
+
/**
|
|
1079
|
+
* If specified, than `to_account_id` must be none.
|
|
1080
|
+
* Transfer funds to accounts, for example to cover bankruptcies.
|
|
1081
|
+
*/
|
|
1082
|
+
specialAccount?: SpecialAccount | undefined;
|
|
962
1083
|
}
|
|
963
1084
|
|
|
964
1085
|
export interface Action_AddTrigger {
|
|
@@ -998,7 +1119,7 @@ export interface Receipt {
|
|
|
998
1119
|
| { $case: "oracleSymbolFeedResult"; value: Receipt_OracleSymbolFeedResult }
|
|
999
1120
|
| { $case: "oracleUpdateResult"; value: Receipt_OracleUpdateResult }
|
|
1000
1121
|
| { $case: "updateGuardianSetResult"; value: Receipt_UpdateGuardianSetResult }
|
|
1001
|
-
| { $case: "liquidated"; value:
|
|
1122
|
+
| { $case: "liquidated"; value: Receipt_AccountLiquidated }
|
|
1002
1123
|
| { $case: "sessionRevoked"; value: Receipt_SessionRevoked }
|
|
1003
1124
|
| { $case: "paused"; value: Receipt_Paused }
|
|
1004
1125
|
| { $case: "unpaused"; value: Receipt_Unpaused }
|
|
@@ -1015,7 +1136,6 @@ export interface Receipt_Posted {
|
|
|
1015
1136
|
size: bigint;
|
|
1016
1137
|
orderId: bigint;
|
|
1017
1138
|
accountId: number;
|
|
1018
|
-
clientOrderId?: bigint | undefined;
|
|
1019
1139
|
}
|
|
1020
1140
|
|
|
1021
1141
|
export interface Receipt_Trade {
|
|
@@ -1033,6 +1153,7 @@ export interface Receipt_CreateSessionResult {
|
|
|
1033
1153
|
export interface Receipt_PlaceOrderResult {
|
|
1034
1154
|
posted?: Receipt_Posted | undefined;
|
|
1035
1155
|
fills: Receipt_Trade[];
|
|
1156
|
+
clientOrderId?: bigint | undefined;
|
|
1036
1157
|
}
|
|
1037
1158
|
|
|
1038
1159
|
export interface Receipt_CancelOrderResult {
|
|
@@ -1082,7 +1203,18 @@ export interface Receipt_UpdateGuardianSetResult {
|
|
|
1082
1203
|
addresses: Uint8Array[];
|
|
1083
1204
|
}
|
|
1084
1205
|
|
|
1085
|
-
export interface
|
|
1206
|
+
export interface Receipt_PerpPosition {
|
|
1207
|
+
marketId: number;
|
|
1208
|
+
baseSize: bigint;
|
|
1209
|
+
price: bigint;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/** / Result of bankruptcy liquidation. */
|
|
1213
|
+
export interface Receipt_AccountLiquidated {
|
|
1214
|
+
liquidatorAccountId: number;
|
|
1215
|
+
liquidateeAccountId: number;
|
|
1216
|
+
cancelledOrders: bigint[];
|
|
1217
|
+
removedPerps: Receipt_PerpPosition[];
|
|
1086
1218
|
}
|
|
1087
1219
|
|
|
1088
1220
|
export interface Receipt_SessionRevoked {
|
|
@@ -1096,10 +1228,11 @@ export interface Receipt_Unpaused {
|
|
|
1096
1228
|
|
|
1097
1229
|
export interface Receipt_Transferred {
|
|
1098
1230
|
fromAccountId: number;
|
|
1099
|
-
|
|
1231
|
+
toUserAccount?: number | undefined;
|
|
1100
1232
|
tokenId: number;
|
|
1101
1233
|
amount: bigint;
|
|
1102
1234
|
accountCreated: boolean;
|
|
1235
|
+
toSpecialAccount?: SpecialAccount | undefined;
|
|
1103
1236
|
}
|
|
1104
1237
|
|
|
1105
1238
|
export interface Receipt_TriggerAdded {
|
|
@@ -1136,20 +1269,22 @@ export const U128: MessageFns<U128> = {
|
|
|
1136
1269
|
while (reader.pos < end) {
|
|
1137
1270
|
const tag = reader.uint32();
|
|
1138
1271
|
switch (tag >>> 3) {
|
|
1139
|
-
case 1:
|
|
1272
|
+
case 1: {
|
|
1140
1273
|
if (tag !== 8) {
|
|
1141
1274
|
break;
|
|
1142
1275
|
}
|
|
1143
1276
|
|
|
1144
1277
|
message.lo = reader.uint64() as bigint;
|
|
1145
1278
|
continue;
|
|
1146
|
-
|
|
1279
|
+
}
|
|
1280
|
+
case 2: {
|
|
1147
1281
|
if (tag !== 16) {
|
|
1148
1282
|
break;
|
|
1149
1283
|
}
|
|
1150
1284
|
|
|
1151
1285
|
message.hi = reader.uint64() as bigint;
|
|
1152
1286
|
continue;
|
|
1287
|
+
}
|
|
1153
1288
|
}
|
|
1154
1289
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1155
1290
|
break;
|
|
@@ -1238,69 +1373,78 @@ export const Market: MessageFns<Market> = {
|
|
|
1238
1373
|
while (reader.pos < end) {
|
|
1239
1374
|
const tag = reader.uint32();
|
|
1240
1375
|
switch (tag >>> 3) {
|
|
1241
|
-
case 1:
|
|
1376
|
+
case 1: {
|
|
1242
1377
|
if (tag !== 8) {
|
|
1243
1378
|
break;
|
|
1244
1379
|
}
|
|
1245
1380
|
|
|
1246
1381
|
message.marketId = reader.uint32();
|
|
1247
1382
|
continue;
|
|
1248
|
-
|
|
1383
|
+
}
|
|
1384
|
+
case 2: {
|
|
1249
1385
|
if (tag !== 16) {
|
|
1250
1386
|
break;
|
|
1251
1387
|
}
|
|
1252
1388
|
|
|
1253
1389
|
message.priceDecimals = reader.uint32();
|
|
1254
1390
|
continue;
|
|
1255
|
-
|
|
1391
|
+
}
|
|
1392
|
+
case 3: {
|
|
1256
1393
|
if (tag !== 24) {
|
|
1257
1394
|
break;
|
|
1258
1395
|
}
|
|
1259
1396
|
|
|
1260
1397
|
message.sizeDecimals = reader.uint32();
|
|
1261
1398
|
continue;
|
|
1262
|
-
|
|
1399
|
+
}
|
|
1400
|
+
case 4: {
|
|
1263
1401
|
if (tag !== 32) {
|
|
1264
1402
|
break;
|
|
1265
1403
|
}
|
|
1266
1404
|
|
|
1267
1405
|
message.baseTokenId = reader.uint32();
|
|
1268
1406
|
continue;
|
|
1269
|
-
|
|
1407
|
+
}
|
|
1408
|
+
case 5: {
|
|
1270
1409
|
if (tag !== 40) {
|
|
1271
1410
|
break;
|
|
1272
1411
|
}
|
|
1273
1412
|
|
|
1274
1413
|
message.marketType = reader.int32() as any;
|
|
1275
1414
|
continue;
|
|
1276
|
-
|
|
1415
|
+
}
|
|
1416
|
+
case 6: {
|
|
1277
1417
|
if (tag !== 48) {
|
|
1278
1418
|
break;
|
|
1279
1419
|
}
|
|
1280
1420
|
|
|
1281
1421
|
message.imfBps = reader.uint32();
|
|
1282
1422
|
continue;
|
|
1283
|
-
|
|
1423
|
+
}
|
|
1424
|
+
case 7: {
|
|
1284
1425
|
if (tag !== 56) {
|
|
1285
1426
|
break;
|
|
1286
1427
|
}
|
|
1287
1428
|
|
|
1288
1429
|
message.cmfBps = reader.uint32();
|
|
1289
1430
|
continue;
|
|
1290
|
-
|
|
1431
|
+
}
|
|
1432
|
+
case 8: {
|
|
1291
1433
|
if (tag !== 64) {
|
|
1292
1434
|
break;
|
|
1293
1435
|
}
|
|
1294
1436
|
|
|
1295
1437
|
message.mmfBps = reader.uint32();
|
|
1296
1438
|
continue;
|
|
1297
|
-
|
|
1439
|
+
}
|
|
1440
|
+
case 10: {
|
|
1298
1441
|
if (tag !== 82) {
|
|
1299
1442
|
break;
|
|
1300
1443
|
}
|
|
1301
1444
|
|
|
1302
1445
|
message.viewSymbol = reader.string();
|
|
1303
1446
|
continue;
|
|
1447
|
+
}
|
|
1304
1448
|
}
|
|
1305
1449
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1306
1450
|
break;
|
|
@@ -1402,34 +1546,38 @@ export const Token: MessageFns<Token> = {
|
|
|
1402
1546
|
while (reader.pos < end) {
|
|
1403
1547
|
const tag = reader.uint32();
|
|
1404
1548
|
switch (tag >>> 3) {
|
|
1405
|
-
case 1:
|
|
1549
|
+
case 1: {
|
|
1406
1550
|
if (tag !== 8) {
|
|
1407
1551
|
break;
|
|
1408
1552
|
}
|
|
1409
1553
|
|
|
1410
1554
|
message.tokenId = reader.uint32();
|
|
1411
1555
|
continue;
|
|
1412
|
-
|
|
1556
|
+
}
|
|
1557
|
+
case 2: {
|
|
1413
1558
|
if (tag !== 16) {
|
|
1414
1559
|
break;
|
|
1415
1560
|
}
|
|
1416
1561
|
|
|
1417
1562
|
message.tokenDecimals = reader.uint32();
|
|
1418
1563
|
continue;
|
|
1419
|
-
|
|
1564
|
+
}
|
|
1565
|
+
case 4: {
|
|
1420
1566
|
if (tag !== 32) {
|
|
1421
1567
|
break;
|
|
1422
1568
|
}
|
|
1423
1569
|
|
|
1424
1570
|
message.weightBps = reader.uint32();
|
|
1425
1571
|
continue;
|
|
1426
|
-
|
|
1572
|
+
}
|
|
1573
|
+
case 5: {
|
|
1427
1574
|
if (tag !== 42) {
|
|
1428
1575
|
break;
|
|
1429
1576
|
}
|
|
1430
1577
|
|
|
1431
1578
|
message.viewSymbol = reader.string();
|
|
1432
1579
|
continue;
|
|
1580
|
+
}
|
|
1433
1581
|
}
|
|
1434
1582
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1435
1583
|
break;
|
|
@@ -1559,70 +1707,79 @@ export const Action: MessageFns<Action> = {
|
|
|
1559
1707
|
while (reader.pos < end) {
|
|
1560
1708
|
const tag = reader.uint32();
|
|
1561
1709
|
switch (tag >>> 3) {
|
|
1562
|
-
case 1:
|
|
1710
|
+
case 1: {
|
|
1563
1711
|
if (tag !== 8) {
|
|
1564
1712
|
break;
|
|
1565
1713
|
}
|
|
1566
1714
|
|
|
1567
1715
|
message.currentTimestamp = reader.int64() as bigint;
|
|
1568
1716
|
continue;
|
|
1569
|
-
|
|
1717
|
+
}
|
|
1718
|
+
case 2: {
|
|
1570
1719
|
if (tag !== 16) {
|
|
1571
1720
|
break;
|
|
1572
1721
|
}
|
|
1573
1722
|
|
|
1574
1723
|
message.nonce = reader.uint32();
|
|
1575
1724
|
continue;
|
|
1576
|
-
|
|
1725
|
+
}
|
|
1726
|
+
case 4: {
|
|
1577
1727
|
if (tag !== 34) {
|
|
1578
1728
|
break;
|
|
1579
1729
|
}
|
|
1580
1730
|
|
|
1581
1731
|
message.kind = { $case: "createSession", value: Action_CreateSession.decode(reader, reader.uint32()) };
|
|
1582
1732
|
continue;
|
|
1583
|
-
|
|
1733
|
+
}
|
|
1734
|
+
case 5: {
|
|
1584
1735
|
if (tag !== 42) {
|
|
1585
1736
|
break;
|
|
1586
1737
|
}
|
|
1587
1738
|
|
|
1588
1739
|
message.kind = { $case: "createToken", value: Action_CreateToken.decode(reader, reader.uint32()) };
|
|
1589
1740
|
continue;
|
|
1590
|
-
|
|
1741
|
+
}
|
|
1742
|
+
case 6: {
|
|
1591
1743
|
if (tag !== 50) {
|
|
1592
1744
|
break;
|
|
1593
1745
|
}
|
|
1594
1746
|
|
|
1595
1747
|
message.kind = { $case: "createMarket", value: Action_CreateMarket.decode(reader, reader.uint32()) };
|
|
1596
1748
|
continue;
|
|
1597
|
-
|
|
1749
|
+
}
|
|
1750
|
+
case 7: {
|
|
1598
1751
|
if (tag !== 58) {
|
|
1599
1752
|
break;
|
|
1600
1753
|
}
|
|
1601
1754
|
|
|
1602
1755
|
message.kind = { $case: "placeOrder", value: Action_PlaceOrder.decode(reader, reader.uint32()) };
|
|
1603
1756
|
continue;
|
|
1604
|
-
|
|
1757
|
+
}
|
|
1758
|
+
case 8: {
|
|
1605
1759
|
if (tag !== 66) {
|
|
1606
1760
|
break;
|
|
1607
1761
|
}
|
|
1608
1762
|
|
|
1609
1763
|
message.kind = { $case: "cancelOrderById", value: Action_CancelOrderById.decode(reader, reader.uint32()) };
|
|
1610
1764
|
continue;
|
|
1611
|
-
|
|
1765
|
+
}
|
|
1766
|
+
case 9: {
|
|
1612
1767
|
if (tag !== 74) {
|
|
1613
1768
|
break;
|
|
1614
1769
|
}
|
|
1615
1770
|
|
|
1616
1771
|
message.kind = { $case: "deposit", value: Action_Deposit.decode(reader, reader.uint32()) };
|
|
1617
1772
|
continue;
|
|
1618
|
-
|
|
1773
|
+
}
|
|
1774
|
+
case 10: {
|
|
1619
1775
|
if (tag !== 82) {
|
|
1620
1776
|
break;
|
|
1621
1777
|
}
|
|
1622
1778
|
|
|
1623
1779
|
message.kind = { $case: "withdraw", value: Action_Withdraw.decode(reader, reader.uint32()) };
|
|
1624
1780
|
continue;
|
|
1625
|
-
|
|
1781
|
+
}
|
|
1782
|
+
case 11: {
|
|
1626
1783
|
if (tag !== 90) {
|
|
1627
1784
|
break;
|
|
1628
1785
|
}
|
|
@@ -1632,7 +1789,8 @@ export const Action: MessageFns<Action> = {
|
|
|
1632
1789
|
value: Action_PythSetWormholeGuardians.decode(reader, reader.uint32()),
|
|
1633
1790
|
};
|
|
1634
1791
|
continue;
|
|
1635
|
-
|
|
1792
|
+
}
|
|
1793
|
+
case 12: {
|
|
1636
1794
|
if (tag !== 98) {
|
|
1637
1795
|
break;
|
|
1638
1796
|
}
|
|
@@ -1642,7 +1800,8 @@ export const Action: MessageFns<Action> = {
|
|
|
1642
1800
|
value: Action_PythSetSymbolFeed.decode(reader, reader.uint32()),
|
|
1643
1801
|
};
|
|
1644
1802
|
continue;
|
|
1645
|
-
|
|
1803
|
+
}
|
|
1804
|
+
case 13: {
|
|
1646
1805
|
if (tag !== 106) {
|
|
1647
1806
|
break;
|
|
1648
1807
|
}
|
|
@@ -1652,62 +1811,71 @@ export const Action: MessageFns<Action> = {
|
|
|
1652
1811
|
value: Action_PythPriceFeedUpdate.decode(reader, reader.uint32()),
|
|
1653
1812
|
};
|
|
1654
1813
|
continue;
|
|
1655
|
-
|
|
1814
|
+
}
|
|
1815
|
+
case 14: {
|
|
1656
1816
|
if (tag !== 114) {
|
|
1657
1817
|
break;
|
|
1658
1818
|
}
|
|
1659
1819
|
|
|
1660
1820
|
message.kind = { $case: "liquidate", value: Action_Liquidate.decode(reader, reader.uint32()) };
|
|
1661
1821
|
continue;
|
|
1662
|
-
|
|
1822
|
+
}
|
|
1823
|
+
case 15: {
|
|
1663
1824
|
if (tag !== 122) {
|
|
1664
1825
|
break;
|
|
1665
1826
|
}
|
|
1666
1827
|
|
|
1667
1828
|
message.kind = { $case: "revokeSession", value: Action_RevokeSession.decode(reader, reader.uint32()) };
|
|
1668
1829
|
continue;
|
|
1669
|
-
|
|
1830
|
+
}
|
|
1831
|
+
case 16: {
|
|
1670
1832
|
if (tag !== 130) {
|
|
1671
1833
|
break;
|
|
1672
1834
|
}
|
|
1673
1835
|
|
|
1674
1836
|
message.kind = { $case: "pause", value: Action_Pause.decode(reader, reader.uint32()) };
|
|
1675
1837
|
continue;
|
|
1676
|
-
|
|
1838
|
+
}
|
|
1839
|
+
case 17: {
|
|
1677
1840
|
if (tag !== 138) {
|
|
1678
1841
|
break;
|
|
1679
1842
|
}
|
|
1680
1843
|
|
|
1681
1844
|
message.kind = { $case: "unpause", value: Action_Unpause.decode(reader, reader.uint32()) };
|
|
1682
1845
|
continue;
|
|
1683
|
-
|
|
1846
|
+
}
|
|
1847
|
+
case 18: {
|
|
1684
1848
|
if (tag !== 146) {
|
|
1685
1849
|
break;
|
|
1686
1850
|
}
|
|
1687
1851
|
|
|
1688
1852
|
message.kind = { $case: "transfer", value: Action_Transfer.decode(reader, reader.uint32()) };
|
|
1689
1853
|
continue;
|
|
1690
|
-
|
|
1854
|
+
}
|
|
1855
|
+
case 19: {
|
|
1691
1856
|
if (tag !== 154) {
|
|
1692
1857
|
break;
|
|
1693
1858
|
}
|
|
1694
1859
|
|
|
1695
1860
|
message.kind = { $case: "message", value: Message.decode(reader, reader.uint32()) };
|
|
1696
1861
|
continue;
|
|
1697
|
-
|
|
1862
|
+
}
|
|
1863
|
+
case 32: {
|
|
1698
1864
|
if (tag !== 258) {
|
|
1699
1865
|
break;
|
|
1700
1866
|
}
|
|
1701
1867
|
|
|
1702
1868
|
message.kind = { $case: "addTrigger", value: Action_AddTrigger.decode(reader, reader.uint32()) };
|
|
1703
1869
|
continue;
|
|
1704
|
-
|
|
1870
|
+
}
|
|
1871
|
+
case 33: {
|
|
1705
1872
|
if (tag !== 266) {
|
|
1706
1873
|
break;
|
|
1707
1874
|
}
|
|
1708
1875
|
|
|
1709
1876
|
message.kind = { $case: "removeTrigger", value: Action_RemoveTrigger.decode(reader, reader.uint32()) };
|
|
1710
1877
|
continue;
|
|
1878
|
+
}
|
|
1711
1879
|
}
|
|
1712
1880
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1713
1881
|
break;
|
|
@@ -1774,56 +1942,39 @@ export const Action: MessageFns<Action> = {
|
|
|
1774
1942
|
}
|
|
1775
1943
|
if (message.kind?.$case === "createSession") {
|
|
1776
1944
|
obj.createSession = Action_CreateSession.toJSON(message.kind.value);
|
|
1777
|
-
}
|
|
1778
|
-
if (message.kind?.$case === "createToken") {
|
|
1945
|
+
} else if (message.kind?.$case === "createToken") {
|
|
1779
1946
|
obj.createToken = Action_CreateToken.toJSON(message.kind.value);
|
|
1780
|
-
}
|
|
1781
|
-
if (message.kind?.$case === "createMarket") {
|
|
1947
|
+
} else if (message.kind?.$case === "createMarket") {
|
|
1782
1948
|
obj.createMarket = Action_CreateMarket.toJSON(message.kind.value);
|
|
1783
|
-
}
|
|
1784
|
-
if (message.kind?.$case === "placeOrder") {
|
|
1949
|
+
} else if (message.kind?.$case === "placeOrder") {
|
|
1785
1950
|
obj.placeOrder = Action_PlaceOrder.toJSON(message.kind.value);
|
|
1786
|
-
}
|
|
1787
|
-
if (message.kind?.$case === "cancelOrderById") {
|
|
1951
|
+
} else if (message.kind?.$case === "cancelOrderById") {
|
|
1788
1952
|
obj.cancelOrderById = Action_CancelOrderById.toJSON(message.kind.value);
|
|
1789
|
-
}
|
|
1790
|
-
if (message.kind?.$case === "deposit") {
|
|
1953
|
+
} else if (message.kind?.$case === "deposit") {
|
|
1791
1954
|
obj.deposit = Action_Deposit.toJSON(message.kind.value);
|
|
1792
|
-
}
|
|
1793
|
-
if (message.kind?.$case === "withdraw") {
|
|
1955
|
+
} else if (message.kind?.$case === "withdraw") {
|
|
1794
1956
|
obj.withdraw = Action_Withdraw.toJSON(message.kind.value);
|
|
1795
|
-
}
|
|
1796
|
-
if (message.kind?.$case === "pythSetWormholeGuardians") {
|
|
1957
|
+
} else if (message.kind?.$case === "pythSetWormholeGuardians") {
|
|
1797
1958
|
obj.pythSetWormholeGuardians = Action_PythSetWormholeGuardians.toJSON(message.kind.value);
|
|
1798
|
-
}
|
|
1799
|
-
if (message.kind?.$case === "pythSetSymbolFeed") {
|
|
1959
|
+
} else if (message.kind?.$case === "pythSetSymbolFeed") {
|
|
1800
1960
|
obj.pythSetSymbolFeed = Action_PythSetSymbolFeed.toJSON(message.kind.value);
|
|
1801
|
-
}
|
|
1802
|
-
if (message.kind?.$case === "pythPriceFeedUpdate") {
|
|
1961
|
+
} else if (message.kind?.$case === "pythPriceFeedUpdate") {
|
|
1803
1962
|
obj.pythPriceFeedUpdate = Action_PythPriceFeedUpdate.toJSON(message.kind.value);
|
|
1804
|
-
}
|
|
1805
|
-
if (message.kind?.$case === "liquidate") {
|
|
1963
|
+
} else if (message.kind?.$case === "liquidate") {
|
|
1806
1964
|
obj.liquidate = Action_Liquidate.toJSON(message.kind.value);
|
|
1807
|
-
}
|
|
1808
|
-
if (message.kind?.$case === "revokeSession") {
|
|
1965
|
+
} else if (message.kind?.$case === "revokeSession") {
|
|
1809
1966
|
obj.revokeSession = Action_RevokeSession.toJSON(message.kind.value);
|
|
1810
|
-
}
|
|
1811
|
-
if (message.kind?.$case === "pause") {
|
|
1967
|
+
} else if (message.kind?.$case === "pause") {
|
|
1812
1968
|
obj.pause = Action_Pause.toJSON(message.kind.value);
|
|
1813
|
-
}
|
|
1814
|
-
if (message.kind?.$case === "unpause") {
|
|
1969
|
+
} else if (message.kind?.$case === "unpause") {
|
|
1815
1970
|
obj.unpause = Action_Unpause.toJSON(message.kind.value);
|
|
1816
|
-
}
|
|
1817
|
-
if (message.kind?.$case === "transfer") {
|
|
1971
|
+
} else if (message.kind?.$case === "transfer") {
|
|
1818
1972
|
obj.transfer = Action_Transfer.toJSON(message.kind.value);
|
|
1819
|
-
}
|
|
1820
|
-
if (message.kind?.$case === "message") {
|
|
1973
|
+
} else if (message.kind?.$case === "message") {
|
|
1821
1974
|
obj.message = Message.toJSON(message.kind.value);
|
|
1822
|
-
}
|
|
1823
|
-
if (message.kind?.$case === "addTrigger") {
|
|
1975
|
+
} else if (message.kind?.$case === "addTrigger") {
|
|
1824
1976
|
obj.addTrigger = Action_AddTrigger.toJSON(message.kind.value);
|
|
1825
|
-
}
|
|
1826
|
-
if (message.kind?.$case === "removeTrigger") {
|
|
1977
|
+
} else if (message.kind?.$case === "removeTrigger") {
|
|
1827
1978
|
obj.removeTrigger = Action_RemoveTrigger.toJSON(message.kind.value);
|
|
1828
1979
|
}
|
|
1829
1980
|
return obj;
|
|
@@ -1836,68 +1987,121 @@ export const Action: MessageFns<Action> = {
|
|
|
1836
1987
|
const message = createBaseAction();
|
|
1837
1988
|
message.currentTimestamp = object.currentTimestamp ?? 0n;
|
|
1838
1989
|
message.nonce = object.nonce ?? 0;
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1990
|
+
switch (object.kind?.$case) {
|
|
1991
|
+
case "createSession": {
|
|
1992
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
1993
|
+
message.kind = { $case: "createSession", value: Action_CreateSession.fromPartial(object.kind.value) };
|
|
1994
|
+
}
|
|
1995
|
+
break;
|
|
1996
|
+
}
|
|
1997
|
+
case "createToken": {
|
|
1998
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
1999
|
+
message.kind = { $case: "createToken", value: Action_CreateToken.fromPartial(object.kind.value) };
|
|
2000
|
+
}
|
|
2001
|
+
break;
|
|
2002
|
+
}
|
|
2003
|
+
case "createMarket": {
|
|
2004
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2005
|
+
message.kind = { $case: "createMarket", value: Action_CreateMarket.fromPartial(object.kind.value) };
|
|
2006
|
+
}
|
|
2007
|
+
break;
|
|
2008
|
+
}
|
|
2009
|
+
case "placeOrder": {
|
|
2010
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2011
|
+
message.kind = { $case: "placeOrder", value: Action_PlaceOrder.fromPartial(object.kind.value) };
|
|
2012
|
+
}
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
case "cancelOrderById": {
|
|
2016
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2017
|
+
message.kind = { $case: "cancelOrderById", value: Action_CancelOrderById.fromPartial(object.kind.value) };
|
|
2018
|
+
}
|
|
2019
|
+
break;
|
|
2020
|
+
}
|
|
2021
|
+
case "deposit": {
|
|
2022
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2023
|
+
message.kind = { $case: "deposit", value: Action_Deposit.fromPartial(object.kind.value) };
|
|
2024
|
+
}
|
|
2025
|
+
break;
|
|
2026
|
+
}
|
|
2027
|
+
case "withdraw": {
|
|
2028
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2029
|
+
message.kind = { $case: "withdraw", value: Action_Withdraw.fromPartial(object.kind.value) };
|
|
2030
|
+
}
|
|
2031
|
+
break;
|
|
2032
|
+
}
|
|
2033
|
+
case "pythSetWormholeGuardians": {
|
|
2034
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2035
|
+
message.kind = {
|
|
2036
|
+
$case: "pythSetWormholeGuardians",
|
|
2037
|
+
value: Action_PythSetWormholeGuardians.fromPartial(object.kind.value),
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
break;
|
|
2041
|
+
}
|
|
2042
|
+
case "pythSetSymbolFeed": {
|
|
2043
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2044
|
+
message.kind = { $case: "pythSetSymbolFeed", value: Action_PythSetSymbolFeed.fromPartial(object.kind.value) };
|
|
2045
|
+
}
|
|
2046
|
+
break;
|
|
2047
|
+
}
|
|
2048
|
+
case "pythPriceFeedUpdate": {
|
|
2049
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2050
|
+
message.kind = {
|
|
2051
|
+
$case: "pythPriceFeedUpdate",
|
|
2052
|
+
value: Action_PythPriceFeedUpdate.fromPartial(object.kind.value),
|
|
2053
|
+
};
|
|
2054
|
+
}
|
|
2055
|
+
break;
|
|
2056
|
+
}
|
|
2057
|
+
case "liquidate": {
|
|
2058
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2059
|
+
message.kind = { $case: "liquidate", value: Action_Liquidate.fromPartial(object.kind.value) };
|
|
2060
|
+
}
|
|
2061
|
+
break;
|
|
2062
|
+
}
|
|
2063
|
+
case "revokeSession": {
|
|
2064
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2065
|
+
message.kind = { $case: "revokeSession", value: Action_RevokeSession.fromPartial(object.kind.value) };
|
|
2066
|
+
}
|
|
2067
|
+
break;
|
|
2068
|
+
}
|
|
2069
|
+
case "pause": {
|
|
2070
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2071
|
+
message.kind = { $case: "pause", value: Action_Pause.fromPartial(object.kind.value) };
|
|
2072
|
+
}
|
|
2073
|
+
break;
|
|
2074
|
+
}
|
|
2075
|
+
case "unpause": {
|
|
2076
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2077
|
+
message.kind = { $case: "unpause", value: Action_Unpause.fromPartial(object.kind.value) };
|
|
2078
|
+
}
|
|
2079
|
+
break;
|
|
2080
|
+
}
|
|
2081
|
+
case "transfer": {
|
|
2082
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2083
|
+
message.kind = { $case: "transfer", value: Action_Transfer.fromPartial(object.kind.value) };
|
|
2084
|
+
}
|
|
2085
|
+
break;
|
|
2086
|
+
}
|
|
2087
|
+
case "message": {
|
|
2088
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2089
|
+
message.kind = { $case: "message", value: Message.fromPartial(object.kind.value) };
|
|
2090
|
+
}
|
|
2091
|
+
break;
|
|
2092
|
+
}
|
|
2093
|
+
case "addTrigger": {
|
|
2094
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2095
|
+
message.kind = { $case: "addTrigger", value: Action_AddTrigger.fromPartial(object.kind.value) };
|
|
2096
|
+
}
|
|
2097
|
+
break;
|
|
2098
|
+
}
|
|
2099
|
+
case "removeTrigger": {
|
|
2100
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2101
|
+
message.kind = { $case: "removeTrigger", value: Action_RemoveTrigger.fromPartial(object.kind.value) };
|
|
2102
|
+
}
|
|
2103
|
+
break;
|
|
2104
|
+
}
|
|
1901
2105
|
}
|
|
1902
2106
|
return message;
|
|
1903
2107
|
},
|
|
@@ -1931,27 +2135,30 @@ export const Action_CreateSession: MessageFns<Action_CreateSession> = {
|
|
|
1931
2135
|
while (reader.pos < end) {
|
|
1932
2136
|
const tag = reader.uint32();
|
|
1933
2137
|
switch (tag >>> 3) {
|
|
1934
|
-
case 1:
|
|
2138
|
+
case 1: {
|
|
1935
2139
|
if (tag !== 10) {
|
|
1936
2140
|
break;
|
|
1937
2141
|
}
|
|
1938
2142
|
|
|
1939
2143
|
message.userPubkey = reader.bytes();
|
|
1940
2144
|
continue;
|
|
1941
|
-
|
|
2145
|
+
}
|
|
2146
|
+
case 2: {
|
|
1942
2147
|
if (tag !== 18) {
|
|
1943
2148
|
break;
|
|
1944
2149
|
}
|
|
1945
2150
|
|
|
1946
2151
|
message.blstPubkey = reader.bytes();
|
|
1947
2152
|
continue;
|
|
1948
|
-
|
|
2153
|
+
}
|
|
2154
|
+
case 3: {
|
|
1949
2155
|
if (tag !== 24) {
|
|
1950
2156
|
break;
|
|
1951
2157
|
}
|
|
1952
2158
|
|
|
1953
2159
|
message.expiryTimestamp = reader.int64() as bigint;
|
|
1954
2160
|
continue;
|
|
2161
|
+
}
|
|
1955
2162
|
}
|
|
1956
2163
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1957
2164
|
break;
|
|
@@ -1996,14 +2203,7 @@ export const Action_CreateSession: MessageFns<Action_CreateSession> = {
|
|
|
1996
2203
|
};
|
|
1997
2204
|
|
|
1998
2205
|
function createBaseAction_CreateToken(): Action_CreateToken {
|
|
1999
|
-
return {
|
|
2000
|
-
tokenDecimals: 0,
|
|
2001
|
-
weightBps: 0,
|
|
2002
|
-
viewSymbol: "",
|
|
2003
|
-
oracleSymbol: "",
|
|
2004
|
-
ethAddr: new Uint8Array(0),
|
|
2005
|
-
minWithdrawAmount: 0n,
|
|
2006
|
-
};
|
|
2206
|
+
return { tokenDecimals: 0, weightBps: 0, viewSymbol: "", oracleSymbol: "", solAddr: new Uint8Array(0) };
|
|
2007
2207
|
}
|
|
2008
2208
|
|
|
2009
2209
|
export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
@@ -2020,14 +2220,8 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2020
2220
|
if (message.oracleSymbol !== "") {
|
|
2021
2221
|
writer.uint32(42).string(message.oracleSymbol);
|
|
2022
2222
|
}
|
|
2023
|
-
if (message.
|
|
2024
|
-
writer.uint32(50).bytes(message.
|
|
2025
|
-
}
|
|
2026
|
-
if (message.minWithdrawAmount !== 0n) {
|
|
2027
|
-
if (BigInt.asUintN(64, message.minWithdrawAmount) !== message.minWithdrawAmount) {
|
|
2028
|
-
throw new globalThis.Error("value provided for field message.minWithdrawAmount of type uint64 too large");
|
|
2029
|
-
}
|
|
2030
|
-
writer.uint32(56).uint64(message.minWithdrawAmount);
|
|
2223
|
+
if (message.solAddr.length !== 0) {
|
|
2224
|
+
writer.uint32(50).bytes(message.solAddr);
|
|
2031
2225
|
}
|
|
2032
2226
|
return writer;
|
|
2033
2227
|
},
|
|
@@ -2039,48 +2233,46 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2039
2233
|
while (reader.pos < end) {
|
|
2040
2234
|
const tag = reader.uint32();
|
|
2041
2235
|
switch (tag >>> 3) {
|
|
2042
|
-
case 1:
|
|
2236
|
+
case 1: {
|
|
2043
2237
|
if (tag !== 8) {
|
|
2044
2238
|
break;
|
|
2045
2239
|
}
|
|
2046
2240
|
|
|
2047
2241
|
message.tokenDecimals = reader.uint32();
|
|
2048
2242
|
continue;
|
|
2049
|
-
|
|
2243
|
+
}
|
|
2244
|
+
case 3: {
|
|
2050
2245
|
if (tag !== 24) {
|
|
2051
2246
|
break;
|
|
2052
2247
|
}
|
|
2053
2248
|
|
|
2054
2249
|
message.weightBps = reader.uint32();
|
|
2055
2250
|
continue;
|
|
2056
|
-
|
|
2251
|
+
}
|
|
2252
|
+
case 4: {
|
|
2057
2253
|
if (tag !== 34) {
|
|
2058
2254
|
break;
|
|
2059
2255
|
}
|
|
2060
2256
|
|
|
2061
2257
|
message.viewSymbol = reader.string();
|
|
2062
2258
|
continue;
|
|
2063
|
-
|
|
2259
|
+
}
|
|
2260
|
+
case 5: {
|
|
2064
2261
|
if (tag !== 42) {
|
|
2065
2262
|
break;
|
|
2066
2263
|
}
|
|
2067
2264
|
|
|
2068
2265
|
message.oracleSymbol = reader.string();
|
|
2069
2266
|
continue;
|
|
2070
|
-
|
|
2267
|
+
}
|
|
2268
|
+
case 6: {
|
|
2071
2269
|
if (tag !== 50) {
|
|
2072
2270
|
break;
|
|
2073
2271
|
}
|
|
2074
2272
|
|
|
2075
|
-
message.
|
|
2076
|
-
continue;
|
|
2077
|
-
case 7:
|
|
2078
|
-
if (tag !== 56) {
|
|
2079
|
-
break;
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
message.minWithdrawAmount = reader.uint64() as bigint;
|
|
2273
|
+
message.solAddr = reader.bytes();
|
|
2083
2274
|
continue;
|
|
2275
|
+
}
|
|
2084
2276
|
}
|
|
2085
2277
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2086
2278
|
break;
|
|
@@ -2096,8 +2288,7 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2096
2288
|
weightBps: isSet(object.weightBps) ? globalThis.Number(object.weightBps) : 0,
|
|
2097
2289
|
viewSymbol: isSet(object.viewSymbol) ? globalThis.String(object.viewSymbol) : "",
|
|
2098
2290
|
oracleSymbol: isSet(object.oracleSymbol) ? globalThis.String(object.oracleSymbol) : "",
|
|
2099
|
-
|
|
2100
|
-
minWithdrawAmount: isSet(object.minWithdrawAmount) ? BigInt(object.minWithdrawAmount) : 0n,
|
|
2291
|
+
solAddr: isSet(object.solAddr) ? bytesFromBase64(object.solAddr) : new Uint8Array(0),
|
|
2101
2292
|
};
|
|
2102
2293
|
},
|
|
2103
2294
|
|
|
@@ -2115,11 +2306,8 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2115
2306
|
if (message.oracleSymbol !== "") {
|
|
2116
2307
|
obj.oracleSymbol = message.oracleSymbol;
|
|
2117
2308
|
}
|
|
2118
|
-
if (message.
|
|
2119
|
-
obj.
|
|
2120
|
-
}
|
|
2121
|
-
if (message.minWithdrawAmount !== 0n) {
|
|
2122
|
-
obj.minWithdrawAmount = message.minWithdrawAmount.toString();
|
|
2309
|
+
if (message.solAddr.length !== 0) {
|
|
2310
|
+
obj.solAddr = base64FromBytes(message.solAddr);
|
|
2123
2311
|
}
|
|
2124
2312
|
return obj;
|
|
2125
2313
|
},
|
|
@@ -2133,8 +2321,7 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2133
2321
|
message.weightBps = object.weightBps ?? 0;
|
|
2134
2322
|
message.viewSymbol = object.viewSymbol ?? "";
|
|
2135
2323
|
message.oracleSymbol = object.oracleSymbol ?? "";
|
|
2136
|
-
message.
|
|
2137
|
-
message.minWithdrawAmount = object.minWithdrawAmount ?? 0n;
|
|
2324
|
+
message.solAddr = object.solAddr ?? new Uint8Array(0);
|
|
2138
2325
|
return message;
|
|
2139
2326
|
},
|
|
2140
2327
|
};
|
|
@@ -2192,69 +2379,78 @@ export const Action_CreateMarket: MessageFns<Action_CreateMarket> = {
|
|
|
2192
2379
|
while (reader.pos < end) {
|
|
2193
2380
|
const tag = reader.uint32();
|
|
2194
2381
|
switch (tag >>> 3) {
|
|
2195
|
-
case 1:
|
|
2382
|
+
case 1: {
|
|
2196
2383
|
if (tag !== 8) {
|
|
2197
2384
|
break;
|
|
2198
2385
|
}
|
|
2199
2386
|
|
|
2200
2387
|
message.sizeDecimals = reader.uint32();
|
|
2201
2388
|
continue;
|
|
2202
|
-
|
|
2389
|
+
}
|
|
2390
|
+
case 2: {
|
|
2203
2391
|
if (tag !== 16) {
|
|
2204
2392
|
break;
|
|
2205
2393
|
}
|
|
2206
2394
|
|
|
2207
2395
|
message.priceDecimals = reader.uint32();
|
|
2208
2396
|
continue;
|
|
2209
|
-
|
|
2397
|
+
}
|
|
2398
|
+
case 3: {
|
|
2210
2399
|
if (tag !== 24) {
|
|
2211
2400
|
break;
|
|
2212
2401
|
}
|
|
2213
2402
|
|
|
2214
2403
|
message.imfBps = reader.uint32();
|
|
2215
2404
|
continue;
|
|
2216
|
-
|
|
2405
|
+
}
|
|
2406
|
+
case 4: {
|
|
2217
2407
|
if (tag !== 32) {
|
|
2218
2408
|
break;
|
|
2219
2409
|
}
|
|
2220
2410
|
|
|
2221
2411
|
message.cmfBps = reader.uint32();
|
|
2222
2412
|
continue;
|
|
2223
|
-
|
|
2413
|
+
}
|
|
2414
|
+
case 5: {
|
|
2224
2415
|
if (tag !== 40) {
|
|
2225
2416
|
break;
|
|
2226
2417
|
}
|
|
2227
2418
|
|
|
2228
2419
|
message.mmfBps = reader.uint32();
|
|
2229
2420
|
continue;
|
|
2230
|
-
|
|
2421
|
+
}
|
|
2422
|
+
case 6: {
|
|
2231
2423
|
if (tag !== 48) {
|
|
2232
2424
|
break;
|
|
2233
2425
|
}
|
|
2234
2426
|
|
|
2235
2427
|
message.marketType = reader.int32() as any;
|
|
2236
2428
|
continue;
|
|
2237
|
-
|
|
2429
|
+
}
|
|
2430
|
+
case 7: {
|
|
2238
2431
|
if (tag !== 58) {
|
|
2239
2432
|
break;
|
|
2240
2433
|
}
|
|
2241
2434
|
|
|
2242
2435
|
message.viewSymbol = reader.string();
|
|
2243
2436
|
continue;
|
|
2244
|
-
|
|
2437
|
+
}
|
|
2438
|
+
case 8: {
|
|
2245
2439
|
if (tag !== 66) {
|
|
2246
2440
|
break;
|
|
2247
2441
|
}
|
|
2248
2442
|
|
|
2249
2443
|
message.oracleSymbol = reader.string();
|
|
2250
2444
|
continue;
|
|
2251
|
-
|
|
2445
|
+
}
|
|
2446
|
+
case 9: {
|
|
2252
2447
|
if (tag !== 72) {
|
|
2253
2448
|
break;
|
|
2254
2449
|
}
|
|
2255
2450
|
|
|
2256
2451
|
message.baseTokenId = reader.uint32();
|
|
2257
2452
|
continue;
|
|
2453
|
+
}
|
|
2258
2454
|
}
|
|
2259
2455
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2260
2456
|
break;
|
|
@@ -2401,83 +2597,94 @@ export const Action_PlaceOrder: MessageFns<Action_PlaceOrder> = {
|
|
|
2401
2597
|
while (reader.pos < end) {
|
|
2402
2598
|
const tag = reader.uint32();
|
|
2403
2599
|
switch (tag >>> 3) {
|
|
2404
|
-
case 1:
|
|
2600
|
+
case 1: {
|
|
2405
2601
|
if (tag !== 8) {
|
|
2406
2602
|
break;
|
|
2407
2603
|
}
|
|
2408
2604
|
|
|
2409
2605
|
message.sessionId = reader.uint64() as bigint;
|
|
2410
2606
|
continue;
|
|
2411
|
-
|
|
2607
|
+
}
|
|
2608
|
+
case 2: {
|
|
2412
2609
|
if (tag !== 16) {
|
|
2413
2610
|
break;
|
|
2414
2611
|
}
|
|
2415
2612
|
|
|
2416
2613
|
message.marketId = reader.uint32();
|
|
2417
2614
|
continue;
|
|
2418
|
-
|
|
2615
|
+
}
|
|
2616
|
+
case 3: {
|
|
2419
2617
|
if (tag !== 24) {
|
|
2420
2618
|
break;
|
|
2421
2619
|
}
|
|
2422
2620
|
|
|
2423
2621
|
message.side = reader.int32() as any;
|
|
2424
2622
|
continue;
|
|
2425
|
-
|
|
2623
|
+
}
|
|
2624
|
+
case 4: {
|
|
2426
2625
|
if (tag !== 32) {
|
|
2427
2626
|
break;
|
|
2428
2627
|
}
|
|
2429
2628
|
|
|
2430
2629
|
message.fillMode = reader.int32() as any;
|
|
2431
2630
|
continue;
|
|
2432
|
-
|
|
2631
|
+
}
|
|
2632
|
+
case 5: {
|
|
2433
2633
|
if (tag !== 40) {
|
|
2434
2634
|
break;
|
|
2435
2635
|
}
|
|
2436
2636
|
|
|
2437
2637
|
message.isReduceOnly = reader.bool();
|
|
2438
2638
|
continue;
|
|
2439
|
-
|
|
2639
|
+
}
|
|
2640
|
+
case 6: {
|
|
2440
2641
|
if (tag !== 48) {
|
|
2441
2642
|
break;
|
|
2442
2643
|
}
|
|
2443
2644
|
|
|
2444
2645
|
message.price = reader.uint64() as bigint;
|
|
2445
2646
|
continue;
|
|
2446
|
-
|
|
2647
|
+
}
|
|
2648
|
+
case 7: {
|
|
2447
2649
|
if (tag !== 56) {
|
|
2448
2650
|
break;
|
|
2449
2651
|
}
|
|
2450
2652
|
|
|
2451
2653
|
message.size = reader.uint64() as bigint;
|
|
2452
2654
|
continue;
|
|
2453
|
-
|
|
2655
|
+
}
|
|
2656
|
+
case 8: {
|
|
2454
2657
|
if (tag !== 66) {
|
|
2455
2658
|
break;
|
|
2456
2659
|
}
|
|
2457
2660
|
|
|
2458
2661
|
message.quoteSize = U128.decode(reader, reader.uint32());
|
|
2459
2662
|
continue;
|
|
2460
|
-
|
|
2663
|
+
}
|
|
2664
|
+
case 32: {
|
|
2461
2665
|
if (tag !== 256) {
|
|
2462
2666
|
break;
|
|
2463
2667
|
}
|
|
2464
2668
|
|
|
2465
2669
|
message.delegatorAccountId = reader.uint32();
|
|
2466
2670
|
continue;
|
|
2467
|
-
|
|
2671
|
+
}
|
|
2672
|
+
case 33: {
|
|
2468
2673
|
if (tag !== 264) {
|
|
2469
2674
|
break;
|
|
2470
2675
|
}
|
|
2471
2676
|
|
|
2472
2677
|
message.clientOrderId = reader.uint64() as bigint;
|
|
2473
2678
|
continue;
|
|
2474
|
-
|
|
2679
|
+
}
|
|
2680
|
+
case 34: {
|
|
2475
2681
|
if (tag !== 272) {
|
|
2476
2682
|
break;
|
|
2477
2683
|
}
|
|
2478
2684
|
|
|
2479
2685
|
message.senderAccountId = reader.uint32();
|
|
2480
2686
|
continue;
|
|
2687
|
+
}
|
|
2481
2688
|
}
|
|
2482
2689
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2483
2690
|
break;
|
|
@@ -2597,34 +2804,38 @@ export const Action_CancelOrderById: MessageFns<Action_CancelOrderById> = {
|
|
|
2597
2804
|
while (reader.pos < end) {
|
|
2598
2805
|
const tag = reader.uint32();
|
|
2599
2806
|
switch (tag >>> 3) {
|
|
2600
|
-
case 1:
|
|
2807
|
+
case 1: {
|
|
2601
2808
|
if (tag !== 8) {
|
|
2602
2809
|
break;
|
|
2603
2810
|
}
|
|
2604
2811
|
|
|
2605
2812
|
message.sessionId = reader.uint64() as bigint;
|
|
2606
2813
|
continue;
|
|
2607
|
-
|
|
2814
|
+
}
|
|
2815
|
+
case 2: {
|
|
2608
2816
|
if (tag !== 16) {
|
|
2609
2817
|
break;
|
|
2610
2818
|
}
|
|
2611
2819
|
|
|
2612
2820
|
message.orderId = reader.uint64() as bigint;
|
|
2613
2821
|
continue;
|
|
2614
|
-
|
|
2822
|
+
}
|
|
2823
|
+
case 32: {
|
|
2615
2824
|
if (tag !== 256) {
|
|
2616
2825
|
break;
|
|
2617
2826
|
}
|
|
2618
2827
|
|
|
2619
2828
|
message.delegatorAccountId = reader.uint32();
|
|
2620
2829
|
continue;
|
|
2621
|
-
|
|
2830
|
+
}
|
|
2831
|
+
case 33: {
|
|
2622
2832
|
if (tag !== 264) {
|
|
2623
2833
|
break;
|
|
2624
2834
|
}
|
|
2625
2835
|
|
|
2626
2836
|
message.senderAccountId = reader.uint32();
|
|
2627
2837
|
continue;
|
|
2838
|
+
}
|
|
2628
2839
|
}
|
|
2629
2840
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2630
2841
|
break;
|
|
@@ -2707,34 +2918,38 @@ export const Action_Deposit: MessageFns<Action_Deposit> = {
|
|
|
2707
2918
|
while (reader.pos < end) {
|
|
2708
2919
|
const tag = reader.uint32();
|
|
2709
2920
|
switch (tag >>> 3) {
|
|
2710
|
-
case 1:
|
|
2921
|
+
case 1: {
|
|
2711
2922
|
if (tag !== 8) {
|
|
2712
2923
|
break;
|
|
2713
2924
|
}
|
|
2714
2925
|
|
|
2715
2926
|
message.actionNonce = reader.uint64() as bigint;
|
|
2716
2927
|
continue;
|
|
2717
|
-
|
|
2928
|
+
}
|
|
2929
|
+
case 2: {
|
|
2718
2930
|
if (tag !== 18) {
|
|
2719
2931
|
break;
|
|
2720
2932
|
}
|
|
2721
2933
|
|
|
2722
2934
|
message.tokenAddr = reader.bytes();
|
|
2723
2935
|
continue;
|
|
2724
|
-
|
|
2936
|
+
}
|
|
2937
|
+
case 3: {
|
|
2725
2938
|
if (tag !== 24) {
|
|
2726
2939
|
break;
|
|
2727
2940
|
}
|
|
2728
2941
|
|
|
2729
2942
|
message.amount = reader.uint64() as bigint;
|
|
2730
2943
|
continue;
|
|
2731
|
-
|
|
2944
|
+
}
|
|
2945
|
+
case 4: {
|
|
2732
2946
|
if (tag !== 34) {
|
|
2733
2947
|
break;
|
|
2734
2948
|
}
|
|
2735
2949
|
|
|
2736
2950
|
message.userPubkey = reader.bytes();
|
|
2737
2951
|
continue;
|
|
2952
|
+
}
|
|
2738
2953
|
}
|
|
2739
2954
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2740
2955
|
break;
|
|
@@ -2814,27 +3029,30 @@ export const Action_Withdraw: MessageFns<Action_Withdraw> = {
|
|
|
2814
3029
|
while (reader.pos < end) {
|
|
2815
3030
|
const tag = reader.uint32();
|
|
2816
3031
|
switch (tag >>> 3) {
|
|
2817
|
-
case 1:
|
|
3032
|
+
case 1: {
|
|
2818
3033
|
if (tag !== 8) {
|
|
2819
3034
|
break;
|
|
2820
3035
|
}
|
|
2821
3036
|
|
|
2822
3037
|
message.tokenId = reader.uint32();
|
|
2823
3038
|
continue;
|
|
2824
|
-
|
|
3039
|
+
}
|
|
3040
|
+
case 2: {
|
|
2825
3041
|
if (tag !== 16) {
|
|
2826
3042
|
break;
|
|
2827
3043
|
}
|
|
2828
3044
|
|
|
2829
3045
|
message.sessionId = reader.uint64() as bigint;
|
|
2830
3046
|
continue;
|
|
2831
|
-
|
|
3047
|
+
}
|
|
3048
|
+
case 3: {
|
|
2832
3049
|
if (tag !== 24) {
|
|
2833
3050
|
break;
|
|
2834
3051
|
}
|
|
2835
3052
|
|
|
2836
3053
|
message.amount = reader.uint64() as bigint;
|
|
2837
3054
|
continue;
|
|
3055
|
+
}
|
|
2838
3056
|
}
|
|
2839
3057
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2840
3058
|
break;
|
|
@@ -2900,20 +3118,22 @@ export const Action_PythSetWormholeGuardians: MessageFns<Action_PythSetWormholeG
|
|
|
2900
3118
|
while (reader.pos < end) {
|
|
2901
3119
|
const tag = reader.uint32();
|
|
2902
3120
|
switch (tag >>> 3) {
|
|
2903
|
-
case 1:
|
|
3121
|
+
case 1: {
|
|
2904
3122
|
if (tag !== 8) {
|
|
2905
3123
|
break;
|
|
2906
3124
|
}
|
|
2907
3125
|
|
|
2908
3126
|
message.guardianSetIndex = reader.uint32();
|
|
2909
3127
|
continue;
|
|
2910
|
-
|
|
3128
|
+
}
|
|
3129
|
+
case 2: {
|
|
2911
3130
|
if (tag !== 18) {
|
|
2912
3131
|
break;
|
|
2913
3132
|
}
|
|
2914
3133
|
|
|
2915
3134
|
message.addresses.push(reader.bytes());
|
|
2916
3135
|
continue;
|
|
3136
|
+
}
|
|
2917
3137
|
}
|
|
2918
3138
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2919
3139
|
break;
|
|
@@ -2978,20 +3198,22 @@ export const Action_PythSetSymbolFeed: MessageFns<Action_PythSetSymbolFeed> = {
|
|
|
2978
3198
|
while (reader.pos < end) {
|
|
2979
3199
|
const tag = reader.uint32();
|
|
2980
3200
|
switch (tag >>> 3) {
|
|
2981
|
-
case 1:
|
|
3201
|
+
case 1: {
|
|
2982
3202
|
if (tag !== 10) {
|
|
2983
3203
|
break;
|
|
2984
3204
|
}
|
|
2985
3205
|
|
|
2986
3206
|
message.oracleSymbol = reader.string();
|
|
2987
3207
|
continue;
|
|
2988
|
-
|
|
3208
|
+
}
|
|
3209
|
+
case 2: {
|
|
2989
3210
|
if (tag !== 18) {
|
|
2990
3211
|
break;
|
|
2991
3212
|
}
|
|
2992
3213
|
|
|
2993
3214
|
message.priceFeedId = reader.bytes();
|
|
2994
3215
|
continue;
|
|
3216
|
+
}
|
|
2995
3217
|
}
|
|
2996
3218
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2997
3219
|
break;
|
|
@@ -3049,13 +3271,14 @@ export const Action_PythPriceFeedUpdate: MessageFns<Action_PythPriceFeedUpdate>
|
|
|
3049
3271
|
while (reader.pos < end) {
|
|
3050
3272
|
const tag = reader.uint32();
|
|
3051
3273
|
switch (tag >>> 3) {
|
|
3052
|
-
case 1:
|
|
3274
|
+
case 1: {
|
|
3053
3275
|
if (tag !== 10) {
|
|
3054
3276
|
break;
|
|
3055
3277
|
}
|
|
3056
3278
|
|
|
3057
3279
|
message.rawPythnetData = reader.bytes();
|
|
3058
3280
|
continue;
|
|
3281
|
+
}
|
|
3059
3282
|
}
|
|
3060
3283
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3061
3284
|
break;
|
|
@@ -3117,27 +3340,30 @@ export const Action_Liquidate: MessageFns<Action_Liquidate> = {
|
|
|
3117
3340
|
while (reader.pos < end) {
|
|
3118
3341
|
const tag = reader.uint32();
|
|
3119
3342
|
switch (tag >>> 3) {
|
|
3120
|
-
case 1:
|
|
3343
|
+
case 1: {
|
|
3121
3344
|
if (tag !== 8) {
|
|
3122
3345
|
break;
|
|
3123
3346
|
}
|
|
3124
3347
|
|
|
3125
3348
|
message.liquidatorSessionId = reader.uint64() as bigint;
|
|
3126
3349
|
continue;
|
|
3127
|
-
|
|
3350
|
+
}
|
|
3351
|
+
case 2: {
|
|
3128
3352
|
if (tag !== 16) {
|
|
3129
3353
|
break;
|
|
3130
3354
|
}
|
|
3131
3355
|
|
|
3132
3356
|
message.liquidateeAccountId = reader.uint32();
|
|
3133
3357
|
continue;
|
|
3134
|
-
|
|
3358
|
+
}
|
|
3359
|
+
case 3: {
|
|
3135
3360
|
if (tag !== 24) {
|
|
3136
3361
|
break;
|
|
3137
3362
|
}
|
|
3138
3363
|
|
|
3139
3364
|
message.liquidatorAccountId = reader.uint32();
|
|
3140
3365
|
continue;
|
|
3366
|
+
}
|
|
3141
3367
|
}
|
|
3142
3368
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3143
3369
|
break;
|
|
@@ -3205,13 +3431,14 @@ export const Action_RevokeSession: MessageFns<Action_RevokeSession> = {
|
|
|
3205
3431
|
while (reader.pos < end) {
|
|
3206
3432
|
const tag = reader.uint32();
|
|
3207
3433
|
switch (tag >>> 3) {
|
|
3208
|
-
case 1:
|
|
3434
|
+
case 1: {
|
|
3209
3435
|
if (tag !== 8) {
|
|
3210
3436
|
break;
|
|
3211
3437
|
}
|
|
3212
3438
|
|
|
3213
3439
|
message.sessionId = reader.uint64() as bigint;
|
|
3214
3440
|
continue;
|
|
3441
|
+
}
|
|
3215
3442
|
}
|
|
3216
3443
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3217
3444
|
break;
|
|
@@ -3330,7 +3557,7 @@ export const Action_Unpause: MessageFns<Action_Unpause> = {
|
|
|
3330
3557
|
};
|
|
3331
3558
|
|
|
3332
3559
|
function createBaseAction_Transfer(): Action_Transfer {
|
|
3333
|
-
return { sessionId: 0n, fromAccountId: 0, tokenId: 0, amount: 0n, toAccountId: undefined };
|
|
3560
|
+
return { sessionId: 0n, fromAccountId: 0, tokenId: 0, amount: 0n, toAccountId: undefined, specialAccount: undefined };
|
|
3334
3561
|
}
|
|
3335
3562
|
|
|
3336
3563
|
export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
@@ -3356,6 +3583,9 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3356
3583
|
if (message.toAccountId !== undefined) {
|
|
3357
3584
|
writer.uint32(64).uint32(message.toAccountId);
|
|
3358
3585
|
}
|
|
3586
|
+
if (message.specialAccount !== undefined) {
|
|
3587
|
+
writer.uint32(72).int32(message.specialAccount);
|
|
3588
|
+
}
|
|
3359
3589
|
return writer;
|
|
3360
3590
|
},
|
|
3361
3591
|
|
|
@@ -3366,41 +3596,54 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3366
3596
|
while (reader.pos < end) {
|
|
3367
3597
|
const tag = reader.uint32();
|
|
3368
3598
|
switch (tag >>> 3) {
|
|
3369
|
-
case 1:
|
|
3599
|
+
case 1: {
|
|
3370
3600
|
if (tag !== 8) {
|
|
3371
3601
|
break;
|
|
3372
3602
|
}
|
|
3373
3603
|
|
|
3374
3604
|
message.sessionId = reader.uint64() as bigint;
|
|
3375
3605
|
continue;
|
|
3376
|
-
|
|
3606
|
+
}
|
|
3607
|
+
case 2: {
|
|
3377
3608
|
if (tag !== 16) {
|
|
3378
3609
|
break;
|
|
3379
3610
|
}
|
|
3380
3611
|
|
|
3381
3612
|
message.fromAccountId = reader.uint32();
|
|
3382
3613
|
continue;
|
|
3383
|
-
|
|
3614
|
+
}
|
|
3615
|
+
case 3: {
|
|
3384
3616
|
if (tag !== 24) {
|
|
3385
3617
|
break;
|
|
3386
3618
|
}
|
|
3387
3619
|
|
|
3388
3620
|
message.tokenId = reader.uint32();
|
|
3389
3621
|
continue;
|
|
3390
|
-
|
|
3622
|
+
}
|
|
3623
|
+
case 4: {
|
|
3391
3624
|
if (tag !== 32) {
|
|
3392
3625
|
break;
|
|
3393
3626
|
}
|
|
3394
3627
|
|
|
3395
3628
|
message.amount = reader.uint64() as bigint;
|
|
3396
3629
|
continue;
|
|
3397
|
-
|
|
3630
|
+
}
|
|
3631
|
+
case 8: {
|
|
3398
3632
|
if (tag !== 64) {
|
|
3399
3633
|
break;
|
|
3400
3634
|
}
|
|
3401
3635
|
|
|
3402
3636
|
message.toAccountId = reader.uint32();
|
|
3403
3637
|
continue;
|
|
3638
|
+
}
|
|
3639
|
+
case 9: {
|
|
3640
|
+
if (tag !== 72) {
|
|
3641
|
+
break;
|
|
3642
|
+
}
|
|
3643
|
+
|
|
3644
|
+
message.specialAccount = reader.int32() as any;
|
|
3645
|
+
continue;
|
|
3646
|
+
}
|
|
3404
3647
|
}
|
|
3405
3648
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3406
3649
|
break;
|
|
@@ -3417,6 +3660,7 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3417
3660
|
tokenId: isSet(object.tokenId) ? globalThis.Number(object.tokenId) : 0,
|
|
3418
3661
|
amount: isSet(object.amount) ? BigInt(object.amount) : 0n,
|
|
3419
3662
|
toAccountId: isSet(object.toAccountId) ? globalThis.Number(object.toAccountId) : undefined,
|
|
3663
|
+
specialAccount: isSet(object.specialAccount) ? specialAccountFromJSON(object.specialAccount) : undefined,
|
|
3420
3664
|
};
|
|
3421
3665
|
},
|
|
3422
3666
|
|
|
@@ -3437,6 +3681,9 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3437
3681
|
if (message.toAccountId !== undefined) {
|
|
3438
3682
|
obj.toAccountId = Math.round(message.toAccountId);
|
|
3439
3683
|
}
|
|
3684
|
+
if (message.specialAccount !== undefined) {
|
|
3685
|
+
obj.specialAccount = specialAccountToJSON(message.specialAccount);
|
|
3686
|
+
}
|
|
3440
3687
|
return obj;
|
|
3441
3688
|
},
|
|
3442
3689
|
|
|
@@ -3450,6 +3697,7 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3450
3697
|
message.tokenId = object.tokenId ?? 0;
|
|
3451
3698
|
message.amount = object.amount ?? 0n;
|
|
3452
3699
|
message.toAccountId = object.toAccountId ?? undefined;
|
|
3700
|
+
message.specialAccount = object.specialAccount ?? undefined;
|
|
3453
3701
|
return message;
|
|
3454
3702
|
},
|
|
3455
3703
|
};
|
|
@@ -3494,48 +3742,54 @@ export const Action_AddTrigger: MessageFns<Action_AddTrigger> = {
|
|
|
3494
3742
|
while (reader.pos < end) {
|
|
3495
3743
|
const tag = reader.uint32();
|
|
3496
3744
|
switch (tag >>> 3) {
|
|
3497
|
-
case 1:
|
|
3745
|
+
case 1: {
|
|
3498
3746
|
if (tag !== 8) {
|
|
3499
3747
|
break;
|
|
3500
3748
|
}
|
|
3501
3749
|
|
|
3502
3750
|
message.sessionId = reader.uint64() as bigint;
|
|
3503
3751
|
continue;
|
|
3504
|
-
|
|
3752
|
+
}
|
|
3753
|
+
case 2: {
|
|
3505
3754
|
if (tag !== 16) {
|
|
3506
3755
|
break;
|
|
3507
3756
|
}
|
|
3508
3757
|
|
|
3509
3758
|
message.marketId = reader.uint32();
|
|
3510
3759
|
continue;
|
|
3511
|
-
|
|
3760
|
+
}
|
|
3761
|
+
case 3: {
|
|
3512
3762
|
if (tag !== 24) {
|
|
3513
3763
|
break;
|
|
3514
3764
|
}
|
|
3515
3765
|
|
|
3516
3766
|
message.kind = reader.int32() as any;
|
|
3517
3767
|
continue;
|
|
3518
|
-
|
|
3768
|
+
}
|
|
3769
|
+
case 4: {
|
|
3519
3770
|
if (tag !== 32) {
|
|
3520
3771
|
break;
|
|
3521
3772
|
}
|
|
3522
3773
|
|
|
3523
3774
|
message.side = reader.int32() as any;
|
|
3524
3775
|
continue;
|
|
3525
|
-
|
|
3776
|
+
}
|
|
3777
|
+
case 5: {
|
|
3526
3778
|
if (tag !== 40) {
|
|
3527
3779
|
break;
|
|
3528
3780
|
}
|
|
3529
3781
|
|
|
3530
3782
|
message.price = reader.uint64() as bigint;
|
|
3531
3783
|
continue;
|
|
3532
|
-
|
|
3784
|
+
}
|
|
3785
|
+
case 10: {
|
|
3533
3786
|
if (tag !== 80) {
|
|
3534
3787
|
break;
|
|
3535
3788
|
}
|
|
3536
3789
|
|
|
3537
3790
|
message.accountId = reader.uint32();
|
|
3538
3791
|
continue;
|
|
3792
|
+
}
|
|
3539
3793
|
}
|
|
3540
3794
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3541
3795
|
break;
|
|
@@ -3628,41 +3882,46 @@ export const Action_RemoveTrigger: MessageFns<Action_RemoveTrigger> = {
|
|
|
3628
3882
|
while (reader.pos < end) {
|
|
3629
3883
|
const tag = reader.uint32();
|
|
3630
3884
|
switch (tag >>> 3) {
|
|
3631
|
-
case 1:
|
|
3885
|
+
case 1: {
|
|
3632
3886
|
if (tag !== 8) {
|
|
3633
3887
|
break;
|
|
3634
3888
|
}
|
|
3635
3889
|
|
|
3636
3890
|
message.sessionId = reader.uint64() as bigint;
|
|
3637
3891
|
continue;
|
|
3638
|
-
|
|
3892
|
+
}
|
|
3893
|
+
case 2: {
|
|
3639
3894
|
if (tag !== 16) {
|
|
3640
3895
|
break;
|
|
3641
3896
|
}
|
|
3642
3897
|
|
|
3643
3898
|
message.marketId = reader.uint32();
|
|
3644
3899
|
continue;
|
|
3645
|
-
|
|
3900
|
+
}
|
|
3901
|
+
case 3: {
|
|
3646
3902
|
if (tag !== 24) {
|
|
3647
3903
|
break;
|
|
3648
3904
|
}
|
|
3649
3905
|
|
|
3650
3906
|
message.kind = reader.int32() as any;
|
|
3651
3907
|
continue;
|
|
3652
|
-
|
|
3908
|
+
}
|
|
3909
|
+
case 4: {
|
|
3653
3910
|
if (tag !== 32) {
|
|
3654
3911
|
break;
|
|
3655
3912
|
}
|
|
3656
3913
|
|
|
3657
3914
|
message.side = reader.int32() as any;
|
|
3658
3915
|
continue;
|
|
3659
|
-
|
|
3916
|
+
}
|
|
3917
|
+
case 10: {
|
|
3660
3918
|
if (tag !== 80) {
|
|
3661
3919
|
break;
|
|
3662
3920
|
}
|
|
3663
3921
|
|
|
3664
3922
|
message.accountId = reader.uint32();
|
|
3665
3923
|
continue;
|
|
3924
|
+
}
|
|
3666
3925
|
}
|
|
3667
3926
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3668
3927
|
break;
|
|
@@ -3763,7 +4022,7 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3763
4022
|
Receipt_UpdateGuardianSetResult.encode(message.kind.value, writer.uint32(338).fork()).join();
|
|
3764
4023
|
break;
|
|
3765
4024
|
case "liquidated":
|
|
3766
|
-
|
|
4025
|
+
Receipt_AccountLiquidated.encode(message.kind.value, writer.uint32(346).fork()).join();
|
|
3767
4026
|
break;
|
|
3768
4027
|
case "sessionRevoked":
|
|
3769
4028
|
Receipt_SessionRevoked.encode(message.kind.value, writer.uint32(354).fork()).join();
|
|
@@ -3794,21 +4053,23 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3794
4053
|
while (reader.pos < end) {
|
|
3795
4054
|
const tag = reader.uint32();
|
|
3796
4055
|
switch (tag >>> 3) {
|
|
3797
|
-
case 1:
|
|
4056
|
+
case 1: {
|
|
3798
4057
|
if (tag !== 8) {
|
|
3799
4058
|
break;
|
|
3800
4059
|
}
|
|
3801
4060
|
|
|
3802
4061
|
message.actionId = reader.uint64() as bigint;
|
|
3803
4062
|
continue;
|
|
3804
|
-
|
|
4063
|
+
}
|
|
4064
|
+
case 32: {
|
|
3805
4065
|
if (tag !== 256) {
|
|
3806
4066
|
break;
|
|
3807
4067
|
}
|
|
3808
4068
|
|
|
3809
4069
|
message.kind = { $case: "err", value: reader.int32() as any };
|
|
3810
4070
|
continue;
|
|
3811
|
-
|
|
4071
|
+
}
|
|
4072
|
+
case 33: {
|
|
3812
4073
|
if (tag !== 266) {
|
|
3813
4074
|
break;
|
|
3814
4075
|
}
|
|
@@ -3818,14 +4079,16 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3818
4079
|
value: Receipt_CreateSessionResult.decode(reader, reader.uint32()),
|
|
3819
4080
|
};
|
|
3820
4081
|
continue;
|
|
3821
|
-
|
|
4082
|
+
}
|
|
4083
|
+
case 34: {
|
|
3822
4084
|
if (tag !== 274) {
|
|
3823
4085
|
break;
|
|
3824
4086
|
}
|
|
3825
4087
|
|
|
3826
4088
|
message.kind = { $case: "placeOrderResult", value: Receipt_PlaceOrderResult.decode(reader, reader.uint32()) };
|
|
3827
4089
|
continue;
|
|
3828
|
-
|
|
4090
|
+
}
|
|
4091
|
+
case 35: {
|
|
3829
4092
|
if (tag !== 282) {
|
|
3830
4093
|
break;
|
|
3831
4094
|
}
|
|
@@ -3835,14 +4098,16 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3835
4098
|
value: Receipt_CancelOrderResult.decode(reader, reader.uint32()),
|
|
3836
4099
|
};
|
|
3837
4100
|
continue;
|
|
3838
|
-
|
|
4101
|
+
}
|
|
4102
|
+
case 36: {
|
|
3839
4103
|
if (tag !== 290) {
|
|
3840
4104
|
break;
|
|
3841
4105
|
}
|
|
3842
4106
|
|
|
3843
4107
|
message.kind = { $case: "depositResult", value: Receipt_DepositResult.decode(reader, reader.uint32()) };
|
|
3844
4108
|
continue;
|
|
3845
|
-
|
|
4109
|
+
}
|
|
4110
|
+
case 37: {
|
|
3846
4111
|
if (tag !== 298) {
|
|
3847
4112
|
break;
|
|
3848
4113
|
}
|
|
@@ -3852,7 +4117,8 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3852
4117
|
value: Receipt_InsertTokenResult.decode(reader, reader.uint32()),
|
|
3853
4118
|
};
|
|
3854
4119
|
continue;
|
|
3855
|
-
|
|
4120
|
+
}
|
|
4121
|
+
case 38: {
|
|
3856
4122
|
if (tag !== 306) {
|
|
3857
4123
|
break;
|
|
3858
4124
|
}
|
|
@@ -3862,14 +4128,16 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3862
4128
|
value: Receipt_InsertMarketResult.decode(reader, reader.uint32()),
|
|
3863
4129
|
};
|
|
3864
4130
|
continue;
|
|
3865
|
-
|
|
4131
|
+
}
|
|
4132
|
+
case 39: {
|
|
3866
4133
|
if (tag !== 314) {
|
|
3867
4134
|
break;
|
|
3868
4135
|
}
|
|
3869
4136
|
|
|
3870
4137
|
message.kind = { $case: "withdrawResult", value: Receipt_WithdrawResult.decode(reader, reader.uint32()) };
|
|
3871
4138
|
continue;
|
|
3872
|
-
|
|
4139
|
+
}
|
|
4140
|
+
case 40: {
|
|
3873
4141
|
if (tag !== 322) {
|
|
3874
4142
|
break;
|
|
3875
4143
|
}
|
|
@@ -3879,7 +4147,8 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3879
4147
|
value: Receipt_OracleSymbolFeedResult.decode(reader, reader.uint32()),
|
|
3880
4148
|
};
|
|
3881
4149
|
continue;
|
|
3882
|
-
|
|
4150
|
+
}
|
|
4151
|
+
case 41: {
|
|
3883
4152
|
if (tag !== 330) {
|
|
3884
4153
|
break;
|
|
3885
4154
|
}
|
|
@@ -3889,7 +4158,8 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3889
4158
|
value: Receipt_OracleUpdateResult.decode(reader, reader.uint32()),
|
|
3890
4159
|
};
|
|
3891
4160
|
continue;
|
|
3892
|
-
|
|
4161
|
+
}
|
|
4162
|
+
case 42: {
|
|
3893
4163
|
if (tag !== 338) {
|
|
3894
4164
|
break;
|
|
3895
4165
|
}
|
|
@@ -3899,55 +4169,63 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3899
4169
|
value: Receipt_UpdateGuardianSetResult.decode(reader, reader.uint32()),
|
|
3900
4170
|
};
|
|
3901
4171
|
continue;
|
|
3902
|
-
|
|
4172
|
+
}
|
|
4173
|
+
case 43: {
|
|
3903
4174
|
if (tag !== 346) {
|
|
3904
4175
|
break;
|
|
3905
4176
|
}
|
|
3906
4177
|
|
|
3907
|
-
message.kind = { $case: "liquidated", value:
|
|
4178
|
+
message.kind = { $case: "liquidated", value: Receipt_AccountLiquidated.decode(reader, reader.uint32()) };
|
|
3908
4179
|
continue;
|
|
3909
|
-
|
|
4180
|
+
}
|
|
4181
|
+
case 44: {
|
|
3910
4182
|
if (tag !== 354) {
|
|
3911
4183
|
break;
|
|
3912
4184
|
}
|
|
3913
4185
|
|
|
3914
4186
|
message.kind = { $case: "sessionRevoked", value: Receipt_SessionRevoked.decode(reader, reader.uint32()) };
|
|
3915
4187
|
continue;
|
|
3916
|
-
|
|
4188
|
+
}
|
|
4189
|
+
case 45: {
|
|
3917
4190
|
if (tag !== 362) {
|
|
3918
4191
|
break;
|
|
3919
4192
|
}
|
|
3920
4193
|
|
|
3921
4194
|
message.kind = { $case: "paused", value: Receipt_Paused.decode(reader, reader.uint32()) };
|
|
3922
4195
|
continue;
|
|
3923
|
-
|
|
4196
|
+
}
|
|
4197
|
+
case 46: {
|
|
3924
4198
|
if (tag !== 370) {
|
|
3925
4199
|
break;
|
|
3926
4200
|
}
|
|
3927
4201
|
|
|
3928
4202
|
message.kind = { $case: "unpaused", value: Receipt_Unpaused.decode(reader, reader.uint32()) };
|
|
3929
4203
|
continue;
|
|
3930
|
-
|
|
4204
|
+
}
|
|
4205
|
+
case 47: {
|
|
3931
4206
|
if (tag !== 378) {
|
|
3932
4207
|
break;
|
|
3933
4208
|
}
|
|
3934
4209
|
|
|
3935
4210
|
message.kind = { $case: "transferred", value: Receipt_Transferred.decode(reader, reader.uint32()) };
|
|
3936
4211
|
continue;
|
|
3937
|
-
|
|
4212
|
+
}
|
|
4213
|
+
case 64: {
|
|
3938
4214
|
if (tag !== 514) {
|
|
3939
4215
|
break;
|
|
3940
4216
|
}
|
|
3941
4217
|
|
|
3942
4218
|
message.kind = { $case: "triggerAdded", value: Receipt_TriggerAdded.decode(reader, reader.uint32()) };
|
|
3943
4219
|
continue;
|
|
3944
|
-
|
|
4220
|
+
}
|
|
4221
|
+
case 65: {
|
|
3945
4222
|
if (tag !== 522) {
|
|
3946
4223
|
break;
|
|
3947
4224
|
}
|
|
3948
4225
|
|
|
3949
4226
|
message.kind = { $case: "triggerRemoved", value: Receipt_TriggerRemoved.decode(reader, reader.uint32()) };
|
|
3950
4227
|
continue;
|
|
4228
|
+
}
|
|
3951
4229
|
}
|
|
3952
4230
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3953
4231
|
break;
|
|
@@ -3989,7 +4267,7 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3989
4267
|
value: Receipt_UpdateGuardianSetResult.fromJSON(object.updateGuardianSetResult),
|
|
3990
4268
|
}
|
|
3991
4269
|
: isSet(object.liquidated)
|
|
3992
|
-
? { $case: "liquidated", value:
|
|
4270
|
+
? { $case: "liquidated", value: Receipt_AccountLiquidated.fromJSON(object.liquidated) }
|
|
3993
4271
|
: isSet(object.sessionRevoked)
|
|
3994
4272
|
? { $case: "sessionRevoked", value: Receipt_SessionRevoked.fromJSON(object.sessionRevoked) }
|
|
3995
4273
|
: isSet(object.paused)
|
|
@@ -4013,56 +4291,39 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
4013
4291
|
}
|
|
4014
4292
|
if (message.kind?.$case === "err") {
|
|
4015
4293
|
obj.err = errorToJSON(message.kind.value);
|
|
4016
|
-
}
|
|
4017
|
-
if (message.kind?.$case === "createSessionResult") {
|
|
4294
|
+
} else if (message.kind?.$case === "createSessionResult") {
|
|
4018
4295
|
obj.createSessionResult = Receipt_CreateSessionResult.toJSON(message.kind.value);
|
|
4019
|
-
}
|
|
4020
|
-
if (message.kind?.$case === "placeOrderResult") {
|
|
4296
|
+
} else if (message.kind?.$case === "placeOrderResult") {
|
|
4021
4297
|
obj.placeOrderResult = Receipt_PlaceOrderResult.toJSON(message.kind.value);
|
|
4022
|
-
}
|
|
4023
|
-
if (message.kind?.$case === "cancelOrderResult") {
|
|
4298
|
+
} else if (message.kind?.$case === "cancelOrderResult") {
|
|
4024
4299
|
obj.cancelOrderResult = Receipt_CancelOrderResult.toJSON(message.kind.value);
|
|
4025
|
-
}
|
|
4026
|
-
if (message.kind?.$case === "depositResult") {
|
|
4300
|
+
} else if (message.kind?.$case === "depositResult") {
|
|
4027
4301
|
obj.depositResult = Receipt_DepositResult.toJSON(message.kind.value);
|
|
4028
|
-
}
|
|
4029
|
-
if (message.kind?.$case === "insertTokenResult") {
|
|
4302
|
+
} else if (message.kind?.$case === "insertTokenResult") {
|
|
4030
4303
|
obj.insertTokenResult = Receipt_InsertTokenResult.toJSON(message.kind.value);
|
|
4031
|
-
}
|
|
4032
|
-
if (message.kind?.$case === "insertMarketResult") {
|
|
4304
|
+
} else if (message.kind?.$case === "insertMarketResult") {
|
|
4033
4305
|
obj.insertMarketResult = Receipt_InsertMarketResult.toJSON(message.kind.value);
|
|
4034
|
-
}
|
|
4035
|
-
if (message.kind?.$case === "withdrawResult") {
|
|
4306
|
+
} else if (message.kind?.$case === "withdrawResult") {
|
|
4036
4307
|
obj.withdrawResult = Receipt_WithdrawResult.toJSON(message.kind.value);
|
|
4037
|
-
}
|
|
4038
|
-
if (message.kind?.$case === "oracleSymbolFeedResult") {
|
|
4308
|
+
} else if (message.kind?.$case === "oracleSymbolFeedResult") {
|
|
4039
4309
|
obj.oracleSymbolFeedResult = Receipt_OracleSymbolFeedResult.toJSON(message.kind.value);
|
|
4040
|
-
}
|
|
4041
|
-
if (message.kind?.$case === "oracleUpdateResult") {
|
|
4310
|
+
} else if (message.kind?.$case === "oracleUpdateResult") {
|
|
4042
4311
|
obj.oracleUpdateResult = Receipt_OracleUpdateResult.toJSON(message.kind.value);
|
|
4043
|
-
}
|
|
4044
|
-
if (message.kind?.$case === "updateGuardianSetResult") {
|
|
4312
|
+
} else if (message.kind?.$case === "updateGuardianSetResult") {
|
|
4045
4313
|
obj.updateGuardianSetResult = Receipt_UpdateGuardianSetResult.toJSON(message.kind.value);
|
|
4046
|
-
}
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
}
|
|
4050
|
-
if (message.kind?.$case === "sessionRevoked") {
|
|
4314
|
+
} else if (message.kind?.$case === "liquidated") {
|
|
4315
|
+
obj.liquidated = Receipt_AccountLiquidated.toJSON(message.kind.value);
|
|
4316
|
+
} else if (message.kind?.$case === "sessionRevoked") {
|
|
4051
4317
|
obj.sessionRevoked = Receipt_SessionRevoked.toJSON(message.kind.value);
|
|
4052
|
-
}
|
|
4053
|
-
if (message.kind?.$case === "paused") {
|
|
4318
|
+
} else if (message.kind?.$case === "paused") {
|
|
4054
4319
|
obj.paused = Receipt_Paused.toJSON(message.kind.value);
|
|
4055
|
-
}
|
|
4056
|
-
if (message.kind?.$case === "unpaused") {
|
|
4320
|
+
} else if (message.kind?.$case === "unpaused") {
|
|
4057
4321
|
obj.unpaused = Receipt_Unpaused.toJSON(message.kind.value);
|
|
4058
|
-
}
|
|
4059
|
-
if (message.kind?.$case === "transferred") {
|
|
4322
|
+
} else if (message.kind?.$case === "transferred") {
|
|
4060
4323
|
obj.transferred = Receipt_Transferred.toJSON(message.kind.value);
|
|
4061
|
-
}
|
|
4062
|
-
if (message.kind?.$case === "triggerAdded") {
|
|
4324
|
+
} else if (message.kind?.$case === "triggerAdded") {
|
|
4063
4325
|
obj.triggerAdded = Receipt_TriggerAdded.toJSON(message.kind.value);
|
|
4064
|
-
}
|
|
4065
|
-
if (message.kind?.$case === "triggerRemoved") {
|
|
4326
|
+
} else if (message.kind?.$case === "triggerRemoved") {
|
|
4066
4327
|
obj.triggerRemoved = Receipt_TriggerRemoved.toJSON(message.kind.value);
|
|
4067
4328
|
}
|
|
4068
4329
|
return obj;
|
|
@@ -4074,87 +4335,143 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
4074
4335
|
fromPartial<I extends Exact<DeepPartial<Receipt>, I>>(object: I): Receipt {
|
|
4075
4336
|
const message = createBaseReceipt();
|
|
4076
4337
|
message.actionId = object.actionId ?? 0n;
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4338
|
+
switch (object.kind?.$case) {
|
|
4339
|
+
case "err": {
|
|
4340
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4341
|
+
message.kind = { $case: "err", value: object.kind.value };
|
|
4342
|
+
}
|
|
4343
|
+
break;
|
|
4344
|
+
}
|
|
4345
|
+
case "createSessionResult": {
|
|
4346
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4347
|
+
message.kind = {
|
|
4348
|
+
$case: "createSessionResult",
|
|
4349
|
+
value: Receipt_CreateSessionResult.fromPartial(object.kind.value),
|
|
4350
|
+
};
|
|
4351
|
+
}
|
|
4352
|
+
break;
|
|
4353
|
+
}
|
|
4354
|
+
case "placeOrderResult": {
|
|
4355
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4356
|
+
message.kind = { $case: "placeOrderResult", value: Receipt_PlaceOrderResult.fromPartial(object.kind.value) };
|
|
4357
|
+
}
|
|
4358
|
+
break;
|
|
4359
|
+
}
|
|
4360
|
+
case "cancelOrderResult": {
|
|
4361
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4362
|
+
message.kind = {
|
|
4363
|
+
$case: "cancelOrderResult",
|
|
4364
|
+
value: Receipt_CancelOrderResult.fromPartial(object.kind.value),
|
|
4365
|
+
};
|
|
4366
|
+
}
|
|
4367
|
+
break;
|
|
4368
|
+
}
|
|
4369
|
+
case "depositResult": {
|
|
4370
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4371
|
+
message.kind = { $case: "depositResult", value: Receipt_DepositResult.fromPartial(object.kind.value) };
|
|
4372
|
+
}
|
|
4373
|
+
break;
|
|
4374
|
+
}
|
|
4375
|
+
case "insertTokenResult": {
|
|
4376
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4377
|
+
message.kind = {
|
|
4378
|
+
$case: "insertTokenResult",
|
|
4379
|
+
value: Receipt_InsertTokenResult.fromPartial(object.kind.value),
|
|
4380
|
+
};
|
|
4381
|
+
}
|
|
4382
|
+
break;
|
|
4383
|
+
}
|
|
4384
|
+
case "insertMarketResult": {
|
|
4385
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4386
|
+
message.kind = {
|
|
4387
|
+
$case: "insertMarketResult",
|
|
4388
|
+
value: Receipt_InsertMarketResult.fromPartial(object.kind.value),
|
|
4389
|
+
};
|
|
4390
|
+
}
|
|
4391
|
+
break;
|
|
4392
|
+
}
|
|
4393
|
+
case "withdrawResult": {
|
|
4394
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4395
|
+
message.kind = { $case: "withdrawResult", value: Receipt_WithdrawResult.fromPartial(object.kind.value) };
|
|
4396
|
+
}
|
|
4397
|
+
break;
|
|
4398
|
+
}
|
|
4399
|
+
case "oracleSymbolFeedResult": {
|
|
4400
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4401
|
+
message.kind = {
|
|
4402
|
+
$case: "oracleSymbolFeedResult",
|
|
4403
|
+
value: Receipt_OracleSymbolFeedResult.fromPartial(object.kind.value),
|
|
4404
|
+
};
|
|
4405
|
+
}
|
|
4406
|
+
break;
|
|
4407
|
+
}
|
|
4408
|
+
case "oracleUpdateResult": {
|
|
4409
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4410
|
+
message.kind = {
|
|
4411
|
+
$case: "oracleUpdateResult",
|
|
4412
|
+
value: Receipt_OracleUpdateResult.fromPartial(object.kind.value),
|
|
4413
|
+
};
|
|
4414
|
+
}
|
|
4415
|
+
break;
|
|
4416
|
+
}
|
|
4417
|
+
case "updateGuardianSetResult": {
|
|
4418
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4419
|
+
message.kind = {
|
|
4420
|
+
$case: "updateGuardianSetResult",
|
|
4421
|
+
value: Receipt_UpdateGuardianSetResult.fromPartial(object.kind.value),
|
|
4422
|
+
};
|
|
4423
|
+
}
|
|
4424
|
+
break;
|
|
4425
|
+
}
|
|
4426
|
+
case "liquidated": {
|
|
4427
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4428
|
+
message.kind = { $case: "liquidated", value: Receipt_AccountLiquidated.fromPartial(object.kind.value) };
|
|
4429
|
+
}
|
|
4430
|
+
break;
|
|
4431
|
+
}
|
|
4432
|
+
case "sessionRevoked": {
|
|
4433
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4434
|
+
message.kind = { $case: "sessionRevoked", value: Receipt_SessionRevoked.fromPartial(object.kind.value) };
|
|
4435
|
+
}
|
|
4436
|
+
break;
|
|
4437
|
+
}
|
|
4438
|
+
case "paused": {
|
|
4439
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4440
|
+
message.kind = { $case: "paused", value: Receipt_Paused.fromPartial(object.kind.value) };
|
|
4441
|
+
}
|
|
4442
|
+
break;
|
|
4443
|
+
}
|
|
4444
|
+
case "unpaused": {
|
|
4445
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4446
|
+
message.kind = { $case: "unpaused", value: Receipt_Unpaused.fromPartial(object.kind.value) };
|
|
4447
|
+
}
|
|
4448
|
+
break;
|
|
4449
|
+
}
|
|
4450
|
+
case "transferred": {
|
|
4451
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4452
|
+
message.kind = { $case: "transferred", value: Receipt_Transferred.fromPartial(object.kind.value) };
|
|
4453
|
+
}
|
|
4454
|
+
break;
|
|
4455
|
+
}
|
|
4456
|
+
case "triggerAdded": {
|
|
4457
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4458
|
+
message.kind = { $case: "triggerAdded", value: Receipt_TriggerAdded.fromPartial(object.kind.value) };
|
|
4459
|
+
}
|
|
4460
|
+
break;
|
|
4461
|
+
}
|
|
4462
|
+
case "triggerRemoved": {
|
|
4463
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4464
|
+
message.kind = { $case: "triggerRemoved", value: Receipt_TriggerRemoved.fromPartial(object.kind.value) };
|
|
4465
|
+
}
|
|
4466
|
+
break;
|
|
4467
|
+
}
|
|
4151
4468
|
}
|
|
4152
4469
|
return message;
|
|
4153
4470
|
},
|
|
4154
4471
|
};
|
|
4155
4472
|
|
|
4156
4473
|
function createBaseReceipt_Posted(): Receipt_Posted {
|
|
4157
|
-
return { side: 0, marketId: 0, price: 0n, size: 0n, orderId: 0n, accountId: 0
|
|
4474
|
+
return { side: 0, marketId: 0, price: 0n, size: 0n, orderId: 0n, accountId: 0 };
|
|
4158
4475
|
}
|
|
4159
4476
|
|
|
4160
4477
|
export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
@@ -4186,12 +4503,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4186
4503
|
if (message.accountId !== 0) {
|
|
4187
4504
|
writer.uint32(48).uint32(message.accountId);
|
|
4188
4505
|
}
|
|
4189
|
-
if (message.clientOrderId !== undefined) {
|
|
4190
|
-
if (BigInt.asUintN(64, message.clientOrderId) !== message.clientOrderId) {
|
|
4191
|
-
throw new globalThis.Error("value provided for field message.clientOrderId of type uint64 too large");
|
|
4192
|
-
}
|
|
4193
|
-
writer.uint32(56).uint64(message.clientOrderId);
|
|
4194
|
-
}
|
|
4195
4506
|
return writer;
|
|
4196
4507
|
},
|
|
4197
4508
|
|
|
@@ -4202,55 +4513,54 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4202
4513
|
while (reader.pos < end) {
|
|
4203
4514
|
const tag = reader.uint32();
|
|
4204
4515
|
switch (tag >>> 3) {
|
|
4205
|
-
case 1:
|
|
4516
|
+
case 1: {
|
|
4206
4517
|
if (tag !== 8) {
|
|
4207
4518
|
break;
|
|
4208
4519
|
}
|
|
4209
4520
|
|
|
4210
4521
|
message.side = reader.int32() as any;
|
|
4211
4522
|
continue;
|
|
4212
|
-
|
|
4523
|
+
}
|
|
4524
|
+
case 2: {
|
|
4213
4525
|
if (tag !== 16) {
|
|
4214
4526
|
break;
|
|
4215
4527
|
}
|
|
4216
4528
|
|
|
4217
4529
|
message.marketId = reader.uint32();
|
|
4218
4530
|
continue;
|
|
4219
|
-
|
|
4531
|
+
}
|
|
4532
|
+
case 3: {
|
|
4220
4533
|
if (tag !== 24) {
|
|
4221
4534
|
break;
|
|
4222
4535
|
}
|
|
4223
4536
|
|
|
4224
4537
|
message.price = reader.uint64() as bigint;
|
|
4225
4538
|
continue;
|
|
4226
|
-
|
|
4539
|
+
}
|
|
4540
|
+
case 4: {
|
|
4227
4541
|
if (tag !== 32) {
|
|
4228
4542
|
break;
|
|
4229
4543
|
}
|
|
4230
4544
|
|
|
4231
4545
|
message.size = reader.uint64() as bigint;
|
|
4232
4546
|
continue;
|
|
4233
|
-
|
|
4547
|
+
}
|
|
4548
|
+
case 5: {
|
|
4234
4549
|
if (tag !== 40) {
|
|
4235
4550
|
break;
|
|
4236
4551
|
}
|
|
4237
4552
|
|
|
4238
4553
|
message.orderId = reader.uint64() as bigint;
|
|
4239
4554
|
continue;
|
|
4240
|
-
|
|
4555
|
+
}
|
|
4556
|
+
case 6: {
|
|
4241
4557
|
if (tag !== 48) {
|
|
4242
4558
|
break;
|
|
4243
4559
|
}
|
|
4244
4560
|
|
|
4245
4561
|
message.accountId = reader.uint32();
|
|
4246
4562
|
continue;
|
|
4247
|
-
|
|
4248
|
-
if (tag !== 56) {
|
|
4249
|
-
break;
|
|
4250
|
-
}
|
|
4251
|
-
|
|
4252
|
-
message.clientOrderId = reader.uint64() as bigint;
|
|
4253
|
-
continue;
|
|
4563
|
+
}
|
|
4254
4564
|
}
|
|
4255
4565
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4256
4566
|
break;
|
|
@@ -4268,7 +4578,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4268
4578
|
size: isSet(object.size) ? BigInt(object.size) : 0n,
|
|
4269
4579
|
orderId: isSet(object.orderId) ? BigInt(object.orderId) : 0n,
|
|
4270
4580
|
accountId: isSet(object.accountId) ? globalThis.Number(object.accountId) : 0,
|
|
4271
|
-
clientOrderId: isSet(object.clientOrderId) ? BigInt(object.clientOrderId) : undefined,
|
|
4272
4581
|
};
|
|
4273
4582
|
},
|
|
4274
4583
|
|
|
@@ -4292,9 +4601,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4292
4601
|
if (message.accountId !== 0) {
|
|
4293
4602
|
obj.accountId = Math.round(message.accountId);
|
|
4294
4603
|
}
|
|
4295
|
-
if (message.clientOrderId !== undefined) {
|
|
4296
|
-
obj.clientOrderId = message.clientOrderId.toString();
|
|
4297
|
-
}
|
|
4298
4604
|
return obj;
|
|
4299
4605
|
},
|
|
4300
4606
|
|
|
@@ -4309,7 +4615,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4309
4615
|
message.size = object.size ?? 0n;
|
|
4310
4616
|
message.orderId = object.orderId ?? 0n;
|
|
4311
4617
|
message.accountId = object.accountId ?? 0;
|
|
4312
|
-
message.clientOrderId = object.clientOrderId ?? undefined;
|
|
4313
4618
|
return message;
|
|
4314
4619
|
},
|
|
4315
4620
|
};
|
|
@@ -4351,34 +4656,38 @@ export const Receipt_Trade: MessageFns<Receipt_Trade> = {
|
|
|
4351
4656
|
while (reader.pos < end) {
|
|
4352
4657
|
const tag = reader.uint32();
|
|
4353
4658
|
switch (tag >>> 3) {
|
|
4354
|
-
case 2:
|
|
4659
|
+
case 2: {
|
|
4355
4660
|
if (tag !== 16) {
|
|
4356
4661
|
break;
|
|
4357
4662
|
}
|
|
4358
4663
|
|
|
4359
4664
|
message.orderId = reader.uint64() as bigint;
|
|
4360
4665
|
continue;
|
|
4361
|
-
|
|
4666
|
+
}
|
|
4667
|
+
case 4: {
|
|
4362
4668
|
if (tag !== 32) {
|
|
4363
4669
|
break;
|
|
4364
4670
|
}
|
|
4365
4671
|
|
|
4366
4672
|
message.price = reader.uint64() as bigint;
|
|
4367
4673
|
continue;
|
|
4368
|
-
|
|
4674
|
+
}
|
|
4675
|
+
case 5: {
|
|
4369
4676
|
if (tag !== 40) {
|
|
4370
4677
|
break;
|
|
4371
4678
|
}
|
|
4372
4679
|
|
|
4373
4680
|
message.size = reader.uint64() as bigint;
|
|
4374
4681
|
continue;
|
|
4375
|
-
|
|
4682
|
+
}
|
|
4683
|
+
case 6: {
|
|
4376
4684
|
if (tag !== 48) {
|
|
4377
4685
|
break;
|
|
4378
4686
|
}
|
|
4379
4687
|
|
|
4380
4688
|
message.accountId = reader.uint32();
|
|
4381
4689
|
continue;
|
|
4690
|
+
}
|
|
4382
4691
|
}
|
|
4383
4692
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4384
4693
|
break;
|
|
@@ -4449,13 +4758,14 @@ export const Receipt_CreateSessionResult: MessageFns<Receipt_CreateSessionResult
|
|
|
4449
4758
|
while (reader.pos < end) {
|
|
4450
4759
|
const tag = reader.uint32();
|
|
4451
4760
|
switch (tag >>> 3) {
|
|
4452
|
-
case 1:
|
|
4761
|
+
case 1: {
|
|
4453
4762
|
if (tag !== 8) {
|
|
4454
4763
|
break;
|
|
4455
4764
|
}
|
|
4456
4765
|
|
|
4457
4766
|
message.sessionId = reader.uint64() as bigint;
|
|
4458
4767
|
continue;
|
|
4768
|
+
}
|
|
4459
4769
|
}
|
|
4460
4770
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4461
4771
|
break;
|
|
@@ -4488,7 +4798,7 @@ export const Receipt_CreateSessionResult: MessageFns<Receipt_CreateSessionResult
|
|
|
4488
4798
|
};
|
|
4489
4799
|
|
|
4490
4800
|
function createBaseReceipt_PlaceOrderResult(): Receipt_PlaceOrderResult {
|
|
4491
|
-
return { posted: undefined, fills: [] };
|
|
4801
|
+
return { posted: undefined, fills: [], clientOrderId: undefined };
|
|
4492
4802
|
}
|
|
4493
4803
|
|
|
4494
4804
|
export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
@@ -4499,6 +4809,12 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4499
4809
|
for (const v of message.fills) {
|
|
4500
4810
|
Receipt_Trade.encode(v!, writer.uint32(18).fork()).join();
|
|
4501
4811
|
}
|
|
4812
|
+
if (message.clientOrderId !== undefined) {
|
|
4813
|
+
if (BigInt.asUintN(64, message.clientOrderId) !== message.clientOrderId) {
|
|
4814
|
+
throw new globalThis.Error("value provided for field message.clientOrderId of type uint64 too large");
|
|
4815
|
+
}
|
|
4816
|
+
writer.uint32(24).uint64(message.clientOrderId);
|
|
4817
|
+
}
|
|
4502
4818
|
return writer;
|
|
4503
4819
|
},
|
|
4504
4820
|
|
|
@@ -4509,20 +4825,30 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4509
4825
|
while (reader.pos < end) {
|
|
4510
4826
|
const tag = reader.uint32();
|
|
4511
4827
|
switch (tag >>> 3) {
|
|
4512
|
-
case 1:
|
|
4828
|
+
case 1: {
|
|
4513
4829
|
if (tag !== 10) {
|
|
4514
4830
|
break;
|
|
4515
4831
|
}
|
|
4516
4832
|
|
|
4517
4833
|
message.posted = Receipt_Posted.decode(reader, reader.uint32());
|
|
4518
4834
|
continue;
|
|
4519
|
-
|
|
4835
|
+
}
|
|
4836
|
+
case 2: {
|
|
4520
4837
|
if (tag !== 18) {
|
|
4521
4838
|
break;
|
|
4522
4839
|
}
|
|
4523
4840
|
|
|
4524
4841
|
message.fills.push(Receipt_Trade.decode(reader, reader.uint32()));
|
|
4525
4842
|
continue;
|
|
4843
|
+
}
|
|
4844
|
+
case 3: {
|
|
4845
|
+
if (tag !== 24) {
|
|
4846
|
+
break;
|
|
4847
|
+
}
|
|
4848
|
+
|
|
4849
|
+
message.clientOrderId = reader.uint64() as bigint;
|
|
4850
|
+
continue;
|
|
4851
|
+
}
|
|
4526
4852
|
}
|
|
4527
4853
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4528
4854
|
break;
|
|
@@ -4536,6 +4862,7 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4536
4862
|
return {
|
|
4537
4863
|
posted: isSet(object.posted) ? Receipt_Posted.fromJSON(object.posted) : undefined,
|
|
4538
4864
|
fills: globalThis.Array.isArray(object?.fills) ? object.fills.map((e: any) => Receipt_Trade.fromJSON(e)) : [],
|
|
4865
|
+
clientOrderId: isSet(object.clientOrderId) ? BigInt(object.clientOrderId) : undefined,
|
|
4539
4866
|
};
|
|
4540
4867
|
},
|
|
4541
4868
|
|
|
@@ -4547,6 +4874,9 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4547
4874
|
if (message.fills?.length) {
|
|
4548
4875
|
obj.fills = message.fills.map((e) => Receipt_Trade.toJSON(e));
|
|
4549
4876
|
}
|
|
4877
|
+
if (message.clientOrderId !== undefined) {
|
|
4878
|
+
obj.clientOrderId = message.clientOrderId.toString();
|
|
4879
|
+
}
|
|
4550
4880
|
return obj;
|
|
4551
4881
|
},
|
|
4552
4882
|
|
|
@@ -4559,6 +4889,7 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4559
4889
|
? Receipt_Posted.fromPartial(object.posted)
|
|
4560
4890
|
: undefined;
|
|
4561
4891
|
message.fills = object.fills?.map((e) => Receipt_Trade.fromPartial(e)) || [];
|
|
4892
|
+
message.clientOrderId = object.clientOrderId ?? undefined;
|
|
4562
4893
|
return message;
|
|
4563
4894
|
},
|
|
4564
4895
|
};
|
|
@@ -4588,20 +4919,22 @@ export const Receipt_CancelOrderResult: MessageFns<Receipt_CancelOrderResult> =
|
|
|
4588
4919
|
while (reader.pos < end) {
|
|
4589
4920
|
const tag = reader.uint32();
|
|
4590
4921
|
switch (tag >>> 3) {
|
|
4591
|
-
case 1:
|
|
4922
|
+
case 1: {
|
|
4592
4923
|
if (tag !== 8) {
|
|
4593
4924
|
break;
|
|
4594
4925
|
}
|
|
4595
4926
|
|
|
4596
4927
|
message.orderId = reader.uint64() as bigint;
|
|
4597
4928
|
continue;
|
|
4598
|
-
|
|
4929
|
+
}
|
|
4930
|
+
case 2: {
|
|
4599
4931
|
if (tag !== 16) {
|
|
4600
4932
|
break;
|
|
4601
4933
|
}
|
|
4602
4934
|
|
|
4603
4935
|
message.accountId = reader.uint32();
|
|
4604
4936
|
continue;
|
|
4937
|
+
}
|
|
4605
4938
|
}
|
|
4606
4939
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4607
4940
|
break;
|
|
@@ -4674,41 +5007,46 @@ export const Receipt_DepositResult: MessageFns<Receipt_DepositResult> = {
|
|
|
4674
5007
|
while (reader.pos < end) {
|
|
4675
5008
|
const tag = reader.uint32();
|
|
4676
5009
|
switch (tag >>> 3) {
|
|
4677
|
-
case 1:
|
|
5010
|
+
case 1: {
|
|
4678
5011
|
if (tag !== 8) {
|
|
4679
5012
|
break;
|
|
4680
5013
|
}
|
|
4681
5014
|
|
|
4682
5015
|
message.tokenId = reader.uint32();
|
|
4683
5016
|
continue;
|
|
4684
|
-
|
|
5017
|
+
}
|
|
5018
|
+
case 2: {
|
|
4685
5019
|
if (tag !== 16) {
|
|
4686
5020
|
break;
|
|
4687
5021
|
}
|
|
4688
5022
|
|
|
4689
5023
|
message.amount = reader.uint64() as bigint;
|
|
4690
5024
|
continue;
|
|
4691
|
-
|
|
5025
|
+
}
|
|
5026
|
+
case 3: {
|
|
4692
5027
|
if (tag !== 24) {
|
|
4693
5028
|
break;
|
|
4694
5029
|
}
|
|
4695
5030
|
|
|
4696
5031
|
message.accountId = reader.uint32();
|
|
4697
5032
|
continue;
|
|
4698
|
-
|
|
5033
|
+
}
|
|
5034
|
+
case 4: {
|
|
4699
5035
|
if (tag !== 32) {
|
|
4700
5036
|
break;
|
|
4701
5037
|
}
|
|
4702
5038
|
|
|
4703
5039
|
message.userCreated = reader.bool();
|
|
4704
5040
|
continue;
|
|
4705
|
-
|
|
5041
|
+
}
|
|
5042
|
+
case 5: {
|
|
4706
5043
|
if (tag !== 42) {
|
|
4707
5044
|
break;
|
|
4708
5045
|
}
|
|
4709
5046
|
|
|
4710
5047
|
message.userPubkey = reader.bytes();
|
|
4711
5048
|
continue;
|
|
5049
|
+
}
|
|
4712
5050
|
}
|
|
4713
5051
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4714
5052
|
break;
|
|
@@ -4784,20 +5122,22 @@ export const Receipt_InsertTokenResult: MessageFns<Receipt_InsertTokenResult> =
|
|
|
4784
5122
|
while (reader.pos < end) {
|
|
4785
5123
|
const tag = reader.uint32();
|
|
4786
5124
|
switch (tag >>> 3) {
|
|
4787
|
-
case 1:
|
|
5125
|
+
case 1: {
|
|
4788
5126
|
if (tag !== 10) {
|
|
4789
5127
|
break;
|
|
4790
5128
|
}
|
|
4791
5129
|
|
|
4792
5130
|
message.chainAddr = reader.bytes();
|
|
4793
5131
|
continue;
|
|
4794
|
-
|
|
5132
|
+
}
|
|
5133
|
+
case 2: {
|
|
4795
5134
|
if (tag !== 18) {
|
|
4796
5135
|
break;
|
|
4797
5136
|
}
|
|
4798
5137
|
|
|
4799
5138
|
message.token = Token.decode(reader, reader.uint32());
|
|
4800
5139
|
continue;
|
|
5140
|
+
}
|
|
4801
5141
|
}
|
|
4802
5142
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4803
5143
|
break;
|
|
@@ -4855,13 +5195,14 @@ export const Receipt_InsertMarketResult: MessageFns<Receipt_InsertMarketResult>
|
|
|
4855
5195
|
while (reader.pos < end) {
|
|
4856
5196
|
const tag = reader.uint32();
|
|
4857
5197
|
switch (tag >>> 3) {
|
|
4858
|
-
case 1:
|
|
5198
|
+
case 1: {
|
|
4859
5199
|
if (tag !== 10) {
|
|
4860
5200
|
break;
|
|
4861
5201
|
}
|
|
4862
5202
|
|
|
4863
5203
|
message.market = Market.decode(reader, reader.uint32());
|
|
4864
5204
|
continue;
|
|
5205
|
+
}
|
|
4865
5206
|
}
|
|
4866
5207
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4867
5208
|
break;
|
|
@@ -4932,41 +5273,46 @@ export const Receipt_WithdrawResult: MessageFns<Receipt_WithdrawResult> = {
|
|
|
4932
5273
|
while (reader.pos < end) {
|
|
4933
5274
|
const tag = reader.uint32();
|
|
4934
5275
|
switch (tag >>> 3) {
|
|
4935
|
-
case 1:
|
|
5276
|
+
case 1: {
|
|
4936
5277
|
if (tag !== 8) {
|
|
4937
5278
|
break;
|
|
4938
5279
|
}
|
|
4939
5280
|
|
|
4940
5281
|
message.tokenId = reader.uint32();
|
|
4941
5282
|
continue;
|
|
4942
|
-
|
|
5283
|
+
}
|
|
5284
|
+
case 2: {
|
|
4943
5285
|
if (tag !== 16) {
|
|
4944
5286
|
break;
|
|
4945
5287
|
}
|
|
4946
5288
|
|
|
4947
5289
|
message.amount = reader.uint64() as bigint;
|
|
4948
5290
|
continue;
|
|
4949
|
-
|
|
5291
|
+
}
|
|
5292
|
+
case 3: {
|
|
4950
5293
|
if (tag !== 24) {
|
|
4951
5294
|
break;
|
|
4952
5295
|
}
|
|
4953
5296
|
|
|
4954
5297
|
message.balance = reader.uint64() as bigint;
|
|
4955
5298
|
continue;
|
|
4956
|
-
|
|
5299
|
+
}
|
|
5300
|
+
case 4: {
|
|
4957
5301
|
if (tag !== 32) {
|
|
4958
5302
|
break;
|
|
4959
5303
|
}
|
|
4960
5304
|
|
|
4961
5305
|
message.accountId = reader.uint32();
|
|
4962
5306
|
continue;
|
|
4963
|
-
|
|
5307
|
+
}
|
|
5308
|
+
case 5: {
|
|
4964
5309
|
if (tag !== 42) {
|
|
4965
5310
|
break;
|
|
4966
5311
|
}
|
|
4967
5312
|
|
|
4968
5313
|
message.userPubkey = reader.bytes();
|
|
4969
5314
|
continue;
|
|
5315
|
+
}
|
|
4970
5316
|
}
|
|
4971
5317
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4972
5318
|
break;
|
|
@@ -5042,20 +5388,22 @@ export const Receipt_OracleSymbolFeedResult: MessageFns<Receipt_OracleSymbolFeed
|
|
|
5042
5388
|
while (reader.pos < end) {
|
|
5043
5389
|
const tag = reader.uint32();
|
|
5044
5390
|
switch (tag >>> 3) {
|
|
5045
|
-
case 1:
|
|
5391
|
+
case 1: {
|
|
5046
5392
|
if (tag !== 10) {
|
|
5047
5393
|
break;
|
|
5048
5394
|
}
|
|
5049
5395
|
|
|
5050
5396
|
message.oracleSymbol = reader.string();
|
|
5051
5397
|
continue;
|
|
5052
|
-
|
|
5398
|
+
}
|
|
5399
|
+
case 2: {
|
|
5053
5400
|
if (tag !== 18) {
|
|
5054
5401
|
break;
|
|
5055
5402
|
}
|
|
5056
5403
|
|
|
5057
5404
|
message.feedId = reader.bytes();
|
|
5058
5405
|
continue;
|
|
5406
|
+
}
|
|
5059
5407
|
}
|
|
5060
5408
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5061
5409
|
break;
|
|
@@ -5118,13 +5466,14 @@ export const Receipt_OracleUpdateResult: MessageFns<Receipt_OracleUpdateResult>
|
|
|
5118
5466
|
while (reader.pos < end) {
|
|
5119
5467
|
const tag = reader.uint32();
|
|
5120
5468
|
switch (tag >>> 3) {
|
|
5121
|
-
case 1:
|
|
5469
|
+
case 1: {
|
|
5122
5470
|
if (tag !== 8) {
|
|
5123
5471
|
break;
|
|
5124
5472
|
}
|
|
5125
5473
|
|
|
5126
5474
|
message.timestamp = reader.int64() as bigint;
|
|
5127
5475
|
continue;
|
|
5476
|
+
}
|
|
5128
5477
|
}
|
|
5129
5478
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5130
5479
|
break;
|
|
@@ -5178,20 +5527,22 @@ export const Receipt_UpdateGuardianSetResult: MessageFns<Receipt_UpdateGuardianS
|
|
|
5178
5527
|
while (reader.pos < end) {
|
|
5179
5528
|
const tag = reader.uint32();
|
|
5180
5529
|
switch (tag >>> 3) {
|
|
5181
|
-
case 1:
|
|
5530
|
+
case 1: {
|
|
5182
5531
|
if (tag !== 8) {
|
|
5183
5532
|
break;
|
|
5184
5533
|
}
|
|
5185
5534
|
|
|
5186
5535
|
message.guardianSetIndex = reader.uint32();
|
|
5187
5536
|
continue;
|
|
5188
|
-
|
|
5537
|
+
}
|
|
5538
|
+
case 2: {
|
|
5189
5539
|
if (tag !== 18) {
|
|
5190
5540
|
break;
|
|
5191
5541
|
}
|
|
5192
5542
|
|
|
5193
5543
|
message.addresses.push(reader.bytes());
|
|
5194
5544
|
continue;
|
|
5545
|
+
}
|
|
5195
5546
|
}
|
|
5196
5547
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5197
5548
|
break;
|
|
@@ -5234,22 +5585,61 @@ export const Receipt_UpdateGuardianSetResult: MessageFns<Receipt_UpdateGuardianS
|
|
|
5234
5585
|
},
|
|
5235
5586
|
};
|
|
5236
5587
|
|
|
5237
|
-
function
|
|
5238
|
-
return {};
|
|
5588
|
+
function createBaseReceipt_PerpPosition(): Receipt_PerpPosition {
|
|
5589
|
+
return { marketId: 0, baseSize: 0n, price: 0n };
|
|
5239
5590
|
}
|
|
5240
5591
|
|
|
5241
|
-
export const
|
|
5242
|
-
encode(
|
|
5592
|
+
export const Receipt_PerpPosition: MessageFns<Receipt_PerpPosition> = {
|
|
5593
|
+
encode(message: Receipt_PerpPosition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
5594
|
+
if (message.marketId !== 0) {
|
|
5595
|
+
writer.uint32(8).uint32(message.marketId);
|
|
5596
|
+
}
|
|
5597
|
+
if (message.baseSize !== 0n) {
|
|
5598
|
+
if (BigInt.asIntN(64, message.baseSize) !== message.baseSize) {
|
|
5599
|
+
throw new globalThis.Error("value provided for field message.baseSize of type int64 too large");
|
|
5600
|
+
}
|
|
5601
|
+
writer.uint32(16).int64(message.baseSize);
|
|
5602
|
+
}
|
|
5603
|
+
if (message.price !== 0n) {
|
|
5604
|
+
if (BigInt.asUintN(64, message.price) !== message.price) {
|
|
5605
|
+
throw new globalThis.Error("value provided for field message.price of type uint64 too large");
|
|
5606
|
+
}
|
|
5607
|
+
writer.uint32(24).uint64(message.price);
|
|
5608
|
+
}
|
|
5243
5609
|
return writer;
|
|
5244
5610
|
},
|
|
5245
5611
|
|
|
5246
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
5612
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Receipt_PerpPosition {
|
|
5247
5613
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5248
5614
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5249
|
-
const message =
|
|
5615
|
+
const message = createBaseReceipt_PerpPosition();
|
|
5250
5616
|
while (reader.pos < end) {
|
|
5251
5617
|
const tag = reader.uint32();
|
|
5252
5618
|
switch (tag >>> 3) {
|
|
5619
|
+
case 1: {
|
|
5620
|
+
if (tag !== 8) {
|
|
5621
|
+
break;
|
|
5622
|
+
}
|
|
5623
|
+
|
|
5624
|
+
message.marketId = reader.uint32();
|
|
5625
|
+
continue;
|
|
5626
|
+
}
|
|
5627
|
+
case 2: {
|
|
5628
|
+
if (tag !== 16) {
|
|
5629
|
+
break;
|
|
5630
|
+
}
|
|
5631
|
+
|
|
5632
|
+
message.baseSize = reader.int64() as bigint;
|
|
5633
|
+
continue;
|
|
5634
|
+
}
|
|
5635
|
+
case 3: {
|
|
5636
|
+
if (tag !== 24) {
|
|
5637
|
+
break;
|
|
5638
|
+
}
|
|
5639
|
+
|
|
5640
|
+
message.price = reader.uint64() as bigint;
|
|
5641
|
+
continue;
|
|
5642
|
+
}
|
|
5253
5643
|
}
|
|
5254
5644
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5255
5645
|
break;
|
|
@@ -5259,20 +5649,163 @@ export const Receipt_Liquidated: MessageFns<Receipt_Liquidated> = {
|
|
|
5259
5649
|
return message;
|
|
5260
5650
|
},
|
|
5261
5651
|
|
|
5262
|
-
fromJSON(
|
|
5263
|
-
return {
|
|
5652
|
+
fromJSON(object: any): Receipt_PerpPosition {
|
|
5653
|
+
return {
|
|
5654
|
+
marketId: isSet(object.marketId) ? globalThis.Number(object.marketId) : 0,
|
|
5655
|
+
baseSize: isSet(object.baseSize) ? BigInt(object.baseSize) : 0n,
|
|
5656
|
+
price: isSet(object.price) ? BigInt(object.price) : 0n,
|
|
5657
|
+
};
|
|
5264
5658
|
},
|
|
5265
5659
|
|
|
5266
|
-
toJSON(
|
|
5660
|
+
toJSON(message: Receipt_PerpPosition): unknown {
|
|
5267
5661
|
const obj: any = {};
|
|
5662
|
+
if (message.marketId !== 0) {
|
|
5663
|
+
obj.marketId = Math.round(message.marketId);
|
|
5664
|
+
}
|
|
5665
|
+
if (message.baseSize !== 0n) {
|
|
5666
|
+
obj.baseSize = message.baseSize.toString();
|
|
5667
|
+
}
|
|
5668
|
+
if (message.price !== 0n) {
|
|
5669
|
+
obj.price = message.price.toString();
|
|
5670
|
+
}
|
|
5268
5671
|
return obj;
|
|
5269
5672
|
},
|
|
5270
5673
|
|
|
5271
|
-
create<I extends Exact<DeepPartial<
|
|
5272
|
-
return
|
|
5674
|
+
create<I extends Exact<DeepPartial<Receipt_PerpPosition>, I>>(base?: I): Receipt_PerpPosition {
|
|
5675
|
+
return Receipt_PerpPosition.fromPartial(base ?? ({} as any));
|
|
5273
5676
|
},
|
|
5274
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
5275
|
-
const message =
|
|
5677
|
+
fromPartial<I extends Exact<DeepPartial<Receipt_PerpPosition>, I>>(object: I): Receipt_PerpPosition {
|
|
5678
|
+
const message = createBaseReceipt_PerpPosition();
|
|
5679
|
+
message.marketId = object.marketId ?? 0;
|
|
5680
|
+
message.baseSize = object.baseSize ?? 0n;
|
|
5681
|
+
message.price = object.price ?? 0n;
|
|
5682
|
+
return message;
|
|
5683
|
+
},
|
|
5684
|
+
};
|
|
5685
|
+
|
|
5686
|
+
function createBaseReceipt_AccountLiquidated(): Receipt_AccountLiquidated {
|
|
5687
|
+
return { liquidatorAccountId: 0, liquidateeAccountId: 0, cancelledOrders: [], removedPerps: [] };
|
|
5688
|
+
}
|
|
5689
|
+
|
|
5690
|
+
export const Receipt_AccountLiquidated: MessageFns<Receipt_AccountLiquidated> = {
|
|
5691
|
+
encode(message: Receipt_AccountLiquidated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
5692
|
+
if (message.liquidatorAccountId !== 0) {
|
|
5693
|
+
writer.uint32(8).uint32(message.liquidatorAccountId);
|
|
5694
|
+
}
|
|
5695
|
+
if (message.liquidateeAccountId !== 0) {
|
|
5696
|
+
writer.uint32(16).uint32(message.liquidateeAccountId);
|
|
5697
|
+
}
|
|
5698
|
+
writer.uint32(26).fork();
|
|
5699
|
+
for (const v of message.cancelledOrders) {
|
|
5700
|
+
if (BigInt.asUintN(64, v) !== v) {
|
|
5701
|
+
throw new globalThis.Error("a value provided in array field cancelledOrders of type uint64 is too large");
|
|
5702
|
+
}
|
|
5703
|
+
writer.uint64(v);
|
|
5704
|
+
}
|
|
5705
|
+
writer.join();
|
|
5706
|
+
for (const v of message.removedPerps) {
|
|
5707
|
+
Receipt_PerpPosition.encode(v!, writer.uint32(34).fork()).join();
|
|
5708
|
+
}
|
|
5709
|
+
return writer;
|
|
5710
|
+
},
|
|
5711
|
+
|
|
5712
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Receipt_AccountLiquidated {
|
|
5713
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5714
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5715
|
+
const message = createBaseReceipt_AccountLiquidated();
|
|
5716
|
+
while (reader.pos < end) {
|
|
5717
|
+
const tag = reader.uint32();
|
|
5718
|
+
switch (tag >>> 3) {
|
|
5719
|
+
case 1: {
|
|
5720
|
+
if (tag !== 8) {
|
|
5721
|
+
break;
|
|
5722
|
+
}
|
|
5723
|
+
|
|
5724
|
+
message.liquidatorAccountId = reader.uint32();
|
|
5725
|
+
continue;
|
|
5726
|
+
}
|
|
5727
|
+
case 2: {
|
|
5728
|
+
if (tag !== 16) {
|
|
5729
|
+
break;
|
|
5730
|
+
}
|
|
5731
|
+
|
|
5732
|
+
message.liquidateeAccountId = reader.uint32();
|
|
5733
|
+
continue;
|
|
5734
|
+
}
|
|
5735
|
+
case 3: {
|
|
5736
|
+
if (tag === 24) {
|
|
5737
|
+
message.cancelledOrders.push(reader.uint64() as bigint);
|
|
5738
|
+
|
|
5739
|
+
continue;
|
|
5740
|
+
}
|
|
5741
|
+
|
|
5742
|
+
if (tag === 26) {
|
|
5743
|
+
const end2 = reader.uint32() + reader.pos;
|
|
5744
|
+
while (reader.pos < end2) {
|
|
5745
|
+
message.cancelledOrders.push(reader.uint64() as bigint);
|
|
5746
|
+
}
|
|
5747
|
+
|
|
5748
|
+
continue;
|
|
5749
|
+
}
|
|
5750
|
+
|
|
5751
|
+
break;
|
|
5752
|
+
}
|
|
5753
|
+
case 4: {
|
|
5754
|
+
if (tag !== 34) {
|
|
5755
|
+
break;
|
|
5756
|
+
}
|
|
5757
|
+
|
|
5758
|
+
message.removedPerps.push(Receipt_PerpPosition.decode(reader, reader.uint32()));
|
|
5759
|
+
continue;
|
|
5760
|
+
}
|
|
5761
|
+
}
|
|
5762
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5763
|
+
break;
|
|
5764
|
+
}
|
|
5765
|
+
reader.skip(tag & 7);
|
|
5766
|
+
}
|
|
5767
|
+
return message;
|
|
5768
|
+
},
|
|
5769
|
+
|
|
5770
|
+
fromJSON(object: any): Receipt_AccountLiquidated {
|
|
5771
|
+
return {
|
|
5772
|
+
liquidatorAccountId: isSet(object.liquidatorAccountId) ? globalThis.Number(object.liquidatorAccountId) : 0,
|
|
5773
|
+
liquidateeAccountId: isSet(object.liquidateeAccountId) ? globalThis.Number(object.liquidateeAccountId) : 0,
|
|
5774
|
+
cancelledOrders: globalThis.Array.isArray(object?.cancelledOrders)
|
|
5775
|
+
? object.cancelledOrders.map((e: any) => BigInt(e))
|
|
5776
|
+
: [],
|
|
5777
|
+
removedPerps: globalThis.Array.isArray(object?.removedPerps)
|
|
5778
|
+
? object.removedPerps.map((e: any) => Receipt_PerpPosition.fromJSON(e))
|
|
5779
|
+
: [],
|
|
5780
|
+
};
|
|
5781
|
+
},
|
|
5782
|
+
|
|
5783
|
+
toJSON(message: Receipt_AccountLiquidated): unknown {
|
|
5784
|
+
const obj: any = {};
|
|
5785
|
+
if (message.liquidatorAccountId !== 0) {
|
|
5786
|
+
obj.liquidatorAccountId = Math.round(message.liquidatorAccountId);
|
|
5787
|
+
}
|
|
5788
|
+
if (message.liquidateeAccountId !== 0) {
|
|
5789
|
+
obj.liquidateeAccountId = Math.round(message.liquidateeAccountId);
|
|
5790
|
+
}
|
|
5791
|
+
if (message.cancelledOrders?.length) {
|
|
5792
|
+
obj.cancelledOrders = message.cancelledOrders.map((e) => e.toString());
|
|
5793
|
+
}
|
|
5794
|
+
if (message.removedPerps?.length) {
|
|
5795
|
+
obj.removedPerps = message.removedPerps.map((e) => Receipt_PerpPosition.toJSON(e));
|
|
5796
|
+
}
|
|
5797
|
+
return obj;
|
|
5798
|
+
},
|
|
5799
|
+
|
|
5800
|
+
create<I extends Exact<DeepPartial<Receipt_AccountLiquidated>, I>>(base?: I): Receipt_AccountLiquidated {
|
|
5801
|
+
return Receipt_AccountLiquidated.fromPartial(base ?? ({} as any));
|
|
5802
|
+
},
|
|
5803
|
+
fromPartial<I extends Exact<DeepPartial<Receipt_AccountLiquidated>, I>>(object: I): Receipt_AccountLiquidated {
|
|
5804
|
+
const message = createBaseReceipt_AccountLiquidated();
|
|
5805
|
+
message.liquidatorAccountId = object.liquidatorAccountId ?? 0;
|
|
5806
|
+
message.liquidateeAccountId = object.liquidateeAccountId ?? 0;
|
|
5807
|
+
message.cancelledOrders = object.cancelledOrders?.map((e) => e) || [];
|
|
5808
|
+
message.removedPerps = object.removedPerps?.map((e) => Receipt_PerpPosition.fromPartial(e)) || [];
|
|
5276
5809
|
return message;
|
|
5277
5810
|
},
|
|
5278
5811
|
};
|
|
@@ -5407,7 +5940,14 @@ export const Receipt_Unpaused: MessageFns<Receipt_Unpaused> = {
|
|
|
5407
5940
|
};
|
|
5408
5941
|
|
|
5409
5942
|
function createBaseReceipt_Transferred(): Receipt_Transferred {
|
|
5410
|
-
return {
|
|
5943
|
+
return {
|
|
5944
|
+
fromAccountId: 0,
|
|
5945
|
+
toUserAccount: undefined,
|
|
5946
|
+
tokenId: 0,
|
|
5947
|
+
amount: 0n,
|
|
5948
|
+
accountCreated: false,
|
|
5949
|
+
toSpecialAccount: undefined,
|
|
5950
|
+
};
|
|
5411
5951
|
}
|
|
5412
5952
|
|
|
5413
5953
|
export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
@@ -5415,8 +5955,8 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5415
5955
|
if (message.fromAccountId !== 0) {
|
|
5416
5956
|
writer.uint32(8).uint32(message.fromAccountId);
|
|
5417
5957
|
}
|
|
5418
|
-
if (message.
|
|
5419
|
-
writer.uint32(16).uint32(message.
|
|
5958
|
+
if (message.toUserAccount !== undefined) {
|
|
5959
|
+
writer.uint32(16).uint32(message.toUserAccount);
|
|
5420
5960
|
}
|
|
5421
5961
|
if (message.tokenId !== 0) {
|
|
5422
5962
|
writer.uint32(24).uint32(message.tokenId);
|
|
@@ -5430,6 +5970,9 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5430
5970
|
if (message.accountCreated !== false) {
|
|
5431
5971
|
writer.uint32(40).bool(message.accountCreated);
|
|
5432
5972
|
}
|
|
5973
|
+
if (message.toSpecialAccount !== undefined) {
|
|
5974
|
+
writer.uint32(48).int32(message.toSpecialAccount);
|
|
5975
|
+
}
|
|
5433
5976
|
return writer;
|
|
5434
5977
|
},
|
|
5435
5978
|
|
|
@@ -5440,41 +5983,54 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5440
5983
|
while (reader.pos < end) {
|
|
5441
5984
|
const tag = reader.uint32();
|
|
5442
5985
|
switch (tag >>> 3) {
|
|
5443
|
-
case 1:
|
|
5986
|
+
case 1: {
|
|
5444
5987
|
if (tag !== 8) {
|
|
5445
5988
|
break;
|
|
5446
5989
|
}
|
|
5447
5990
|
|
|
5448
5991
|
message.fromAccountId = reader.uint32();
|
|
5449
5992
|
continue;
|
|
5450
|
-
|
|
5993
|
+
}
|
|
5994
|
+
case 2: {
|
|
5451
5995
|
if (tag !== 16) {
|
|
5452
5996
|
break;
|
|
5453
5997
|
}
|
|
5454
5998
|
|
|
5455
|
-
message.
|
|
5999
|
+
message.toUserAccount = reader.uint32();
|
|
5456
6000
|
continue;
|
|
5457
|
-
|
|
6001
|
+
}
|
|
6002
|
+
case 3: {
|
|
5458
6003
|
if (tag !== 24) {
|
|
5459
6004
|
break;
|
|
5460
6005
|
}
|
|
5461
6006
|
|
|
5462
6007
|
message.tokenId = reader.uint32();
|
|
5463
6008
|
continue;
|
|
5464
|
-
|
|
6009
|
+
}
|
|
6010
|
+
case 4: {
|
|
5465
6011
|
if (tag !== 32) {
|
|
5466
6012
|
break;
|
|
5467
6013
|
}
|
|
5468
6014
|
|
|
5469
6015
|
message.amount = reader.uint64() as bigint;
|
|
5470
6016
|
continue;
|
|
5471
|
-
|
|
6017
|
+
}
|
|
6018
|
+
case 5: {
|
|
5472
6019
|
if (tag !== 40) {
|
|
5473
6020
|
break;
|
|
5474
6021
|
}
|
|
5475
6022
|
|
|
5476
6023
|
message.accountCreated = reader.bool();
|
|
5477
6024
|
continue;
|
|
6025
|
+
}
|
|
6026
|
+
case 6: {
|
|
6027
|
+
if (tag !== 48) {
|
|
6028
|
+
break;
|
|
6029
|
+
}
|
|
6030
|
+
|
|
6031
|
+
message.toSpecialAccount = reader.int32() as any;
|
|
6032
|
+
continue;
|
|
6033
|
+
}
|
|
5478
6034
|
}
|
|
5479
6035
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5480
6036
|
break;
|
|
@@ -5487,10 +6043,11 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5487
6043
|
fromJSON(object: any): Receipt_Transferred {
|
|
5488
6044
|
return {
|
|
5489
6045
|
fromAccountId: isSet(object.fromAccountId) ? globalThis.Number(object.fromAccountId) : 0,
|
|
5490
|
-
|
|
6046
|
+
toUserAccount: isSet(object.toUserAccount) ? globalThis.Number(object.toUserAccount) : undefined,
|
|
5491
6047
|
tokenId: isSet(object.tokenId) ? globalThis.Number(object.tokenId) : 0,
|
|
5492
6048
|
amount: isSet(object.amount) ? BigInt(object.amount) : 0n,
|
|
5493
6049
|
accountCreated: isSet(object.accountCreated) ? globalThis.Boolean(object.accountCreated) : false,
|
|
6050
|
+
toSpecialAccount: isSet(object.toSpecialAccount) ? specialAccountFromJSON(object.toSpecialAccount) : undefined,
|
|
5494
6051
|
};
|
|
5495
6052
|
},
|
|
5496
6053
|
|
|
@@ -5499,8 +6056,8 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5499
6056
|
if (message.fromAccountId !== 0) {
|
|
5500
6057
|
obj.fromAccountId = Math.round(message.fromAccountId);
|
|
5501
6058
|
}
|
|
5502
|
-
if (message.
|
|
5503
|
-
obj.
|
|
6059
|
+
if (message.toUserAccount !== undefined) {
|
|
6060
|
+
obj.toUserAccount = Math.round(message.toUserAccount);
|
|
5504
6061
|
}
|
|
5505
6062
|
if (message.tokenId !== 0) {
|
|
5506
6063
|
obj.tokenId = Math.round(message.tokenId);
|
|
@@ -5511,6 +6068,9 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5511
6068
|
if (message.accountCreated !== false) {
|
|
5512
6069
|
obj.accountCreated = message.accountCreated;
|
|
5513
6070
|
}
|
|
6071
|
+
if (message.toSpecialAccount !== undefined) {
|
|
6072
|
+
obj.toSpecialAccount = specialAccountToJSON(message.toSpecialAccount);
|
|
6073
|
+
}
|
|
5514
6074
|
return obj;
|
|
5515
6075
|
},
|
|
5516
6076
|
|
|
@@ -5520,10 +6080,11 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5520
6080
|
fromPartial<I extends Exact<DeepPartial<Receipt_Transferred>, I>>(object: I): Receipt_Transferred {
|
|
5521
6081
|
const message = createBaseReceipt_Transferred();
|
|
5522
6082
|
message.fromAccountId = object.fromAccountId ?? 0;
|
|
5523
|
-
message.
|
|
6083
|
+
message.toUserAccount = object.toUserAccount ?? undefined;
|
|
5524
6084
|
message.tokenId = object.tokenId ?? 0;
|
|
5525
6085
|
message.amount = object.amount ?? 0n;
|
|
5526
6086
|
message.accountCreated = object.accountCreated ?? false;
|
|
6087
|
+
message.toSpecialAccount = object.toSpecialAccount ?? undefined;
|
|
5527
6088
|
return message;
|
|
5528
6089
|
},
|
|
5529
6090
|
};
|