@n1xyz/nord-ts 0.0.1 → 0.0.5
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/README.md +148 -65
- 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/const.d.ts +2 -5
- package/dist/const.js +2 -6
- package/dist/gen/common.d.ts +6 -1
- package/dist/gen/common.js +19 -9
- package/dist/gen/nord.d.ts +76 -21
- 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 +5 -2
- package/dist/index.js +18 -2
- package/dist/nord/{actions.d.ts → api/actions.d.ts} +6 -6
- package/dist/nord/{actions.js → api/actions.js} +6 -10
- package/dist/nord/api/core.d.ts +49 -0
- package/dist/nord/api/core.js +121 -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/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 +697 -0
- package/dist/nord/index.d.ts +9 -2
- package/dist/nord/index.js +30 -6
- package/dist/nord/models/Subscriber.d.ts +37 -0
- package/dist/nord/models/Subscriber.js +25 -0
- package/dist/nord/utils/NordError.d.ts +35 -0
- package/dist/nord/utils/NordError.js +46 -0
- package/dist/types.d.ts +143 -86
- package/dist/types.js +12 -1
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +20 -1
- package/dist/websocket/NordWebSocketClient.d.ts +71 -0
- package/dist/websocket/NordWebSocketClient.js +343 -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/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +16 -16
- package/docs/assets/icons.js +17 -14
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +5 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1423 -1227
- package/docs/classes/Nord.html +189 -43
- package/docs/classes/NordError.html +24 -0
- package/docs/classes/NordUser.html +120 -35
- package/docs/classes/NordWebSocketClient.html +335 -0
- package/docs/classes/SolanaBridgeClient.html +86 -0
- package/docs/classes/Subscriber.html +10 -6
- package/docs/enums/FillMode.html +5 -5
- package/docs/enums/KeyType.html +4 -4
- package/docs/enums/MetricPeriod.html +9 -0
- package/docs/enums/PdaSeedType.html +9 -0
- package/docs/enums/PeakTpsPeriodUnit.html +7 -7
- package/docs/enums/Side.html +3 -3
- package/docs/enums/WebSocketMessageType.html +7 -0
- package/docs/functions/actionQueryRollman.html +6 -0
- package/docs/functions/actionsQueryRollman.html +6 -0
- package/docs/functions/aggregateMetrics-1.html +7 -0
- package/docs/functions/assert.html +1 -1
- package/docs/functions/bigIntToProtoU128.html +3 -3
- package/docs/functions/blockQueryRollman.html +6 -0
- package/docs/functions/blockSummaryQueryRollman.html +6 -0
- package/docs/functions/bridgeToBN.html +5 -0
- package/docs/functions/bufferToHex.html +4 -0
- package/docs/functions/cancelOrder.html +1 -0
- package/docs/functions/checkPubKeyLength.html +1 -1
- package/docs/functions/checkedFetch.html +4 -4
- package/docs/functions/createSession.html +1 -0
- package/docs/functions/decodeLengthDelimited.html +7 -6
- package/docs/functions/encodeLengthDelimited.html +4 -4
- package/docs/functions/fillModeToProtoFillMode.html +4 -4
- package/docs/functions/findMarket.html +1 -1
- package/docs/functions/findPda.html +6 -0
- package/docs/functions/findToken.html +1 -1
- package/docs/functions/fromBN.html +5 -0
- package/docs/functions/getAccount.html +6 -0
- package/docs/functions/getActionNonce.html +5 -0
- package/docs/functions/getCurrentTps.html +6 -0
- package/docs/functions/getInfo.html +5 -0
- package/docs/functions/getMedianLatency.html +6 -0
- package/docs/functions/getOrderbook.html +6 -0
- package/docs/functions/getPeakTps.html +6 -0
- package/docs/functions/getTimestamp.html +5 -0
- package/docs/functions/getTotalTransactions.html +5 -0
- package/docs/functions/getTrades.html +6 -0
- package/docs/functions/getUserAccountIds.html +6 -0
- package/docs/functions/hexToBuffer.html +4 -0
- package/docs/functions/initWebSocketClient.html +12 -0
- package/docs/functions/keypairFromPrivateKey.html +4 -0
- package/docs/functions/makeSigningFunction.html +4 -0
- package/docs/functions/makeWalletSignFn.html +5 -5
- package/docs/functions/marketsStats.html +5 -0
- package/docs/functions/optExpect.html +4 -4
- package/docs/functions/optMap.html +5 -5
- package/docs/functions/optUnwrap.html +2 -2
- package/docs/functions/panic.html +1 -1
- package/docs/functions/placeOrder.html +1 -0
- package/docs/functions/queryAction.html +6 -0
- package/docs/functions/queryBlock.html +6 -0
- package/docs/functions/queryLastNBlocks.html +5 -0
- package/docs/functions/queryPrometheus.html +6 -0
- package/docs/functions/queryRecentActions.html +6 -0
- package/docs/functions/queryRecentBlocks.html +6 -0
- package/docs/functions/revokeSession.html +1 -0
- package/docs/functions/shortenPublicKey.html +5 -0
- package/docs/functions/signAction.html +2 -2
- package/docs/functions/toBN.html +5 -0
- package/docs/functions/toScaledU128.html +5 -5
- package/docs/functions/toScaledU64.html +5 -5
- package/docs/functions/transfer.html +1 -0
- package/docs/functions/withdraw.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +39 -20
- package/docs/interfaces/Account.html +8 -8
- package/docs/interfaces/ActionInfo.html +8 -8
- package/docs/interfaces/ActionNonceResponse.html +3 -0
- package/docs/interfaces/ActionQuery.html +4 -4
- package/docs/interfaces/ActionResponse.html +8 -8
- package/docs/interfaces/ActionsExtendedInfo.html +10 -10
- package/docs/interfaces/ActionsQuery.html +5 -5
- package/docs/interfaces/ActionsResponse.html +6 -6
- package/docs/interfaces/AggregateMetrics.html +12 -12
- package/docs/interfaces/BlockFacts.html +10 -0
- package/docs/interfaces/BlockQuery.html +6 -6
- package/docs/interfaces/BlockResponse.html +6 -6
- package/docs/interfaces/BlockSummary.html +8 -8
- package/docs/interfaces/BlockSummaryResponse.html +6 -6
- package/docs/interfaces/DeltaEvent.html +6 -6
- package/docs/interfaces/DepositSplParams.html +10 -0
- package/docs/interfaces/Info.html +3 -3
- package/docs/interfaces/Market.html +8 -6
- package/docs/interfaces/MarketStats.html +7 -7
- package/docs/interfaces/MarketsStatsResponse.html +2 -2
- package/docs/interfaces/NordConfig.html +14 -5
- package/docs/interfaces/NordWebSocketClientEvents.html +4 -0
- package/docs/interfaces/NordWebSocketEvents.html +8 -0
- package/docs/interfaces/Order.html +6 -6
- package/docs/interfaces/OrderInfo.html +6 -6
- package/docs/interfaces/OrderbookEntry.html +4 -0
- package/docs/interfaces/OrderbookQuery.html +6 -0
- package/docs/interfaces/OrderbookResponse.html +6 -10
- package/docs/interfaces/OrderbookSubscription.html +159 -0
- package/docs/interfaces/PerpMarketStats.html +5 -5
- package/docs/interfaces/RollmanActionExtendedInfo.html +4 -4
- package/docs/interfaces/RollmanActionInfo.html +4 -4
- package/docs/interfaces/RollmanActionResponse.html +4 -4
- package/docs/interfaces/RollmanActionsResponse.html +2 -2
- package/docs/interfaces/RollmanBlockResponse.html +3 -3
- package/docs/interfaces/SPLTokenInfo.html +10 -0
- package/docs/interfaces/SolanaBridgeConfig.html +10 -0
- package/docs/interfaces/StateFacts.html +10 -0
- package/docs/interfaces/SubscriberConfig.html +3 -3
- package/docs/interfaces/TimestampResponse.html +3 -0
- package/docs/interfaces/Token.html +5 -5
- package/docs/interfaces/TokenInfo.html +5 -0
- package/docs/interfaces/Trade.html +5 -5
- package/docs/interfaces/TradeSubscription.html +159 -0
- package/docs/interfaces/Trades.html +5 -5
- package/docs/interfaces/TradesQuery.html +6 -0
- package/docs/interfaces/TradesResponse.html +7 -12
- package/docs/interfaces/TransferParams.html +8 -0
- package/docs/interfaces/UserAccountIdsQuery.html +3 -0
- package/docs/interfaces/UserAccountIdsResponse.html +3 -0
- package/docs/interfaces/WebSocketDeltaUpdate.html +9 -0
- package/docs/interfaces/WebSocketSubscription.html +4 -0
- package/docs/interfaces/WebSocketTradeUpdate.html +6 -0
- package/docs/interfaces/WebSocketUserUpdate.html +6 -0
- package/docs/interfaces/WithdrawalClaim.html +14 -0
- package/docs/interfaces/WithdrawalParams.html +8 -0
- package/docs/modules.html +1 -77
- package/docs/types/BigIntValue.html +2 -2
- package/docs/types/WebSocketMessage.html +1 -0
- package/docs/variables/DEBUG_KEYS.html +1 -1
- package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +1 -1
- package/docs/variables/DEV_TOKEN_INFOS.html +1 -1
- package/docs/variables/DEV_URL.html +1 -1
- package/docs/variables/MAX_BUFFER_LEN.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/docs/variables/_private.html +2 -0
- package/eslint.config.mjs +66 -0
- package/package.json +20 -23
- 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 +4 -9
- package/src/gen/common.ts +27 -10
- package/src/gen/nord.ts +1045 -487
- package/src/idl/bridge.ts +702 -0
- package/src/index.ts +21 -2
- package/src/nord/{actions.ts → api/actions.ts} +12 -16
- 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 +1101 -0
- package/src/nord/index.ts +16 -2
- package/src/nord/models/Subscriber.ts +56 -0
- package/src/nord/utils/NordError.ts +72 -0
- package/src/types.ts +163 -92
- package/src/utils.ts +22 -1
- package/src/websocket/NordWebSocketClient.ts +432 -0
- package/src/websocket/events.ts +31 -0
- package/src/websocket/index.ts +2 -0
- package/tsconfig.eslint.json +12 -0
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -20
- package/dist/abis/ERC20_ABI.d.ts +0 -39
- package/dist/abis/ERC20_ABI.js +0 -313
- package/dist/abis/NORD_GETTERS_FACET_ABI.d.ts +0 -34
- package/dist/abis/NORD_GETTERS_FACET_ABI.js +0 -195
- package/dist/abis/NORD_RAMP_FACET_ABI.d.ts +0 -35
- package/dist/abis/NORD_RAMP_FACET_ABI.js +0 -144
- package/dist/abis/index.d.ts +0 -3
- package/dist/abis/index.js +0 -9
- package/dist/nord/Nord.d.ts +0 -76
- package/dist/nord/Nord.js +0 -376
- package/dist/nord/NordImpl.d.ts +0 -7
- package/dist/nord/NordImpl.js +0 -6
- package/dist/nord/NordUser.d.ts +0 -77
- package/dist/nord/NordUser.js +0 -249
- package/docs/functions/createWebSocketSubscription.html +0 -12
- package/docs/interfaces/ERC20TokenInfo.html +0 -5
- package/docs/interfaces/OrderbookOrder.html +0 -6
- package/docs/interfaces/TradeInfo.html +0 -20
- package/docs/interfaces/TradesQueryParams.html +0 -10
- package/docs/variables/DEV_CONTRACT_ADDRESS.html +0 -1
- package/docs/variables/ERC20_ABI.html +0 -1
- package/docs/variables/EVM_DEV_URL.html +0 -1
- package/docs/variables/FAUCET_PRIVATE_ADDRESS.html +0 -1
- package/docs/variables/NORD_GETTERS_FACET_ABI.html +0 -1
- package/docs/variables/NORD_RAMP_FACET_ABI.html +0 -1
- 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
|
|
@@ -890,10 +997,7 @@ export interface Action_CancelOrderById {
|
|
|
890
997
|
}
|
|
891
998
|
|
|
892
999
|
export interface Action_Deposit {
|
|
893
|
-
/**
|
|
894
|
-
* used for integration of rollup with nord app
|
|
895
|
-
* todo(n1): remove when integrated with gate
|
|
896
|
-
*/
|
|
1000
|
+
/** used for integration of rollup with nord app */
|
|
897
1001
|
actionNonce: bigint;
|
|
898
1002
|
tokenAddr: Uint8Array;
|
|
899
1003
|
/** Shifted by the token's decimals. */
|
|
@@ -935,6 +1039,12 @@ export interface Action_PythPriceFeedUpdate {
|
|
|
935
1039
|
rawPythnetData: Uint8Array;
|
|
936
1040
|
}
|
|
937
1041
|
|
|
1042
|
+
/**
|
|
1043
|
+
* Perform final account liquidation procedure.
|
|
1044
|
+
* Can be executed only accounts with AV < 0 (bankrupt).
|
|
1045
|
+
* After execution, `liquidatee_account_id` is removed from state.
|
|
1046
|
+
* See MARKETS.md `Bankruptcy` for details.
|
|
1047
|
+
*/
|
|
938
1048
|
export interface Action_Liquidate {
|
|
939
1049
|
liquidatorSessionId: bigint;
|
|
940
1050
|
liquidateeAccountId: number;
|
|
@@ -952,13 +1062,21 @@ export interface Action_Pause {
|
|
|
952
1062
|
export interface Action_Unpause {
|
|
953
1063
|
}
|
|
954
1064
|
|
|
1065
|
+
/** Transfers tokens to specified account. */
|
|
955
1066
|
export interface Action_Transfer {
|
|
956
1067
|
sessionId: bigint;
|
|
957
1068
|
fromAccountId: number;
|
|
958
1069
|
tokenId: number;
|
|
959
1070
|
amount: bigint;
|
|
960
|
-
/** If target account id isn't specified, new account is created */
|
|
961
|
-
toAccountId?:
|
|
1071
|
+
/** If target account id isn't specified, new account is created. */
|
|
1072
|
+
toAccountId?:
|
|
1073
|
+
| number
|
|
1074
|
+
| undefined;
|
|
1075
|
+
/**
|
|
1076
|
+
* If specified, than `to_account_id` must be none.
|
|
1077
|
+
* Transfer funds to accounts, for example to cover bankruptcies.
|
|
1078
|
+
*/
|
|
1079
|
+
specialAccount?: SpecialAccount | undefined;
|
|
962
1080
|
}
|
|
963
1081
|
|
|
964
1082
|
export interface Action_AddTrigger {
|
|
@@ -998,7 +1116,7 @@ export interface Receipt {
|
|
|
998
1116
|
| { $case: "oracleSymbolFeedResult"; value: Receipt_OracleSymbolFeedResult }
|
|
999
1117
|
| { $case: "oracleUpdateResult"; value: Receipt_OracleUpdateResult }
|
|
1000
1118
|
| { $case: "updateGuardianSetResult"; value: Receipt_UpdateGuardianSetResult }
|
|
1001
|
-
| { $case: "liquidated"; value:
|
|
1119
|
+
| { $case: "liquidated"; value: Receipt_AccountLiquidated }
|
|
1002
1120
|
| { $case: "sessionRevoked"; value: Receipt_SessionRevoked }
|
|
1003
1121
|
| { $case: "paused"; value: Receipt_Paused }
|
|
1004
1122
|
| { $case: "unpaused"; value: Receipt_Unpaused }
|
|
@@ -1015,7 +1133,6 @@ export interface Receipt_Posted {
|
|
|
1015
1133
|
size: bigint;
|
|
1016
1134
|
orderId: bigint;
|
|
1017
1135
|
accountId: number;
|
|
1018
|
-
clientOrderId?: bigint | undefined;
|
|
1019
1136
|
}
|
|
1020
1137
|
|
|
1021
1138
|
export interface Receipt_Trade {
|
|
@@ -1033,6 +1150,7 @@ export interface Receipt_CreateSessionResult {
|
|
|
1033
1150
|
export interface Receipt_PlaceOrderResult {
|
|
1034
1151
|
posted?: Receipt_Posted | undefined;
|
|
1035
1152
|
fills: Receipt_Trade[];
|
|
1153
|
+
clientOrderId?: bigint | undefined;
|
|
1036
1154
|
}
|
|
1037
1155
|
|
|
1038
1156
|
export interface Receipt_CancelOrderResult {
|
|
@@ -1082,7 +1200,18 @@ export interface Receipt_UpdateGuardianSetResult {
|
|
|
1082
1200
|
addresses: Uint8Array[];
|
|
1083
1201
|
}
|
|
1084
1202
|
|
|
1085
|
-
export interface
|
|
1203
|
+
export interface Receipt_PerpPosition {
|
|
1204
|
+
marketId: number;
|
|
1205
|
+
baseSize: bigint;
|
|
1206
|
+
price: bigint;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/** / Result of bankruptcy liquidation. */
|
|
1210
|
+
export interface Receipt_AccountLiquidated {
|
|
1211
|
+
liquidatorAccountId: number;
|
|
1212
|
+
liquidateeAccountId: number;
|
|
1213
|
+
cancelledOrders: bigint[];
|
|
1214
|
+
removedPerps: Receipt_PerpPosition[];
|
|
1086
1215
|
}
|
|
1087
1216
|
|
|
1088
1217
|
export interface Receipt_SessionRevoked {
|
|
@@ -1096,10 +1225,11 @@ export interface Receipt_Unpaused {
|
|
|
1096
1225
|
|
|
1097
1226
|
export interface Receipt_Transferred {
|
|
1098
1227
|
fromAccountId: number;
|
|
1099
|
-
|
|
1228
|
+
toUserAccount?: number | undefined;
|
|
1100
1229
|
tokenId: number;
|
|
1101
1230
|
amount: bigint;
|
|
1102
1231
|
accountCreated: boolean;
|
|
1232
|
+
toSpecialAccount?: SpecialAccount | undefined;
|
|
1103
1233
|
}
|
|
1104
1234
|
|
|
1105
1235
|
export interface Receipt_TriggerAdded {
|
|
@@ -1136,20 +1266,22 @@ export const U128: MessageFns<U128> = {
|
|
|
1136
1266
|
while (reader.pos < end) {
|
|
1137
1267
|
const tag = reader.uint32();
|
|
1138
1268
|
switch (tag >>> 3) {
|
|
1139
|
-
case 1:
|
|
1269
|
+
case 1: {
|
|
1140
1270
|
if (tag !== 8) {
|
|
1141
1271
|
break;
|
|
1142
1272
|
}
|
|
1143
1273
|
|
|
1144
1274
|
message.lo = reader.uint64() as bigint;
|
|
1145
1275
|
continue;
|
|
1146
|
-
|
|
1276
|
+
}
|
|
1277
|
+
case 2: {
|
|
1147
1278
|
if (tag !== 16) {
|
|
1148
1279
|
break;
|
|
1149
1280
|
}
|
|
1150
1281
|
|
|
1151
1282
|
message.hi = reader.uint64() as bigint;
|
|
1152
1283
|
continue;
|
|
1284
|
+
}
|
|
1153
1285
|
}
|
|
1154
1286
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1155
1287
|
break;
|
|
@@ -1238,69 +1370,78 @@ export const Market: MessageFns<Market> = {
|
|
|
1238
1370
|
while (reader.pos < end) {
|
|
1239
1371
|
const tag = reader.uint32();
|
|
1240
1372
|
switch (tag >>> 3) {
|
|
1241
|
-
case 1:
|
|
1373
|
+
case 1: {
|
|
1242
1374
|
if (tag !== 8) {
|
|
1243
1375
|
break;
|
|
1244
1376
|
}
|
|
1245
1377
|
|
|
1246
1378
|
message.marketId = reader.uint32();
|
|
1247
1379
|
continue;
|
|
1248
|
-
|
|
1380
|
+
}
|
|
1381
|
+
case 2: {
|
|
1249
1382
|
if (tag !== 16) {
|
|
1250
1383
|
break;
|
|
1251
1384
|
}
|
|
1252
1385
|
|
|
1253
1386
|
message.priceDecimals = reader.uint32();
|
|
1254
1387
|
continue;
|
|
1255
|
-
|
|
1388
|
+
}
|
|
1389
|
+
case 3: {
|
|
1256
1390
|
if (tag !== 24) {
|
|
1257
1391
|
break;
|
|
1258
1392
|
}
|
|
1259
1393
|
|
|
1260
1394
|
message.sizeDecimals = reader.uint32();
|
|
1261
1395
|
continue;
|
|
1262
|
-
|
|
1396
|
+
}
|
|
1397
|
+
case 4: {
|
|
1263
1398
|
if (tag !== 32) {
|
|
1264
1399
|
break;
|
|
1265
1400
|
}
|
|
1266
1401
|
|
|
1267
1402
|
message.baseTokenId = reader.uint32();
|
|
1268
1403
|
continue;
|
|
1269
|
-
|
|
1404
|
+
}
|
|
1405
|
+
case 5: {
|
|
1270
1406
|
if (tag !== 40) {
|
|
1271
1407
|
break;
|
|
1272
1408
|
}
|
|
1273
1409
|
|
|
1274
1410
|
message.marketType = reader.int32() as any;
|
|
1275
1411
|
continue;
|
|
1276
|
-
|
|
1412
|
+
}
|
|
1413
|
+
case 6: {
|
|
1277
1414
|
if (tag !== 48) {
|
|
1278
1415
|
break;
|
|
1279
1416
|
}
|
|
1280
1417
|
|
|
1281
1418
|
message.imfBps = reader.uint32();
|
|
1282
1419
|
continue;
|
|
1283
|
-
|
|
1420
|
+
}
|
|
1421
|
+
case 7: {
|
|
1284
1422
|
if (tag !== 56) {
|
|
1285
1423
|
break;
|
|
1286
1424
|
}
|
|
1287
1425
|
|
|
1288
1426
|
message.cmfBps = reader.uint32();
|
|
1289
1427
|
continue;
|
|
1290
|
-
|
|
1428
|
+
}
|
|
1429
|
+
case 8: {
|
|
1291
1430
|
if (tag !== 64) {
|
|
1292
1431
|
break;
|
|
1293
1432
|
}
|
|
1294
1433
|
|
|
1295
1434
|
message.mmfBps = reader.uint32();
|
|
1296
1435
|
continue;
|
|
1297
|
-
|
|
1436
|
+
}
|
|
1437
|
+
case 10: {
|
|
1298
1438
|
if (tag !== 82) {
|
|
1299
1439
|
break;
|
|
1300
1440
|
}
|
|
1301
1441
|
|
|
1302
1442
|
message.viewSymbol = reader.string();
|
|
1303
1443
|
continue;
|
|
1444
|
+
}
|
|
1304
1445
|
}
|
|
1305
1446
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1306
1447
|
break;
|
|
@@ -1402,34 +1543,38 @@ export const Token: MessageFns<Token> = {
|
|
|
1402
1543
|
while (reader.pos < end) {
|
|
1403
1544
|
const tag = reader.uint32();
|
|
1404
1545
|
switch (tag >>> 3) {
|
|
1405
|
-
case 1:
|
|
1546
|
+
case 1: {
|
|
1406
1547
|
if (tag !== 8) {
|
|
1407
1548
|
break;
|
|
1408
1549
|
}
|
|
1409
1550
|
|
|
1410
1551
|
message.tokenId = reader.uint32();
|
|
1411
1552
|
continue;
|
|
1412
|
-
|
|
1553
|
+
}
|
|
1554
|
+
case 2: {
|
|
1413
1555
|
if (tag !== 16) {
|
|
1414
1556
|
break;
|
|
1415
1557
|
}
|
|
1416
1558
|
|
|
1417
1559
|
message.tokenDecimals = reader.uint32();
|
|
1418
1560
|
continue;
|
|
1419
|
-
|
|
1561
|
+
}
|
|
1562
|
+
case 4: {
|
|
1420
1563
|
if (tag !== 32) {
|
|
1421
1564
|
break;
|
|
1422
1565
|
}
|
|
1423
1566
|
|
|
1424
1567
|
message.weightBps = reader.uint32();
|
|
1425
1568
|
continue;
|
|
1426
|
-
|
|
1569
|
+
}
|
|
1570
|
+
case 5: {
|
|
1427
1571
|
if (tag !== 42) {
|
|
1428
1572
|
break;
|
|
1429
1573
|
}
|
|
1430
1574
|
|
|
1431
1575
|
message.viewSymbol = reader.string();
|
|
1432
1576
|
continue;
|
|
1577
|
+
}
|
|
1433
1578
|
}
|
|
1434
1579
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1435
1580
|
break;
|
|
@@ -1559,70 +1704,79 @@ export const Action: MessageFns<Action> = {
|
|
|
1559
1704
|
while (reader.pos < end) {
|
|
1560
1705
|
const tag = reader.uint32();
|
|
1561
1706
|
switch (tag >>> 3) {
|
|
1562
|
-
case 1:
|
|
1707
|
+
case 1: {
|
|
1563
1708
|
if (tag !== 8) {
|
|
1564
1709
|
break;
|
|
1565
1710
|
}
|
|
1566
1711
|
|
|
1567
1712
|
message.currentTimestamp = reader.int64() as bigint;
|
|
1568
1713
|
continue;
|
|
1569
|
-
|
|
1714
|
+
}
|
|
1715
|
+
case 2: {
|
|
1570
1716
|
if (tag !== 16) {
|
|
1571
1717
|
break;
|
|
1572
1718
|
}
|
|
1573
1719
|
|
|
1574
1720
|
message.nonce = reader.uint32();
|
|
1575
1721
|
continue;
|
|
1576
|
-
|
|
1722
|
+
}
|
|
1723
|
+
case 4: {
|
|
1577
1724
|
if (tag !== 34) {
|
|
1578
1725
|
break;
|
|
1579
1726
|
}
|
|
1580
1727
|
|
|
1581
1728
|
message.kind = { $case: "createSession", value: Action_CreateSession.decode(reader, reader.uint32()) };
|
|
1582
1729
|
continue;
|
|
1583
|
-
|
|
1730
|
+
}
|
|
1731
|
+
case 5: {
|
|
1584
1732
|
if (tag !== 42) {
|
|
1585
1733
|
break;
|
|
1586
1734
|
}
|
|
1587
1735
|
|
|
1588
1736
|
message.kind = { $case: "createToken", value: Action_CreateToken.decode(reader, reader.uint32()) };
|
|
1589
1737
|
continue;
|
|
1590
|
-
|
|
1738
|
+
}
|
|
1739
|
+
case 6: {
|
|
1591
1740
|
if (tag !== 50) {
|
|
1592
1741
|
break;
|
|
1593
1742
|
}
|
|
1594
1743
|
|
|
1595
1744
|
message.kind = { $case: "createMarket", value: Action_CreateMarket.decode(reader, reader.uint32()) };
|
|
1596
1745
|
continue;
|
|
1597
|
-
|
|
1746
|
+
}
|
|
1747
|
+
case 7: {
|
|
1598
1748
|
if (tag !== 58) {
|
|
1599
1749
|
break;
|
|
1600
1750
|
}
|
|
1601
1751
|
|
|
1602
1752
|
message.kind = { $case: "placeOrder", value: Action_PlaceOrder.decode(reader, reader.uint32()) };
|
|
1603
1753
|
continue;
|
|
1604
|
-
|
|
1754
|
+
}
|
|
1755
|
+
case 8: {
|
|
1605
1756
|
if (tag !== 66) {
|
|
1606
1757
|
break;
|
|
1607
1758
|
}
|
|
1608
1759
|
|
|
1609
1760
|
message.kind = { $case: "cancelOrderById", value: Action_CancelOrderById.decode(reader, reader.uint32()) };
|
|
1610
1761
|
continue;
|
|
1611
|
-
|
|
1762
|
+
}
|
|
1763
|
+
case 9: {
|
|
1612
1764
|
if (tag !== 74) {
|
|
1613
1765
|
break;
|
|
1614
1766
|
}
|
|
1615
1767
|
|
|
1616
1768
|
message.kind = { $case: "deposit", value: Action_Deposit.decode(reader, reader.uint32()) };
|
|
1617
1769
|
continue;
|
|
1618
|
-
|
|
1770
|
+
}
|
|
1771
|
+
case 10: {
|
|
1619
1772
|
if (tag !== 82) {
|
|
1620
1773
|
break;
|
|
1621
1774
|
}
|
|
1622
1775
|
|
|
1623
1776
|
message.kind = { $case: "withdraw", value: Action_Withdraw.decode(reader, reader.uint32()) };
|
|
1624
1777
|
continue;
|
|
1625
|
-
|
|
1778
|
+
}
|
|
1779
|
+
case 11: {
|
|
1626
1780
|
if (tag !== 90) {
|
|
1627
1781
|
break;
|
|
1628
1782
|
}
|
|
@@ -1632,7 +1786,8 @@ export const Action: MessageFns<Action> = {
|
|
|
1632
1786
|
value: Action_PythSetWormholeGuardians.decode(reader, reader.uint32()),
|
|
1633
1787
|
};
|
|
1634
1788
|
continue;
|
|
1635
|
-
|
|
1789
|
+
}
|
|
1790
|
+
case 12: {
|
|
1636
1791
|
if (tag !== 98) {
|
|
1637
1792
|
break;
|
|
1638
1793
|
}
|
|
@@ -1642,7 +1797,8 @@ export const Action: MessageFns<Action> = {
|
|
|
1642
1797
|
value: Action_PythSetSymbolFeed.decode(reader, reader.uint32()),
|
|
1643
1798
|
};
|
|
1644
1799
|
continue;
|
|
1645
|
-
|
|
1800
|
+
}
|
|
1801
|
+
case 13: {
|
|
1646
1802
|
if (tag !== 106) {
|
|
1647
1803
|
break;
|
|
1648
1804
|
}
|
|
@@ -1652,62 +1808,71 @@ export const Action: MessageFns<Action> = {
|
|
|
1652
1808
|
value: Action_PythPriceFeedUpdate.decode(reader, reader.uint32()),
|
|
1653
1809
|
};
|
|
1654
1810
|
continue;
|
|
1655
|
-
|
|
1811
|
+
}
|
|
1812
|
+
case 14: {
|
|
1656
1813
|
if (tag !== 114) {
|
|
1657
1814
|
break;
|
|
1658
1815
|
}
|
|
1659
1816
|
|
|
1660
1817
|
message.kind = { $case: "liquidate", value: Action_Liquidate.decode(reader, reader.uint32()) };
|
|
1661
1818
|
continue;
|
|
1662
|
-
|
|
1819
|
+
}
|
|
1820
|
+
case 15: {
|
|
1663
1821
|
if (tag !== 122) {
|
|
1664
1822
|
break;
|
|
1665
1823
|
}
|
|
1666
1824
|
|
|
1667
1825
|
message.kind = { $case: "revokeSession", value: Action_RevokeSession.decode(reader, reader.uint32()) };
|
|
1668
1826
|
continue;
|
|
1669
|
-
|
|
1827
|
+
}
|
|
1828
|
+
case 16: {
|
|
1670
1829
|
if (tag !== 130) {
|
|
1671
1830
|
break;
|
|
1672
1831
|
}
|
|
1673
1832
|
|
|
1674
1833
|
message.kind = { $case: "pause", value: Action_Pause.decode(reader, reader.uint32()) };
|
|
1675
1834
|
continue;
|
|
1676
|
-
|
|
1835
|
+
}
|
|
1836
|
+
case 17: {
|
|
1677
1837
|
if (tag !== 138) {
|
|
1678
1838
|
break;
|
|
1679
1839
|
}
|
|
1680
1840
|
|
|
1681
1841
|
message.kind = { $case: "unpause", value: Action_Unpause.decode(reader, reader.uint32()) };
|
|
1682
1842
|
continue;
|
|
1683
|
-
|
|
1843
|
+
}
|
|
1844
|
+
case 18: {
|
|
1684
1845
|
if (tag !== 146) {
|
|
1685
1846
|
break;
|
|
1686
1847
|
}
|
|
1687
1848
|
|
|
1688
1849
|
message.kind = { $case: "transfer", value: Action_Transfer.decode(reader, reader.uint32()) };
|
|
1689
1850
|
continue;
|
|
1690
|
-
|
|
1851
|
+
}
|
|
1852
|
+
case 19: {
|
|
1691
1853
|
if (tag !== 154) {
|
|
1692
1854
|
break;
|
|
1693
1855
|
}
|
|
1694
1856
|
|
|
1695
1857
|
message.kind = { $case: "message", value: Message.decode(reader, reader.uint32()) };
|
|
1696
1858
|
continue;
|
|
1697
|
-
|
|
1859
|
+
}
|
|
1860
|
+
case 32: {
|
|
1698
1861
|
if (tag !== 258) {
|
|
1699
1862
|
break;
|
|
1700
1863
|
}
|
|
1701
1864
|
|
|
1702
1865
|
message.kind = { $case: "addTrigger", value: Action_AddTrigger.decode(reader, reader.uint32()) };
|
|
1703
1866
|
continue;
|
|
1704
|
-
|
|
1867
|
+
}
|
|
1868
|
+
case 33: {
|
|
1705
1869
|
if (tag !== 266) {
|
|
1706
1870
|
break;
|
|
1707
1871
|
}
|
|
1708
1872
|
|
|
1709
1873
|
message.kind = { $case: "removeTrigger", value: Action_RemoveTrigger.decode(reader, reader.uint32()) };
|
|
1710
1874
|
continue;
|
|
1875
|
+
}
|
|
1711
1876
|
}
|
|
1712
1877
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1713
1878
|
break;
|
|
@@ -1774,56 +1939,39 @@ export const Action: MessageFns<Action> = {
|
|
|
1774
1939
|
}
|
|
1775
1940
|
if (message.kind?.$case === "createSession") {
|
|
1776
1941
|
obj.createSession = Action_CreateSession.toJSON(message.kind.value);
|
|
1777
|
-
}
|
|
1778
|
-
if (message.kind?.$case === "createToken") {
|
|
1942
|
+
} else if (message.kind?.$case === "createToken") {
|
|
1779
1943
|
obj.createToken = Action_CreateToken.toJSON(message.kind.value);
|
|
1780
|
-
}
|
|
1781
|
-
if (message.kind?.$case === "createMarket") {
|
|
1944
|
+
} else if (message.kind?.$case === "createMarket") {
|
|
1782
1945
|
obj.createMarket = Action_CreateMarket.toJSON(message.kind.value);
|
|
1783
|
-
}
|
|
1784
|
-
if (message.kind?.$case === "placeOrder") {
|
|
1946
|
+
} else if (message.kind?.$case === "placeOrder") {
|
|
1785
1947
|
obj.placeOrder = Action_PlaceOrder.toJSON(message.kind.value);
|
|
1786
|
-
}
|
|
1787
|
-
if (message.kind?.$case === "cancelOrderById") {
|
|
1948
|
+
} else if (message.kind?.$case === "cancelOrderById") {
|
|
1788
1949
|
obj.cancelOrderById = Action_CancelOrderById.toJSON(message.kind.value);
|
|
1789
|
-
}
|
|
1790
|
-
if (message.kind?.$case === "deposit") {
|
|
1950
|
+
} else if (message.kind?.$case === "deposit") {
|
|
1791
1951
|
obj.deposit = Action_Deposit.toJSON(message.kind.value);
|
|
1792
|
-
}
|
|
1793
|
-
if (message.kind?.$case === "withdraw") {
|
|
1952
|
+
} else if (message.kind?.$case === "withdraw") {
|
|
1794
1953
|
obj.withdraw = Action_Withdraw.toJSON(message.kind.value);
|
|
1795
|
-
}
|
|
1796
|
-
if (message.kind?.$case === "pythSetWormholeGuardians") {
|
|
1954
|
+
} else if (message.kind?.$case === "pythSetWormholeGuardians") {
|
|
1797
1955
|
obj.pythSetWormholeGuardians = Action_PythSetWormholeGuardians.toJSON(message.kind.value);
|
|
1798
|
-
}
|
|
1799
|
-
if (message.kind?.$case === "pythSetSymbolFeed") {
|
|
1956
|
+
} else if (message.kind?.$case === "pythSetSymbolFeed") {
|
|
1800
1957
|
obj.pythSetSymbolFeed = Action_PythSetSymbolFeed.toJSON(message.kind.value);
|
|
1801
|
-
}
|
|
1802
|
-
if (message.kind?.$case === "pythPriceFeedUpdate") {
|
|
1958
|
+
} else if (message.kind?.$case === "pythPriceFeedUpdate") {
|
|
1803
1959
|
obj.pythPriceFeedUpdate = Action_PythPriceFeedUpdate.toJSON(message.kind.value);
|
|
1804
|
-
}
|
|
1805
|
-
if (message.kind?.$case === "liquidate") {
|
|
1960
|
+
} else if (message.kind?.$case === "liquidate") {
|
|
1806
1961
|
obj.liquidate = Action_Liquidate.toJSON(message.kind.value);
|
|
1807
|
-
}
|
|
1808
|
-
if (message.kind?.$case === "revokeSession") {
|
|
1962
|
+
} else if (message.kind?.$case === "revokeSession") {
|
|
1809
1963
|
obj.revokeSession = Action_RevokeSession.toJSON(message.kind.value);
|
|
1810
|
-
}
|
|
1811
|
-
if (message.kind?.$case === "pause") {
|
|
1964
|
+
} else if (message.kind?.$case === "pause") {
|
|
1812
1965
|
obj.pause = Action_Pause.toJSON(message.kind.value);
|
|
1813
|
-
}
|
|
1814
|
-
if (message.kind?.$case === "unpause") {
|
|
1966
|
+
} else if (message.kind?.$case === "unpause") {
|
|
1815
1967
|
obj.unpause = Action_Unpause.toJSON(message.kind.value);
|
|
1816
|
-
}
|
|
1817
|
-
if (message.kind?.$case === "transfer") {
|
|
1968
|
+
} else if (message.kind?.$case === "transfer") {
|
|
1818
1969
|
obj.transfer = Action_Transfer.toJSON(message.kind.value);
|
|
1819
|
-
}
|
|
1820
|
-
if (message.kind?.$case === "message") {
|
|
1970
|
+
} else if (message.kind?.$case === "message") {
|
|
1821
1971
|
obj.message = Message.toJSON(message.kind.value);
|
|
1822
|
-
}
|
|
1823
|
-
if (message.kind?.$case === "addTrigger") {
|
|
1972
|
+
} else if (message.kind?.$case === "addTrigger") {
|
|
1824
1973
|
obj.addTrigger = Action_AddTrigger.toJSON(message.kind.value);
|
|
1825
|
-
}
|
|
1826
|
-
if (message.kind?.$case === "removeTrigger") {
|
|
1974
|
+
} else if (message.kind?.$case === "removeTrigger") {
|
|
1827
1975
|
obj.removeTrigger = Action_RemoveTrigger.toJSON(message.kind.value);
|
|
1828
1976
|
}
|
|
1829
1977
|
return obj;
|
|
@@ -1836,68 +1984,121 @@ export const Action: MessageFns<Action> = {
|
|
|
1836
1984
|
const message = createBaseAction();
|
|
1837
1985
|
message.currentTimestamp = object.currentTimestamp ?? 0n;
|
|
1838
1986
|
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
|
-
|
|
1987
|
+
switch (object.kind?.$case) {
|
|
1988
|
+
case "createSession": {
|
|
1989
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
1990
|
+
message.kind = { $case: "createSession", value: Action_CreateSession.fromPartial(object.kind.value) };
|
|
1991
|
+
}
|
|
1992
|
+
break;
|
|
1993
|
+
}
|
|
1994
|
+
case "createToken": {
|
|
1995
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
1996
|
+
message.kind = { $case: "createToken", value: Action_CreateToken.fromPartial(object.kind.value) };
|
|
1997
|
+
}
|
|
1998
|
+
break;
|
|
1999
|
+
}
|
|
2000
|
+
case "createMarket": {
|
|
2001
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2002
|
+
message.kind = { $case: "createMarket", value: Action_CreateMarket.fromPartial(object.kind.value) };
|
|
2003
|
+
}
|
|
2004
|
+
break;
|
|
2005
|
+
}
|
|
2006
|
+
case "placeOrder": {
|
|
2007
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2008
|
+
message.kind = { $case: "placeOrder", value: Action_PlaceOrder.fromPartial(object.kind.value) };
|
|
2009
|
+
}
|
|
2010
|
+
break;
|
|
2011
|
+
}
|
|
2012
|
+
case "cancelOrderById": {
|
|
2013
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2014
|
+
message.kind = { $case: "cancelOrderById", value: Action_CancelOrderById.fromPartial(object.kind.value) };
|
|
2015
|
+
}
|
|
2016
|
+
break;
|
|
2017
|
+
}
|
|
2018
|
+
case "deposit": {
|
|
2019
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2020
|
+
message.kind = { $case: "deposit", value: Action_Deposit.fromPartial(object.kind.value) };
|
|
2021
|
+
}
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
case "withdraw": {
|
|
2025
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2026
|
+
message.kind = { $case: "withdraw", value: Action_Withdraw.fromPartial(object.kind.value) };
|
|
2027
|
+
}
|
|
2028
|
+
break;
|
|
2029
|
+
}
|
|
2030
|
+
case "pythSetWormholeGuardians": {
|
|
2031
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2032
|
+
message.kind = {
|
|
2033
|
+
$case: "pythSetWormholeGuardians",
|
|
2034
|
+
value: Action_PythSetWormholeGuardians.fromPartial(object.kind.value),
|
|
2035
|
+
};
|
|
2036
|
+
}
|
|
2037
|
+
break;
|
|
2038
|
+
}
|
|
2039
|
+
case "pythSetSymbolFeed": {
|
|
2040
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2041
|
+
message.kind = { $case: "pythSetSymbolFeed", value: Action_PythSetSymbolFeed.fromPartial(object.kind.value) };
|
|
2042
|
+
}
|
|
2043
|
+
break;
|
|
2044
|
+
}
|
|
2045
|
+
case "pythPriceFeedUpdate": {
|
|
2046
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2047
|
+
message.kind = {
|
|
2048
|
+
$case: "pythPriceFeedUpdate",
|
|
2049
|
+
value: Action_PythPriceFeedUpdate.fromPartial(object.kind.value),
|
|
2050
|
+
};
|
|
2051
|
+
}
|
|
2052
|
+
break;
|
|
2053
|
+
}
|
|
2054
|
+
case "liquidate": {
|
|
2055
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2056
|
+
message.kind = { $case: "liquidate", value: Action_Liquidate.fromPartial(object.kind.value) };
|
|
2057
|
+
}
|
|
2058
|
+
break;
|
|
2059
|
+
}
|
|
2060
|
+
case "revokeSession": {
|
|
2061
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2062
|
+
message.kind = { $case: "revokeSession", value: Action_RevokeSession.fromPartial(object.kind.value) };
|
|
2063
|
+
}
|
|
2064
|
+
break;
|
|
2065
|
+
}
|
|
2066
|
+
case "pause": {
|
|
2067
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2068
|
+
message.kind = { $case: "pause", value: Action_Pause.fromPartial(object.kind.value) };
|
|
2069
|
+
}
|
|
2070
|
+
break;
|
|
2071
|
+
}
|
|
2072
|
+
case "unpause": {
|
|
2073
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2074
|
+
message.kind = { $case: "unpause", value: Action_Unpause.fromPartial(object.kind.value) };
|
|
2075
|
+
}
|
|
2076
|
+
break;
|
|
2077
|
+
}
|
|
2078
|
+
case "transfer": {
|
|
2079
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2080
|
+
message.kind = { $case: "transfer", value: Action_Transfer.fromPartial(object.kind.value) };
|
|
2081
|
+
}
|
|
2082
|
+
break;
|
|
2083
|
+
}
|
|
2084
|
+
case "message": {
|
|
2085
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2086
|
+
message.kind = { $case: "message", value: Message.fromPartial(object.kind.value) };
|
|
2087
|
+
}
|
|
2088
|
+
break;
|
|
2089
|
+
}
|
|
2090
|
+
case "addTrigger": {
|
|
2091
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2092
|
+
message.kind = { $case: "addTrigger", value: Action_AddTrigger.fromPartial(object.kind.value) };
|
|
2093
|
+
}
|
|
2094
|
+
break;
|
|
2095
|
+
}
|
|
2096
|
+
case "removeTrigger": {
|
|
2097
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
2098
|
+
message.kind = { $case: "removeTrigger", value: Action_RemoveTrigger.fromPartial(object.kind.value) };
|
|
2099
|
+
}
|
|
2100
|
+
break;
|
|
2101
|
+
}
|
|
1901
2102
|
}
|
|
1902
2103
|
return message;
|
|
1903
2104
|
},
|
|
@@ -1931,27 +2132,30 @@ export const Action_CreateSession: MessageFns<Action_CreateSession> = {
|
|
|
1931
2132
|
while (reader.pos < end) {
|
|
1932
2133
|
const tag = reader.uint32();
|
|
1933
2134
|
switch (tag >>> 3) {
|
|
1934
|
-
case 1:
|
|
2135
|
+
case 1: {
|
|
1935
2136
|
if (tag !== 10) {
|
|
1936
2137
|
break;
|
|
1937
2138
|
}
|
|
1938
2139
|
|
|
1939
2140
|
message.userPubkey = reader.bytes();
|
|
1940
2141
|
continue;
|
|
1941
|
-
|
|
2142
|
+
}
|
|
2143
|
+
case 2: {
|
|
1942
2144
|
if (tag !== 18) {
|
|
1943
2145
|
break;
|
|
1944
2146
|
}
|
|
1945
2147
|
|
|
1946
2148
|
message.blstPubkey = reader.bytes();
|
|
1947
2149
|
continue;
|
|
1948
|
-
|
|
2150
|
+
}
|
|
2151
|
+
case 3: {
|
|
1949
2152
|
if (tag !== 24) {
|
|
1950
2153
|
break;
|
|
1951
2154
|
}
|
|
1952
2155
|
|
|
1953
2156
|
message.expiryTimestamp = reader.int64() as bigint;
|
|
1954
2157
|
continue;
|
|
2158
|
+
}
|
|
1955
2159
|
}
|
|
1956
2160
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1957
2161
|
break;
|
|
@@ -1996,14 +2200,7 @@ export const Action_CreateSession: MessageFns<Action_CreateSession> = {
|
|
|
1996
2200
|
};
|
|
1997
2201
|
|
|
1998
2202
|
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
|
-
};
|
|
2203
|
+
return { tokenDecimals: 0, weightBps: 0, viewSymbol: "", oracleSymbol: "", solAddr: new Uint8Array(0) };
|
|
2007
2204
|
}
|
|
2008
2205
|
|
|
2009
2206
|
export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
@@ -2020,14 +2217,8 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2020
2217
|
if (message.oracleSymbol !== "") {
|
|
2021
2218
|
writer.uint32(42).string(message.oracleSymbol);
|
|
2022
2219
|
}
|
|
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);
|
|
2220
|
+
if (message.solAddr.length !== 0) {
|
|
2221
|
+
writer.uint32(50).bytes(message.solAddr);
|
|
2031
2222
|
}
|
|
2032
2223
|
return writer;
|
|
2033
2224
|
},
|
|
@@ -2039,48 +2230,46 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2039
2230
|
while (reader.pos < end) {
|
|
2040
2231
|
const tag = reader.uint32();
|
|
2041
2232
|
switch (tag >>> 3) {
|
|
2042
|
-
case 1:
|
|
2233
|
+
case 1: {
|
|
2043
2234
|
if (tag !== 8) {
|
|
2044
2235
|
break;
|
|
2045
2236
|
}
|
|
2046
2237
|
|
|
2047
2238
|
message.tokenDecimals = reader.uint32();
|
|
2048
2239
|
continue;
|
|
2049
|
-
|
|
2240
|
+
}
|
|
2241
|
+
case 3: {
|
|
2050
2242
|
if (tag !== 24) {
|
|
2051
2243
|
break;
|
|
2052
2244
|
}
|
|
2053
2245
|
|
|
2054
2246
|
message.weightBps = reader.uint32();
|
|
2055
2247
|
continue;
|
|
2056
|
-
|
|
2248
|
+
}
|
|
2249
|
+
case 4: {
|
|
2057
2250
|
if (tag !== 34) {
|
|
2058
2251
|
break;
|
|
2059
2252
|
}
|
|
2060
2253
|
|
|
2061
2254
|
message.viewSymbol = reader.string();
|
|
2062
2255
|
continue;
|
|
2063
|
-
|
|
2256
|
+
}
|
|
2257
|
+
case 5: {
|
|
2064
2258
|
if (tag !== 42) {
|
|
2065
2259
|
break;
|
|
2066
2260
|
}
|
|
2067
2261
|
|
|
2068
2262
|
message.oracleSymbol = reader.string();
|
|
2069
2263
|
continue;
|
|
2070
|
-
|
|
2264
|
+
}
|
|
2265
|
+
case 6: {
|
|
2071
2266
|
if (tag !== 50) {
|
|
2072
2267
|
break;
|
|
2073
2268
|
}
|
|
2074
2269
|
|
|
2075
|
-
message.
|
|
2076
|
-
continue;
|
|
2077
|
-
case 7:
|
|
2078
|
-
if (tag !== 56) {
|
|
2079
|
-
break;
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
message.minWithdrawAmount = reader.uint64() as bigint;
|
|
2270
|
+
message.solAddr = reader.bytes();
|
|
2083
2271
|
continue;
|
|
2272
|
+
}
|
|
2084
2273
|
}
|
|
2085
2274
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2086
2275
|
break;
|
|
@@ -2096,8 +2285,7 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2096
2285
|
weightBps: isSet(object.weightBps) ? globalThis.Number(object.weightBps) : 0,
|
|
2097
2286
|
viewSymbol: isSet(object.viewSymbol) ? globalThis.String(object.viewSymbol) : "",
|
|
2098
2287
|
oracleSymbol: isSet(object.oracleSymbol) ? globalThis.String(object.oracleSymbol) : "",
|
|
2099
|
-
|
|
2100
|
-
minWithdrawAmount: isSet(object.minWithdrawAmount) ? BigInt(object.minWithdrawAmount) : 0n,
|
|
2288
|
+
solAddr: isSet(object.solAddr) ? bytesFromBase64(object.solAddr) : new Uint8Array(0),
|
|
2101
2289
|
};
|
|
2102
2290
|
},
|
|
2103
2291
|
|
|
@@ -2115,11 +2303,8 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2115
2303
|
if (message.oracleSymbol !== "") {
|
|
2116
2304
|
obj.oracleSymbol = message.oracleSymbol;
|
|
2117
2305
|
}
|
|
2118
|
-
if (message.
|
|
2119
|
-
obj.
|
|
2120
|
-
}
|
|
2121
|
-
if (message.minWithdrawAmount !== 0n) {
|
|
2122
|
-
obj.minWithdrawAmount = message.minWithdrawAmount.toString();
|
|
2306
|
+
if (message.solAddr.length !== 0) {
|
|
2307
|
+
obj.solAddr = base64FromBytes(message.solAddr);
|
|
2123
2308
|
}
|
|
2124
2309
|
return obj;
|
|
2125
2310
|
},
|
|
@@ -2133,8 +2318,7 @@ export const Action_CreateToken: MessageFns<Action_CreateToken> = {
|
|
|
2133
2318
|
message.weightBps = object.weightBps ?? 0;
|
|
2134
2319
|
message.viewSymbol = object.viewSymbol ?? "";
|
|
2135
2320
|
message.oracleSymbol = object.oracleSymbol ?? "";
|
|
2136
|
-
message.
|
|
2137
|
-
message.minWithdrawAmount = object.minWithdrawAmount ?? 0n;
|
|
2321
|
+
message.solAddr = object.solAddr ?? new Uint8Array(0);
|
|
2138
2322
|
return message;
|
|
2139
2323
|
},
|
|
2140
2324
|
};
|
|
@@ -2192,69 +2376,78 @@ export const Action_CreateMarket: MessageFns<Action_CreateMarket> = {
|
|
|
2192
2376
|
while (reader.pos < end) {
|
|
2193
2377
|
const tag = reader.uint32();
|
|
2194
2378
|
switch (tag >>> 3) {
|
|
2195
|
-
case 1:
|
|
2379
|
+
case 1: {
|
|
2196
2380
|
if (tag !== 8) {
|
|
2197
2381
|
break;
|
|
2198
2382
|
}
|
|
2199
2383
|
|
|
2200
2384
|
message.sizeDecimals = reader.uint32();
|
|
2201
2385
|
continue;
|
|
2202
|
-
|
|
2386
|
+
}
|
|
2387
|
+
case 2: {
|
|
2203
2388
|
if (tag !== 16) {
|
|
2204
2389
|
break;
|
|
2205
2390
|
}
|
|
2206
2391
|
|
|
2207
2392
|
message.priceDecimals = reader.uint32();
|
|
2208
2393
|
continue;
|
|
2209
|
-
|
|
2394
|
+
}
|
|
2395
|
+
case 3: {
|
|
2210
2396
|
if (tag !== 24) {
|
|
2211
2397
|
break;
|
|
2212
2398
|
}
|
|
2213
2399
|
|
|
2214
2400
|
message.imfBps = reader.uint32();
|
|
2215
2401
|
continue;
|
|
2216
|
-
|
|
2402
|
+
}
|
|
2403
|
+
case 4: {
|
|
2217
2404
|
if (tag !== 32) {
|
|
2218
2405
|
break;
|
|
2219
2406
|
}
|
|
2220
2407
|
|
|
2221
2408
|
message.cmfBps = reader.uint32();
|
|
2222
2409
|
continue;
|
|
2223
|
-
|
|
2410
|
+
}
|
|
2411
|
+
case 5: {
|
|
2224
2412
|
if (tag !== 40) {
|
|
2225
2413
|
break;
|
|
2226
2414
|
}
|
|
2227
2415
|
|
|
2228
2416
|
message.mmfBps = reader.uint32();
|
|
2229
2417
|
continue;
|
|
2230
|
-
|
|
2418
|
+
}
|
|
2419
|
+
case 6: {
|
|
2231
2420
|
if (tag !== 48) {
|
|
2232
2421
|
break;
|
|
2233
2422
|
}
|
|
2234
2423
|
|
|
2235
2424
|
message.marketType = reader.int32() as any;
|
|
2236
2425
|
continue;
|
|
2237
|
-
|
|
2426
|
+
}
|
|
2427
|
+
case 7: {
|
|
2238
2428
|
if (tag !== 58) {
|
|
2239
2429
|
break;
|
|
2240
2430
|
}
|
|
2241
2431
|
|
|
2242
2432
|
message.viewSymbol = reader.string();
|
|
2243
2433
|
continue;
|
|
2244
|
-
|
|
2434
|
+
}
|
|
2435
|
+
case 8: {
|
|
2245
2436
|
if (tag !== 66) {
|
|
2246
2437
|
break;
|
|
2247
2438
|
}
|
|
2248
2439
|
|
|
2249
2440
|
message.oracleSymbol = reader.string();
|
|
2250
2441
|
continue;
|
|
2251
|
-
|
|
2442
|
+
}
|
|
2443
|
+
case 9: {
|
|
2252
2444
|
if (tag !== 72) {
|
|
2253
2445
|
break;
|
|
2254
2446
|
}
|
|
2255
2447
|
|
|
2256
2448
|
message.baseTokenId = reader.uint32();
|
|
2257
2449
|
continue;
|
|
2450
|
+
}
|
|
2258
2451
|
}
|
|
2259
2452
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2260
2453
|
break;
|
|
@@ -2401,83 +2594,94 @@ export const Action_PlaceOrder: MessageFns<Action_PlaceOrder> = {
|
|
|
2401
2594
|
while (reader.pos < end) {
|
|
2402
2595
|
const tag = reader.uint32();
|
|
2403
2596
|
switch (tag >>> 3) {
|
|
2404
|
-
case 1:
|
|
2597
|
+
case 1: {
|
|
2405
2598
|
if (tag !== 8) {
|
|
2406
2599
|
break;
|
|
2407
2600
|
}
|
|
2408
2601
|
|
|
2409
2602
|
message.sessionId = reader.uint64() as bigint;
|
|
2410
2603
|
continue;
|
|
2411
|
-
|
|
2604
|
+
}
|
|
2605
|
+
case 2: {
|
|
2412
2606
|
if (tag !== 16) {
|
|
2413
2607
|
break;
|
|
2414
2608
|
}
|
|
2415
2609
|
|
|
2416
2610
|
message.marketId = reader.uint32();
|
|
2417
2611
|
continue;
|
|
2418
|
-
|
|
2612
|
+
}
|
|
2613
|
+
case 3: {
|
|
2419
2614
|
if (tag !== 24) {
|
|
2420
2615
|
break;
|
|
2421
2616
|
}
|
|
2422
2617
|
|
|
2423
2618
|
message.side = reader.int32() as any;
|
|
2424
2619
|
continue;
|
|
2425
|
-
|
|
2620
|
+
}
|
|
2621
|
+
case 4: {
|
|
2426
2622
|
if (tag !== 32) {
|
|
2427
2623
|
break;
|
|
2428
2624
|
}
|
|
2429
2625
|
|
|
2430
2626
|
message.fillMode = reader.int32() as any;
|
|
2431
2627
|
continue;
|
|
2432
|
-
|
|
2628
|
+
}
|
|
2629
|
+
case 5: {
|
|
2433
2630
|
if (tag !== 40) {
|
|
2434
2631
|
break;
|
|
2435
2632
|
}
|
|
2436
2633
|
|
|
2437
2634
|
message.isReduceOnly = reader.bool();
|
|
2438
2635
|
continue;
|
|
2439
|
-
|
|
2636
|
+
}
|
|
2637
|
+
case 6: {
|
|
2440
2638
|
if (tag !== 48) {
|
|
2441
2639
|
break;
|
|
2442
2640
|
}
|
|
2443
2641
|
|
|
2444
2642
|
message.price = reader.uint64() as bigint;
|
|
2445
2643
|
continue;
|
|
2446
|
-
|
|
2644
|
+
}
|
|
2645
|
+
case 7: {
|
|
2447
2646
|
if (tag !== 56) {
|
|
2448
2647
|
break;
|
|
2449
2648
|
}
|
|
2450
2649
|
|
|
2451
2650
|
message.size = reader.uint64() as bigint;
|
|
2452
2651
|
continue;
|
|
2453
|
-
|
|
2652
|
+
}
|
|
2653
|
+
case 8: {
|
|
2454
2654
|
if (tag !== 66) {
|
|
2455
2655
|
break;
|
|
2456
2656
|
}
|
|
2457
2657
|
|
|
2458
2658
|
message.quoteSize = U128.decode(reader, reader.uint32());
|
|
2459
2659
|
continue;
|
|
2460
|
-
|
|
2660
|
+
}
|
|
2661
|
+
case 32: {
|
|
2461
2662
|
if (tag !== 256) {
|
|
2462
2663
|
break;
|
|
2463
2664
|
}
|
|
2464
2665
|
|
|
2465
2666
|
message.delegatorAccountId = reader.uint32();
|
|
2466
2667
|
continue;
|
|
2467
|
-
|
|
2668
|
+
}
|
|
2669
|
+
case 33: {
|
|
2468
2670
|
if (tag !== 264) {
|
|
2469
2671
|
break;
|
|
2470
2672
|
}
|
|
2471
2673
|
|
|
2472
2674
|
message.clientOrderId = reader.uint64() as bigint;
|
|
2473
2675
|
continue;
|
|
2474
|
-
|
|
2676
|
+
}
|
|
2677
|
+
case 34: {
|
|
2475
2678
|
if (tag !== 272) {
|
|
2476
2679
|
break;
|
|
2477
2680
|
}
|
|
2478
2681
|
|
|
2479
2682
|
message.senderAccountId = reader.uint32();
|
|
2480
2683
|
continue;
|
|
2684
|
+
}
|
|
2481
2685
|
}
|
|
2482
2686
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2483
2687
|
break;
|
|
@@ -2597,34 +2801,38 @@ export const Action_CancelOrderById: MessageFns<Action_CancelOrderById> = {
|
|
|
2597
2801
|
while (reader.pos < end) {
|
|
2598
2802
|
const tag = reader.uint32();
|
|
2599
2803
|
switch (tag >>> 3) {
|
|
2600
|
-
case 1:
|
|
2804
|
+
case 1: {
|
|
2601
2805
|
if (tag !== 8) {
|
|
2602
2806
|
break;
|
|
2603
2807
|
}
|
|
2604
2808
|
|
|
2605
2809
|
message.sessionId = reader.uint64() as bigint;
|
|
2606
2810
|
continue;
|
|
2607
|
-
|
|
2811
|
+
}
|
|
2812
|
+
case 2: {
|
|
2608
2813
|
if (tag !== 16) {
|
|
2609
2814
|
break;
|
|
2610
2815
|
}
|
|
2611
2816
|
|
|
2612
2817
|
message.orderId = reader.uint64() as bigint;
|
|
2613
2818
|
continue;
|
|
2614
|
-
|
|
2819
|
+
}
|
|
2820
|
+
case 32: {
|
|
2615
2821
|
if (tag !== 256) {
|
|
2616
2822
|
break;
|
|
2617
2823
|
}
|
|
2618
2824
|
|
|
2619
2825
|
message.delegatorAccountId = reader.uint32();
|
|
2620
2826
|
continue;
|
|
2621
|
-
|
|
2827
|
+
}
|
|
2828
|
+
case 33: {
|
|
2622
2829
|
if (tag !== 264) {
|
|
2623
2830
|
break;
|
|
2624
2831
|
}
|
|
2625
2832
|
|
|
2626
2833
|
message.senderAccountId = reader.uint32();
|
|
2627
2834
|
continue;
|
|
2835
|
+
}
|
|
2628
2836
|
}
|
|
2629
2837
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2630
2838
|
break;
|
|
@@ -2707,34 +2915,38 @@ export const Action_Deposit: MessageFns<Action_Deposit> = {
|
|
|
2707
2915
|
while (reader.pos < end) {
|
|
2708
2916
|
const tag = reader.uint32();
|
|
2709
2917
|
switch (tag >>> 3) {
|
|
2710
|
-
case 1:
|
|
2918
|
+
case 1: {
|
|
2711
2919
|
if (tag !== 8) {
|
|
2712
2920
|
break;
|
|
2713
2921
|
}
|
|
2714
2922
|
|
|
2715
2923
|
message.actionNonce = reader.uint64() as bigint;
|
|
2716
2924
|
continue;
|
|
2717
|
-
|
|
2925
|
+
}
|
|
2926
|
+
case 2: {
|
|
2718
2927
|
if (tag !== 18) {
|
|
2719
2928
|
break;
|
|
2720
2929
|
}
|
|
2721
2930
|
|
|
2722
2931
|
message.tokenAddr = reader.bytes();
|
|
2723
2932
|
continue;
|
|
2724
|
-
|
|
2933
|
+
}
|
|
2934
|
+
case 3: {
|
|
2725
2935
|
if (tag !== 24) {
|
|
2726
2936
|
break;
|
|
2727
2937
|
}
|
|
2728
2938
|
|
|
2729
2939
|
message.amount = reader.uint64() as bigint;
|
|
2730
2940
|
continue;
|
|
2731
|
-
|
|
2941
|
+
}
|
|
2942
|
+
case 4: {
|
|
2732
2943
|
if (tag !== 34) {
|
|
2733
2944
|
break;
|
|
2734
2945
|
}
|
|
2735
2946
|
|
|
2736
2947
|
message.userPubkey = reader.bytes();
|
|
2737
2948
|
continue;
|
|
2949
|
+
}
|
|
2738
2950
|
}
|
|
2739
2951
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2740
2952
|
break;
|
|
@@ -2814,27 +3026,30 @@ export const Action_Withdraw: MessageFns<Action_Withdraw> = {
|
|
|
2814
3026
|
while (reader.pos < end) {
|
|
2815
3027
|
const tag = reader.uint32();
|
|
2816
3028
|
switch (tag >>> 3) {
|
|
2817
|
-
case 1:
|
|
3029
|
+
case 1: {
|
|
2818
3030
|
if (tag !== 8) {
|
|
2819
3031
|
break;
|
|
2820
3032
|
}
|
|
2821
3033
|
|
|
2822
3034
|
message.tokenId = reader.uint32();
|
|
2823
3035
|
continue;
|
|
2824
|
-
|
|
3036
|
+
}
|
|
3037
|
+
case 2: {
|
|
2825
3038
|
if (tag !== 16) {
|
|
2826
3039
|
break;
|
|
2827
3040
|
}
|
|
2828
3041
|
|
|
2829
3042
|
message.sessionId = reader.uint64() as bigint;
|
|
2830
3043
|
continue;
|
|
2831
|
-
|
|
3044
|
+
}
|
|
3045
|
+
case 3: {
|
|
2832
3046
|
if (tag !== 24) {
|
|
2833
3047
|
break;
|
|
2834
3048
|
}
|
|
2835
3049
|
|
|
2836
3050
|
message.amount = reader.uint64() as bigint;
|
|
2837
3051
|
continue;
|
|
3052
|
+
}
|
|
2838
3053
|
}
|
|
2839
3054
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2840
3055
|
break;
|
|
@@ -2900,20 +3115,22 @@ export const Action_PythSetWormholeGuardians: MessageFns<Action_PythSetWormholeG
|
|
|
2900
3115
|
while (reader.pos < end) {
|
|
2901
3116
|
const tag = reader.uint32();
|
|
2902
3117
|
switch (tag >>> 3) {
|
|
2903
|
-
case 1:
|
|
3118
|
+
case 1: {
|
|
2904
3119
|
if (tag !== 8) {
|
|
2905
3120
|
break;
|
|
2906
3121
|
}
|
|
2907
3122
|
|
|
2908
3123
|
message.guardianSetIndex = reader.uint32();
|
|
2909
3124
|
continue;
|
|
2910
|
-
|
|
3125
|
+
}
|
|
3126
|
+
case 2: {
|
|
2911
3127
|
if (tag !== 18) {
|
|
2912
3128
|
break;
|
|
2913
3129
|
}
|
|
2914
3130
|
|
|
2915
3131
|
message.addresses.push(reader.bytes());
|
|
2916
3132
|
continue;
|
|
3133
|
+
}
|
|
2917
3134
|
}
|
|
2918
3135
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2919
3136
|
break;
|
|
@@ -2978,20 +3195,22 @@ export const Action_PythSetSymbolFeed: MessageFns<Action_PythSetSymbolFeed> = {
|
|
|
2978
3195
|
while (reader.pos < end) {
|
|
2979
3196
|
const tag = reader.uint32();
|
|
2980
3197
|
switch (tag >>> 3) {
|
|
2981
|
-
case 1:
|
|
3198
|
+
case 1: {
|
|
2982
3199
|
if (tag !== 10) {
|
|
2983
3200
|
break;
|
|
2984
3201
|
}
|
|
2985
3202
|
|
|
2986
3203
|
message.oracleSymbol = reader.string();
|
|
2987
3204
|
continue;
|
|
2988
|
-
|
|
3205
|
+
}
|
|
3206
|
+
case 2: {
|
|
2989
3207
|
if (tag !== 18) {
|
|
2990
3208
|
break;
|
|
2991
3209
|
}
|
|
2992
3210
|
|
|
2993
3211
|
message.priceFeedId = reader.bytes();
|
|
2994
3212
|
continue;
|
|
3213
|
+
}
|
|
2995
3214
|
}
|
|
2996
3215
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2997
3216
|
break;
|
|
@@ -3049,13 +3268,14 @@ export const Action_PythPriceFeedUpdate: MessageFns<Action_PythPriceFeedUpdate>
|
|
|
3049
3268
|
while (reader.pos < end) {
|
|
3050
3269
|
const tag = reader.uint32();
|
|
3051
3270
|
switch (tag >>> 3) {
|
|
3052
|
-
case 1:
|
|
3271
|
+
case 1: {
|
|
3053
3272
|
if (tag !== 10) {
|
|
3054
3273
|
break;
|
|
3055
3274
|
}
|
|
3056
3275
|
|
|
3057
3276
|
message.rawPythnetData = reader.bytes();
|
|
3058
3277
|
continue;
|
|
3278
|
+
}
|
|
3059
3279
|
}
|
|
3060
3280
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3061
3281
|
break;
|
|
@@ -3117,27 +3337,30 @@ export const Action_Liquidate: MessageFns<Action_Liquidate> = {
|
|
|
3117
3337
|
while (reader.pos < end) {
|
|
3118
3338
|
const tag = reader.uint32();
|
|
3119
3339
|
switch (tag >>> 3) {
|
|
3120
|
-
case 1:
|
|
3340
|
+
case 1: {
|
|
3121
3341
|
if (tag !== 8) {
|
|
3122
3342
|
break;
|
|
3123
3343
|
}
|
|
3124
3344
|
|
|
3125
3345
|
message.liquidatorSessionId = reader.uint64() as bigint;
|
|
3126
3346
|
continue;
|
|
3127
|
-
|
|
3347
|
+
}
|
|
3348
|
+
case 2: {
|
|
3128
3349
|
if (tag !== 16) {
|
|
3129
3350
|
break;
|
|
3130
3351
|
}
|
|
3131
3352
|
|
|
3132
3353
|
message.liquidateeAccountId = reader.uint32();
|
|
3133
3354
|
continue;
|
|
3134
|
-
|
|
3355
|
+
}
|
|
3356
|
+
case 3: {
|
|
3135
3357
|
if (tag !== 24) {
|
|
3136
3358
|
break;
|
|
3137
3359
|
}
|
|
3138
3360
|
|
|
3139
3361
|
message.liquidatorAccountId = reader.uint32();
|
|
3140
3362
|
continue;
|
|
3363
|
+
}
|
|
3141
3364
|
}
|
|
3142
3365
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3143
3366
|
break;
|
|
@@ -3205,13 +3428,14 @@ export const Action_RevokeSession: MessageFns<Action_RevokeSession> = {
|
|
|
3205
3428
|
while (reader.pos < end) {
|
|
3206
3429
|
const tag = reader.uint32();
|
|
3207
3430
|
switch (tag >>> 3) {
|
|
3208
|
-
case 1:
|
|
3431
|
+
case 1: {
|
|
3209
3432
|
if (tag !== 8) {
|
|
3210
3433
|
break;
|
|
3211
3434
|
}
|
|
3212
3435
|
|
|
3213
3436
|
message.sessionId = reader.uint64() as bigint;
|
|
3214
3437
|
continue;
|
|
3438
|
+
}
|
|
3215
3439
|
}
|
|
3216
3440
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3217
3441
|
break;
|
|
@@ -3330,7 +3554,7 @@ export const Action_Unpause: MessageFns<Action_Unpause> = {
|
|
|
3330
3554
|
};
|
|
3331
3555
|
|
|
3332
3556
|
function createBaseAction_Transfer(): Action_Transfer {
|
|
3333
|
-
return { sessionId: 0n, fromAccountId: 0, tokenId: 0, amount: 0n, toAccountId: undefined };
|
|
3557
|
+
return { sessionId: 0n, fromAccountId: 0, tokenId: 0, amount: 0n, toAccountId: undefined, specialAccount: undefined };
|
|
3334
3558
|
}
|
|
3335
3559
|
|
|
3336
3560
|
export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
@@ -3356,6 +3580,9 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3356
3580
|
if (message.toAccountId !== undefined) {
|
|
3357
3581
|
writer.uint32(64).uint32(message.toAccountId);
|
|
3358
3582
|
}
|
|
3583
|
+
if (message.specialAccount !== undefined) {
|
|
3584
|
+
writer.uint32(72).int32(message.specialAccount);
|
|
3585
|
+
}
|
|
3359
3586
|
return writer;
|
|
3360
3587
|
},
|
|
3361
3588
|
|
|
@@ -3366,41 +3593,54 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3366
3593
|
while (reader.pos < end) {
|
|
3367
3594
|
const tag = reader.uint32();
|
|
3368
3595
|
switch (tag >>> 3) {
|
|
3369
|
-
case 1:
|
|
3596
|
+
case 1: {
|
|
3370
3597
|
if (tag !== 8) {
|
|
3371
3598
|
break;
|
|
3372
3599
|
}
|
|
3373
3600
|
|
|
3374
3601
|
message.sessionId = reader.uint64() as bigint;
|
|
3375
3602
|
continue;
|
|
3376
|
-
|
|
3603
|
+
}
|
|
3604
|
+
case 2: {
|
|
3377
3605
|
if (tag !== 16) {
|
|
3378
3606
|
break;
|
|
3379
3607
|
}
|
|
3380
3608
|
|
|
3381
3609
|
message.fromAccountId = reader.uint32();
|
|
3382
3610
|
continue;
|
|
3383
|
-
|
|
3611
|
+
}
|
|
3612
|
+
case 3: {
|
|
3384
3613
|
if (tag !== 24) {
|
|
3385
3614
|
break;
|
|
3386
3615
|
}
|
|
3387
3616
|
|
|
3388
3617
|
message.tokenId = reader.uint32();
|
|
3389
3618
|
continue;
|
|
3390
|
-
|
|
3619
|
+
}
|
|
3620
|
+
case 4: {
|
|
3391
3621
|
if (tag !== 32) {
|
|
3392
3622
|
break;
|
|
3393
3623
|
}
|
|
3394
3624
|
|
|
3395
3625
|
message.amount = reader.uint64() as bigint;
|
|
3396
3626
|
continue;
|
|
3397
|
-
|
|
3627
|
+
}
|
|
3628
|
+
case 8: {
|
|
3398
3629
|
if (tag !== 64) {
|
|
3399
3630
|
break;
|
|
3400
3631
|
}
|
|
3401
3632
|
|
|
3402
3633
|
message.toAccountId = reader.uint32();
|
|
3403
3634
|
continue;
|
|
3635
|
+
}
|
|
3636
|
+
case 9: {
|
|
3637
|
+
if (tag !== 72) {
|
|
3638
|
+
break;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
message.specialAccount = reader.int32() as any;
|
|
3642
|
+
continue;
|
|
3643
|
+
}
|
|
3404
3644
|
}
|
|
3405
3645
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3406
3646
|
break;
|
|
@@ -3417,6 +3657,7 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3417
3657
|
tokenId: isSet(object.tokenId) ? globalThis.Number(object.tokenId) : 0,
|
|
3418
3658
|
amount: isSet(object.amount) ? BigInt(object.amount) : 0n,
|
|
3419
3659
|
toAccountId: isSet(object.toAccountId) ? globalThis.Number(object.toAccountId) : undefined,
|
|
3660
|
+
specialAccount: isSet(object.specialAccount) ? specialAccountFromJSON(object.specialAccount) : undefined,
|
|
3420
3661
|
};
|
|
3421
3662
|
},
|
|
3422
3663
|
|
|
@@ -3437,6 +3678,9 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3437
3678
|
if (message.toAccountId !== undefined) {
|
|
3438
3679
|
obj.toAccountId = Math.round(message.toAccountId);
|
|
3439
3680
|
}
|
|
3681
|
+
if (message.specialAccount !== undefined) {
|
|
3682
|
+
obj.specialAccount = specialAccountToJSON(message.specialAccount);
|
|
3683
|
+
}
|
|
3440
3684
|
return obj;
|
|
3441
3685
|
},
|
|
3442
3686
|
|
|
@@ -3450,6 +3694,7 @@ export const Action_Transfer: MessageFns<Action_Transfer> = {
|
|
|
3450
3694
|
message.tokenId = object.tokenId ?? 0;
|
|
3451
3695
|
message.amount = object.amount ?? 0n;
|
|
3452
3696
|
message.toAccountId = object.toAccountId ?? undefined;
|
|
3697
|
+
message.specialAccount = object.specialAccount ?? undefined;
|
|
3453
3698
|
return message;
|
|
3454
3699
|
},
|
|
3455
3700
|
};
|
|
@@ -3494,48 +3739,54 @@ export const Action_AddTrigger: MessageFns<Action_AddTrigger> = {
|
|
|
3494
3739
|
while (reader.pos < end) {
|
|
3495
3740
|
const tag = reader.uint32();
|
|
3496
3741
|
switch (tag >>> 3) {
|
|
3497
|
-
case 1:
|
|
3742
|
+
case 1: {
|
|
3498
3743
|
if (tag !== 8) {
|
|
3499
3744
|
break;
|
|
3500
3745
|
}
|
|
3501
3746
|
|
|
3502
3747
|
message.sessionId = reader.uint64() as bigint;
|
|
3503
3748
|
continue;
|
|
3504
|
-
|
|
3749
|
+
}
|
|
3750
|
+
case 2: {
|
|
3505
3751
|
if (tag !== 16) {
|
|
3506
3752
|
break;
|
|
3507
3753
|
}
|
|
3508
3754
|
|
|
3509
3755
|
message.marketId = reader.uint32();
|
|
3510
3756
|
continue;
|
|
3511
|
-
|
|
3757
|
+
}
|
|
3758
|
+
case 3: {
|
|
3512
3759
|
if (tag !== 24) {
|
|
3513
3760
|
break;
|
|
3514
3761
|
}
|
|
3515
3762
|
|
|
3516
3763
|
message.kind = reader.int32() as any;
|
|
3517
3764
|
continue;
|
|
3518
|
-
|
|
3765
|
+
}
|
|
3766
|
+
case 4: {
|
|
3519
3767
|
if (tag !== 32) {
|
|
3520
3768
|
break;
|
|
3521
3769
|
}
|
|
3522
3770
|
|
|
3523
3771
|
message.side = reader.int32() as any;
|
|
3524
3772
|
continue;
|
|
3525
|
-
|
|
3773
|
+
}
|
|
3774
|
+
case 5: {
|
|
3526
3775
|
if (tag !== 40) {
|
|
3527
3776
|
break;
|
|
3528
3777
|
}
|
|
3529
3778
|
|
|
3530
3779
|
message.price = reader.uint64() as bigint;
|
|
3531
3780
|
continue;
|
|
3532
|
-
|
|
3781
|
+
}
|
|
3782
|
+
case 10: {
|
|
3533
3783
|
if (tag !== 80) {
|
|
3534
3784
|
break;
|
|
3535
3785
|
}
|
|
3536
3786
|
|
|
3537
3787
|
message.accountId = reader.uint32();
|
|
3538
3788
|
continue;
|
|
3789
|
+
}
|
|
3539
3790
|
}
|
|
3540
3791
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3541
3792
|
break;
|
|
@@ -3628,41 +3879,46 @@ export const Action_RemoveTrigger: MessageFns<Action_RemoveTrigger> = {
|
|
|
3628
3879
|
while (reader.pos < end) {
|
|
3629
3880
|
const tag = reader.uint32();
|
|
3630
3881
|
switch (tag >>> 3) {
|
|
3631
|
-
case 1:
|
|
3882
|
+
case 1: {
|
|
3632
3883
|
if (tag !== 8) {
|
|
3633
3884
|
break;
|
|
3634
3885
|
}
|
|
3635
3886
|
|
|
3636
3887
|
message.sessionId = reader.uint64() as bigint;
|
|
3637
3888
|
continue;
|
|
3638
|
-
|
|
3889
|
+
}
|
|
3890
|
+
case 2: {
|
|
3639
3891
|
if (tag !== 16) {
|
|
3640
3892
|
break;
|
|
3641
3893
|
}
|
|
3642
3894
|
|
|
3643
3895
|
message.marketId = reader.uint32();
|
|
3644
3896
|
continue;
|
|
3645
|
-
|
|
3897
|
+
}
|
|
3898
|
+
case 3: {
|
|
3646
3899
|
if (tag !== 24) {
|
|
3647
3900
|
break;
|
|
3648
3901
|
}
|
|
3649
3902
|
|
|
3650
3903
|
message.kind = reader.int32() as any;
|
|
3651
3904
|
continue;
|
|
3652
|
-
|
|
3905
|
+
}
|
|
3906
|
+
case 4: {
|
|
3653
3907
|
if (tag !== 32) {
|
|
3654
3908
|
break;
|
|
3655
3909
|
}
|
|
3656
3910
|
|
|
3657
3911
|
message.side = reader.int32() as any;
|
|
3658
3912
|
continue;
|
|
3659
|
-
|
|
3913
|
+
}
|
|
3914
|
+
case 10: {
|
|
3660
3915
|
if (tag !== 80) {
|
|
3661
3916
|
break;
|
|
3662
3917
|
}
|
|
3663
3918
|
|
|
3664
3919
|
message.accountId = reader.uint32();
|
|
3665
3920
|
continue;
|
|
3921
|
+
}
|
|
3666
3922
|
}
|
|
3667
3923
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3668
3924
|
break;
|
|
@@ -3763,7 +4019,7 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3763
4019
|
Receipt_UpdateGuardianSetResult.encode(message.kind.value, writer.uint32(338).fork()).join();
|
|
3764
4020
|
break;
|
|
3765
4021
|
case "liquidated":
|
|
3766
|
-
|
|
4022
|
+
Receipt_AccountLiquidated.encode(message.kind.value, writer.uint32(346).fork()).join();
|
|
3767
4023
|
break;
|
|
3768
4024
|
case "sessionRevoked":
|
|
3769
4025
|
Receipt_SessionRevoked.encode(message.kind.value, writer.uint32(354).fork()).join();
|
|
@@ -3794,21 +4050,23 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3794
4050
|
while (reader.pos < end) {
|
|
3795
4051
|
const tag = reader.uint32();
|
|
3796
4052
|
switch (tag >>> 3) {
|
|
3797
|
-
case 1:
|
|
4053
|
+
case 1: {
|
|
3798
4054
|
if (tag !== 8) {
|
|
3799
4055
|
break;
|
|
3800
4056
|
}
|
|
3801
4057
|
|
|
3802
4058
|
message.actionId = reader.uint64() as bigint;
|
|
3803
4059
|
continue;
|
|
3804
|
-
|
|
4060
|
+
}
|
|
4061
|
+
case 32: {
|
|
3805
4062
|
if (tag !== 256) {
|
|
3806
4063
|
break;
|
|
3807
4064
|
}
|
|
3808
4065
|
|
|
3809
4066
|
message.kind = { $case: "err", value: reader.int32() as any };
|
|
3810
4067
|
continue;
|
|
3811
|
-
|
|
4068
|
+
}
|
|
4069
|
+
case 33: {
|
|
3812
4070
|
if (tag !== 266) {
|
|
3813
4071
|
break;
|
|
3814
4072
|
}
|
|
@@ -3818,14 +4076,16 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3818
4076
|
value: Receipt_CreateSessionResult.decode(reader, reader.uint32()),
|
|
3819
4077
|
};
|
|
3820
4078
|
continue;
|
|
3821
|
-
|
|
4079
|
+
}
|
|
4080
|
+
case 34: {
|
|
3822
4081
|
if (tag !== 274) {
|
|
3823
4082
|
break;
|
|
3824
4083
|
}
|
|
3825
4084
|
|
|
3826
4085
|
message.kind = { $case: "placeOrderResult", value: Receipt_PlaceOrderResult.decode(reader, reader.uint32()) };
|
|
3827
4086
|
continue;
|
|
3828
|
-
|
|
4087
|
+
}
|
|
4088
|
+
case 35: {
|
|
3829
4089
|
if (tag !== 282) {
|
|
3830
4090
|
break;
|
|
3831
4091
|
}
|
|
@@ -3835,14 +4095,16 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3835
4095
|
value: Receipt_CancelOrderResult.decode(reader, reader.uint32()),
|
|
3836
4096
|
};
|
|
3837
4097
|
continue;
|
|
3838
|
-
|
|
4098
|
+
}
|
|
4099
|
+
case 36: {
|
|
3839
4100
|
if (tag !== 290) {
|
|
3840
4101
|
break;
|
|
3841
4102
|
}
|
|
3842
4103
|
|
|
3843
4104
|
message.kind = { $case: "depositResult", value: Receipt_DepositResult.decode(reader, reader.uint32()) };
|
|
3844
4105
|
continue;
|
|
3845
|
-
|
|
4106
|
+
}
|
|
4107
|
+
case 37: {
|
|
3846
4108
|
if (tag !== 298) {
|
|
3847
4109
|
break;
|
|
3848
4110
|
}
|
|
@@ -3852,7 +4114,8 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3852
4114
|
value: Receipt_InsertTokenResult.decode(reader, reader.uint32()),
|
|
3853
4115
|
};
|
|
3854
4116
|
continue;
|
|
3855
|
-
|
|
4117
|
+
}
|
|
4118
|
+
case 38: {
|
|
3856
4119
|
if (tag !== 306) {
|
|
3857
4120
|
break;
|
|
3858
4121
|
}
|
|
@@ -3862,14 +4125,16 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3862
4125
|
value: Receipt_InsertMarketResult.decode(reader, reader.uint32()),
|
|
3863
4126
|
};
|
|
3864
4127
|
continue;
|
|
3865
|
-
|
|
4128
|
+
}
|
|
4129
|
+
case 39: {
|
|
3866
4130
|
if (tag !== 314) {
|
|
3867
4131
|
break;
|
|
3868
4132
|
}
|
|
3869
4133
|
|
|
3870
4134
|
message.kind = { $case: "withdrawResult", value: Receipt_WithdrawResult.decode(reader, reader.uint32()) };
|
|
3871
4135
|
continue;
|
|
3872
|
-
|
|
4136
|
+
}
|
|
4137
|
+
case 40: {
|
|
3873
4138
|
if (tag !== 322) {
|
|
3874
4139
|
break;
|
|
3875
4140
|
}
|
|
@@ -3879,7 +4144,8 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3879
4144
|
value: Receipt_OracleSymbolFeedResult.decode(reader, reader.uint32()),
|
|
3880
4145
|
};
|
|
3881
4146
|
continue;
|
|
3882
|
-
|
|
4147
|
+
}
|
|
4148
|
+
case 41: {
|
|
3883
4149
|
if (tag !== 330) {
|
|
3884
4150
|
break;
|
|
3885
4151
|
}
|
|
@@ -3889,7 +4155,8 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3889
4155
|
value: Receipt_OracleUpdateResult.decode(reader, reader.uint32()),
|
|
3890
4156
|
};
|
|
3891
4157
|
continue;
|
|
3892
|
-
|
|
4158
|
+
}
|
|
4159
|
+
case 42: {
|
|
3893
4160
|
if (tag !== 338) {
|
|
3894
4161
|
break;
|
|
3895
4162
|
}
|
|
@@ -3899,55 +4166,63 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3899
4166
|
value: Receipt_UpdateGuardianSetResult.decode(reader, reader.uint32()),
|
|
3900
4167
|
};
|
|
3901
4168
|
continue;
|
|
3902
|
-
|
|
4169
|
+
}
|
|
4170
|
+
case 43: {
|
|
3903
4171
|
if (tag !== 346) {
|
|
3904
4172
|
break;
|
|
3905
4173
|
}
|
|
3906
4174
|
|
|
3907
|
-
message.kind = { $case: "liquidated", value:
|
|
4175
|
+
message.kind = { $case: "liquidated", value: Receipt_AccountLiquidated.decode(reader, reader.uint32()) };
|
|
3908
4176
|
continue;
|
|
3909
|
-
|
|
4177
|
+
}
|
|
4178
|
+
case 44: {
|
|
3910
4179
|
if (tag !== 354) {
|
|
3911
4180
|
break;
|
|
3912
4181
|
}
|
|
3913
4182
|
|
|
3914
4183
|
message.kind = { $case: "sessionRevoked", value: Receipt_SessionRevoked.decode(reader, reader.uint32()) };
|
|
3915
4184
|
continue;
|
|
3916
|
-
|
|
4185
|
+
}
|
|
4186
|
+
case 45: {
|
|
3917
4187
|
if (tag !== 362) {
|
|
3918
4188
|
break;
|
|
3919
4189
|
}
|
|
3920
4190
|
|
|
3921
4191
|
message.kind = { $case: "paused", value: Receipt_Paused.decode(reader, reader.uint32()) };
|
|
3922
4192
|
continue;
|
|
3923
|
-
|
|
4193
|
+
}
|
|
4194
|
+
case 46: {
|
|
3924
4195
|
if (tag !== 370) {
|
|
3925
4196
|
break;
|
|
3926
4197
|
}
|
|
3927
4198
|
|
|
3928
4199
|
message.kind = { $case: "unpaused", value: Receipt_Unpaused.decode(reader, reader.uint32()) };
|
|
3929
4200
|
continue;
|
|
3930
|
-
|
|
4201
|
+
}
|
|
4202
|
+
case 47: {
|
|
3931
4203
|
if (tag !== 378) {
|
|
3932
4204
|
break;
|
|
3933
4205
|
}
|
|
3934
4206
|
|
|
3935
4207
|
message.kind = { $case: "transferred", value: Receipt_Transferred.decode(reader, reader.uint32()) };
|
|
3936
4208
|
continue;
|
|
3937
|
-
|
|
4209
|
+
}
|
|
4210
|
+
case 64: {
|
|
3938
4211
|
if (tag !== 514) {
|
|
3939
4212
|
break;
|
|
3940
4213
|
}
|
|
3941
4214
|
|
|
3942
4215
|
message.kind = { $case: "triggerAdded", value: Receipt_TriggerAdded.decode(reader, reader.uint32()) };
|
|
3943
4216
|
continue;
|
|
3944
|
-
|
|
4217
|
+
}
|
|
4218
|
+
case 65: {
|
|
3945
4219
|
if (tag !== 522) {
|
|
3946
4220
|
break;
|
|
3947
4221
|
}
|
|
3948
4222
|
|
|
3949
4223
|
message.kind = { $case: "triggerRemoved", value: Receipt_TriggerRemoved.decode(reader, reader.uint32()) };
|
|
3950
4224
|
continue;
|
|
4225
|
+
}
|
|
3951
4226
|
}
|
|
3952
4227
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3953
4228
|
break;
|
|
@@ -3989,7 +4264,7 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
3989
4264
|
value: Receipt_UpdateGuardianSetResult.fromJSON(object.updateGuardianSetResult),
|
|
3990
4265
|
}
|
|
3991
4266
|
: isSet(object.liquidated)
|
|
3992
|
-
? { $case: "liquidated", value:
|
|
4267
|
+
? { $case: "liquidated", value: Receipt_AccountLiquidated.fromJSON(object.liquidated) }
|
|
3993
4268
|
: isSet(object.sessionRevoked)
|
|
3994
4269
|
? { $case: "sessionRevoked", value: Receipt_SessionRevoked.fromJSON(object.sessionRevoked) }
|
|
3995
4270
|
: isSet(object.paused)
|
|
@@ -4013,56 +4288,39 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
4013
4288
|
}
|
|
4014
4289
|
if (message.kind?.$case === "err") {
|
|
4015
4290
|
obj.err = errorToJSON(message.kind.value);
|
|
4016
|
-
}
|
|
4017
|
-
if (message.kind?.$case === "createSessionResult") {
|
|
4291
|
+
} else if (message.kind?.$case === "createSessionResult") {
|
|
4018
4292
|
obj.createSessionResult = Receipt_CreateSessionResult.toJSON(message.kind.value);
|
|
4019
|
-
}
|
|
4020
|
-
if (message.kind?.$case === "placeOrderResult") {
|
|
4293
|
+
} else if (message.kind?.$case === "placeOrderResult") {
|
|
4021
4294
|
obj.placeOrderResult = Receipt_PlaceOrderResult.toJSON(message.kind.value);
|
|
4022
|
-
}
|
|
4023
|
-
if (message.kind?.$case === "cancelOrderResult") {
|
|
4295
|
+
} else if (message.kind?.$case === "cancelOrderResult") {
|
|
4024
4296
|
obj.cancelOrderResult = Receipt_CancelOrderResult.toJSON(message.kind.value);
|
|
4025
|
-
}
|
|
4026
|
-
if (message.kind?.$case === "depositResult") {
|
|
4297
|
+
} else if (message.kind?.$case === "depositResult") {
|
|
4027
4298
|
obj.depositResult = Receipt_DepositResult.toJSON(message.kind.value);
|
|
4028
|
-
}
|
|
4029
|
-
if (message.kind?.$case === "insertTokenResult") {
|
|
4299
|
+
} else if (message.kind?.$case === "insertTokenResult") {
|
|
4030
4300
|
obj.insertTokenResult = Receipt_InsertTokenResult.toJSON(message.kind.value);
|
|
4031
|
-
}
|
|
4032
|
-
if (message.kind?.$case === "insertMarketResult") {
|
|
4301
|
+
} else if (message.kind?.$case === "insertMarketResult") {
|
|
4033
4302
|
obj.insertMarketResult = Receipt_InsertMarketResult.toJSON(message.kind.value);
|
|
4034
|
-
}
|
|
4035
|
-
if (message.kind?.$case === "withdrawResult") {
|
|
4303
|
+
} else if (message.kind?.$case === "withdrawResult") {
|
|
4036
4304
|
obj.withdrawResult = Receipt_WithdrawResult.toJSON(message.kind.value);
|
|
4037
|
-
}
|
|
4038
|
-
if (message.kind?.$case === "oracleSymbolFeedResult") {
|
|
4305
|
+
} else if (message.kind?.$case === "oracleSymbolFeedResult") {
|
|
4039
4306
|
obj.oracleSymbolFeedResult = Receipt_OracleSymbolFeedResult.toJSON(message.kind.value);
|
|
4040
|
-
}
|
|
4041
|
-
if (message.kind?.$case === "oracleUpdateResult") {
|
|
4307
|
+
} else if (message.kind?.$case === "oracleUpdateResult") {
|
|
4042
4308
|
obj.oracleUpdateResult = Receipt_OracleUpdateResult.toJSON(message.kind.value);
|
|
4043
|
-
}
|
|
4044
|
-
if (message.kind?.$case === "updateGuardianSetResult") {
|
|
4309
|
+
} else if (message.kind?.$case === "updateGuardianSetResult") {
|
|
4045
4310
|
obj.updateGuardianSetResult = Receipt_UpdateGuardianSetResult.toJSON(message.kind.value);
|
|
4046
|
-
}
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
}
|
|
4050
|
-
if (message.kind?.$case === "sessionRevoked") {
|
|
4311
|
+
} else if (message.kind?.$case === "liquidated") {
|
|
4312
|
+
obj.liquidated = Receipt_AccountLiquidated.toJSON(message.kind.value);
|
|
4313
|
+
} else if (message.kind?.$case === "sessionRevoked") {
|
|
4051
4314
|
obj.sessionRevoked = Receipt_SessionRevoked.toJSON(message.kind.value);
|
|
4052
|
-
}
|
|
4053
|
-
if (message.kind?.$case === "paused") {
|
|
4315
|
+
} else if (message.kind?.$case === "paused") {
|
|
4054
4316
|
obj.paused = Receipt_Paused.toJSON(message.kind.value);
|
|
4055
|
-
}
|
|
4056
|
-
if (message.kind?.$case === "unpaused") {
|
|
4317
|
+
} else if (message.kind?.$case === "unpaused") {
|
|
4057
4318
|
obj.unpaused = Receipt_Unpaused.toJSON(message.kind.value);
|
|
4058
|
-
}
|
|
4059
|
-
if (message.kind?.$case === "transferred") {
|
|
4319
|
+
} else if (message.kind?.$case === "transferred") {
|
|
4060
4320
|
obj.transferred = Receipt_Transferred.toJSON(message.kind.value);
|
|
4061
|
-
}
|
|
4062
|
-
if (message.kind?.$case === "triggerAdded") {
|
|
4321
|
+
} else if (message.kind?.$case === "triggerAdded") {
|
|
4063
4322
|
obj.triggerAdded = Receipt_TriggerAdded.toJSON(message.kind.value);
|
|
4064
|
-
}
|
|
4065
|
-
if (message.kind?.$case === "triggerRemoved") {
|
|
4323
|
+
} else if (message.kind?.$case === "triggerRemoved") {
|
|
4066
4324
|
obj.triggerRemoved = Receipt_TriggerRemoved.toJSON(message.kind.value);
|
|
4067
4325
|
}
|
|
4068
4326
|
return obj;
|
|
@@ -4074,87 +4332,143 @@ export const Receipt: MessageFns<Receipt> = {
|
|
|
4074
4332
|
fromPartial<I extends Exact<DeepPartial<Receipt>, I>>(object: I): Receipt {
|
|
4075
4333
|
const message = createBaseReceipt();
|
|
4076
4334
|
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
|
-
|
|
4335
|
+
switch (object.kind?.$case) {
|
|
4336
|
+
case "err": {
|
|
4337
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4338
|
+
message.kind = { $case: "err", value: object.kind.value };
|
|
4339
|
+
}
|
|
4340
|
+
break;
|
|
4341
|
+
}
|
|
4342
|
+
case "createSessionResult": {
|
|
4343
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4344
|
+
message.kind = {
|
|
4345
|
+
$case: "createSessionResult",
|
|
4346
|
+
value: Receipt_CreateSessionResult.fromPartial(object.kind.value),
|
|
4347
|
+
};
|
|
4348
|
+
}
|
|
4349
|
+
break;
|
|
4350
|
+
}
|
|
4351
|
+
case "placeOrderResult": {
|
|
4352
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4353
|
+
message.kind = { $case: "placeOrderResult", value: Receipt_PlaceOrderResult.fromPartial(object.kind.value) };
|
|
4354
|
+
}
|
|
4355
|
+
break;
|
|
4356
|
+
}
|
|
4357
|
+
case "cancelOrderResult": {
|
|
4358
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4359
|
+
message.kind = {
|
|
4360
|
+
$case: "cancelOrderResult",
|
|
4361
|
+
value: Receipt_CancelOrderResult.fromPartial(object.kind.value),
|
|
4362
|
+
};
|
|
4363
|
+
}
|
|
4364
|
+
break;
|
|
4365
|
+
}
|
|
4366
|
+
case "depositResult": {
|
|
4367
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4368
|
+
message.kind = { $case: "depositResult", value: Receipt_DepositResult.fromPartial(object.kind.value) };
|
|
4369
|
+
}
|
|
4370
|
+
break;
|
|
4371
|
+
}
|
|
4372
|
+
case "insertTokenResult": {
|
|
4373
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4374
|
+
message.kind = {
|
|
4375
|
+
$case: "insertTokenResult",
|
|
4376
|
+
value: Receipt_InsertTokenResult.fromPartial(object.kind.value),
|
|
4377
|
+
};
|
|
4378
|
+
}
|
|
4379
|
+
break;
|
|
4380
|
+
}
|
|
4381
|
+
case "insertMarketResult": {
|
|
4382
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4383
|
+
message.kind = {
|
|
4384
|
+
$case: "insertMarketResult",
|
|
4385
|
+
value: Receipt_InsertMarketResult.fromPartial(object.kind.value),
|
|
4386
|
+
};
|
|
4387
|
+
}
|
|
4388
|
+
break;
|
|
4389
|
+
}
|
|
4390
|
+
case "withdrawResult": {
|
|
4391
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4392
|
+
message.kind = { $case: "withdrawResult", value: Receipt_WithdrawResult.fromPartial(object.kind.value) };
|
|
4393
|
+
}
|
|
4394
|
+
break;
|
|
4395
|
+
}
|
|
4396
|
+
case "oracleSymbolFeedResult": {
|
|
4397
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4398
|
+
message.kind = {
|
|
4399
|
+
$case: "oracleSymbolFeedResult",
|
|
4400
|
+
value: Receipt_OracleSymbolFeedResult.fromPartial(object.kind.value),
|
|
4401
|
+
};
|
|
4402
|
+
}
|
|
4403
|
+
break;
|
|
4404
|
+
}
|
|
4405
|
+
case "oracleUpdateResult": {
|
|
4406
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4407
|
+
message.kind = {
|
|
4408
|
+
$case: "oracleUpdateResult",
|
|
4409
|
+
value: Receipt_OracleUpdateResult.fromPartial(object.kind.value),
|
|
4410
|
+
};
|
|
4411
|
+
}
|
|
4412
|
+
break;
|
|
4413
|
+
}
|
|
4414
|
+
case "updateGuardianSetResult": {
|
|
4415
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4416
|
+
message.kind = {
|
|
4417
|
+
$case: "updateGuardianSetResult",
|
|
4418
|
+
value: Receipt_UpdateGuardianSetResult.fromPartial(object.kind.value),
|
|
4419
|
+
};
|
|
4420
|
+
}
|
|
4421
|
+
break;
|
|
4422
|
+
}
|
|
4423
|
+
case "liquidated": {
|
|
4424
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4425
|
+
message.kind = { $case: "liquidated", value: Receipt_AccountLiquidated.fromPartial(object.kind.value) };
|
|
4426
|
+
}
|
|
4427
|
+
break;
|
|
4428
|
+
}
|
|
4429
|
+
case "sessionRevoked": {
|
|
4430
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4431
|
+
message.kind = { $case: "sessionRevoked", value: Receipt_SessionRevoked.fromPartial(object.kind.value) };
|
|
4432
|
+
}
|
|
4433
|
+
break;
|
|
4434
|
+
}
|
|
4435
|
+
case "paused": {
|
|
4436
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4437
|
+
message.kind = { $case: "paused", value: Receipt_Paused.fromPartial(object.kind.value) };
|
|
4438
|
+
}
|
|
4439
|
+
break;
|
|
4440
|
+
}
|
|
4441
|
+
case "unpaused": {
|
|
4442
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4443
|
+
message.kind = { $case: "unpaused", value: Receipt_Unpaused.fromPartial(object.kind.value) };
|
|
4444
|
+
}
|
|
4445
|
+
break;
|
|
4446
|
+
}
|
|
4447
|
+
case "transferred": {
|
|
4448
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4449
|
+
message.kind = { $case: "transferred", value: Receipt_Transferred.fromPartial(object.kind.value) };
|
|
4450
|
+
}
|
|
4451
|
+
break;
|
|
4452
|
+
}
|
|
4453
|
+
case "triggerAdded": {
|
|
4454
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4455
|
+
message.kind = { $case: "triggerAdded", value: Receipt_TriggerAdded.fromPartial(object.kind.value) };
|
|
4456
|
+
}
|
|
4457
|
+
break;
|
|
4458
|
+
}
|
|
4459
|
+
case "triggerRemoved": {
|
|
4460
|
+
if (object.kind?.value !== undefined && object.kind?.value !== null) {
|
|
4461
|
+
message.kind = { $case: "triggerRemoved", value: Receipt_TriggerRemoved.fromPartial(object.kind.value) };
|
|
4462
|
+
}
|
|
4463
|
+
break;
|
|
4464
|
+
}
|
|
4151
4465
|
}
|
|
4152
4466
|
return message;
|
|
4153
4467
|
},
|
|
4154
4468
|
};
|
|
4155
4469
|
|
|
4156
4470
|
function createBaseReceipt_Posted(): Receipt_Posted {
|
|
4157
|
-
return { side: 0, marketId: 0, price: 0n, size: 0n, orderId: 0n, accountId: 0
|
|
4471
|
+
return { side: 0, marketId: 0, price: 0n, size: 0n, orderId: 0n, accountId: 0 };
|
|
4158
4472
|
}
|
|
4159
4473
|
|
|
4160
4474
|
export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
@@ -4186,12 +4500,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4186
4500
|
if (message.accountId !== 0) {
|
|
4187
4501
|
writer.uint32(48).uint32(message.accountId);
|
|
4188
4502
|
}
|
|
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
4503
|
return writer;
|
|
4196
4504
|
},
|
|
4197
4505
|
|
|
@@ -4202,55 +4510,54 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4202
4510
|
while (reader.pos < end) {
|
|
4203
4511
|
const tag = reader.uint32();
|
|
4204
4512
|
switch (tag >>> 3) {
|
|
4205
|
-
case 1:
|
|
4513
|
+
case 1: {
|
|
4206
4514
|
if (tag !== 8) {
|
|
4207
4515
|
break;
|
|
4208
4516
|
}
|
|
4209
4517
|
|
|
4210
4518
|
message.side = reader.int32() as any;
|
|
4211
4519
|
continue;
|
|
4212
|
-
|
|
4520
|
+
}
|
|
4521
|
+
case 2: {
|
|
4213
4522
|
if (tag !== 16) {
|
|
4214
4523
|
break;
|
|
4215
4524
|
}
|
|
4216
4525
|
|
|
4217
4526
|
message.marketId = reader.uint32();
|
|
4218
4527
|
continue;
|
|
4219
|
-
|
|
4528
|
+
}
|
|
4529
|
+
case 3: {
|
|
4220
4530
|
if (tag !== 24) {
|
|
4221
4531
|
break;
|
|
4222
4532
|
}
|
|
4223
4533
|
|
|
4224
4534
|
message.price = reader.uint64() as bigint;
|
|
4225
4535
|
continue;
|
|
4226
|
-
|
|
4536
|
+
}
|
|
4537
|
+
case 4: {
|
|
4227
4538
|
if (tag !== 32) {
|
|
4228
4539
|
break;
|
|
4229
4540
|
}
|
|
4230
4541
|
|
|
4231
4542
|
message.size = reader.uint64() as bigint;
|
|
4232
4543
|
continue;
|
|
4233
|
-
|
|
4544
|
+
}
|
|
4545
|
+
case 5: {
|
|
4234
4546
|
if (tag !== 40) {
|
|
4235
4547
|
break;
|
|
4236
4548
|
}
|
|
4237
4549
|
|
|
4238
4550
|
message.orderId = reader.uint64() as bigint;
|
|
4239
4551
|
continue;
|
|
4240
|
-
|
|
4552
|
+
}
|
|
4553
|
+
case 6: {
|
|
4241
4554
|
if (tag !== 48) {
|
|
4242
4555
|
break;
|
|
4243
4556
|
}
|
|
4244
4557
|
|
|
4245
4558
|
message.accountId = reader.uint32();
|
|
4246
4559
|
continue;
|
|
4247
|
-
|
|
4248
|
-
if (tag !== 56) {
|
|
4249
|
-
break;
|
|
4250
|
-
}
|
|
4251
|
-
|
|
4252
|
-
message.clientOrderId = reader.uint64() as bigint;
|
|
4253
|
-
continue;
|
|
4560
|
+
}
|
|
4254
4561
|
}
|
|
4255
4562
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4256
4563
|
break;
|
|
@@ -4268,7 +4575,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4268
4575
|
size: isSet(object.size) ? BigInt(object.size) : 0n,
|
|
4269
4576
|
orderId: isSet(object.orderId) ? BigInt(object.orderId) : 0n,
|
|
4270
4577
|
accountId: isSet(object.accountId) ? globalThis.Number(object.accountId) : 0,
|
|
4271
|
-
clientOrderId: isSet(object.clientOrderId) ? BigInt(object.clientOrderId) : undefined,
|
|
4272
4578
|
};
|
|
4273
4579
|
},
|
|
4274
4580
|
|
|
@@ -4292,9 +4598,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4292
4598
|
if (message.accountId !== 0) {
|
|
4293
4599
|
obj.accountId = Math.round(message.accountId);
|
|
4294
4600
|
}
|
|
4295
|
-
if (message.clientOrderId !== undefined) {
|
|
4296
|
-
obj.clientOrderId = message.clientOrderId.toString();
|
|
4297
|
-
}
|
|
4298
4601
|
return obj;
|
|
4299
4602
|
},
|
|
4300
4603
|
|
|
@@ -4309,7 +4612,6 @@ export const Receipt_Posted: MessageFns<Receipt_Posted> = {
|
|
|
4309
4612
|
message.size = object.size ?? 0n;
|
|
4310
4613
|
message.orderId = object.orderId ?? 0n;
|
|
4311
4614
|
message.accountId = object.accountId ?? 0;
|
|
4312
|
-
message.clientOrderId = object.clientOrderId ?? undefined;
|
|
4313
4615
|
return message;
|
|
4314
4616
|
},
|
|
4315
4617
|
};
|
|
@@ -4351,34 +4653,38 @@ export const Receipt_Trade: MessageFns<Receipt_Trade> = {
|
|
|
4351
4653
|
while (reader.pos < end) {
|
|
4352
4654
|
const tag = reader.uint32();
|
|
4353
4655
|
switch (tag >>> 3) {
|
|
4354
|
-
case 2:
|
|
4656
|
+
case 2: {
|
|
4355
4657
|
if (tag !== 16) {
|
|
4356
4658
|
break;
|
|
4357
4659
|
}
|
|
4358
4660
|
|
|
4359
4661
|
message.orderId = reader.uint64() as bigint;
|
|
4360
4662
|
continue;
|
|
4361
|
-
|
|
4663
|
+
}
|
|
4664
|
+
case 4: {
|
|
4362
4665
|
if (tag !== 32) {
|
|
4363
4666
|
break;
|
|
4364
4667
|
}
|
|
4365
4668
|
|
|
4366
4669
|
message.price = reader.uint64() as bigint;
|
|
4367
4670
|
continue;
|
|
4368
|
-
|
|
4671
|
+
}
|
|
4672
|
+
case 5: {
|
|
4369
4673
|
if (tag !== 40) {
|
|
4370
4674
|
break;
|
|
4371
4675
|
}
|
|
4372
4676
|
|
|
4373
4677
|
message.size = reader.uint64() as bigint;
|
|
4374
4678
|
continue;
|
|
4375
|
-
|
|
4679
|
+
}
|
|
4680
|
+
case 6: {
|
|
4376
4681
|
if (tag !== 48) {
|
|
4377
4682
|
break;
|
|
4378
4683
|
}
|
|
4379
4684
|
|
|
4380
4685
|
message.accountId = reader.uint32();
|
|
4381
4686
|
continue;
|
|
4687
|
+
}
|
|
4382
4688
|
}
|
|
4383
4689
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4384
4690
|
break;
|
|
@@ -4449,13 +4755,14 @@ export const Receipt_CreateSessionResult: MessageFns<Receipt_CreateSessionResult
|
|
|
4449
4755
|
while (reader.pos < end) {
|
|
4450
4756
|
const tag = reader.uint32();
|
|
4451
4757
|
switch (tag >>> 3) {
|
|
4452
|
-
case 1:
|
|
4758
|
+
case 1: {
|
|
4453
4759
|
if (tag !== 8) {
|
|
4454
4760
|
break;
|
|
4455
4761
|
}
|
|
4456
4762
|
|
|
4457
4763
|
message.sessionId = reader.uint64() as bigint;
|
|
4458
4764
|
continue;
|
|
4765
|
+
}
|
|
4459
4766
|
}
|
|
4460
4767
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4461
4768
|
break;
|
|
@@ -4488,7 +4795,7 @@ export const Receipt_CreateSessionResult: MessageFns<Receipt_CreateSessionResult
|
|
|
4488
4795
|
};
|
|
4489
4796
|
|
|
4490
4797
|
function createBaseReceipt_PlaceOrderResult(): Receipt_PlaceOrderResult {
|
|
4491
|
-
return { posted: undefined, fills: [] };
|
|
4798
|
+
return { posted: undefined, fills: [], clientOrderId: undefined };
|
|
4492
4799
|
}
|
|
4493
4800
|
|
|
4494
4801
|
export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
@@ -4499,6 +4806,12 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4499
4806
|
for (const v of message.fills) {
|
|
4500
4807
|
Receipt_Trade.encode(v!, writer.uint32(18).fork()).join();
|
|
4501
4808
|
}
|
|
4809
|
+
if (message.clientOrderId !== undefined) {
|
|
4810
|
+
if (BigInt.asUintN(64, message.clientOrderId) !== message.clientOrderId) {
|
|
4811
|
+
throw new globalThis.Error("value provided for field message.clientOrderId of type uint64 too large");
|
|
4812
|
+
}
|
|
4813
|
+
writer.uint32(24).uint64(message.clientOrderId);
|
|
4814
|
+
}
|
|
4502
4815
|
return writer;
|
|
4503
4816
|
},
|
|
4504
4817
|
|
|
@@ -4509,20 +4822,30 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4509
4822
|
while (reader.pos < end) {
|
|
4510
4823
|
const tag = reader.uint32();
|
|
4511
4824
|
switch (tag >>> 3) {
|
|
4512
|
-
case 1:
|
|
4825
|
+
case 1: {
|
|
4513
4826
|
if (tag !== 10) {
|
|
4514
4827
|
break;
|
|
4515
4828
|
}
|
|
4516
4829
|
|
|
4517
4830
|
message.posted = Receipt_Posted.decode(reader, reader.uint32());
|
|
4518
4831
|
continue;
|
|
4519
|
-
|
|
4832
|
+
}
|
|
4833
|
+
case 2: {
|
|
4520
4834
|
if (tag !== 18) {
|
|
4521
4835
|
break;
|
|
4522
4836
|
}
|
|
4523
4837
|
|
|
4524
4838
|
message.fills.push(Receipt_Trade.decode(reader, reader.uint32()));
|
|
4525
4839
|
continue;
|
|
4840
|
+
}
|
|
4841
|
+
case 3: {
|
|
4842
|
+
if (tag !== 24) {
|
|
4843
|
+
break;
|
|
4844
|
+
}
|
|
4845
|
+
|
|
4846
|
+
message.clientOrderId = reader.uint64() as bigint;
|
|
4847
|
+
continue;
|
|
4848
|
+
}
|
|
4526
4849
|
}
|
|
4527
4850
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4528
4851
|
break;
|
|
@@ -4536,6 +4859,7 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4536
4859
|
return {
|
|
4537
4860
|
posted: isSet(object.posted) ? Receipt_Posted.fromJSON(object.posted) : undefined,
|
|
4538
4861
|
fills: globalThis.Array.isArray(object?.fills) ? object.fills.map((e: any) => Receipt_Trade.fromJSON(e)) : [],
|
|
4862
|
+
clientOrderId: isSet(object.clientOrderId) ? BigInt(object.clientOrderId) : undefined,
|
|
4539
4863
|
};
|
|
4540
4864
|
},
|
|
4541
4865
|
|
|
@@ -4547,6 +4871,9 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4547
4871
|
if (message.fills?.length) {
|
|
4548
4872
|
obj.fills = message.fills.map((e) => Receipt_Trade.toJSON(e));
|
|
4549
4873
|
}
|
|
4874
|
+
if (message.clientOrderId !== undefined) {
|
|
4875
|
+
obj.clientOrderId = message.clientOrderId.toString();
|
|
4876
|
+
}
|
|
4550
4877
|
return obj;
|
|
4551
4878
|
},
|
|
4552
4879
|
|
|
@@ -4559,6 +4886,7 @@ export const Receipt_PlaceOrderResult: MessageFns<Receipt_PlaceOrderResult> = {
|
|
|
4559
4886
|
? Receipt_Posted.fromPartial(object.posted)
|
|
4560
4887
|
: undefined;
|
|
4561
4888
|
message.fills = object.fills?.map((e) => Receipt_Trade.fromPartial(e)) || [];
|
|
4889
|
+
message.clientOrderId = object.clientOrderId ?? undefined;
|
|
4562
4890
|
return message;
|
|
4563
4891
|
},
|
|
4564
4892
|
};
|
|
@@ -4588,20 +4916,22 @@ export const Receipt_CancelOrderResult: MessageFns<Receipt_CancelOrderResult> =
|
|
|
4588
4916
|
while (reader.pos < end) {
|
|
4589
4917
|
const tag = reader.uint32();
|
|
4590
4918
|
switch (tag >>> 3) {
|
|
4591
|
-
case 1:
|
|
4919
|
+
case 1: {
|
|
4592
4920
|
if (tag !== 8) {
|
|
4593
4921
|
break;
|
|
4594
4922
|
}
|
|
4595
4923
|
|
|
4596
4924
|
message.orderId = reader.uint64() as bigint;
|
|
4597
4925
|
continue;
|
|
4598
|
-
|
|
4926
|
+
}
|
|
4927
|
+
case 2: {
|
|
4599
4928
|
if (tag !== 16) {
|
|
4600
4929
|
break;
|
|
4601
4930
|
}
|
|
4602
4931
|
|
|
4603
4932
|
message.accountId = reader.uint32();
|
|
4604
4933
|
continue;
|
|
4934
|
+
}
|
|
4605
4935
|
}
|
|
4606
4936
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4607
4937
|
break;
|
|
@@ -4674,41 +5004,46 @@ export const Receipt_DepositResult: MessageFns<Receipt_DepositResult> = {
|
|
|
4674
5004
|
while (reader.pos < end) {
|
|
4675
5005
|
const tag = reader.uint32();
|
|
4676
5006
|
switch (tag >>> 3) {
|
|
4677
|
-
case 1:
|
|
5007
|
+
case 1: {
|
|
4678
5008
|
if (tag !== 8) {
|
|
4679
5009
|
break;
|
|
4680
5010
|
}
|
|
4681
5011
|
|
|
4682
5012
|
message.tokenId = reader.uint32();
|
|
4683
5013
|
continue;
|
|
4684
|
-
|
|
5014
|
+
}
|
|
5015
|
+
case 2: {
|
|
4685
5016
|
if (tag !== 16) {
|
|
4686
5017
|
break;
|
|
4687
5018
|
}
|
|
4688
5019
|
|
|
4689
5020
|
message.amount = reader.uint64() as bigint;
|
|
4690
5021
|
continue;
|
|
4691
|
-
|
|
5022
|
+
}
|
|
5023
|
+
case 3: {
|
|
4692
5024
|
if (tag !== 24) {
|
|
4693
5025
|
break;
|
|
4694
5026
|
}
|
|
4695
5027
|
|
|
4696
5028
|
message.accountId = reader.uint32();
|
|
4697
5029
|
continue;
|
|
4698
|
-
|
|
5030
|
+
}
|
|
5031
|
+
case 4: {
|
|
4699
5032
|
if (tag !== 32) {
|
|
4700
5033
|
break;
|
|
4701
5034
|
}
|
|
4702
5035
|
|
|
4703
5036
|
message.userCreated = reader.bool();
|
|
4704
5037
|
continue;
|
|
4705
|
-
|
|
5038
|
+
}
|
|
5039
|
+
case 5: {
|
|
4706
5040
|
if (tag !== 42) {
|
|
4707
5041
|
break;
|
|
4708
5042
|
}
|
|
4709
5043
|
|
|
4710
5044
|
message.userPubkey = reader.bytes();
|
|
4711
5045
|
continue;
|
|
5046
|
+
}
|
|
4712
5047
|
}
|
|
4713
5048
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4714
5049
|
break;
|
|
@@ -4784,20 +5119,22 @@ export const Receipt_InsertTokenResult: MessageFns<Receipt_InsertTokenResult> =
|
|
|
4784
5119
|
while (reader.pos < end) {
|
|
4785
5120
|
const tag = reader.uint32();
|
|
4786
5121
|
switch (tag >>> 3) {
|
|
4787
|
-
case 1:
|
|
5122
|
+
case 1: {
|
|
4788
5123
|
if (tag !== 10) {
|
|
4789
5124
|
break;
|
|
4790
5125
|
}
|
|
4791
5126
|
|
|
4792
5127
|
message.chainAddr = reader.bytes();
|
|
4793
5128
|
continue;
|
|
4794
|
-
|
|
5129
|
+
}
|
|
5130
|
+
case 2: {
|
|
4795
5131
|
if (tag !== 18) {
|
|
4796
5132
|
break;
|
|
4797
5133
|
}
|
|
4798
5134
|
|
|
4799
5135
|
message.token = Token.decode(reader, reader.uint32());
|
|
4800
5136
|
continue;
|
|
5137
|
+
}
|
|
4801
5138
|
}
|
|
4802
5139
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4803
5140
|
break;
|
|
@@ -4855,13 +5192,14 @@ export const Receipt_InsertMarketResult: MessageFns<Receipt_InsertMarketResult>
|
|
|
4855
5192
|
while (reader.pos < end) {
|
|
4856
5193
|
const tag = reader.uint32();
|
|
4857
5194
|
switch (tag >>> 3) {
|
|
4858
|
-
case 1:
|
|
5195
|
+
case 1: {
|
|
4859
5196
|
if (tag !== 10) {
|
|
4860
5197
|
break;
|
|
4861
5198
|
}
|
|
4862
5199
|
|
|
4863
5200
|
message.market = Market.decode(reader, reader.uint32());
|
|
4864
5201
|
continue;
|
|
5202
|
+
}
|
|
4865
5203
|
}
|
|
4866
5204
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4867
5205
|
break;
|
|
@@ -4932,41 +5270,46 @@ export const Receipt_WithdrawResult: MessageFns<Receipt_WithdrawResult> = {
|
|
|
4932
5270
|
while (reader.pos < end) {
|
|
4933
5271
|
const tag = reader.uint32();
|
|
4934
5272
|
switch (tag >>> 3) {
|
|
4935
|
-
case 1:
|
|
5273
|
+
case 1: {
|
|
4936
5274
|
if (tag !== 8) {
|
|
4937
5275
|
break;
|
|
4938
5276
|
}
|
|
4939
5277
|
|
|
4940
5278
|
message.tokenId = reader.uint32();
|
|
4941
5279
|
continue;
|
|
4942
|
-
|
|
5280
|
+
}
|
|
5281
|
+
case 2: {
|
|
4943
5282
|
if (tag !== 16) {
|
|
4944
5283
|
break;
|
|
4945
5284
|
}
|
|
4946
5285
|
|
|
4947
5286
|
message.amount = reader.uint64() as bigint;
|
|
4948
5287
|
continue;
|
|
4949
|
-
|
|
5288
|
+
}
|
|
5289
|
+
case 3: {
|
|
4950
5290
|
if (tag !== 24) {
|
|
4951
5291
|
break;
|
|
4952
5292
|
}
|
|
4953
5293
|
|
|
4954
5294
|
message.balance = reader.uint64() as bigint;
|
|
4955
5295
|
continue;
|
|
4956
|
-
|
|
5296
|
+
}
|
|
5297
|
+
case 4: {
|
|
4957
5298
|
if (tag !== 32) {
|
|
4958
5299
|
break;
|
|
4959
5300
|
}
|
|
4960
5301
|
|
|
4961
5302
|
message.accountId = reader.uint32();
|
|
4962
5303
|
continue;
|
|
4963
|
-
|
|
5304
|
+
}
|
|
5305
|
+
case 5: {
|
|
4964
5306
|
if (tag !== 42) {
|
|
4965
5307
|
break;
|
|
4966
5308
|
}
|
|
4967
5309
|
|
|
4968
5310
|
message.userPubkey = reader.bytes();
|
|
4969
5311
|
continue;
|
|
5312
|
+
}
|
|
4970
5313
|
}
|
|
4971
5314
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4972
5315
|
break;
|
|
@@ -5042,20 +5385,22 @@ export const Receipt_OracleSymbolFeedResult: MessageFns<Receipt_OracleSymbolFeed
|
|
|
5042
5385
|
while (reader.pos < end) {
|
|
5043
5386
|
const tag = reader.uint32();
|
|
5044
5387
|
switch (tag >>> 3) {
|
|
5045
|
-
case 1:
|
|
5388
|
+
case 1: {
|
|
5046
5389
|
if (tag !== 10) {
|
|
5047
5390
|
break;
|
|
5048
5391
|
}
|
|
5049
5392
|
|
|
5050
5393
|
message.oracleSymbol = reader.string();
|
|
5051
5394
|
continue;
|
|
5052
|
-
|
|
5395
|
+
}
|
|
5396
|
+
case 2: {
|
|
5053
5397
|
if (tag !== 18) {
|
|
5054
5398
|
break;
|
|
5055
5399
|
}
|
|
5056
5400
|
|
|
5057
5401
|
message.feedId = reader.bytes();
|
|
5058
5402
|
continue;
|
|
5403
|
+
}
|
|
5059
5404
|
}
|
|
5060
5405
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5061
5406
|
break;
|
|
@@ -5118,13 +5463,14 @@ export const Receipt_OracleUpdateResult: MessageFns<Receipt_OracleUpdateResult>
|
|
|
5118
5463
|
while (reader.pos < end) {
|
|
5119
5464
|
const tag = reader.uint32();
|
|
5120
5465
|
switch (tag >>> 3) {
|
|
5121
|
-
case 1:
|
|
5466
|
+
case 1: {
|
|
5122
5467
|
if (tag !== 8) {
|
|
5123
5468
|
break;
|
|
5124
5469
|
}
|
|
5125
5470
|
|
|
5126
5471
|
message.timestamp = reader.int64() as bigint;
|
|
5127
5472
|
continue;
|
|
5473
|
+
}
|
|
5128
5474
|
}
|
|
5129
5475
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5130
5476
|
break;
|
|
@@ -5178,20 +5524,22 @@ export const Receipt_UpdateGuardianSetResult: MessageFns<Receipt_UpdateGuardianS
|
|
|
5178
5524
|
while (reader.pos < end) {
|
|
5179
5525
|
const tag = reader.uint32();
|
|
5180
5526
|
switch (tag >>> 3) {
|
|
5181
|
-
case 1:
|
|
5527
|
+
case 1: {
|
|
5182
5528
|
if (tag !== 8) {
|
|
5183
5529
|
break;
|
|
5184
5530
|
}
|
|
5185
5531
|
|
|
5186
5532
|
message.guardianSetIndex = reader.uint32();
|
|
5187
5533
|
continue;
|
|
5188
|
-
|
|
5534
|
+
}
|
|
5535
|
+
case 2: {
|
|
5189
5536
|
if (tag !== 18) {
|
|
5190
5537
|
break;
|
|
5191
5538
|
}
|
|
5192
5539
|
|
|
5193
5540
|
message.addresses.push(reader.bytes());
|
|
5194
5541
|
continue;
|
|
5542
|
+
}
|
|
5195
5543
|
}
|
|
5196
5544
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5197
5545
|
break;
|
|
@@ -5234,22 +5582,61 @@ export const Receipt_UpdateGuardianSetResult: MessageFns<Receipt_UpdateGuardianS
|
|
|
5234
5582
|
},
|
|
5235
5583
|
};
|
|
5236
5584
|
|
|
5237
|
-
function
|
|
5238
|
-
return {};
|
|
5585
|
+
function createBaseReceipt_PerpPosition(): Receipt_PerpPosition {
|
|
5586
|
+
return { marketId: 0, baseSize: 0n, price: 0n };
|
|
5239
5587
|
}
|
|
5240
5588
|
|
|
5241
|
-
export const
|
|
5242
|
-
encode(
|
|
5589
|
+
export const Receipt_PerpPosition: MessageFns<Receipt_PerpPosition> = {
|
|
5590
|
+
encode(message: Receipt_PerpPosition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
5591
|
+
if (message.marketId !== 0) {
|
|
5592
|
+
writer.uint32(8).uint32(message.marketId);
|
|
5593
|
+
}
|
|
5594
|
+
if (message.baseSize !== 0n) {
|
|
5595
|
+
if (BigInt.asIntN(64, message.baseSize) !== message.baseSize) {
|
|
5596
|
+
throw new globalThis.Error("value provided for field message.baseSize of type int64 too large");
|
|
5597
|
+
}
|
|
5598
|
+
writer.uint32(16).int64(message.baseSize);
|
|
5599
|
+
}
|
|
5600
|
+
if (message.price !== 0n) {
|
|
5601
|
+
if (BigInt.asUintN(64, message.price) !== message.price) {
|
|
5602
|
+
throw new globalThis.Error("value provided for field message.price of type uint64 too large");
|
|
5603
|
+
}
|
|
5604
|
+
writer.uint32(24).uint64(message.price);
|
|
5605
|
+
}
|
|
5243
5606
|
return writer;
|
|
5244
5607
|
},
|
|
5245
5608
|
|
|
5246
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
5609
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Receipt_PerpPosition {
|
|
5247
5610
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5248
5611
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5249
|
-
const message =
|
|
5612
|
+
const message = createBaseReceipt_PerpPosition();
|
|
5250
5613
|
while (reader.pos < end) {
|
|
5251
5614
|
const tag = reader.uint32();
|
|
5252
5615
|
switch (tag >>> 3) {
|
|
5616
|
+
case 1: {
|
|
5617
|
+
if (tag !== 8) {
|
|
5618
|
+
break;
|
|
5619
|
+
}
|
|
5620
|
+
|
|
5621
|
+
message.marketId = reader.uint32();
|
|
5622
|
+
continue;
|
|
5623
|
+
}
|
|
5624
|
+
case 2: {
|
|
5625
|
+
if (tag !== 16) {
|
|
5626
|
+
break;
|
|
5627
|
+
}
|
|
5628
|
+
|
|
5629
|
+
message.baseSize = reader.int64() as bigint;
|
|
5630
|
+
continue;
|
|
5631
|
+
}
|
|
5632
|
+
case 3: {
|
|
5633
|
+
if (tag !== 24) {
|
|
5634
|
+
break;
|
|
5635
|
+
}
|
|
5636
|
+
|
|
5637
|
+
message.price = reader.uint64() as bigint;
|
|
5638
|
+
continue;
|
|
5639
|
+
}
|
|
5253
5640
|
}
|
|
5254
5641
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5255
5642
|
break;
|
|
@@ -5259,20 +5646,163 @@ export const Receipt_Liquidated: MessageFns<Receipt_Liquidated> = {
|
|
|
5259
5646
|
return message;
|
|
5260
5647
|
},
|
|
5261
5648
|
|
|
5262
|
-
fromJSON(
|
|
5263
|
-
return {
|
|
5649
|
+
fromJSON(object: any): Receipt_PerpPosition {
|
|
5650
|
+
return {
|
|
5651
|
+
marketId: isSet(object.marketId) ? globalThis.Number(object.marketId) : 0,
|
|
5652
|
+
baseSize: isSet(object.baseSize) ? BigInt(object.baseSize) : 0n,
|
|
5653
|
+
price: isSet(object.price) ? BigInt(object.price) : 0n,
|
|
5654
|
+
};
|
|
5655
|
+
},
|
|
5656
|
+
|
|
5657
|
+
toJSON(message: Receipt_PerpPosition): unknown {
|
|
5658
|
+
const obj: any = {};
|
|
5659
|
+
if (message.marketId !== 0) {
|
|
5660
|
+
obj.marketId = Math.round(message.marketId);
|
|
5661
|
+
}
|
|
5662
|
+
if (message.baseSize !== 0n) {
|
|
5663
|
+
obj.baseSize = message.baseSize.toString();
|
|
5664
|
+
}
|
|
5665
|
+
if (message.price !== 0n) {
|
|
5666
|
+
obj.price = message.price.toString();
|
|
5667
|
+
}
|
|
5668
|
+
return obj;
|
|
5669
|
+
},
|
|
5670
|
+
|
|
5671
|
+
create<I extends Exact<DeepPartial<Receipt_PerpPosition>, I>>(base?: I): Receipt_PerpPosition {
|
|
5672
|
+
return Receipt_PerpPosition.fromPartial(base ?? ({} as any));
|
|
5673
|
+
},
|
|
5674
|
+
fromPartial<I extends Exact<DeepPartial<Receipt_PerpPosition>, I>>(object: I): Receipt_PerpPosition {
|
|
5675
|
+
const message = createBaseReceipt_PerpPosition();
|
|
5676
|
+
message.marketId = object.marketId ?? 0;
|
|
5677
|
+
message.baseSize = object.baseSize ?? 0n;
|
|
5678
|
+
message.price = object.price ?? 0n;
|
|
5679
|
+
return message;
|
|
5264
5680
|
},
|
|
5681
|
+
};
|
|
5682
|
+
|
|
5683
|
+
function createBaseReceipt_AccountLiquidated(): Receipt_AccountLiquidated {
|
|
5684
|
+
return { liquidatorAccountId: 0, liquidateeAccountId: 0, cancelledOrders: [], removedPerps: [] };
|
|
5685
|
+
}
|
|
5686
|
+
|
|
5687
|
+
export const Receipt_AccountLiquidated: MessageFns<Receipt_AccountLiquidated> = {
|
|
5688
|
+
encode(message: Receipt_AccountLiquidated, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
5689
|
+
if (message.liquidatorAccountId !== 0) {
|
|
5690
|
+
writer.uint32(8).uint32(message.liquidatorAccountId);
|
|
5691
|
+
}
|
|
5692
|
+
if (message.liquidateeAccountId !== 0) {
|
|
5693
|
+
writer.uint32(16).uint32(message.liquidateeAccountId);
|
|
5694
|
+
}
|
|
5695
|
+
writer.uint32(26).fork();
|
|
5696
|
+
for (const v of message.cancelledOrders) {
|
|
5697
|
+
if (BigInt.asUintN(64, v) !== v) {
|
|
5698
|
+
throw new globalThis.Error("a value provided in array field cancelledOrders of type uint64 is too large");
|
|
5699
|
+
}
|
|
5700
|
+
writer.uint64(v);
|
|
5701
|
+
}
|
|
5702
|
+
writer.join();
|
|
5703
|
+
for (const v of message.removedPerps) {
|
|
5704
|
+
Receipt_PerpPosition.encode(v!, writer.uint32(34).fork()).join();
|
|
5705
|
+
}
|
|
5706
|
+
return writer;
|
|
5707
|
+
},
|
|
5708
|
+
|
|
5709
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Receipt_AccountLiquidated {
|
|
5710
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5711
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5712
|
+
const message = createBaseReceipt_AccountLiquidated();
|
|
5713
|
+
while (reader.pos < end) {
|
|
5714
|
+
const tag = reader.uint32();
|
|
5715
|
+
switch (tag >>> 3) {
|
|
5716
|
+
case 1: {
|
|
5717
|
+
if (tag !== 8) {
|
|
5718
|
+
break;
|
|
5719
|
+
}
|
|
5720
|
+
|
|
5721
|
+
message.liquidatorAccountId = reader.uint32();
|
|
5722
|
+
continue;
|
|
5723
|
+
}
|
|
5724
|
+
case 2: {
|
|
5725
|
+
if (tag !== 16) {
|
|
5726
|
+
break;
|
|
5727
|
+
}
|
|
5265
5728
|
|
|
5266
|
-
|
|
5729
|
+
message.liquidateeAccountId = reader.uint32();
|
|
5730
|
+
continue;
|
|
5731
|
+
}
|
|
5732
|
+
case 3: {
|
|
5733
|
+
if (tag === 24) {
|
|
5734
|
+
message.cancelledOrders.push(reader.uint64() as bigint);
|
|
5735
|
+
|
|
5736
|
+
continue;
|
|
5737
|
+
}
|
|
5738
|
+
|
|
5739
|
+
if (tag === 26) {
|
|
5740
|
+
const end2 = reader.uint32() + reader.pos;
|
|
5741
|
+
while (reader.pos < end2) {
|
|
5742
|
+
message.cancelledOrders.push(reader.uint64() as bigint);
|
|
5743
|
+
}
|
|
5744
|
+
|
|
5745
|
+
continue;
|
|
5746
|
+
}
|
|
5747
|
+
|
|
5748
|
+
break;
|
|
5749
|
+
}
|
|
5750
|
+
case 4: {
|
|
5751
|
+
if (tag !== 34) {
|
|
5752
|
+
break;
|
|
5753
|
+
}
|
|
5754
|
+
|
|
5755
|
+
message.removedPerps.push(Receipt_PerpPosition.decode(reader, reader.uint32()));
|
|
5756
|
+
continue;
|
|
5757
|
+
}
|
|
5758
|
+
}
|
|
5759
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5760
|
+
break;
|
|
5761
|
+
}
|
|
5762
|
+
reader.skip(tag & 7);
|
|
5763
|
+
}
|
|
5764
|
+
return message;
|
|
5765
|
+
},
|
|
5766
|
+
|
|
5767
|
+
fromJSON(object: any): Receipt_AccountLiquidated {
|
|
5768
|
+
return {
|
|
5769
|
+
liquidatorAccountId: isSet(object.liquidatorAccountId) ? globalThis.Number(object.liquidatorAccountId) : 0,
|
|
5770
|
+
liquidateeAccountId: isSet(object.liquidateeAccountId) ? globalThis.Number(object.liquidateeAccountId) : 0,
|
|
5771
|
+
cancelledOrders: globalThis.Array.isArray(object?.cancelledOrders)
|
|
5772
|
+
? object.cancelledOrders.map((e: any) => BigInt(e))
|
|
5773
|
+
: [],
|
|
5774
|
+
removedPerps: globalThis.Array.isArray(object?.removedPerps)
|
|
5775
|
+
? object.removedPerps.map((e: any) => Receipt_PerpPosition.fromJSON(e))
|
|
5776
|
+
: [],
|
|
5777
|
+
};
|
|
5778
|
+
},
|
|
5779
|
+
|
|
5780
|
+
toJSON(message: Receipt_AccountLiquidated): unknown {
|
|
5267
5781
|
const obj: any = {};
|
|
5782
|
+
if (message.liquidatorAccountId !== 0) {
|
|
5783
|
+
obj.liquidatorAccountId = Math.round(message.liquidatorAccountId);
|
|
5784
|
+
}
|
|
5785
|
+
if (message.liquidateeAccountId !== 0) {
|
|
5786
|
+
obj.liquidateeAccountId = Math.round(message.liquidateeAccountId);
|
|
5787
|
+
}
|
|
5788
|
+
if (message.cancelledOrders?.length) {
|
|
5789
|
+
obj.cancelledOrders = message.cancelledOrders.map((e) => e.toString());
|
|
5790
|
+
}
|
|
5791
|
+
if (message.removedPerps?.length) {
|
|
5792
|
+
obj.removedPerps = message.removedPerps.map((e) => Receipt_PerpPosition.toJSON(e));
|
|
5793
|
+
}
|
|
5268
5794
|
return obj;
|
|
5269
5795
|
},
|
|
5270
5796
|
|
|
5271
|
-
create<I extends Exact<DeepPartial<
|
|
5272
|
-
return
|
|
5797
|
+
create<I extends Exact<DeepPartial<Receipt_AccountLiquidated>, I>>(base?: I): Receipt_AccountLiquidated {
|
|
5798
|
+
return Receipt_AccountLiquidated.fromPartial(base ?? ({} as any));
|
|
5273
5799
|
},
|
|
5274
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
5275
|
-
const message =
|
|
5800
|
+
fromPartial<I extends Exact<DeepPartial<Receipt_AccountLiquidated>, I>>(object: I): Receipt_AccountLiquidated {
|
|
5801
|
+
const message = createBaseReceipt_AccountLiquidated();
|
|
5802
|
+
message.liquidatorAccountId = object.liquidatorAccountId ?? 0;
|
|
5803
|
+
message.liquidateeAccountId = object.liquidateeAccountId ?? 0;
|
|
5804
|
+
message.cancelledOrders = object.cancelledOrders?.map((e) => e) || [];
|
|
5805
|
+
message.removedPerps = object.removedPerps?.map((e) => Receipt_PerpPosition.fromPartial(e)) || [];
|
|
5276
5806
|
return message;
|
|
5277
5807
|
},
|
|
5278
5808
|
};
|
|
@@ -5407,7 +5937,14 @@ export const Receipt_Unpaused: MessageFns<Receipt_Unpaused> = {
|
|
|
5407
5937
|
};
|
|
5408
5938
|
|
|
5409
5939
|
function createBaseReceipt_Transferred(): Receipt_Transferred {
|
|
5410
|
-
return {
|
|
5940
|
+
return {
|
|
5941
|
+
fromAccountId: 0,
|
|
5942
|
+
toUserAccount: undefined,
|
|
5943
|
+
tokenId: 0,
|
|
5944
|
+
amount: 0n,
|
|
5945
|
+
accountCreated: false,
|
|
5946
|
+
toSpecialAccount: undefined,
|
|
5947
|
+
};
|
|
5411
5948
|
}
|
|
5412
5949
|
|
|
5413
5950
|
export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
@@ -5415,8 +5952,8 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5415
5952
|
if (message.fromAccountId !== 0) {
|
|
5416
5953
|
writer.uint32(8).uint32(message.fromAccountId);
|
|
5417
5954
|
}
|
|
5418
|
-
if (message.
|
|
5419
|
-
writer.uint32(16).uint32(message.
|
|
5955
|
+
if (message.toUserAccount !== undefined) {
|
|
5956
|
+
writer.uint32(16).uint32(message.toUserAccount);
|
|
5420
5957
|
}
|
|
5421
5958
|
if (message.tokenId !== 0) {
|
|
5422
5959
|
writer.uint32(24).uint32(message.tokenId);
|
|
@@ -5430,6 +5967,9 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5430
5967
|
if (message.accountCreated !== false) {
|
|
5431
5968
|
writer.uint32(40).bool(message.accountCreated);
|
|
5432
5969
|
}
|
|
5970
|
+
if (message.toSpecialAccount !== undefined) {
|
|
5971
|
+
writer.uint32(48).int32(message.toSpecialAccount);
|
|
5972
|
+
}
|
|
5433
5973
|
return writer;
|
|
5434
5974
|
},
|
|
5435
5975
|
|
|
@@ -5440,41 +5980,54 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5440
5980
|
while (reader.pos < end) {
|
|
5441
5981
|
const tag = reader.uint32();
|
|
5442
5982
|
switch (tag >>> 3) {
|
|
5443
|
-
case 1:
|
|
5983
|
+
case 1: {
|
|
5444
5984
|
if (tag !== 8) {
|
|
5445
5985
|
break;
|
|
5446
5986
|
}
|
|
5447
5987
|
|
|
5448
5988
|
message.fromAccountId = reader.uint32();
|
|
5449
5989
|
continue;
|
|
5450
|
-
|
|
5990
|
+
}
|
|
5991
|
+
case 2: {
|
|
5451
5992
|
if (tag !== 16) {
|
|
5452
5993
|
break;
|
|
5453
5994
|
}
|
|
5454
5995
|
|
|
5455
|
-
message.
|
|
5996
|
+
message.toUserAccount = reader.uint32();
|
|
5456
5997
|
continue;
|
|
5457
|
-
|
|
5998
|
+
}
|
|
5999
|
+
case 3: {
|
|
5458
6000
|
if (tag !== 24) {
|
|
5459
6001
|
break;
|
|
5460
6002
|
}
|
|
5461
6003
|
|
|
5462
6004
|
message.tokenId = reader.uint32();
|
|
5463
6005
|
continue;
|
|
5464
|
-
|
|
6006
|
+
}
|
|
6007
|
+
case 4: {
|
|
5465
6008
|
if (tag !== 32) {
|
|
5466
6009
|
break;
|
|
5467
6010
|
}
|
|
5468
6011
|
|
|
5469
6012
|
message.amount = reader.uint64() as bigint;
|
|
5470
6013
|
continue;
|
|
5471
|
-
|
|
6014
|
+
}
|
|
6015
|
+
case 5: {
|
|
5472
6016
|
if (tag !== 40) {
|
|
5473
6017
|
break;
|
|
5474
6018
|
}
|
|
5475
6019
|
|
|
5476
6020
|
message.accountCreated = reader.bool();
|
|
5477
6021
|
continue;
|
|
6022
|
+
}
|
|
6023
|
+
case 6: {
|
|
6024
|
+
if (tag !== 48) {
|
|
6025
|
+
break;
|
|
6026
|
+
}
|
|
6027
|
+
|
|
6028
|
+
message.toSpecialAccount = reader.int32() as any;
|
|
6029
|
+
continue;
|
|
6030
|
+
}
|
|
5478
6031
|
}
|
|
5479
6032
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5480
6033
|
break;
|
|
@@ -5487,10 +6040,11 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5487
6040
|
fromJSON(object: any): Receipt_Transferred {
|
|
5488
6041
|
return {
|
|
5489
6042
|
fromAccountId: isSet(object.fromAccountId) ? globalThis.Number(object.fromAccountId) : 0,
|
|
5490
|
-
|
|
6043
|
+
toUserAccount: isSet(object.toUserAccount) ? globalThis.Number(object.toUserAccount) : undefined,
|
|
5491
6044
|
tokenId: isSet(object.tokenId) ? globalThis.Number(object.tokenId) : 0,
|
|
5492
6045
|
amount: isSet(object.amount) ? BigInt(object.amount) : 0n,
|
|
5493
6046
|
accountCreated: isSet(object.accountCreated) ? globalThis.Boolean(object.accountCreated) : false,
|
|
6047
|
+
toSpecialAccount: isSet(object.toSpecialAccount) ? specialAccountFromJSON(object.toSpecialAccount) : undefined,
|
|
5494
6048
|
};
|
|
5495
6049
|
},
|
|
5496
6050
|
|
|
@@ -5499,8 +6053,8 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5499
6053
|
if (message.fromAccountId !== 0) {
|
|
5500
6054
|
obj.fromAccountId = Math.round(message.fromAccountId);
|
|
5501
6055
|
}
|
|
5502
|
-
if (message.
|
|
5503
|
-
obj.
|
|
6056
|
+
if (message.toUserAccount !== undefined) {
|
|
6057
|
+
obj.toUserAccount = Math.round(message.toUserAccount);
|
|
5504
6058
|
}
|
|
5505
6059
|
if (message.tokenId !== 0) {
|
|
5506
6060
|
obj.tokenId = Math.round(message.tokenId);
|
|
@@ -5511,6 +6065,9 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5511
6065
|
if (message.accountCreated !== false) {
|
|
5512
6066
|
obj.accountCreated = message.accountCreated;
|
|
5513
6067
|
}
|
|
6068
|
+
if (message.toSpecialAccount !== undefined) {
|
|
6069
|
+
obj.toSpecialAccount = specialAccountToJSON(message.toSpecialAccount);
|
|
6070
|
+
}
|
|
5514
6071
|
return obj;
|
|
5515
6072
|
},
|
|
5516
6073
|
|
|
@@ -5520,10 +6077,11 @@ export const Receipt_Transferred: MessageFns<Receipt_Transferred> = {
|
|
|
5520
6077
|
fromPartial<I extends Exact<DeepPartial<Receipt_Transferred>, I>>(object: I): Receipt_Transferred {
|
|
5521
6078
|
const message = createBaseReceipt_Transferred();
|
|
5522
6079
|
message.fromAccountId = object.fromAccountId ?? 0;
|
|
5523
|
-
message.
|
|
6080
|
+
message.toUserAccount = object.toUserAccount ?? undefined;
|
|
5524
6081
|
message.tokenId = object.tokenId ?? 0;
|
|
5525
6082
|
message.amount = object.amount ?? 0n;
|
|
5526
6083
|
message.accountCreated = object.accountCreated ?? false;
|
|
6084
|
+
message.toSpecialAccount = object.toSpecialAccount ?? undefined;
|
|
5527
6085
|
return message;
|
|
5528
6086
|
},
|
|
5529
6087
|
};
|