@zoguxprotocol/proto 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/codegen/cosmos/bundle.ts +126 -126
- package/src/codegen/zogux/bridge/events.ts +12 -6
- package/src/codegen/zogux/bridge/params.ts +6 -4
- package/src/codegen/zogux/bundle.ts +167 -161
- package/src/codegen/zogux/indexer/events/events.ts +59 -4
- package/src/codegen/zogux/indexer/protocol/v1/subaccount.ts +82 -0
- package/src/codegen/zogux/rpc.tx.ts +1 -0
- package/src/codegen/zogux/sending/transfer.ts +570 -0
- package/src/codegen/zogux/sending/tx.rpc.msg.ts +68 -2
- package/src/codegen/zogux/sending/tx.ts +224 -0
- package/src/codegen/zogux/spots/tx.rpc.msg.ts +11 -1
- package/src/codegen/zogux/spots/tx.ts +110 -0
- package/src/codegen/zogux/subaccounts/spot_position.ts +84 -0
- package/src/codegen/zogux/subaccounts/subaccount.ts +39 -2
- package/src/codegen/zogux/subaccounts/tx.rpc.msg.ts +28 -0
- package/src/codegen/zogux/subaccounts/tx.ts +159 -0
|
@@ -84,6 +84,33 @@ export interface IndexerAssetPositionSDKType {
|
|
|
84
84
|
quantums: Uint8Array;
|
|
85
85
|
index: Long;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* IndexerSpotLockedBalance tracks locked funds for pending spot orders for a
|
|
89
|
+
* specific asset. This is used to ensure users have sufficient balance when
|
|
90
|
+
* placing limit orders.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
export interface IndexerSpotLockedBalance {
|
|
94
|
+
/** The Id of the Asset being locked (e.g., USDC = 0, BTC = 1). */
|
|
95
|
+
assetId: number;
|
|
96
|
+
/**
|
|
97
|
+
* Quantums of this asset locked for pending spot orders.
|
|
98
|
+
* For BUY orders: quote asset (e.g., USDC) is locked.
|
|
99
|
+
* For SELL orders: base asset (e.g., BTC) is locked.
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
quantumsLocked: Uint8Array;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* IndexerSpotLockedBalance tracks locked funds for pending spot orders for a
|
|
106
|
+
* specific asset. This is used to ensure users have sufficient balance when
|
|
107
|
+
* placing limit orders.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export interface IndexerSpotLockedBalanceSDKType {
|
|
111
|
+
asset_id: number;
|
|
112
|
+
quantums_locked: Uint8Array;
|
|
113
|
+
}
|
|
87
114
|
|
|
88
115
|
function createBaseIndexerSubaccountId(): IndexerSubaccountId {
|
|
89
116
|
return {
|
|
@@ -278,4 +305,59 @@ export const IndexerAssetPosition = {
|
|
|
278
305
|
return message;
|
|
279
306
|
}
|
|
280
307
|
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
function createBaseIndexerSpotLockedBalance(): IndexerSpotLockedBalance {
|
|
311
|
+
return {
|
|
312
|
+
assetId: 0,
|
|
313
|
+
quantumsLocked: new Uint8Array()
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export const IndexerSpotLockedBalance = {
|
|
318
|
+
encode(message: IndexerSpotLockedBalance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
319
|
+
if (message.assetId !== 0) {
|
|
320
|
+
writer.uint32(8).uint32(message.assetId);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (message.quantumsLocked.length !== 0) {
|
|
324
|
+
writer.uint32(18).bytes(message.quantumsLocked);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return writer;
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): IndexerSpotLockedBalance {
|
|
331
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
332
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
333
|
+
const message = createBaseIndexerSpotLockedBalance();
|
|
334
|
+
|
|
335
|
+
while (reader.pos < end) {
|
|
336
|
+
const tag = reader.uint32();
|
|
337
|
+
|
|
338
|
+
switch (tag >>> 3) {
|
|
339
|
+
case 1:
|
|
340
|
+
message.assetId = reader.uint32();
|
|
341
|
+
break;
|
|
342
|
+
|
|
343
|
+
case 2:
|
|
344
|
+
message.quantumsLocked = reader.bytes();
|
|
345
|
+
break;
|
|
346
|
+
|
|
347
|
+
default:
|
|
348
|
+
reader.skipType(tag & 7);
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return message;
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
fromPartial(object: DeepPartial<IndexerSpotLockedBalance>): IndexerSpotLockedBalance {
|
|
357
|
+
const message = createBaseIndexerSpotLockedBalance();
|
|
358
|
+
message.assetId = object.assetId ?? 0;
|
|
359
|
+
message.quantumsLocked = object.quantumsLocked ?? new Uint8Array();
|
|
360
|
+
return message;
|
|
361
|
+
}
|
|
362
|
+
|
|
281
363
|
};
|
|
@@ -77,6 +77,7 @@ export const createRPCMsgClient = async ({
|
|
|
77
77
|
sending: new (await import("./sending/tx.rpc.msg")).MsgClientImpl(rpc),
|
|
78
78
|
spots: new (await import("./spots/tx.rpc.msg")).MsgClientImpl(rpc),
|
|
79
79
|
stats: new (await import("./stats/tx.rpc.msg")).MsgClientImpl(rpc),
|
|
80
|
+
subaccounts: new (await import("./subaccounts/tx.rpc.msg")).MsgClientImpl(rpc),
|
|
80
81
|
token: new (await import("./token/tx.rpc.msg")).MsgClientImpl(rpc),
|
|
81
82
|
vault: new (await import("./vault/tx.rpc.msg")).MsgClientImpl(rpc),
|
|
82
83
|
vest: new (await import("./vest/tx.rpc.msg")).MsgClientImpl(rpc)
|
|
@@ -25,6 +25,39 @@ export interface TransferSDKType {
|
|
|
25
25
|
asset_id: number;
|
|
26
26
|
amount: Long;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* MsgCreateTransferSpot represents a single transfer of spot assets between two
|
|
30
|
+
* subaccounts.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
export interface MsgCreateTransferSpot {
|
|
34
|
+
/** The sender subaccount owner's wallet address (used as signer). */
|
|
35
|
+
sender: string;
|
|
36
|
+
/** The sender subaccount ID. */
|
|
37
|
+
|
|
38
|
+
senderSubaccountId?: SubaccountId;
|
|
39
|
+
/** The recipient subaccount ID. */
|
|
40
|
+
|
|
41
|
+
recipientSubaccountId?: SubaccountId;
|
|
42
|
+
/** Id of the asset to transfer. */
|
|
43
|
+
|
|
44
|
+
assetId: number;
|
|
45
|
+
/** The number of quantums of asset to transfer. */
|
|
46
|
+
|
|
47
|
+
quantums: Long;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* MsgCreateTransferSpot represents a single transfer of spot assets between two
|
|
51
|
+
* subaccounts.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
export interface MsgCreateTransferSpotSDKType {
|
|
55
|
+
sender: string;
|
|
56
|
+
sender_subaccount_id?: SubaccountIdSDKType;
|
|
57
|
+
recipient_subaccount_id?: SubaccountIdSDKType;
|
|
58
|
+
asset_id: number;
|
|
59
|
+
quantums: Long;
|
|
60
|
+
}
|
|
28
61
|
/**
|
|
29
62
|
* MsgDepositToSubaccount represents a single transfer from an `x/bank`
|
|
30
63
|
* account to an `x/subaccounts` subaccount.
|
|
@@ -118,6 +151,138 @@ export interface MsgSendFromModuleToAccountSDKType {
|
|
|
118
151
|
recipient: string;
|
|
119
152
|
coin?: CoinSDKType;
|
|
120
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* MsgDepositToSpot represents a single transfer from an `x/bank`
|
|
156
|
+
* account to an `x/subaccounts` subaccount's spot balance.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
export interface MsgDepositToSpot {
|
|
160
|
+
/** The sender wallet address. */
|
|
161
|
+
sender: string;
|
|
162
|
+
/** The recipient subaccount ID. */
|
|
163
|
+
|
|
164
|
+
recipient?: SubaccountId;
|
|
165
|
+
/** Id of the asset to transfer. */
|
|
166
|
+
|
|
167
|
+
assetId: number;
|
|
168
|
+
/** The number of quantums of asset to transfer. */
|
|
169
|
+
|
|
170
|
+
quantums: Long;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* MsgDepositToSpot represents a single transfer from an `x/bank`
|
|
174
|
+
* account to an `x/subaccounts` subaccount's spot balance.
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
export interface MsgDepositToSpotSDKType {
|
|
178
|
+
sender: string;
|
|
179
|
+
recipient?: SubaccountIdSDKType;
|
|
180
|
+
asset_id: number;
|
|
181
|
+
quantums: Long;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* MsgWithdrawFromSpot represents a single transfer from an
|
|
185
|
+
* `x/subaccounts` subaccount's spot balance to an `x/bank` account.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
export interface MsgWithdrawFromSpot {
|
|
189
|
+
/** The sender subaccount ID. */
|
|
190
|
+
sender?: SubaccountId;
|
|
191
|
+
/** The recipient wallet address. */
|
|
192
|
+
|
|
193
|
+
recipient: string;
|
|
194
|
+
/** Id of the asset to transfer. */
|
|
195
|
+
|
|
196
|
+
assetId: number;
|
|
197
|
+
/** The number of quantums of asset to transfer. */
|
|
198
|
+
|
|
199
|
+
quantums: Long;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* MsgWithdrawFromSpot represents a single transfer from an
|
|
203
|
+
* `x/subaccounts` subaccount's spot balance to an `x/bank` account.
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
export interface MsgWithdrawFromSpotSDKType {
|
|
207
|
+
sender?: SubaccountIdSDKType;
|
|
208
|
+
recipient: string;
|
|
209
|
+
asset_id: number;
|
|
210
|
+
quantums: Long;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* MsgTransferSpotToPerp represents a transfer from spot balance to
|
|
214
|
+
* perpetual collateral. If sender_subaccount_id and recipient_subaccount_id
|
|
215
|
+
* are the same, it transfers within the same subaccount. Otherwise, it
|
|
216
|
+
* transfers between different subaccounts.
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
export interface MsgTransferSpotToPerp {
|
|
220
|
+
/** The sender subaccount owner's wallet address (used as signer). */
|
|
221
|
+
sender: string;
|
|
222
|
+
/** The sender subaccount ID (spot balance source). */
|
|
223
|
+
|
|
224
|
+
senderSubaccountId?: SubaccountId;
|
|
225
|
+
/** The recipient subaccount ID (perpetual collateral destination). */
|
|
226
|
+
|
|
227
|
+
recipientSubaccountId?: SubaccountId;
|
|
228
|
+
/** Id of the asset to transfer. */
|
|
229
|
+
|
|
230
|
+
assetId: number;
|
|
231
|
+
/** The number of quantums of asset to transfer. */
|
|
232
|
+
|
|
233
|
+
quantums: Long;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* MsgTransferSpotToPerp represents a transfer from spot balance to
|
|
237
|
+
* perpetual collateral. If sender_subaccount_id and recipient_subaccount_id
|
|
238
|
+
* are the same, it transfers within the same subaccount. Otherwise, it
|
|
239
|
+
* transfers between different subaccounts.
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
export interface MsgTransferSpotToPerpSDKType {
|
|
243
|
+
sender: string;
|
|
244
|
+
sender_subaccount_id?: SubaccountIdSDKType;
|
|
245
|
+
recipient_subaccount_id?: SubaccountIdSDKType;
|
|
246
|
+
asset_id: number;
|
|
247
|
+
quantums: Long;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* MsgTransferPerpToSpot represents a transfer from perpetual collateral to
|
|
251
|
+
* spot balance. If sender_subaccount_id and recipient_subaccount_id
|
|
252
|
+
* are the same, it transfers within the same subaccount. Otherwise, it
|
|
253
|
+
* transfers between different subaccounts.
|
|
254
|
+
*/
|
|
255
|
+
|
|
256
|
+
export interface MsgTransferPerpToSpot {
|
|
257
|
+
/** The sender subaccount owner's wallet address (used as signer). */
|
|
258
|
+
sender: string;
|
|
259
|
+
/** The sender subaccount ID (perpetual collateral source). */
|
|
260
|
+
|
|
261
|
+
senderSubaccountId?: SubaccountId;
|
|
262
|
+
/** The recipient subaccount ID (spot balance destination). */
|
|
263
|
+
|
|
264
|
+
recipientSubaccountId?: SubaccountId;
|
|
265
|
+
/** Id of the asset to transfer. */
|
|
266
|
+
|
|
267
|
+
assetId: number;
|
|
268
|
+
/** The number of quantums of asset to transfer. */
|
|
269
|
+
|
|
270
|
+
quantums: Long;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* MsgTransferPerpToSpot represents a transfer from perpetual collateral to
|
|
274
|
+
* spot balance. If sender_subaccount_id and recipient_subaccount_id
|
|
275
|
+
* are the same, it transfers within the same subaccount. Otherwise, it
|
|
276
|
+
* transfers between different subaccounts.
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
export interface MsgTransferPerpToSpotSDKType {
|
|
280
|
+
sender: string;
|
|
281
|
+
sender_subaccount_id?: SubaccountIdSDKType;
|
|
282
|
+
recipient_subaccount_id?: SubaccountIdSDKType;
|
|
283
|
+
asset_id: number;
|
|
284
|
+
quantums: Long;
|
|
285
|
+
}
|
|
121
286
|
|
|
122
287
|
function createBaseTransfer(): Transfer {
|
|
123
288
|
return {
|
|
@@ -194,6 +359,91 @@ export const Transfer = {
|
|
|
194
359
|
|
|
195
360
|
};
|
|
196
361
|
|
|
362
|
+
function createBaseMsgCreateTransferSpot(): MsgCreateTransferSpot {
|
|
363
|
+
return {
|
|
364
|
+
sender: "",
|
|
365
|
+
senderSubaccountId: undefined,
|
|
366
|
+
recipientSubaccountId: undefined,
|
|
367
|
+
assetId: 0,
|
|
368
|
+
quantums: Long.UZERO
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export const MsgCreateTransferSpot = {
|
|
373
|
+
encode(message: MsgCreateTransferSpot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
374
|
+
if (message.sender !== "") {
|
|
375
|
+
writer.uint32(10).string(message.sender);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (message.senderSubaccountId !== undefined) {
|
|
379
|
+
SubaccountId.encode(message.senderSubaccountId, writer.uint32(18).fork()).ldelim();
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
if (message.recipientSubaccountId !== undefined) {
|
|
383
|
+
SubaccountId.encode(message.recipientSubaccountId, writer.uint32(26).fork()).ldelim();
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (message.assetId !== 0) {
|
|
387
|
+
writer.uint32(32).uint32(message.assetId);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (!message.quantums.isZero()) {
|
|
391
|
+
writer.uint32(40).uint64(message.quantums);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
return writer;
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateTransferSpot {
|
|
398
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
399
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
400
|
+
const message = createBaseMsgCreateTransferSpot();
|
|
401
|
+
|
|
402
|
+
while (reader.pos < end) {
|
|
403
|
+
const tag = reader.uint32();
|
|
404
|
+
|
|
405
|
+
switch (tag >>> 3) {
|
|
406
|
+
case 1:
|
|
407
|
+
message.sender = reader.string();
|
|
408
|
+
break;
|
|
409
|
+
|
|
410
|
+
case 2:
|
|
411
|
+
message.senderSubaccountId = SubaccountId.decode(reader, reader.uint32());
|
|
412
|
+
break;
|
|
413
|
+
|
|
414
|
+
case 3:
|
|
415
|
+
message.recipientSubaccountId = SubaccountId.decode(reader, reader.uint32());
|
|
416
|
+
break;
|
|
417
|
+
|
|
418
|
+
case 4:
|
|
419
|
+
message.assetId = reader.uint32();
|
|
420
|
+
break;
|
|
421
|
+
|
|
422
|
+
case 5:
|
|
423
|
+
message.quantums = (reader.uint64() as Long);
|
|
424
|
+
break;
|
|
425
|
+
|
|
426
|
+
default:
|
|
427
|
+
reader.skipType(tag & 7);
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return message;
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
fromPartial(object: DeepPartial<MsgCreateTransferSpot>): MsgCreateTransferSpot {
|
|
436
|
+
const message = createBaseMsgCreateTransferSpot();
|
|
437
|
+
message.sender = object.sender ?? "";
|
|
438
|
+
message.senderSubaccountId = object.senderSubaccountId !== undefined && object.senderSubaccountId !== null ? SubaccountId.fromPartial(object.senderSubaccountId) : undefined;
|
|
439
|
+
message.recipientSubaccountId = object.recipientSubaccountId !== undefined && object.recipientSubaccountId !== null ? SubaccountId.fromPartial(object.recipientSubaccountId) : undefined;
|
|
440
|
+
message.assetId = object.assetId ?? 0;
|
|
441
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
442
|
+
return message;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
};
|
|
446
|
+
|
|
197
447
|
function createBaseMsgDepositToSubaccount(): MsgDepositToSubaccount {
|
|
198
448
|
return {
|
|
199
449
|
sender: "",
|
|
@@ -417,4 +667,324 @@ export const MsgSendFromModuleToAccount = {
|
|
|
417
667
|
return message;
|
|
418
668
|
}
|
|
419
669
|
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
function createBaseMsgDepositToSpot(): MsgDepositToSpot {
|
|
673
|
+
return {
|
|
674
|
+
sender: "",
|
|
675
|
+
recipient: undefined,
|
|
676
|
+
assetId: 0,
|
|
677
|
+
quantums: Long.UZERO
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export const MsgDepositToSpot = {
|
|
682
|
+
encode(message: MsgDepositToSpot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
683
|
+
if (message.sender !== "") {
|
|
684
|
+
writer.uint32(10).string(message.sender);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
if (message.recipient !== undefined) {
|
|
688
|
+
SubaccountId.encode(message.recipient, writer.uint32(18).fork()).ldelim();
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (message.assetId !== 0) {
|
|
692
|
+
writer.uint32(24).uint32(message.assetId);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
if (!message.quantums.isZero()) {
|
|
696
|
+
writer.uint32(32).uint64(message.quantums);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return writer;
|
|
700
|
+
},
|
|
701
|
+
|
|
702
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositToSpot {
|
|
703
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
704
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
705
|
+
const message = createBaseMsgDepositToSpot();
|
|
706
|
+
|
|
707
|
+
while (reader.pos < end) {
|
|
708
|
+
const tag = reader.uint32();
|
|
709
|
+
|
|
710
|
+
switch (tag >>> 3) {
|
|
711
|
+
case 1:
|
|
712
|
+
message.sender = reader.string();
|
|
713
|
+
break;
|
|
714
|
+
|
|
715
|
+
case 2:
|
|
716
|
+
message.recipient = SubaccountId.decode(reader, reader.uint32());
|
|
717
|
+
break;
|
|
718
|
+
|
|
719
|
+
case 3:
|
|
720
|
+
message.assetId = reader.uint32();
|
|
721
|
+
break;
|
|
722
|
+
|
|
723
|
+
case 4:
|
|
724
|
+
message.quantums = (reader.uint64() as Long);
|
|
725
|
+
break;
|
|
726
|
+
|
|
727
|
+
default:
|
|
728
|
+
reader.skipType(tag & 7);
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
return message;
|
|
734
|
+
},
|
|
735
|
+
|
|
736
|
+
fromPartial(object: DeepPartial<MsgDepositToSpot>): MsgDepositToSpot {
|
|
737
|
+
const message = createBaseMsgDepositToSpot();
|
|
738
|
+
message.sender = object.sender ?? "";
|
|
739
|
+
message.recipient = object.recipient !== undefined && object.recipient !== null ? SubaccountId.fromPartial(object.recipient) : undefined;
|
|
740
|
+
message.assetId = object.assetId ?? 0;
|
|
741
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
742
|
+
return message;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
function createBaseMsgWithdrawFromSpot(): MsgWithdrawFromSpot {
|
|
748
|
+
return {
|
|
749
|
+
sender: undefined,
|
|
750
|
+
recipient: "",
|
|
751
|
+
assetId: 0,
|
|
752
|
+
quantums: Long.UZERO
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export const MsgWithdrawFromSpot = {
|
|
757
|
+
encode(message: MsgWithdrawFromSpot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
758
|
+
if (message.sender !== undefined) {
|
|
759
|
+
SubaccountId.encode(message.sender, writer.uint32(18).fork()).ldelim();
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
if (message.recipient !== "") {
|
|
763
|
+
writer.uint32(10).string(message.recipient);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
if (message.assetId !== 0) {
|
|
767
|
+
writer.uint32(24).uint32(message.assetId);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
if (!message.quantums.isZero()) {
|
|
771
|
+
writer.uint32(32).uint64(message.quantums);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
return writer;
|
|
775
|
+
},
|
|
776
|
+
|
|
777
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawFromSpot {
|
|
778
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
779
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
780
|
+
const message = createBaseMsgWithdrawFromSpot();
|
|
781
|
+
|
|
782
|
+
while (reader.pos < end) {
|
|
783
|
+
const tag = reader.uint32();
|
|
784
|
+
|
|
785
|
+
switch (tag >>> 3) {
|
|
786
|
+
case 2:
|
|
787
|
+
message.sender = SubaccountId.decode(reader, reader.uint32());
|
|
788
|
+
break;
|
|
789
|
+
|
|
790
|
+
case 1:
|
|
791
|
+
message.recipient = reader.string();
|
|
792
|
+
break;
|
|
793
|
+
|
|
794
|
+
case 3:
|
|
795
|
+
message.assetId = reader.uint32();
|
|
796
|
+
break;
|
|
797
|
+
|
|
798
|
+
case 4:
|
|
799
|
+
message.quantums = (reader.uint64() as Long);
|
|
800
|
+
break;
|
|
801
|
+
|
|
802
|
+
default:
|
|
803
|
+
reader.skipType(tag & 7);
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
return message;
|
|
809
|
+
},
|
|
810
|
+
|
|
811
|
+
fromPartial(object: DeepPartial<MsgWithdrawFromSpot>): MsgWithdrawFromSpot {
|
|
812
|
+
const message = createBaseMsgWithdrawFromSpot();
|
|
813
|
+
message.sender = object.sender !== undefined && object.sender !== null ? SubaccountId.fromPartial(object.sender) : undefined;
|
|
814
|
+
message.recipient = object.recipient ?? "";
|
|
815
|
+
message.assetId = object.assetId ?? 0;
|
|
816
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
817
|
+
return message;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
function createBaseMsgTransferSpotToPerp(): MsgTransferSpotToPerp {
|
|
823
|
+
return {
|
|
824
|
+
sender: "",
|
|
825
|
+
senderSubaccountId: undefined,
|
|
826
|
+
recipientSubaccountId: undefined,
|
|
827
|
+
assetId: 0,
|
|
828
|
+
quantums: Long.UZERO
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export const MsgTransferSpotToPerp = {
|
|
833
|
+
encode(message: MsgTransferSpotToPerp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
834
|
+
if (message.sender !== "") {
|
|
835
|
+
writer.uint32(10).string(message.sender);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if (message.senderSubaccountId !== undefined) {
|
|
839
|
+
SubaccountId.encode(message.senderSubaccountId, writer.uint32(18).fork()).ldelim();
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
if (message.recipientSubaccountId !== undefined) {
|
|
843
|
+
SubaccountId.encode(message.recipientSubaccountId, writer.uint32(26).fork()).ldelim();
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
if (message.assetId !== 0) {
|
|
847
|
+
writer.uint32(32).uint32(message.assetId);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
if (!message.quantums.isZero()) {
|
|
851
|
+
writer.uint32(40).uint64(message.quantums);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
return writer;
|
|
855
|
+
},
|
|
856
|
+
|
|
857
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferSpotToPerp {
|
|
858
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
859
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
860
|
+
const message = createBaseMsgTransferSpotToPerp();
|
|
861
|
+
|
|
862
|
+
while (reader.pos < end) {
|
|
863
|
+
const tag = reader.uint32();
|
|
864
|
+
|
|
865
|
+
switch (tag >>> 3) {
|
|
866
|
+
case 1:
|
|
867
|
+
message.sender = reader.string();
|
|
868
|
+
break;
|
|
869
|
+
|
|
870
|
+
case 2:
|
|
871
|
+
message.senderSubaccountId = SubaccountId.decode(reader, reader.uint32());
|
|
872
|
+
break;
|
|
873
|
+
|
|
874
|
+
case 3:
|
|
875
|
+
message.recipientSubaccountId = SubaccountId.decode(reader, reader.uint32());
|
|
876
|
+
break;
|
|
877
|
+
|
|
878
|
+
case 4:
|
|
879
|
+
message.assetId = reader.uint32();
|
|
880
|
+
break;
|
|
881
|
+
|
|
882
|
+
case 5:
|
|
883
|
+
message.quantums = (reader.uint64() as Long);
|
|
884
|
+
break;
|
|
885
|
+
|
|
886
|
+
default:
|
|
887
|
+
reader.skipType(tag & 7);
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
return message;
|
|
893
|
+
},
|
|
894
|
+
|
|
895
|
+
fromPartial(object: DeepPartial<MsgTransferSpotToPerp>): MsgTransferSpotToPerp {
|
|
896
|
+
const message = createBaseMsgTransferSpotToPerp();
|
|
897
|
+
message.sender = object.sender ?? "";
|
|
898
|
+
message.senderSubaccountId = object.senderSubaccountId !== undefined && object.senderSubaccountId !== null ? SubaccountId.fromPartial(object.senderSubaccountId) : undefined;
|
|
899
|
+
message.recipientSubaccountId = object.recipientSubaccountId !== undefined && object.recipientSubaccountId !== null ? SubaccountId.fromPartial(object.recipientSubaccountId) : undefined;
|
|
900
|
+
message.assetId = object.assetId ?? 0;
|
|
901
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
902
|
+
return message;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
function createBaseMsgTransferPerpToSpot(): MsgTransferPerpToSpot {
|
|
908
|
+
return {
|
|
909
|
+
sender: "",
|
|
910
|
+
senderSubaccountId: undefined,
|
|
911
|
+
recipientSubaccountId: undefined,
|
|
912
|
+
assetId: 0,
|
|
913
|
+
quantums: Long.UZERO
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
export const MsgTransferPerpToSpot = {
|
|
918
|
+
encode(message: MsgTransferPerpToSpot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
919
|
+
if (message.sender !== "") {
|
|
920
|
+
writer.uint32(10).string(message.sender);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
if (message.senderSubaccountId !== undefined) {
|
|
924
|
+
SubaccountId.encode(message.senderSubaccountId, writer.uint32(18).fork()).ldelim();
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
if (message.recipientSubaccountId !== undefined) {
|
|
928
|
+
SubaccountId.encode(message.recipientSubaccountId, writer.uint32(26).fork()).ldelim();
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
if (message.assetId !== 0) {
|
|
932
|
+
writer.uint32(32).uint32(message.assetId);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
if (!message.quantums.isZero()) {
|
|
936
|
+
writer.uint32(40).uint64(message.quantums);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
return writer;
|
|
940
|
+
},
|
|
941
|
+
|
|
942
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferPerpToSpot {
|
|
943
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
944
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
945
|
+
const message = createBaseMsgTransferPerpToSpot();
|
|
946
|
+
|
|
947
|
+
while (reader.pos < end) {
|
|
948
|
+
const tag = reader.uint32();
|
|
949
|
+
|
|
950
|
+
switch (tag >>> 3) {
|
|
951
|
+
case 1:
|
|
952
|
+
message.sender = reader.string();
|
|
953
|
+
break;
|
|
954
|
+
|
|
955
|
+
case 2:
|
|
956
|
+
message.senderSubaccountId = SubaccountId.decode(reader, reader.uint32());
|
|
957
|
+
break;
|
|
958
|
+
|
|
959
|
+
case 3:
|
|
960
|
+
message.recipientSubaccountId = SubaccountId.decode(reader, reader.uint32());
|
|
961
|
+
break;
|
|
962
|
+
|
|
963
|
+
case 4:
|
|
964
|
+
message.assetId = reader.uint32();
|
|
965
|
+
break;
|
|
966
|
+
|
|
967
|
+
case 5:
|
|
968
|
+
message.quantums = (reader.uint64() as Long);
|
|
969
|
+
break;
|
|
970
|
+
|
|
971
|
+
default:
|
|
972
|
+
reader.skipType(tag & 7);
|
|
973
|
+
break;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
return message;
|
|
978
|
+
},
|
|
979
|
+
|
|
980
|
+
fromPartial(object: DeepPartial<MsgTransferPerpToSpot>): MsgTransferPerpToSpot {
|
|
981
|
+
const message = createBaseMsgTransferPerpToSpot();
|
|
982
|
+
message.sender = object.sender ?? "";
|
|
983
|
+
message.senderSubaccountId = object.senderSubaccountId !== undefined && object.senderSubaccountId !== null ? SubaccountId.fromPartial(object.senderSubaccountId) : undefined;
|
|
984
|
+
message.recipientSubaccountId = object.recipientSubaccountId !== undefined && object.recipientSubaccountId !== null ? SubaccountId.fromPartial(object.recipientSubaccountId) : undefined;
|
|
985
|
+
message.assetId = object.assetId ?? 0;
|
|
986
|
+
message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO;
|
|
987
|
+
return message;
|
|
988
|
+
}
|
|
989
|
+
|
|
420
990
|
};
|