@zoguxprotocol/proto 0.1.7 → 0.1.9
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/bridge_event.ts +75 -1
- package/src/codegen/zogux/bridge/events.ts +234 -6
- package/src/codegen/zogux/bridge/genesis.ts +16 -2
- package/src/codegen/zogux/bridge/params.ts +102 -5
- package/src/codegen/zogux/bridge/query.lcd.ts +29 -2
- package/src/codegen/zogux/bridge/query.rpc.Query.ts +32 -2
- package/src/codegen/zogux/bridge/query.ts +123 -0
- package/src/codegen/zogux/bridge/token.ts +96 -0
- package/src/codegen/zogux/bridge/tss.ts +316 -3
- package/src/codegen/zogux/bridge/tx.rpc.msg.ts +21 -1
- package/src/codegen/zogux/bridge/withdrawal.ts +98 -1
- package/src/codegen/zogux/indexer/events/events.ts +581 -1
- package/src/codegen/zogux/indexer/protocol/v1/subaccount.ts +6 -4
- package/src/codegen/zogux/sending/transfer.ts +8 -2
- package/src/codegen/zogux/sending/tx.rpc.msg.ts +6 -2
- package/src/codegen/zogux/spots/tx.rpc.msg.ts +11 -1
- package/src/codegen/zogux/spots/tx.ts +110 -0
- package/src/codegen/zogux/stats/stats.ts +103 -5
- package/src/codegen/zogux/subaccounts/spot_position.ts +6 -4
- package/src/codegen/zogux/subaccounts/tx.rpc.msg.ts +3 -2
- package/src/codegen/zogux/subaccounts/tx.ts +22 -7
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin";
|
|
2
2
|
import { Long, DeepPartial } from "../../helpers";
|
|
3
3
|
import * as _m0 from "protobufjs/minimal";
|
|
4
|
+
/** DepositType indicates where bridged funds are credited (main account, spot, or perps). Values match EVM enum (0=MainAccount, 1=Spot, 2=Preps). */
|
|
5
|
+
|
|
6
|
+
export enum DepositType {
|
|
7
|
+
/** DEPOSIT_TYPE_MAIN - main account */
|
|
8
|
+
DEPOSIT_TYPE_MAIN = 0,
|
|
9
|
+
DEPOSIT_TYPE_SPOT = 1,
|
|
10
|
+
DEPOSIT_TYPE_PREPS = 2,
|
|
11
|
+
UNRECOGNIZED = -1,
|
|
12
|
+
}
|
|
13
|
+
export const DepositTypeSDKType = DepositType;
|
|
14
|
+
export function depositTypeFromJSON(object: any): DepositType {
|
|
15
|
+
switch (object) {
|
|
16
|
+
case 0:
|
|
17
|
+
case "DEPOSIT_TYPE_MAIN":
|
|
18
|
+
return DepositType.DEPOSIT_TYPE_MAIN;
|
|
19
|
+
|
|
20
|
+
case 1:
|
|
21
|
+
case "DEPOSIT_TYPE_SPOT":
|
|
22
|
+
return DepositType.DEPOSIT_TYPE_SPOT;
|
|
23
|
+
|
|
24
|
+
case 2:
|
|
25
|
+
case "DEPOSIT_TYPE_PREPS":
|
|
26
|
+
return DepositType.DEPOSIT_TYPE_PREPS;
|
|
27
|
+
|
|
28
|
+
case -1:
|
|
29
|
+
case "UNRECOGNIZED":
|
|
30
|
+
default:
|
|
31
|
+
return DepositType.UNRECOGNIZED;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function depositTypeToJSON(object: DepositType): string {
|
|
35
|
+
switch (object) {
|
|
36
|
+
case DepositType.DEPOSIT_TYPE_MAIN:
|
|
37
|
+
return "DEPOSIT_TYPE_MAIN";
|
|
38
|
+
|
|
39
|
+
case DepositType.DEPOSIT_TYPE_SPOT:
|
|
40
|
+
return "DEPOSIT_TYPE_SPOT";
|
|
41
|
+
|
|
42
|
+
case DepositType.DEPOSIT_TYPE_PREPS:
|
|
43
|
+
return "DEPOSIT_TYPE_PREPS";
|
|
44
|
+
|
|
45
|
+
case DepositType.UNRECOGNIZED:
|
|
46
|
+
default:
|
|
47
|
+
return "UNRECOGNIZED";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
4
50
|
/** BridgeEvent is a recognized event from any EVM blockchain. */
|
|
5
51
|
|
|
6
52
|
export interface BridgeEvent {
|
|
@@ -30,6 +76,12 @@ export interface BridgeEvent {
|
|
|
30
76
|
/** Number of signatures received. */
|
|
31
77
|
|
|
32
78
|
signatureCount: number;
|
|
79
|
+
/** Where to credit the bridged funds: main account, spot, or perps. */
|
|
80
|
+
|
|
81
|
+
depositType: DepositType;
|
|
82
|
+
/** Transaction hash of the Zogux chain transaction that finalized the bridge deposit. */
|
|
83
|
+
|
|
84
|
+
zoguxTxHash: string;
|
|
33
85
|
}
|
|
34
86
|
/** BridgeEvent is a recognized event from any EVM blockchain. */
|
|
35
87
|
|
|
@@ -43,6 +95,8 @@ export interface BridgeEventSDKType {
|
|
|
43
95
|
tx_hash: string;
|
|
44
96
|
tss_signatures: Uint8Array[];
|
|
45
97
|
signature_count: number;
|
|
98
|
+
deposit_type: DepositType;
|
|
99
|
+
zogux_tx_hash: string;
|
|
46
100
|
}
|
|
47
101
|
|
|
48
102
|
function createBaseBridgeEvent(): BridgeEvent {
|
|
@@ -55,7 +109,9 @@ function createBaseBridgeEvent(): BridgeEvent {
|
|
|
55
109
|
tokenAddress: "",
|
|
56
110
|
txHash: "",
|
|
57
111
|
tssSignatures: [],
|
|
58
|
-
signatureCount: 0
|
|
112
|
+
signatureCount: 0,
|
|
113
|
+
depositType: 0,
|
|
114
|
+
zoguxTxHash: ""
|
|
59
115
|
};
|
|
60
116
|
}
|
|
61
117
|
|
|
@@ -97,6 +153,14 @@ export const BridgeEvent = {
|
|
|
97
153
|
writer.uint32(72).uint32(message.signatureCount);
|
|
98
154
|
}
|
|
99
155
|
|
|
156
|
+
if (message.depositType !== 0) {
|
|
157
|
+
writer.uint32(80).int32(message.depositType);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (message.zoguxTxHash !== "") {
|
|
161
|
+
writer.uint32(90).string(message.zoguxTxHash);
|
|
162
|
+
}
|
|
163
|
+
|
|
100
164
|
return writer;
|
|
101
165
|
},
|
|
102
166
|
|
|
@@ -145,6 +209,14 @@ export const BridgeEvent = {
|
|
|
145
209
|
message.signatureCount = reader.uint32();
|
|
146
210
|
break;
|
|
147
211
|
|
|
212
|
+
case 10:
|
|
213
|
+
message.depositType = (reader.int32() as any);
|
|
214
|
+
break;
|
|
215
|
+
|
|
216
|
+
case 11:
|
|
217
|
+
message.zoguxTxHash = reader.string();
|
|
218
|
+
break;
|
|
219
|
+
|
|
148
220
|
default:
|
|
149
221
|
reader.skipType(tag & 7);
|
|
150
222
|
break;
|
|
@@ -165,6 +237,8 @@ export const BridgeEvent = {
|
|
|
165
237
|
message.txHash = object.txHash ?? "";
|
|
166
238
|
message.tssSignatures = object.tssSignatures?.map(e => e) || [];
|
|
167
239
|
message.signatureCount = object.signatureCount ?? 0;
|
|
240
|
+
message.depositType = object.depositType ?? 0;
|
|
241
|
+
message.zoguxTxHash = object.zoguxTxHash ?? "";
|
|
168
242
|
return message;
|
|
169
243
|
}
|
|
170
244
|
|
|
@@ -87,8 +87,8 @@ export interface EventWithdrawalSignatureSubmittedSDKType {
|
|
|
87
87
|
block_height: Long;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* EventWithdrawalSigned is emitted when a withdrawal has collected enough TSS
|
|
91
|
-
* Signer service should listen to this and submit to EVM.
|
|
90
|
+
* EventWithdrawalSigned is emitted when a withdrawal has collected enough TSS
|
|
91
|
+
* signatures. Signer service should listen to this and submit to EVM.
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
export interface EventWithdrawalSigned {
|
|
@@ -102,8 +102,8 @@ export interface EventWithdrawalSigned {
|
|
|
102
102
|
blockHeight: Long;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* EventWithdrawalSigned is emitted when a withdrawal has collected enough TSS
|
|
106
|
-
* Signer service should listen to this and submit to EVM.
|
|
105
|
+
* EventWithdrawalSigned is emitted when a withdrawal has collected enough TSS
|
|
106
|
+
* signatures. Signer service should listen to this and submit to EVM.
|
|
107
107
|
*/
|
|
108
108
|
|
|
109
109
|
export interface EventWithdrawalSignedSDKType {
|
|
@@ -111,7 +111,10 @@ export interface EventWithdrawalSignedSDKType {
|
|
|
111
111
|
signature: Uint8Array;
|
|
112
112
|
block_height: Long;
|
|
113
113
|
}
|
|
114
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* EventWithdrawalSubmitted is emitted when signer has submitted the withdrawal
|
|
116
|
+
* to EVM.
|
|
117
|
+
*/
|
|
115
118
|
|
|
116
119
|
export interface EventWithdrawalSubmitted {
|
|
117
120
|
/** Withdrawal ID */
|
|
@@ -123,7 +126,10 @@ export interface EventWithdrawalSubmitted {
|
|
|
123
126
|
|
|
124
127
|
blockHeight: Long;
|
|
125
128
|
}
|
|
126
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* EventWithdrawalSubmitted is emitted when signer has submitted the withdrawal
|
|
131
|
+
* to EVM.
|
|
132
|
+
*/
|
|
127
133
|
|
|
128
134
|
export interface EventWithdrawalSubmittedSDKType {
|
|
129
135
|
withdrawal_id: string;
|
|
@@ -172,6 +178,68 @@ export interface EventWithdrawalCancelledSDKType {
|
|
|
172
178
|
reason: string;
|
|
173
179
|
block_height: Long;
|
|
174
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* EventWithdrawalFailed is emitted when a withdrawal fails (e.g. TSS timeout,
|
|
183
|
+
* EVM revert); funds remain locked until resolved by admin.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
export interface EventWithdrawalFailed {
|
|
187
|
+
/** Withdrawal ID */
|
|
188
|
+
withdrawalId: string;
|
|
189
|
+
/** Reason for failure */
|
|
190
|
+
|
|
191
|
+
reason: string;
|
|
192
|
+
/** Block height when failed */
|
|
193
|
+
|
|
194
|
+
blockHeight: Long;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* EventWithdrawalFailed is emitted when a withdrawal fails (e.g. TSS timeout,
|
|
198
|
+
* EVM revert); funds remain locked until resolved by admin.
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
export interface EventWithdrawalFailedSDKType {
|
|
202
|
+
withdrawal_id: string;
|
|
203
|
+
reason: string;
|
|
204
|
+
block_height: Long;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* EventWithdrawalResolved is emitted when admin resolves a failed withdrawal
|
|
208
|
+
* by sending locked funds to a destination address.
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
export interface EventWithdrawalResolved {
|
|
212
|
+
/** Withdrawal ID */
|
|
213
|
+
withdrawalId: string;
|
|
214
|
+
/** Destination address that received the funds */
|
|
215
|
+
|
|
216
|
+
destinationAddress: string;
|
|
217
|
+
/** Amount sent */
|
|
218
|
+
|
|
219
|
+
amount: string;
|
|
220
|
+
/** Denom */
|
|
221
|
+
|
|
222
|
+
denom: string;
|
|
223
|
+
/** Optional reason */
|
|
224
|
+
|
|
225
|
+
reason: string;
|
|
226
|
+
/** Block height when resolved */
|
|
227
|
+
|
|
228
|
+
blockHeight: Long;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* EventWithdrawalResolved is emitted when admin resolves a failed withdrawal
|
|
232
|
+
* by sending locked funds to a destination address.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
export interface EventWithdrawalResolvedSDKType {
|
|
236
|
+
withdrawal_id: string;
|
|
237
|
+
destination_address: string;
|
|
238
|
+
amount: string;
|
|
239
|
+
denom: string;
|
|
240
|
+
reason: string;
|
|
241
|
+
block_height: Long;
|
|
242
|
+
}
|
|
175
243
|
|
|
176
244
|
function createBaseEventWithdrawalRequested(): EventWithdrawalRequested {
|
|
177
245
|
return {
|
|
@@ -661,4 +729,164 @@ export const EventWithdrawalCancelled = {
|
|
|
661
729
|
return message;
|
|
662
730
|
}
|
|
663
731
|
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
function createBaseEventWithdrawalFailed(): EventWithdrawalFailed {
|
|
735
|
+
return {
|
|
736
|
+
withdrawalId: "",
|
|
737
|
+
reason: "",
|
|
738
|
+
blockHeight: Long.UZERO
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export const EventWithdrawalFailed = {
|
|
743
|
+
encode(message: EventWithdrawalFailed, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
744
|
+
if (message.withdrawalId !== "") {
|
|
745
|
+
writer.uint32(10).string(message.withdrawalId);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
if (message.reason !== "") {
|
|
749
|
+
writer.uint32(18).string(message.reason);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if (!message.blockHeight.isZero()) {
|
|
753
|
+
writer.uint32(24).uint64(message.blockHeight);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
return writer;
|
|
757
|
+
},
|
|
758
|
+
|
|
759
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdrawalFailed {
|
|
760
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
761
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
762
|
+
const message = createBaseEventWithdrawalFailed();
|
|
763
|
+
|
|
764
|
+
while (reader.pos < end) {
|
|
765
|
+
const tag = reader.uint32();
|
|
766
|
+
|
|
767
|
+
switch (tag >>> 3) {
|
|
768
|
+
case 1:
|
|
769
|
+
message.withdrawalId = reader.string();
|
|
770
|
+
break;
|
|
771
|
+
|
|
772
|
+
case 2:
|
|
773
|
+
message.reason = reader.string();
|
|
774
|
+
break;
|
|
775
|
+
|
|
776
|
+
case 3:
|
|
777
|
+
message.blockHeight = (reader.uint64() as Long);
|
|
778
|
+
break;
|
|
779
|
+
|
|
780
|
+
default:
|
|
781
|
+
reader.skipType(tag & 7);
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
return message;
|
|
787
|
+
},
|
|
788
|
+
|
|
789
|
+
fromPartial(object: DeepPartial<EventWithdrawalFailed>): EventWithdrawalFailed {
|
|
790
|
+
const message = createBaseEventWithdrawalFailed();
|
|
791
|
+
message.withdrawalId = object.withdrawalId ?? "";
|
|
792
|
+
message.reason = object.reason ?? "";
|
|
793
|
+
message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.UZERO;
|
|
794
|
+
return message;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
function createBaseEventWithdrawalResolved(): EventWithdrawalResolved {
|
|
800
|
+
return {
|
|
801
|
+
withdrawalId: "",
|
|
802
|
+
destinationAddress: "",
|
|
803
|
+
amount: "",
|
|
804
|
+
denom: "",
|
|
805
|
+
reason: "",
|
|
806
|
+
blockHeight: Long.UZERO
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export const EventWithdrawalResolved = {
|
|
811
|
+
encode(message: EventWithdrawalResolved, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
812
|
+
if (message.withdrawalId !== "") {
|
|
813
|
+
writer.uint32(10).string(message.withdrawalId);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
if (message.destinationAddress !== "") {
|
|
817
|
+
writer.uint32(18).string(message.destinationAddress);
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
if (message.amount !== "") {
|
|
821
|
+
writer.uint32(26).string(message.amount);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
if (message.denom !== "") {
|
|
825
|
+
writer.uint32(34).string(message.denom);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
if (message.reason !== "") {
|
|
829
|
+
writer.uint32(42).string(message.reason);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
if (!message.blockHeight.isZero()) {
|
|
833
|
+
writer.uint32(48).uint64(message.blockHeight);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return writer;
|
|
837
|
+
},
|
|
838
|
+
|
|
839
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdrawalResolved {
|
|
840
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
841
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
842
|
+
const message = createBaseEventWithdrawalResolved();
|
|
843
|
+
|
|
844
|
+
while (reader.pos < end) {
|
|
845
|
+
const tag = reader.uint32();
|
|
846
|
+
|
|
847
|
+
switch (tag >>> 3) {
|
|
848
|
+
case 1:
|
|
849
|
+
message.withdrawalId = reader.string();
|
|
850
|
+
break;
|
|
851
|
+
|
|
852
|
+
case 2:
|
|
853
|
+
message.destinationAddress = reader.string();
|
|
854
|
+
break;
|
|
855
|
+
|
|
856
|
+
case 3:
|
|
857
|
+
message.amount = reader.string();
|
|
858
|
+
break;
|
|
859
|
+
|
|
860
|
+
case 4:
|
|
861
|
+
message.denom = reader.string();
|
|
862
|
+
break;
|
|
863
|
+
|
|
864
|
+
case 5:
|
|
865
|
+
message.reason = reader.string();
|
|
866
|
+
break;
|
|
867
|
+
|
|
868
|
+
case 6:
|
|
869
|
+
message.blockHeight = (reader.uint64() as Long);
|
|
870
|
+
break;
|
|
871
|
+
|
|
872
|
+
default:
|
|
873
|
+
reader.skipType(tag & 7);
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
return message;
|
|
879
|
+
},
|
|
880
|
+
|
|
881
|
+
fromPartial(object: DeepPartial<EventWithdrawalResolved>): EventWithdrawalResolved {
|
|
882
|
+
const message = createBaseEventWithdrawalResolved();
|
|
883
|
+
message.withdrawalId = object.withdrawalId ?? "";
|
|
884
|
+
message.destinationAddress = object.destinationAddress ?? "";
|
|
885
|
+
message.amount = object.amount ?? "";
|
|
886
|
+
message.denom = object.denom ?? "";
|
|
887
|
+
message.reason = object.reason ?? "";
|
|
888
|
+
message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? Long.fromValue(object.blockHeight) : Long.UZERO;
|
|
889
|
+
return message;
|
|
890
|
+
}
|
|
891
|
+
|
|
664
892
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventParams, EventParamsSDKType, ProposeParams, ProposeParamsSDKType, SafetyParams, SafetyParamsSDKType, TSSParams, TSSParamsSDKType } from "./params";
|
|
1
|
+
import { EventParams, EventParamsSDKType, ProposeParams, ProposeParamsSDKType, SafetyParams, SafetyParamsSDKType, TSSParams, TSSParamsSDKType, BridgeFeeParams, BridgeFeeParamsSDKType } 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";
|
|
@@ -26,6 +26,9 @@ export interface GenesisState {
|
|
|
26
26
|
/** TSS (Threshold Signature Scheme) parameters. */
|
|
27
27
|
|
|
28
28
|
tssParams?: TSSParams;
|
|
29
|
+
/** Bridge fee parameters (deposit/withdrawal fixed fees). */
|
|
30
|
+
|
|
31
|
+
bridgeFeeParams?: BridgeFeeParams;
|
|
29
32
|
}
|
|
30
33
|
/** GenesisState defines the bridge module's genesis state. */
|
|
31
34
|
|
|
@@ -37,6 +40,7 @@ export interface GenesisStateSDKType {
|
|
|
37
40
|
token_infos: TokenInfoSDKType[];
|
|
38
41
|
token_pairs: TokenPairSDKType[];
|
|
39
42
|
tss_params?: TSSParamsSDKType;
|
|
43
|
+
bridge_fee_params?: BridgeFeeParamsSDKType;
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
function createBaseGenesisState(): GenesisState {
|
|
@@ -47,7 +51,8 @@ function createBaseGenesisState(): GenesisState {
|
|
|
47
51
|
acknowledgedEventInfo: undefined,
|
|
48
52
|
tokenInfos: [],
|
|
49
53
|
tokenPairs: [],
|
|
50
|
-
tssParams: undefined
|
|
54
|
+
tssParams: undefined,
|
|
55
|
+
bridgeFeeParams: undefined
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
58
|
|
|
@@ -81,6 +86,10 @@ export const GenesisState = {
|
|
|
81
86
|
TSSParams.encode(message.tssParams, writer.uint32(58).fork()).ldelim();
|
|
82
87
|
}
|
|
83
88
|
|
|
89
|
+
if (message.bridgeFeeParams !== undefined) {
|
|
90
|
+
BridgeFeeParams.encode(message.bridgeFeeParams, writer.uint32(66).fork()).ldelim();
|
|
91
|
+
}
|
|
92
|
+
|
|
84
93
|
return writer;
|
|
85
94
|
},
|
|
86
95
|
|
|
@@ -121,6 +130,10 @@ export const GenesisState = {
|
|
|
121
130
|
message.tssParams = TSSParams.decode(reader, reader.uint32());
|
|
122
131
|
break;
|
|
123
132
|
|
|
133
|
+
case 8:
|
|
134
|
+
message.bridgeFeeParams = BridgeFeeParams.decode(reader, reader.uint32());
|
|
135
|
+
break;
|
|
136
|
+
|
|
124
137
|
default:
|
|
125
138
|
reader.skipType(tag & 7);
|
|
126
139
|
break;
|
|
@@ -139,6 +152,7 @@ export const GenesisState = {
|
|
|
139
152
|
message.tokenInfos = object.tokenInfos?.map(e => TokenInfo.fromPartial(e)) || [];
|
|
140
153
|
message.tokenPairs = object.tokenPairs?.map(e => TokenPair.fromPartial(e)) || [];
|
|
141
154
|
message.tssParams = object.tssParams !== undefined && object.tssParams !== null ? TSSParams.fromPartial(object.tssParams) : undefined;
|
|
155
|
+
message.bridgeFeeParams = object.bridgeFeeParams !== undefined && object.bridgeFeeParams !== null ? BridgeFeeParams.fromPartial(object.bridgeFeeParams) : undefined;
|
|
142
156
|
return message;
|
|
143
157
|
}
|
|
144
158
|
|
|
@@ -76,16 +76,47 @@ export interface SafetyParams {
|
|
|
76
76
|
*/
|
|
77
77
|
|
|
78
78
|
delayBlocks: number;
|
|
79
|
+
/**
|
|
80
|
+
* Additional relayer addresses allowed to sign MsgFailWithdrawal and
|
|
81
|
+
* MsgResolveWithdrawal.
|
|
82
|
+
* If non-empty, these addresses are accepted in addition to configured module
|
|
83
|
+
* authorities.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
relayerAddresses: string[];
|
|
79
87
|
}
|
|
80
88
|
/** SafetyParams stores safety parameters for the module. */
|
|
81
89
|
|
|
82
90
|
export interface SafetyParamsSDKType {
|
|
83
91
|
is_disabled: boolean;
|
|
84
92
|
delay_blocks: number;
|
|
93
|
+
relayer_addresses: string[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* BridgeFeeParams stores fee parameters for deposit and withdrawal.
|
|
97
|
+
* Fee is a fixed amount in the same denom as the transfer (smallest units).
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
export interface BridgeFeeParams {
|
|
101
|
+
/** Fixed deposit fee amount (in deposit denom's smallest units). "0" or empty = no fee. */
|
|
102
|
+
depositFeeAmount: string;
|
|
103
|
+
/** Fixed withdrawal fee amount (in withdrawal denom's smallest units). "0" or empty = no fee. */
|
|
104
|
+
|
|
105
|
+
withdrawalFeeAmount: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* BridgeFeeParams stores fee parameters for deposit and withdrawal.
|
|
109
|
+
* Fee is a fixed amount in the same denom as the transfer (smallest units).
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
export interface BridgeFeeParamsSDKType {
|
|
113
|
+
deposit_fee_amount: string;
|
|
114
|
+
withdrawal_fee_amount: string;
|
|
85
115
|
}
|
|
86
116
|
/**
|
|
87
117
|
* TSSParams stores parameters for TSS (Threshold Signature Scheme).
|
|
88
|
-
* Note: TSS produces a single aggregated signature, no threshold counting
|
|
118
|
+
* Note: TSS produces a single aggregated signature, no threshold counting
|
|
119
|
+
* needed.
|
|
89
120
|
*/
|
|
90
121
|
|
|
91
122
|
export interface TSSParams {
|
|
@@ -98,15 +129,16 @@ export interface TSSParams {
|
|
|
98
129
|
|
|
99
130
|
supportedChainIds: Long[];
|
|
100
131
|
/**
|
|
101
|
-
* TSS group public key (hex-encoded, 66 chars for compressed or 130 for
|
|
102
|
-
* This is used to verify TSS signatures.
|
|
132
|
+
* TSS group public key (hex-encoded, 66 chars for compressed or 130 for
|
|
133
|
+
* uncompressed). This is used to verify TSS signatures.
|
|
103
134
|
*/
|
|
104
135
|
|
|
105
136
|
tssPubKey: string;
|
|
106
137
|
}
|
|
107
138
|
/**
|
|
108
139
|
* TSSParams stores parameters for TSS (Threshold Signature Scheme).
|
|
109
|
-
* Note: TSS produces a single aggregated signature, no threshold counting
|
|
140
|
+
* Note: TSS produces a single aggregated signature, no threshold counting
|
|
141
|
+
* needed.
|
|
110
142
|
*/
|
|
111
143
|
|
|
112
144
|
export interface TSSParamsSDKType {
|
|
@@ -259,7 +291,8 @@ export const ProposeParams = {
|
|
|
259
291
|
function createBaseSafetyParams(): SafetyParams {
|
|
260
292
|
return {
|
|
261
293
|
isDisabled: false,
|
|
262
|
-
delayBlocks: 0
|
|
294
|
+
delayBlocks: 0,
|
|
295
|
+
relayerAddresses: []
|
|
263
296
|
};
|
|
264
297
|
}
|
|
265
298
|
|
|
@@ -273,6 +306,10 @@ export const SafetyParams = {
|
|
|
273
306
|
writer.uint32(16).uint32(message.delayBlocks);
|
|
274
307
|
}
|
|
275
308
|
|
|
309
|
+
for (const v of message.relayerAddresses) {
|
|
310
|
+
writer.uint32(26).string(v!);
|
|
311
|
+
}
|
|
312
|
+
|
|
276
313
|
return writer;
|
|
277
314
|
},
|
|
278
315
|
|
|
@@ -293,6 +330,10 @@ export const SafetyParams = {
|
|
|
293
330
|
message.delayBlocks = reader.uint32();
|
|
294
331
|
break;
|
|
295
332
|
|
|
333
|
+
case 3:
|
|
334
|
+
message.relayerAddresses.push(reader.string());
|
|
335
|
+
break;
|
|
336
|
+
|
|
296
337
|
default:
|
|
297
338
|
reader.skipType(tag & 7);
|
|
298
339
|
break;
|
|
@@ -306,6 +347,62 @@ export const SafetyParams = {
|
|
|
306
347
|
const message = createBaseSafetyParams();
|
|
307
348
|
message.isDisabled = object.isDisabled ?? false;
|
|
308
349
|
message.delayBlocks = object.delayBlocks ?? 0;
|
|
350
|
+
message.relayerAddresses = object.relayerAddresses?.map(e => e) || [];
|
|
351
|
+
return message;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
function createBaseBridgeFeeParams(): BridgeFeeParams {
|
|
357
|
+
return {
|
|
358
|
+
depositFeeAmount: "",
|
|
359
|
+
withdrawalFeeAmount: ""
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export const BridgeFeeParams = {
|
|
364
|
+
encode(message: BridgeFeeParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
365
|
+
if (message.depositFeeAmount !== "") {
|
|
366
|
+
writer.uint32(10).string(message.depositFeeAmount);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (message.withdrawalFeeAmount !== "") {
|
|
370
|
+
writer.uint32(18).string(message.withdrawalFeeAmount);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return writer;
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): BridgeFeeParams {
|
|
377
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
378
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
379
|
+
const message = createBaseBridgeFeeParams();
|
|
380
|
+
|
|
381
|
+
while (reader.pos < end) {
|
|
382
|
+
const tag = reader.uint32();
|
|
383
|
+
|
|
384
|
+
switch (tag >>> 3) {
|
|
385
|
+
case 1:
|
|
386
|
+
message.depositFeeAmount = reader.string();
|
|
387
|
+
break;
|
|
388
|
+
|
|
389
|
+
case 2:
|
|
390
|
+
message.withdrawalFeeAmount = reader.string();
|
|
391
|
+
break;
|
|
392
|
+
|
|
393
|
+
default:
|
|
394
|
+
reader.skipType(tag & 7);
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return message;
|
|
400
|
+
},
|
|
401
|
+
|
|
402
|
+
fromPartial(object: DeepPartial<BridgeFeeParams>): BridgeFeeParams {
|
|
403
|
+
const message = createBaseBridgeFeeParams();
|
|
404
|
+
message.depositFeeAmount = object.depositFeeAmount ?? "";
|
|
405
|
+
message.withdrawalFeeAmount = object.withdrawalFeeAmount ?? "";
|
|
309
406
|
return message;
|
|
310
407
|
}
|
|
311
408
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { setPaginationParams } from "../../helpers";
|
|
1
2
|
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, QueryVerifyWithdrawalForTSSRequest, QueryVerifyWithdrawalForTSSResponseSDKType } from "./query";
|
|
3
|
-
import { QueryTokenInfoRequest, QueryTokenInfoResponseSDKType, QueryTokenPairRequest, QueryTokenPairResponseSDKType, QueryAllTokensRequest, QueryAllTokensResponseSDKType, QueryTokenPairsBySourceRequest, QueryTokenPairsBySourceResponseSDKType } from "./token";
|
|
3
|
+
import { QueryEventParamsRequest, QueryEventParamsResponseSDKType, QueryProposeParamsRequest, QueryProposeParamsResponseSDKType, QuerySafetyParamsRequest, QuerySafetyParamsResponseSDKType, QueryAcknowledgedEventInfoRequest, QueryAcknowledgedEventInfoResponseSDKType, QueryRecognizedEventInfoRequest, QueryRecognizedEventInfoResponseSDKType, QueryDelayedCompleteBridgeMessagesRequest, QueryDelayedCompleteBridgeMessagesResponseSDKType, QueryTSSParamsRequest, QueryTSSParamsResponseSDKType, QueryWithdrawalRequestRequest, QueryWithdrawalRequestResponseSDKType, QueryWithdrawalsByAddressRequest, QueryWithdrawalsByAddressResponseSDKType, QueryPendingWithdrawalsRequest, QueryPendingWithdrawalsResponseSDKType, QuerySignedWithdrawalsRequest, QuerySignedWithdrawalsResponseSDKType, QueryWithdrawalByChainAndNonceRequest, QueryWithdrawalByChainAndNonceResponseSDKType, QueryVerifyWithdrawalForTSSRequest, QueryVerifyWithdrawalForTSSResponseSDKType } from "./query";
|
|
4
|
+
import { QueryTokenInfoRequest, QueryTokenInfoResponseSDKType, QueryTokenPairRequest, QueryTokenPairResponseSDKType, QueryAllTokensRequest, QueryAllTokensResponseSDKType, QueryTokenPairsBySourceRequest, QueryTokenPairsBySourceResponseSDKType, QueryAllTokenPairsRequest, QueryAllTokenPairsResponseSDKType } from "./token";
|
|
4
5
|
export class LCDQueryClient {
|
|
5
6
|
req: LCDClient;
|
|
6
7
|
|
|
@@ -20,11 +21,13 @@ export class LCDQueryClient {
|
|
|
20
21
|
this.withdrawalRequest = this.withdrawalRequest.bind(this);
|
|
21
22
|
this.withdrawalsByAddress = this.withdrawalsByAddress.bind(this);
|
|
22
23
|
this.pendingWithdrawals = this.pendingWithdrawals.bind(this);
|
|
24
|
+
this.signedWithdrawals = this.signedWithdrawals.bind(this);
|
|
23
25
|
this.withdrawalByChainAndNonce = this.withdrawalByChainAndNonce.bind(this);
|
|
24
26
|
this.tokenInfo = this.tokenInfo.bind(this);
|
|
25
27
|
this.tokenPair = this.tokenPair.bind(this);
|
|
26
28
|
this.allTokens = this.allTokens.bind(this);
|
|
27
29
|
this.tokenPairsBySource = this.tokenPairsBySource.bind(this);
|
|
30
|
+
this.allTokenPairs = this.allTokenPairs.bind(this);
|
|
28
31
|
this.verifyWithdrawalForTSS = this.verifyWithdrawalForTSS.bind(this);
|
|
29
32
|
}
|
|
30
33
|
/* Queries the EventParams. */
|
|
@@ -123,6 +126,23 @@ export class LCDQueryClient {
|
|
|
123
126
|
const endpoint = `zoguxprotocol/v4/bridge/pending_withdrawals`;
|
|
124
127
|
return await this.req.get<QueryPendingWithdrawalsResponseSDKType>(endpoint, options);
|
|
125
128
|
}
|
|
129
|
+
/* Queries signed withdrawals (those with enough TSS signatures). */
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
async signedWithdrawals(params: QuerySignedWithdrawalsRequest = {
|
|
133
|
+
pagination: undefined
|
|
134
|
+
}): Promise<QuerySignedWithdrawalsResponseSDKType> {
|
|
135
|
+
const options: any = {
|
|
136
|
+
params: {}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
if (typeof params?.pagination !== "undefined") {
|
|
140
|
+
setPaginationParams(options, params.pagination);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const endpoint = `zoguxprotocol/v4/bridge/signed_withdrawals`;
|
|
144
|
+
return await this.req.get<QuerySignedWithdrawalsResponseSDKType>(endpoint, options);
|
|
145
|
+
}
|
|
126
146
|
/* Queries a specific withdrawal by chain ID and nonce.
|
|
127
147
|
Used by TSS service to check deposit info. */
|
|
128
148
|
|
|
@@ -159,6 +179,13 @@ export class LCDQueryClient {
|
|
|
159
179
|
const endpoint = `zogux/v4/bridge/token_pairs/${params.srcChainId}/${params.srcTokenAddress}`;
|
|
160
180
|
return await this.req.get<QueryTokenPairsBySourceResponseSDKType>(endpoint);
|
|
161
181
|
}
|
|
182
|
+
/* Queries all token pairs. */
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
async allTokenPairs(_params: QueryAllTokenPairsRequest = {}): Promise<QueryAllTokenPairsResponseSDKType> {
|
|
186
|
+
const endpoint = `zogux/v4/bridge/all_token_pairs`;
|
|
187
|
+
return await this.req.get<QueryAllTokenPairsResponseSDKType>(endpoint);
|
|
188
|
+
}
|
|
162
189
|
/* Verifies a withdrawal for TSS signing. */
|
|
163
190
|
|
|
164
191
|
|