@zoguxprotocol/proto 0.1.2 → 0.1.3
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/zogux/bridge/events.ts +235 -5
- package/src/codegen/zogux/bridge/genesis.ts +16 -2
- package/src/codegen/zogux/bridge/params.ts +27 -31
- package/src/codegen/zogux/bridge/query.lcd.ts +9 -1
- package/src/codegen/zogux/bridge/query.rpc.Query.ts +15 -1
- package/src/codegen/zogux/bridge/query.ts +147 -1
- package/src/codegen/zogux/bridge/tss.ts +282 -3
- package/src/codegen/zogux/bridge/tx.rpc.msg.ts +25 -2
- package/src/codegen/zogux/bridge/withdrawal.ts +54 -2
- package/src/codegen/zogux/indexer/events/events.ts +107 -31
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export interface EventWithdrawalRequested {
|
|
|
14
14
|
/** Destination address on target chain */
|
|
15
15
|
|
|
16
16
|
toAddress: string;
|
|
17
|
-
/** Amount to withdraw */
|
|
17
|
+
/** Amount to withdraw (in EVM decimals after conversion) */
|
|
18
18
|
|
|
19
19
|
amount: string;
|
|
20
20
|
/** Target chain ID */
|
|
@@ -32,6 +32,15 @@ export interface EventWithdrawalRequested {
|
|
|
32
32
|
/** Estimated timeout for signatures */
|
|
33
33
|
|
|
34
34
|
timeoutSeconds: Long;
|
|
35
|
+
/** Token address on EVM chain */
|
|
36
|
+
|
|
37
|
+
tokenAddress: string;
|
|
38
|
+
/** Source chain token decimals (Zogux) */
|
|
39
|
+
|
|
40
|
+
srcDecimals: number;
|
|
41
|
+
/** Destination chain token decimals (EVM) */
|
|
42
|
+
|
|
43
|
+
dstDecimals: number;
|
|
35
44
|
}
|
|
36
45
|
/**
|
|
37
46
|
* EventWithdrawalRequested is emitted when a user requests a withdrawal.
|
|
@@ -48,6 +57,9 @@ export interface EventWithdrawalRequestedSDKType {
|
|
|
48
57
|
nonce: Long;
|
|
49
58
|
block_height: Long;
|
|
50
59
|
timeout_seconds: Long;
|
|
60
|
+
token_address: string;
|
|
61
|
+
src_decimals: number;
|
|
62
|
+
dst_decimals: number;
|
|
51
63
|
}
|
|
52
64
|
/**
|
|
53
65
|
* EventWithdrawalSignatureSubmitted is emitted when a validator submits a
|
|
@@ -74,7 +86,51 @@ export interface EventWithdrawalSignatureSubmittedSDKType {
|
|
|
74
86
|
validator: string;
|
|
75
87
|
block_height: Long;
|
|
76
88
|
}
|
|
77
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* EventWithdrawalSigned is emitted when a withdrawal has collected enough TSS signatures.
|
|
91
|
+
* Signer service should listen to this and submit to EVM.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
export interface EventWithdrawalSigned {
|
|
95
|
+
/** Withdrawal ID */
|
|
96
|
+
withdrawalId: string;
|
|
97
|
+
/** Aggregated TSS signature */
|
|
98
|
+
|
|
99
|
+
signature: Uint8Array;
|
|
100
|
+
/** Block height when signed */
|
|
101
|
+
|
|
102
|
+
blockHeight: Long;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* EventWithdrawalSigned is emitted when a withdrawal has collected enough TSS signatures.
|
|
106
|
+
* Signer service should listen to this and submit to EVM.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
export interface EventWithdrawalSignedSDKType {
|
|
110
|
+
withdrawal_id: string;
|
|
111
|
+
signature: Uint8Array;
|
|
112
|
+
block_height: Long;
|
|
113
|
+
}
|
|
114
|
+
/** EventWithdrawalSubmitted is emitted when signer has submitted the withdrawal to EVM. */
|
|
115
|
+
|
|
116
|
+
export interface EventWithdrawalSubmitted {
|
|
117
|
+
/** Withdrawal ID */
|
|
118
|
+
withdrawalId: string;
|
|
119
|
+
/** EVM transaction hash */
|
|
120
|
+
|
|
121
|
+
txHash: string;
|
|
122
|
+
/** Block height when submitted */
|
|
123
|
+
|
|
124
|
+
blockHeight: Long;
|
|
125
|
+
}
|
|
126
|
+
/** EventWithdrawalSubmitted is emitted when signer has submitted the withdrawal to EVM. */
|
|
127
|
+
|
|
128
|
+
export interface EventWithdrawalSubmittedSDKType {
|
|
129
|
+
withdrawal_id: string;
|
|
130
|
+
tx_hash: string;
|
|
131
|
+
block_height: Long;
|
|
132
|
+
}
|
|
133
|
+
/** EventWithdrawalCompleted is emitted when a withdrawal is confirmed on EVM. */
|
|
78
134
|
|
|
79
135
|
export interface EventWithdrawalCompleted {
|
|
80
136
|
/** Withdrawal ID */
|
|
@@ -85,13 +141,17 @@ export interface EventWithdrawalCompleted {
|
|
|
85
141
|
/** Block height when completed */
|
|
86
142
|
|
|
87
143
|
blockHeight: Long;
|
|
144
|
+
/** EVM transaction hash confirming the withdrawal */
|
|
145
|
+
|
|
146
|
+
evmTxHash: string;
|
|
88
147
|
}
|
|
89
|
-
/** EventWithdrawalCompleted is emitted when a withdrawal is
|
|
148
|
+
/** EventWithdrawalCompleted is emitted when a withdrawal is confirmed on EVM. */
|
|
90
149
|
|
|
91
150
|
export interface EventWithdrawalCompletedSDKType {
|
|
92
151
|
withdrawal_id: string;
|
|
93
152
|
signature: Uint8Array;
|
|
94
153
|
block_height: Long;
|
|
154
|
+
evm_tx_hash: string;
|
|
95
155
|
}
|
|
96
156
|
/** EventWithdrawalCancelled is emitted when a withdrawal is cancelled. */
|
|
97
157
|
|
|
@@ -123,7 +183,10 @@ function createBaseEventWithdrawalRequested(): EventWithdrawalRequested {
|
|
|
123
183
|
denom: "",
|
|
124
184
|
nonce: Long.UZERO,
|
|
125
185
|
blockHeight: Long.UZERO,
|
|
126
|
-
timeoutSeconds: Long.UZERO
|
|
186
|
+
timeoutSeconds: Long.UZERO,
|
|
187
|
+
tokenAddress: "",
|
|
188
|
+
srcDecimals: 0,
|
|
189
|
+
dstDecimals: 0
|
|
127
190
|
};
|
|
128
191
|
}
|
|
129
192
|
|
|
@@ -165,6 +228,18 @@ export const EventWithdrawalRequested = {
|
|
|
165
228
|
writer.uint32(72).uint64(message.timeoutSeconds);
|
|
166
229
|
}
|
|
167
230
|
|
|
231
|
+
if (message.tokenAddress !== "") {
|
|
232
|
+
writer.uint32(82).string(message.tokenAddress);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (message.srcDecimals !== 0) {
|
|
236
|
+
writer.uint32(88).uint32(message.srcDecimals);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (message.dstDecimals !== 0) {
|
|
240
|
+
writer.uint32(96).uint32(message.dstDecimals);
|
|
241
|
+
}
|
|
242
|
+
|
|
168
243
|
return writer;
|
|
169
244
|
},
|
|
170
245
|
|
|
@@ -213,6 +288,18 @@ export const EventWithdrawalRequested = {
|
|
|
213
288
|
message.timeoutSeconds = (reader.uint64() as Long);
|
|
214
289
|
break;
|
|
215
290
|
|
|
291
|
+
case 10:
|
|
292
|
+
message.tokenAddress = reader.string();
|
|
293
|
+
break;
|
|
294
|
+
|
|
295
|
+
case 11:
|
|
296
|
+
message.srcDecimals = reader.uint32();
|
|
297
|
+
break;
|
|
298
|
+
|
|
299
|
+
case 12:
|
|
300
|
+
message.dstDecimals = reader.uint32();
|
|
301
|
+
break;
|
|
302
|
+
|
|
216
303
|
default:
|
|
217
304
|
reader.skipType(tag & 7);
|
|
218
305
|
break;
|
|
@@ -233,6 +320,9 @@ export const EventWithdrawalRequested = {
|
|
|
233
320
|
message.nonce = object.nonce !== undefined && object.nonce !== null ? Long.fromValue(object.nonce) : Long.UZERO;
|
|
234
321
|
message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.UZERO;
|
|
235
322
|
message.timeoutSeconds = object.timeoutSeconds !== undefined && object.timeoutSeconds !== null ? Long.fromValue(object.timeoutSeconds) : Long.UZERO;
|
|
323
|
+
message.tokenAddress = object.tokenAddress ?? "";
|
|
324
|
+
message.srcDecimals = object.srcDecimals ?? 0;
|
|
325
|
+
message.dstDecimals = object.dstDecimals ?? 0;
|
|
236
326
|
return message;
|
|
237
327
|
}
|
|
238
328
|
|
|
@@ -303,7 +393,7 @@ export const EventWithdrawalSignatureSubmitted = {
|
|
|
303
393
|
|
|
304
394
|
};
|
|
305
395
|
|
|
306
|
-
function
|
|
396
|
+
function createBaseEventWithdrawalSigned(): EventWithdrawalSigned {
|
|
307
397
|
return {
|
|
308
398
|
withdrawalId: "",
|
|
309
399
|
signature: new Uint8Array(),
|
|
@@ -311,6 +401,137 @@ function createBaseEventWithdrawalCompleted(): EventWithdrawalCompleted {
|
|
|
311
401
|
};
|
|
312
402
|
}
|
|
313
403
|
|
|
404
|
+
export const EventWithdrawalSigned = {
|
|
405
|
+
encode(message: EventWithdrawalSigned, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
406
|
+
if (message.withdrawalId !== "") {
|
|
407
|
+
writer.uint32(10).string(message.withdrawalId);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (message.signature.length !== 0) {
|
|
411
|
+
writer.uint32(18).bytes(message.signature);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (!message.blockHeight.isZero()) {
|
|
415
|
+
writer.uint32(24).uint64(message.blockHeight);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return writer;
|
|
419
|
+
},
|
|
420
|
+
|
|
421
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdrawalSigned {
|
|
422
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
423
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
424
|
+
const message = createBaseEventWithdrawalSigned();
|
|
425
|
+
|
|
426
|
+
while (reader.pos < end) {
|
|
427
|
+
const tag = reader.uint32();
|
|
428
|
+
|
|
429
|
+
switch (tag >>> 3) {
|
|
430
|
+
case 1:
|
|
431
|
+
message.withdrawalId = reader.string();
|
|
432
|
+
break;
|
|
433
|
+
|
|
434
|
+
case 2:
|
|
435
|
+
message.signature = reader.bytes();
|
|
436
|
+
break;
|
|
437
|
+
|
|
438
|
+
case 3:
|
|
439
|
+
message.blockHeight = (reader.uint64() as Long);
|
|
440
|
+
break;
|
|
441
|
+
|
|
442
|
+
default:
|
|
443
|
+
reader.skipType(tag & 7);
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return message;
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
fromPartial(object: DeepPartial<EventWithdrawalSigned>): EventWithdrawalSigned {
|
|
452
|
+
const message = createBaseEventWithdrawalSigned();
|
|
453
|
+
message.withdrawalId = object.withdrawalId ?? "";
|
|
454
|
+
message.signature = object.signature ?? new Uint8Array();
|
|
455
|
+
message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.UZERO;
|
|
456
|
+
return message;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
function createBaseEventWithdrawalSubmitted(): EventWithdrawalSubmitted {
|
|
462
|
+
return {
|
|
463
|
+
withdrawalId: "",
|
|
464
|
+
txHash: "",
|
|
465
|
+
blockHeight: Long.UZERO
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export const EventWithdrawalSubmitted = {
|
|
470
|
+
encode(message: EventWithdrawalSubmitted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
471
|
+
if (message.withdrawalId !== "") {
|
|
472
|
+
writer.uint32(10).string(message.withdrawalId);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (message.txHash !== "") {
|
|
476
|
+
writer.uint32(18).string(message.txHash);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
if (!message.blockHeight.isZero()) {
|
|
480
|
+
writer.uint32(24).uint64(message.blockHeight);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
return writer;
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdrawalSubmitted {
|
|
487
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
488
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
489
|
+
const message = createBaseEventWithdrawalSubmitted();
|
|
490
|
+
|
|
491
|
+
while (reader.pos < end) {
|
|
492
|
+
const tag = reader.uint32();
|
|
493
|
+
|
|
494
|
+
switch (tag >>> 3) {
|
|
495
|
+
case 1:
|
|
496
|
+
message.withdrawalId = reader.string();
|
|
497
|
+
break;
|
|
498
|
+
|
|
499
|
+
case 2:
|
|
500
|
+
message.txHash = reader.string();
|
|
501
|
+
break;
|
|
502
|
+
|
|
503
|
+
case 3:
|
|
504
|
+
message.blockHeight = (reader.uint64() as Long);
|
|
505
|
+
break;
|
|
506
|
+
|
|
507
|
+
default:
|
|
508
|
+
reader.skipType(tag & 7);
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
return message;
|
|
514
|
+
},
|
|
515
|
+
|
|
516
|
+
fromPartial(object: DeepPartial<EventWithdrawalSubmitted>): EventWithdrawalSubmitted {
|
|
517
|
+
const message = createBaseEventWithdrawalSubmitted();
|
|
518
|
+
message.withdrawalId = object.withdrawalId ?? "";
|
|
519
|
+
message.txHash = object.txHash ?? "";
|
|
520
|
+
message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.UZERO;
|
|
521
|
+
return message;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
function createBaseEventWithdrawalCompleted(): EventWithdrawalCompleted {
|
|
527
|
+
return {
|
|
528
|
+
withdrawalId: "",
|
|
529
|
+
signature: new Uint8Array(),
|
|
530
|
+
blockHeight: Long.UZERO,
|
|
531
|
+
evmTxHash: ""
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
|
|
314
535
|
export const EventWithdrawalCompleted = {
|
|
315
536
|
encode(message: EventWithdrawalCompleted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
316
537
|
if (message.withdrawalId !== "") {
|
|
@@ -325,6 +546,10 @@ export const EventWithdrawalCompleted = {
|
|
|
325
546
|
writer.uint32(24).uint64(message.blockHeight);
|
|
326
547
|
}
|
|
327
548
|
|
|
549
|
+
if (message.evmTxHash !== "") {
|
|
550
|
+
writer.uint32(34).string(message.evmTxHash);
|
|
551
|
+
}
|
|
552
|
+
|
|
328
553
|
return writer;
|
|
329
554
|
},
|
|
330
555
|
|
|
@@ -349,6 +574,10 @@ export const EventWithdrawalCompleted = {
|
|
|
349
574
|
message.blockHeight = (reader.uint64() as Long);
|
|
350
575
|
break;
|
|
351
576
|
|
|
577
|
+
case 4:
|
|
578
|
+
message.evmTxHash = reader.string();
|
|
579
|
+
break;
|
|
580
|
+
|
|
352
581
|
default:
|
|
353
582
|
reader.skipType(tag & 7);
|
|
354
583
|
break;
|
|
@@ -363,6 +592,7 @@ export const EventWithdrawalCompleted = {
|
|
|
363
592
|
message.withdrawalId = object.withdrawalId ?? "";
|
|
364
593
|
message.signature = object.signature ?? new Uint8Array();
|
|
365
594
|
message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.UZERO;
|
|
595
|
+
message.evmTxHash = object.evmTxHash ?? "";
|
|
366
596
|
return message;
|
|
367
597
|
}
|
|
368
598
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventParams, EventParamsSDKType, ProposeParams, ProposeParamsSDKType, SafetyParams, SafetyParamsSDKType } from "./params";
|
|
1
|
+
import { EventParams, EventParamsSDKType, ProposeParams, ProposeParamsSDKType, SafetyParams, SafetyParamsSDKType, TSSParams, TSSParamsSDKType } from "./params";
|
|
2
2
|
import { BridgeEventInfo, BridgeEventInfoSDKType } from "./bridge_event_info";
|
|
3
3
|
import { TokenInfo, TokenInfoSDKType, TokenPair, TokenPairSDKType } from "./token";
|
|
4
4
|
import * as _m0 from "protobufjs/minimal";
|
|
@@ -23,6 +23,9 @@ export interface GenesisState {
|
|
|
23
23
|
/** Token pair mappings for cross-chain transfers. */
|
|
24
24
|
|
|
25
25
|
tokenPairs: TokenPair[];
|
|
26
|
+
/** TSS (Threshold Signature Scheme) parameters. */
|
|
27
|
+
|
|
28
|
+
tssParams?: TSSParams;
|
|
26
29
|
}
|
|
27
30
|
/** GenesisState defines the bridge module's genesis state. */
|
|
28
31
|
|
|
@@ -33,6 +36,7 @@ export interface GenesisStateSDKType {
|
|
|
33
36
|
acknowledged_event_info?: BridgeEventInfoSDKType;
|
|
34
37
|
token_infos: TokenInfoSDKType[];
|
|
35
38
|
token_pairs: TokenPairSDKType[];
|
|
39
|
+
tss_params?: TSSParamsSDKType;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
function createBaseGenesisState(): GenesisState {
|
|
@@ -42,7 +46,8 @@ function createBaseGenesisState(): GenesisState {
|
|
|
42
46
|
safetyParams: undefined,
|
|
43
47
|
acknowledgedEventInfo: undefined,
|
|
44
48
|
tokenInfos: [],
|
|
45
|
-
tokenPairs: []
|
|
49
|
+
tokenPairs: [],
|
|
50
|
+
tssParams: undefined
|
|
46
51
|
};
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -72,6 +77,10 @@ export const GenesisState = {
|
|
|
72
77
|
TokenPair.encode(v!, writer.uint32(50).fork()).ldelim();
|
|
73
78
|
}
|
|
74
79
|
|
|
80
|
+
if (message.tssParams !== undefined) {
|
|
81
|
+
TSSParams.encode(message.tssParams, writer.uint32(58).fork()).ldelim();
|
|
82
|
+
}
|
|
83
|
+
|
|
75
84
|
return writer;
|
|
76
85
|
},
|
|
77
86
|
|
|
@@ -108,6 +117,10 @@ export const GenesisState = {
|
|
|
108
117
|
message.tokenPairs.push(TokenPair.decode(reader, reader.uint32()));
|
|
109
118
|
break;
|
|
110
119
|
|
|
120
|
+
case 7:
|
|
121
|
+
message.tssParams = TSSParams.decode(reader, reader.uint32());
|
|
122
|
+
break;
|
|
123
|
+
|
|
111
124
|
default:
|
|
112
125
|
reader.skipType(tag & 7);
|
|
113
126
|
break;
|
|
@@ -125,6 +138,7 @@ export const GenesisState = {
|
|
|
125
138
|
message.acknowledgedEventInfo = object.acknowledgedEventInfo !== undefined && object.acknowledgedEventInfo !== null ? BridgeEventInfo.fromPartial(object.acknowledgedEventInfo) : undefined;
|
|
126
139
|
message.tokenInfos = object.tokenInfos?.map(e => TokenInfo.fromPartial(e)) || [];
|
|
127
140
|
message.tokenPairs = object.tokenPairs?.map(e => TokenPair.fromPartial(e)) || [];
|
|
141
|
+
message.tssParams = object.tssParams !== undefined && object.tssParams !== null ? TSSParams.fromPartial(object.tssParams) : undefined;
|
|
128
142
|
return message;
|
|
129
143
|
}
|
|
130
144
|
|
|
@@ -83,16 +83,13 @@ export interface SafetyParamsSDKType {
|
|
|
83
83
|
is_disabled: boolean;
|
|
84
84
|
delay_blocks: number;
|
|
85
85
|
}
|
|
86
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* TSSParams stores parameters for TSS (Threshold Signature Scheme).
|
|
88
|
+
* Note: TSS produces a single aggregated signature, no threshold counting needed.
|
|
89
|
+
*/
|
|
87
90
|
|
|
88
91
|
export interface TSSParams {
|
|
89
|
-
/** Threshold of signatures required (e.g., 2 for 2/3). */
|
|
90
|
-
threshold: number;
|
|
91
|
-
/** Total number of TSS parties/validators. */
|
|
92
|
-
|
|
93
|
-
totalParties: number;
|
|
94
92
|
/** Timeout for TSS signing operations in seconds. */
|
|
95
|
-
|
|
96
93
|
timeoutSeconds: Long;
|
|
97
94
|
/** Whitelist enabled (permissioned mode). */
|
|
98
95
|
|
|
@@ -100,15 +97,23 @@ export interface TSSParams {
|
|
|
100
97
|
/** Supported chain IDs (1=Ethereum, 42161=Arbitrum, etc.). */
|
|
101
98
|
|
|
102
99
|
supportedChainIds: Long[];
|
|
100
|
+
/**
|
|
101
|
+
* TSS group public key (hex-encoded, 66 chars for compressed or 130 for uncompressed).
|
|
102
|
+
* This is used to verify TSS signatures.
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
tssPubKey: string;
|
|
103
106
|
}
|
|
104
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* TSSParams stores parameters for TSS (Threshold Signature Scheme).
|
|
109
|
+
* Note: TSS produces a single aggregated signature, no threshold counting needed.
|
|
110
|
+
*/
|
|
105
111
|
|
|
106
112
|
export interface TSSParamsSDKType {
|
|
107
|
-
threshold: number;
|
|
108
|
-
total_parties: number;
|
|
109
113
|
timeout_seconds: Long;
|
|
110
114
|
whitelist_enabled: boolean;
|
|
111
115
|
supported_chain_ids: Long[];
|
|
116
|
+
tss_pub_key: string;
|
|
112
117
|
}
|
|
113
118
|
|
|
114
119
|
function createBaseEventParams(): EventParams {
|
|
@@ -308,24 +313,15 @@ export const SafetyParams = {
|
|
|
308
313
|
|
|
309
314
|
function createBaseTSSParams(): TSSParams {
|
|
310
315
|
return {
|
|
311
|
-
threshold: 0,
|
|
312
|
-
totalParties: 0,
|
|
313
316
|
timeoutSeconds: Long.UZERO,
|
|
314
317
|
whitelistEnabled: false,
|
|
315
|
-
supportedChainIds: []
|
|
318
|
+
supportedChainIds: [],
|
|
319
|
+
tssPubKey: ""
|
|
316
320
|
};
|
|
317
321
|
}
|
|
318
322
|
|
|
319
323
|
export const TSSParams = {
|
|
320
324
|
encode(message: TSSParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
321
|
-
if (message.threshold !== 0) {
|
|
322
|
-
writer.uint32(8).uint32(message.threshold);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
if (message.totalParties !== 0) {
|
|
326
|
-
writer.uint32(16).uint32(message.totalParties);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
325
|
if (!message.timeoutSeconds.isZero()) {
|
|
330
326
|
writer.uint32(24).uint64(message.timeoutSeconds);
|
|
331
327
|
}
|
|
@@ -341,6 +337,11 @@ export const TSSParams = {
|
|
|
341
337
|
}
|
|
342
338
|
|
|
343
339
|
writer.ldelim();
|
|
340
|
+
|
|
341
|
+
if (message.tssPubKey !== "") {
|
|
342
|
+
writer.uint32(50).string(message.tssPubKey);
|
|
343
|
+
}
|
|
344
|
+
|
|
344
345
|
return writer;
|
|
345
346
|
},
|
|
346
347
|
|
|
@@ -353,14 +354,6 @@ export const TSSParams = {
|
|
|
353
354
|
const tag = reader.uint32();
|
|
354
355
|
|
|
355
356
|
switch (tag >>> 3) {
|
|
356
|
-
case 1:
|
|
357
|
-
message.threshold = reader.uint32();
|
|
358
|
-
break;
|
|
359
|
-
|
|
360
|
-
case 2:
|
|
361
|
-
message.totalParties = reader.uint32();
|
|
362
|
-
break;
|
|
363
|
-
|
|
364
357
|
case 3:
|
|
365
358
|
message.timeoutSeconds = (reader.uint64() as Long);
|
|
366
359
|
break;
|
|
@@ -382,6 +375,10 @@ export const TSSParams = {
|
|
|
382
375
|
|
|
383
376
|
break;
|
|
384
377
|
|
|
378
|
+
case 6:
|
|
379
|
+
message.tssPubKey = reader.string();
|
|
380
|
+
break;
|
|
381
|
+
|
|
385
382
|
default:
|
|
386
383
|
reader.skipType(tag & 7);
|
|
387
384
|
break;
|
|
@@ -393,11 +390,10 @@ export const TSSParams = {
|
|
|
393
390
|
|
|
394
391
|
fromPartial(object: DeepPartial<TSSParams>): TSSParams {
|
|
395
392
|
const message = createBaseTSSParams();
|
|
396
|
-
message.threshold = object.threshold ?? 0;
|
|
397
|
-
message.totalParties = object.totalParties ?? 0;
|
|
398
393
|
message.timeoutSeconds = object.timeoutSeconds !== undefined && object.timeoutSeconds !== null ? Long.fromValue(object.timeoutSeconds) : Long.UZERO;
|
|
399
394
|
message.whitelistEnabled = object.whitelistEnabled ?? false;
|
|
400
395
|
message.supportedChainIds = object.supportedChainIds?.map(e => Long.fromValue(e)) || [];
|
|
396
|
+
message.tssPubKey = object.tssPubKey ?? "";
|
|
401
397
|
return message;
|
|
402
398
|
}
|
|
403
399
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LCDClient } from "@osmonauts/lcd";
|
|
2
|
-
import { QueryEventParamsRequest, QueryEventParamsResponseSDKType, QueryProposeParamsRequest, QueryProposeParamsResponseSDKType, QuerySafetyParamsRequest, QuerySafetyParamsResponseSDKType, QueryAcknowledgedEventInfoRequest, QueryAcknowledgedEventInfoResponseSDKType, QueryRecognizedEventInfoRequest, QueryRecognizedEventInfoResponseSDKType, QueryDelayedCompleteBridgeMessagesRequest, QueryDelayedCompleteBridgeMessagesResponseSDKType, QueryTSSParamsRequest, QueryTSSParamsResponseSDKType, QueryWithdrawalRequestRequest, QueryWithdrawalRequestResponseSDKType, QueryWithdrawalsByAddressRequest, QueryWithdrawalsByAddressResponseSDKType, QueryPendingWithdrawalsRequest, QueryPendingWithdrawalsResponseSDKType, QueryWithdrawalByChainAndNonceRequest, QueryWithdrawalByChainAndNonceResponseSDKType } from "./query";
|
|
2
|
+
import { QueryEventParamsRequest, QueryEventParamsResponseSDKType, QueryProposeParamsRequest, QueryProposeParamsResponseSDKType, QuerySafetyParamsRequest, QuerySafetyParamsResponseSDKType, QueryAcknowledgedEventInfoRequest, QueryAcknowledgedEventInfoResponseSDKType, QueryRecognizedEventInfoRequest, QueryRecognizedEventInfoResponseSDKType, QueryDelayedCompleteBridgeMessagesRequest, QueryDelayedCompleteBridgeMessagesResponseSDKType, QueryTSSParamsRequest, QueryTSSParamsResponseSDKType, QueryWithdrawalRequestRequest, QueryWithdrawalRequestResponseSDKType, QueryWithdrawalsByAddressRequest, QueryWithdrawalsByAddressResponseSDKType, QueryPendingWithdrawalsRequest, QueryPendingWithdrawalsResponseSDKType, QueryWithdrawalByChainAndNonceRequest, QueryWithdrawalByChainAndNonceResponseSDKType, QueryVerifyWithdrawalForTSSRequest, QueryVerifyWithdrawalForTSSResponseSDKType } from "./query";
|
|
3
3
|
import { QueryTokenInfoRequest, QueryTokenInfoResponseSDKType, QueryTokenPairRequest, QueryTokenPairResponseSDKType, QueryAllTokensRequest, QueryAllTokensResponseSDKType, QueryTokenPairsBySourceRequest, QueryTokenPairsBySourceResponseSDKType } from "./token";
|
|
4
4
|
export class LCDQueryClient {
|
|
5
5
|
req: LCDClient;
|
|
@@ -25,6 +25,7 @@ export class LCDQueryClient {
|
|
|
25
25
|
this.tokenPair = this.tokenPair.bind(this);
|
|
26
26
|
this.allTokens = this.allTokens.bind(this);
|
|
27
27
|
this.tokenPairsBySource = this.tokenPairsBySource.bind(this);
|
|
28
|
+
this.verifyWithdrawalForTSS = this.verifyWithdrawalForTSS.bind(this);
|
|
28
29
|
}
|
|
29
30
|
/* Queries the EventParams. */
|
|
30
31
|
|
|
@@ -158,5 +159,12 @@ export class LCDQueryClient {
|
|
|
158
159
|
const endpoint = `zogux/v4/bridge/token_pairs/${params.srcChainId}/${params.srcTokenAddress}`;
|
|
159
160
|
return await this.req.get<QueryTokenPairsBySourceResponseSDKType>(endpoint);
|
|
160
161
|
}
|
|
162
|
+
/* Verifies a withdrawal for TSS signing. */
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
async verifyWithdrawalForTSS(params: QueryVerifyWithdrawalForTSSRequest): Promise<QueryVerifyWithdrawalForTSSResponseSDKType> {
|
|
166
|
+
const endpoint = `zoguxprotocol/v4/bridge/verify_withdrawal_for_tss/${params.withdrawalId}/${params.requiredConfirmations}`;
|
|
167
|
+
return await this.req.get<QueryVerifyWithdrawalForTSSResponseSDKType>(endpoint);
|
|
168
|
+
}
|
|
161
169
|
|
|
162
170
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Rpc } from "../../helpers";
|
|
2
2
|
import * as _m0 from "protobufjs/minimal";
|
|
3
3
|
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate";
|
|
4
|
-
import { QueryEventParamsRequest, QueryEventParamsResponse, QueryProposeParamsRequest, QueryProposeParamsResponse, QuerySafetyParamsRequest, QuerySafetyParamsResponse, QueryAcknowledgedEventInfoRequest, QueryAcknowledgedEventInfoResponse, QueryRecognizedEventInfoRequest, QueryRecognizedEventInfoResponse, QueryDelayedCompleteBridgeMessagesRequest, QueryDelayedCompleteBridgeMessagesResponse, QueryTSSParamsRequest, QueryTSSParamsResponse, QueryWithdrawalRequestRequest, QueryWithdrawalRequestResponse, QueryWithdrawalsByAddressRequest, QueryWithdrawalsByAddressResponse, QueryPendingWithdrawalsRequest, QueryPendingWithdrawalsResponse, QueryWithdrawalByChainAndNonceRequest, QueryWithdrawalByChainAndNonceResponse } from "./query";
|
|
4
|
+
import { QueryEventParamsRequest, QueryEventParamsResponse, QueryProposeParamsRequest, QueryProposeParamsResponse, QuerySafetyParamsRequest, QuerySafetyParamsResponse, QueryAcknowledgedEventInfoRequest, QueryAcknowledgedEventInfoResponse, QueryRecognizedEventInfoRequest, QueryRecognizedEventInfoResponse, QueryDelayedCompleteBridgeMessagesRequest, QueryDelayedCompleteBridgeMessagesResponse, QueryTSSParamsRequest, QueryTSSParamsResponse, QueryWithdrawalRequestRequest, QueryWithdrawalRequestResponse, QueryWithdrawalsByAddressRequest, QueryWithdrawalsByAddressResponse, QueryPendingWithdrawalsRequest, QueryPendingWithdrawalsResponse, QueryWithdrawalByChainAndNonceRequest, QueryWithdrawalByChainAndNonceResponse, QueryVerifyWithdrawalForTSSRequest, QueryVerifyWithdrawalForTSSResponse } from "./query";
|
|
5
5
|
import { QueryTokenInfoRequest, QueryTokenInfoResponse, QueryTokenPairRequest, QueryTokenPairResponse, QueryAllTokensRequest, QueryAllTokensResponse, QueryTokenPairsBySourceRequest, QueryTokenPairsBySourceResponse } from "./token";
|
|
6
6
|
/** Query defines the gRPC querier service. */
|
|
7
7
|
|
|
@@ -67,6 +67,9 @@ export interface Query {
|
|
|
67
67
|
/** Queries all token pairs for a given source token. */
|
|
68
68
|
|
|
69
69
|
tokenPairsBySource(request: QueryTokenPairsBySourceRequest): Promise<QueryTokenPairsBySourceResponse>;
|
|
70
|
+
/** Verifies a withdrawal for TSS signing. */
|
|
71
|
+
|
|
72
|
+
verifyWithdrawalForTSS(request: QueryVerifyWithdrawalForTSSRequest): Promise<QueryVerifyWithdrawalForTSSResponse>;
|
|
70
73
|
}
|
|
71
74
|
export class QueryClientImpl implements Query {
|
|
72
75
|
private readonly rpc: Rpc;
|
|
@@ -88,6 +91,7 @@ export class QueryClientImpl implements Query {
|
|
|
88
91
|
this.tokenPair = this.tokenPair.bind(this);
|
|
89
92
|
this.allTokens = this.allTokens.bind(this);
|
|
90
93
|
this.tokenPairsBySource = this.tokenPairsBySource.bind(this);
|
|
94
|
+
this.verifyWithdrawalForTSS = this.verifyWithdrawalForTSS.bind(this);
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
eventParams(request: QueryEventParamsRequest = {}): Promise<QueryEventParamsResponse> {
|
|
@@ -180,6 +184,12 @@ export class QueryClientImpl implements Query {
|
|
|
180
184
|
return promise.then(data => QueryTokenPairsBySourceResponse.decode(new _m0.Reader(data)));
|
|
181
185
|
}
|
|
182
186
|
|
|
187
|
+
verifyWithdrawalForTSS(request: QueryVerifyWithdrawalForTSSRequest): Promise<QueryVerifyWithdrawalForTSSResponse> {
|
|
188
|
+
const data = QueryVerifyWithdrawalForTSSRequest.encode(request).finish();
|
|
189
|
+
const promise = this.rpc.request("zogux.bridge.Query", "VerifyWithdrawalForTSS", data);
|
|
190
|
+
return promise.then(data => QueryVerifyWithdrawalForTSSResponse.decode(new _m0.Reader(data)));
|
|
191
|
+
}
|
|
192
|
+
|
|
183
193
|
}
|
|
184
194
|
export const createRpcQueryExtension = (base: QueryClient) => {
|
|
185
195
|
const rpc = createProtobufRpcClient(base);
|
|
@@ -243,6 +253,10 @@ export const createRpcQueryExtension = (base: QueryClient) => {
|
|
|
243
253
|
|
|
244
254
|
tokenPairsBySource(request: QueryTokenPairsBySourceRequest): Promise<QueryTokenPairsBySourceResponse> {
|
|
245
255
|
return queryService.tokenPairsBySource(request);
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
verifyWithdrawalForTSS(request: QueryVerifyWithdrawalForTSSRequest): Promise<QueryVerifyWithdrawalForTSSResponse> {
|
|
259
|
+
return queryService.verifyWithdrawalForTSS(request);
|
|
246
260
|
}
|
|
247
261
|
|
|
248
262
|
};
|