@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.
@@ -0,0 +1,28 @@
1
+ import { Rpc } from "../../helpers";
2
+ import * as _m0 from "protobufjs/minimal";
3
+ import { MsgRecoverySpotBalance, MsgRecoverySpotBalanceResponse } from "./tx";
4
+ /** Msg defines the subaccounts Msg service. */
5
+
6
+ export interface Msg {
7
+ /**
8
+ * RecoverySpotBalance is an admin function to recover spot balance
9
+ * discrepancies. This should only be called by authorized admin/governance
10
+ * addresses.
11
+ */
12
+ recoverySpotBalance(request: MsgRecoverySpotBalance): Promise<MsgRecoverySpotBalanceResponse>;
13
+ }
14
+ export class MsgClientImpl implements Msg {
15
+ private readonly rpc: Rpc;
16
+
17
+ constructor(rpc: Rpc) {
18
+ this.rpc = rpc;
19
+ this.recoverySpotBalance = this.recoverySpotBalance.bind(this);
20
+ }
21
+
22
+ recoverySpotBalance(request: MsgRecoverySpotBalance): Promise<MsgRecoverySpotBalanceResponse> {
23
+ const data = MsgRecoverySpotBalance.encode(request).finish();
24
+ const promise = this.rpc.request("zogux.subaccounts.Msg", "RecoverySpotBalance", data);
25
+ return promise.then(data => MsgRecoverySpotBalanceResponse.decode(new _m0.Reader(data)));
26
+ }
27
+
28
+ }
@@ -0,0 +1,159 @@
1
+ import { SubaccountId, SubaccountIdSDKType } from "./subaccount";
2
+ import * as _m0 from "protobufjs/minimal";
3
+ import { DeepPartial } from "../../helpers";
4
+ /**
5
+ * MsgRecoverySpotBalance is the request type for recovering spot balance
6
+ * discrepancies.
7
+ */
8
+
9
+ export interface MsgRecoverySpotBalance {
10
+ /**
11
+ * Authority is the address authorized to execute this message (typically
12
+ * governance).
13
+ */
14
+ authority: string;
15
+ /** SubaccountId identifies the subaccount to recover. */
16
+
17
+ subaccountId?: SubaccountId;
18
+ /** AssetId is the asset ID to recover balance for. */
19
+
20
+ assetId: number;
21
+ /**
22
+ * DeltaAmount is the amount to add (positive) or subtract (negative) to
23
+ * recover the balance. This is a string representation of a big.Int.
24
+ */
25
+
26
+ deltaAmount: string;
27
+ }
28
+ /**
29
+ * MsgRecoverySpotBalance is the request type for recovering spot balance
30
+ * discrepancies.
31
+ */
32
+
33
+ export interface MsgRecoverySpotBalanceSDKType {
34
+ authority: string;
35
+ subaccount_id?: SubaccountIdSDKType;
36
+ asset_id: number;
37
+ delta_amount: string;
38
+ }
39
+ /**
40
+ * MsgRecoverySpotBalanceResponse is the response type for
41
+ * MsgRecoverySpotBalance.
42
+ */
43
+
44
+ export interface MsgRecoverySpotBalanceResponse {}
45
+ /**
46
+ * MsgRecoverySpotBalanceResponse is the response type for
47
+ * MsgRecoverySpotBalance.
48
+ */
49
+
50
+ export interface MsgRecoverySpotBalanceResponseSDKType {}
51
+
52
+ function createBaseMsgRecoverySpotBalance(): MsgRecoverySpotBalance {
53
+ return {
54
+ authority: "",
55
+ subaccountId: undefined,
56
+ assetId: 0,
57
+ deltaAmount: ""
58
+ };
59
+ }
60
+
61
+ export const MsgRecoverySpotBalance = {
62
+ encode(message: MsgRecoverySpotBalance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
63
+ if (message.authority !== "") {
64
+ writer.uint32(10).string(message.authority);
65
+ }
66
+
67
+ if (message.subaccountId !== undefined) {
68
+ SubaccountId.encode(message.subaccountId, writer.uint32(18).fork()).ldelim();
69
+ }
70
+
71
+ if (message.assetId !== 0) {
72
+ writer.uint32(24).uint32(message.assetId);
73
+ }
74
+
75
+ if (message.deltaAmount !== "") {
76
+ writer.uint32(34).string(message.deltaAmount);
77
+ }
78
+
79
+ return writer;
80
+ },
81
+
82
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecoverySpotBalance {
83
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
84
+ let end = length === undefined ? reader.len : reader.pos + length;
85
+ const message = createBaseMsgRecoverySpotBalance();
86
+
87
+ while (reader.pos < end) {
88
+ const tag = reader.uint32();
89
+
90
+ switch (tag >>> 3) {
91
+ case 1:
92
+ message.authority = reader.string();
93
+ break;
94
+
95
+ case 2:
96
+ message.subaccountId = SubaccountId.decode(reader, reader.uint32());
97
+ break;
98
+
99
+ case 3:
100
+ message.assetId = reader.uint32();
101
+ break;
102
+
103
+ case 4:
104
+ message.deltaAmount = reader.string();
105
+ break;
106
+
107
+ default:
108
+ reader.skipType(tag & 7);
109
+ break;
110
+ }
111
+ }
112
+
113
+ return message;
114
+ },
115
+
116
+ fromPartial(object: DeepPartial<MsgRecoverySpotBalance>): MsgRecoverySpotBalance {
117
+ const message = createBaseMsgRecoverySpotBalance();
118
+ message.authority = object.authority ?? "";
119
+ message.subaccountId = object.subaccountId !== undefined && object.subaccountId !== null ? SubaccountId.fromPartial(object.subaccountId) : undefined;
120
+ message.assetId = object.assetId ?? 0;
121
+ message.deltaAmount = object.deltaAmount ?? "";
122
+ return message;
123
+ }
124
+
125
+ };
126
+
127
+ function createBaseMsgRecoverySpotBalanceResponse(): MsgRecoverySpotBalanceResponse {
128
+ return {};
129
+ }
130
+
131
+ export const MsgRecoverySpotBalanceResponse = {
132
+ encode(_: MsgRecoverySpotBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
133
+ return writer;
134
+ },
135
+
136
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecoverySpotBalanceResponse {
137
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
138
+ let end = length === undefined ? reader.len : reader.pos + length;
139
+ const message = createBaseMsgRecoverySpotBalanceResponse();
140
+
141
+ while (reader.pos < end) {
142
+ const tag = reader.uint32();
143
+
144
+ switch (tag >>> 3) {
145
+ default:
146
+ reader.skipType(tag & 7);
147
+ break;
148
+ }
149
+ }
150
+
151
+ return message;
152
+ },
153
+
154
+ fromPartial(_: DeepPartial<MsgRecoverySpotBalanceResponse>): MsgRecoverySpotBalanceResponse {
155
+ const message = createBaseMsgRecoverySpotBalanceResponse();
156
+ return message;
157
+ }
158
+
159
+ };