@caict/bop-typescript-sdk 1.0.0
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/CHANGELOG.md +34 -0
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +112 -0
- package/package.json +90 -0
- package/src/bop/bop-base/README.md +5 -0
- package/src/bop/bop-base/base.ts +366 -0
- package/src/bop/bop-base/index.ts +83 -0
- package/src/bop/bop-base/permit.ts +116 -0
- package/src/bop/bop-base/test/base.test.ts +867 -0
- package/src/bop/bop-base/test/index.test.ts +69 -0
- package/src/bop/bop-base/test/permit.test.ts +125 -0
- package/src/bop/bop-base/tsconfig.json +8 -0
- package/src/bop/bop-proto/README.md +2 -0
- package/src/bop/bop-proto/bop-ws.proto +266 -0
- package/src/bop/bop-proto/bop-ws.ts +4447 -0
- package/src/bop/bop-proto/bop.proto +898 -0
- package/src/bop/bop-proto/bop.ts +12890 -0
- package/src/bop/bop-proto/tsconfig.json +8 -0
- package/src/bop/bop-ws/index.ts +315 -0
- package/src/bop/bop-ws/sample/sample.ts +107 -0
- package/src/bop/bop-ws/tsconfig.json +8 -0
- package/src/bop/index.ts +14 -0
- package/src/bop-sdk/index.ts +22 -0
- package/src/bop-sdk/interface/abstract-service/abstract-account.ts +23 -0
- package/src/bop-sdk/interface/abstract-service/abstract-chain.ts +9 -0
- package/src/bop-sdk/interface/abstract-service/abstract-contract.ts +16 -0
- package/src/bop-sdk/interface/abstract-service/abstract-ledger.ts +15 -0
- package/src/bop-sdk/interface/abstract-service/abstract-provider.ts +13 -0
- package/src/bop-sdk/interface/abstract-service/abstract-signer.ts +133 -0
- package/src/bop-sdk/interface/abstract-service/abstract-transaction.ts +86 -0
- package/src/bop-sdk/interface/provider-ws.ts +10 -0
- package/src/bop-sdk/interface/provider.ts +22 -0
- package/src/bop-sdk/interface/service/3rd.ts +54 -0
- package/src/bop-sdk/interface/service/account.ts +86 -0
- package/src/bop-sdk/interface/service/chain.ts +27 -0
- package/src/bop-sdk/interface/service/contract.ts +51 -0
- package/src/bop-sdk/interface/service/helper.ts +426 -0
- package/src/bop-sdk/interface/service/ledger.ts +75 -0
- package/src/bop-sdk/interface/service/offline/check/index.js +138 -0
- package/src/bop-sdk/interface/service/offline/common/constant.js +6 -0
- package/src/bop-sdk/interface/service/offline/common/snowFlakeUtils.js +192 -0
- package/src/bop-sdk/interface/service/offline/common/util.js +511 -0
- package/src/bop-sdk/interface/service/offline/exception/customErrors.js +29 -0
- package/src/bop-sdk/interface/service/offline/exception/errors.js +90 -0
- package/src/bop-sdk/interface/service/offline/exception/index.js +5 -0
- package/src/bop-sdk/interface/service/offline/operation/accountCreateOperation.js +28 -0
- package/src/bop-sdk/interface/service/offline/operation/accountSetMetadataOperation.js +44 -0
- package/src/bop-sdk/interface/service/offline/operation/accountSetPrivilegeOperation.js +49 -0
- package/src/bop-sdk/interface/service/offline/operation/contractCreateOperation.js +43 -0
- package/src/bop-sdk/interface/service/offline/operation/contractInvokeOperation.js +42 -0
- package/src/bop-sdk/interface/service/offline/operation/contractInvokeRequestOperation.js +69 -0
- package/src/bop-sdk/interface/service/offline/operation/gasSendOperation.js +29 -0
- package/src/bop-sdk/interface/service/offline/operation/gasSendRequestOperation.js +61 -0
- package/src/bop-sdk/interface/service/offline/operation/index.js +20 -0
- package/src/bop-sdk/interface/service/offline/proto/chain_pb.js +12079 -0
- package/src/bop-sdk/interface/service/offline/proto/common_pb.js +2867 -0
- package/src/bop-sdk/interface/service/offline/transaction/index.js +988 -0
- package/src/bop-sdk/interface/service/offline/transaction/operations.js +188 -0
- package/src/bop-sdk/interface/service/offline/validate/account.js +152 -0
- package/src/bop-sdk/interface/service/offline/validate/contract.js +101 -0
- package/src/bop-sdk/interface/service/offline/validate/index.js +10 -0
- package/src/bop-sdk/interface/service/offline/validate/transaction.js +51 -0
- package/src/bop-sdk/interface/service/transaction.ts +731 -0
- package/src/bop-sdk/interface/signer.ts +46 -0
- package/src/bop-sdk/interface/test/3rd.test.ts +1571 -0
- package/src/bop-sdk/interface/test/account.test.ts +284 -0
- package/src/bop-sdk/interface/test/chain.test.ts +45 -0
- package/src/bop-sdk/interface/test/contract.test.ts +283 -0
- package/src/bop-sdk/interface/test/ledger.test.ts +166 -0
- package/src/bop-sdk/interface/test/provider.test.ts +407 -0
- package/src/bop-sdk/interface/test/signer.test.ts +105 -0
- package/src/bop-sdk/interface/test/transaction.test.ts +713 -0
- package/src/bop-sdk/proto/bop-sdk-common.proto +159 -0
- package/src/bop-sdk/proto/bop-sdk-common.ts +829 -0
- package/src/bop-sdk/proto/bop-sdk-interface.proto +581 -0
- package/src/bop-sdk/proto/bop-sdk-interface.ts +10839 -0
- package/src/bop-sdk/proto/bop-sdk-utils.proto +86 -0
- package/src/bop-sdk/proto/bop-sdk-utils.ts +1495 -0
- package/src/bop-sdk/utils/abi/abi-coder.ts +147 -0
- package/src/bop-sdk/utils/abi/address.ts +109 -0
- package/src/bop-sdk/utils/abi/bignumber.ts +403 -0
- package/src/bop-sdk/utils/abi/bytes.ts +565 -0
- package/src/bop-sdk/utils/abi/coders/abstract-coder.ts +239 -0
- package/src/bop-sdk/utils/abi/coders/address.ts +58 -0
- package/src/bop-sdk/utils/abi/coders/anonymous.ts +25 -0
- package/src/bop-sdk/utils/abi/coders/array.ts +275 -0
- package/src/bop-sdk/utils/abi/coders/boolean.ts +21 -0
- package/src/bop-sdk/utils/abi/coders/bytes.ts +36 -0
- package/src/bop-sdk/utils/abi/coders/fixed-bytes.ts +35 -0
- package/src/bop-sdk/utils/abi/coders/null.ts +25 -0
- package/src/bop-sdk/utils/abi/coders/number.ts +56 -0
- package/src/bop-sdk/utils/abi/coders/string.ts +24 -0
- package/src/bop-sdk/utils/abi/coders/tuple.ts +73 -0
- package/src/bop-sdk/utils/abi/constants/addresses.ts +1 -0
- package/src/bop-sdk/utils/abi/constants/bignumbers.ts +30 -0
- package/src/bop-sdk/utils/abi/constants/hashes.ts +2 -0
- package/src/bop-sdk/utils/abi/constants/index.ts +15 -0
- package/src/bop-sdk/utils/abi/constants/strings.ts +2 -0
- package/src/bop-sdk/utils/abi/fragments.ts +1243 -0
- package/src/bop-sdk/utils/abi/id.ts +6 -0
- package/src/bop-sdk/utils/abi/index.ts +46 -0
- package/src/bop-sdk/utils/abi/interface.ts +921 -0
- package/src/bop-sdk/utils/abi/keccak256.ts +9 -0
- package/src/bop-sdk/utils/abi/properties.ts +172 -0
- package/src/bop-sdk/utils/abi/strings/bytes32.ts +40 -0
- package/src/bop-sdk/utils/abi/strings/idna.ts +258 -0
- package/src/bop-sdk/utils/abi/strings/index.ts +28 -0
- package/src/bop-sdk/utils/abi/strings/utf8.ts +373 -0
- package/src/bop-sdk/utils/encryption-address.ts +501 -0
- package/src/bop-sdk/utils/encryption-crypto.ts +427 -0
- package/src/bop-sdk/utils/encryption-mnemonics.ts +120 -0
- package/src/bop-sdk/utils/index.ts +27 -0
- package/src/bop-sdk/utils/logger.ts +480 -0
- package/src/index.ts +35 -0
|
@@ -0,0 +1,4447 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.6.0
|
|
4
|
+
// protoc v3.20.3
|
|
5
|
+
// source: bop-ws.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "bopws";
|
|
11
|
+
|
|
12
|
+
/** 定义心跳消息、错误提示和订阅类型的枚举 */
|
|
13
|
+
export enum MessageType {
|
|
14
|
+
/** HEARTBEAT - 心跳消息 */
|
|
15
|
+
HEARTBEAT = 0,
|
|
16
|
+
/** ERROR - 连接返回错误提示 */
|
|
17
|
+
ERROR = -1,
|
|
18
|
+
/** BLOCK_HEADER - 订阅区块头 */
|
|
19
|
+
BLOCK_HEADER = 1,
|
|
20
|
+
/** BID_TRANSACTION - 订阅指定bid的交易 */
|
|
21
|
+
BID_TRANSACTION = 2,
|
|
22
|
+
/** TLOG - 订阅TLOG */
|
|
23
|
+
TLOG = 3,
|
|
24
|
+
/** DISCARD_TRANSACTION - 订阅丢弃交易 */
|
|
25
|
+
DISCARD_TRANSACTION = 4,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function messageTypeFromJSON(object: any): MessageType {
|
|
29
|
+
switch (object) {
|
|
30
|
+
case 0:
|
|
31
|
+
case "HEARTBEAT":
|
|
32
|
+
return MessageType.HEARTBEAT;
|
|
33
|
+
case -1:
|
|
34
|
+
case "ERROR":
|
|
35
|
+
return MessageType.ERROR;
|
|
36
|
+
case 1:
|
|
37
|
+
case "BLOCK_HEADER":
|
|
38
|
+
return MessageType.BLOCK_HEADER;
|
|
39
|
+
case 2:
|
|
40
|
+
case "BID_TRANSACTION":
|
|
41
|
+
return MessageType.BID_TRANSACTION;
|
|
42
|
+
case 3:
|
|
43
|
+
case "TLOG":
|
|
44
|
+
return MessageType.TLOG;
|
|
45
|
+
case 4:
|
|
46
|
+
case "DISCARD_TRANSACTION":
|
|
47
|
+
return MessageType.DISCARD_TRANSACTION;
|
|
48
|
+
default:
|
|
49
|
+
return MessageType.ERROR;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function messageTypeToJSON(object: MessageType): string {
|
|
54
|
+
switch (object) {
|
|
55
|
+
case MessageType.HEARTBEAT:
|
|
56
|
+
return "HEARTBEAT";
|
|
57
|
+
case MessageType.ERROR:
|
|
58
|
+
return "ERROR";
|
|
59
|
+
case MessageType.BLOCK_HEADER:
|
|
60
|
+
return "BLOCK_HEADER";
|
|
61
|
+
case MessageType.BID_TRANSACTION:
|
|
62
|
+
return "BID_TRANSACTION";
|
|
63
|
+
case MessageType.TLOG:
|
|
64
|
+
return "TLOG";
|
|
65
|
+
case MessageType.DISCARD_TRANSACTION:
|
|
66
|
+
return "DISCARD_TRANSACTION";
|
|
67
|
+
default:
|
|
68
|
+
return "ERROR";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** 心跳消息(可以是ping或pong) */
|
|
73
|
+
export interface HeartbeatMessage {
|
|
74
|
+
/** 可选的附加信息,如"ping"或"pong" */
|
|
75
|
+
message?: string | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface SubscribeRequest {
|
|
79
|
+
message?: string[] | undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface LedgerHeaderMessage {
|
|
83
|
+
seq?: number | undefined;
|
|
84
|
+
hash?: string | undefined;
|
|
85
|
+
previousHash?: string | undefined;
|
|
86
|
+
accountTreeHash?: string | undefined;
|
|
87
|
+
closeTime?: number | undefined;
|
|
88
|
+
consensusValueHash?: string | undefined;
|
|
89
|
+
version?: number | undefined;
|
|
90
|
+
txCount?: number | undefined;
|
|
91
|
+
/** hash */
|
|
92
|
+
validatorsHash?: string | undefined;
|
|
93
|
+
feesHash?: string | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface Contract {
|
|
97
|
+
type?: Contract_ContractType | undefined;
|
|
98
|
+
payload?: string | undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export enum Contract_ContractType {
|
|
102
|
+
JAVASCRIPT = 0,
|
|
103
|
+
EVM = 1,
|
|
104
|
+
SYSTEM = 2,
|
|
105
|
+
UNRECOGNIZED = -1,
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function contract_ContractTypeFromJSON(
|
|
109
|
+
object: any,
|
|
110
|
+
): Contract_ContractType {
|
|
111
|
+
switch (object) {
|
|
112
|
+
case 0:
|
|
113
|
+
case "JAVASCRIPT":
|
|
114
|
+
return Contract_ContractType.JAVASCRIPT;
|
|
115
|
+
case 1:
|
|
116
|
+
case "EVM":
|
|
117
|
+
return Contract_ContractType.EVM;
|
|
118
|
+
case 2:
|
|
119
|
+
case "SYSTEM":
|
|
120
|
+
return Contract_ContractType.SYSTEM;
|
|
121
|
+
case -1:
|
|
122
|
+
case "UNRECOGNIZED":
|
|
123
|
+
default:
|
|
124
|
+
return Contract_ContractType.UNRECOGNIZED;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function contract_ContractTypeToJSON(
|
|
129
|
+
object: Contract_ContractType,
|
|
130
|
+
): string {
|
|
131
|
+
switch (object) {
|
|
132
|
+
case Contract_ContractType.JAVASCRIPT:
|
|
133
|
+
return "JAVASCRIPT";
|
|
134
|
+
case Contract_ContractType.EVM:
|
|
135
|
+
return "EVM";
|
|
136
|
+
case Contract_ContractType.SYSTEM:
|
|
137
|
+
return "SYSTEM";
|
|
138
|
+
case Contract_ContractType.UNRECOGNIZED:
|
|
139
|
+
default:
|
|
140
|
+
return "UNRECOGNIZED";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface Signer {
|
|
145
|
+
address?: string | undefined;
|
|
146
|
+
weight?: number | undefined;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export enum Signer_Limit {
|
|
150
|
+
SIGNER_NONE = 0,
|
|
151
|
+
SIGNER = 100,
|
|
152
|
+
UNRECOGNIZED = -1,
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function signer_LimitFromJSON(object: any): Signer_Limit {
|
|
156
|
+
switch (object) {
|
|
157
|
+
case 0:
|
|
158
|
+
case "SIGNER_NONE":
|
|
159
|
+
return Signer_Limit.SIGNER_NONE;
|
|
160
|
+
case 100:
|
|
161
|
+
case "SIGNER":
|
|
162
|
+
return Signer_Limit.SIGNER;
|
|
163
|
+
case -1:
|
|
164
|
+
case "UNRECOGNIZED":
|
|
165
|
+
default:
|
|
166
|
+
return Signer_Limit.UNRECOGNIZED;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function signer_LimitToJSON(object: Signer_Limit): string {
|
|
171
|
+
switch (object) {
|
|
172
|
+
case Signer_Limit.SIGNER_NONE:
|
|
173
|
+
return "SIGNER_NONE";
|
|
174
|
+
case Signer_Limit.SIGNER:
|
|
175
|
+
return "SIGNER";
|
|
176
|
+
case Signer_Limit.UNRECOGNIZED:
|
|
177
|
+
default:
|
|
178
|
+
return "UNRECOGNIZED";
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface AccountPrivilege {
|
|
183
|
+
masterWeight?: number | undefined;
|
|
184
|
+
signers?: Signer[] | undefined;
|
|
185
|
+
thresholds?: AccountThreshold | undefined;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface OperationTypeThreshold {
|
|
189
|
+
type?: OperationTypeThreshold_Type | undefined;
|
|
190
|
+
threshold?: number | undefined;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export enum OperationTypeThreshold_Type {
|
|
194
|
+
UNKNOWN = 0,
|
|
195
|
+
CREATE_ACCOUNT = 1,
|
|
196
|
+
SET_METADATA = 4,
|
|
197
|
+
SET_SIGNER_WEIGHT = 5,
|
|
198
|
+
SET_THRESHOLD = 6,
|
|
199
|
+
PAY_COIN = 7,
|
|
200
|
+
LOG = 8,
|
|
201
|
+
SET_PRIVILEGE = 9,
|
|
202
|
+
UPGRADE_CONTRACT = 10,
|
|
203
|
+
SET_CONTROLLED_AREA = 11,
|
|
204
|
+
AUTHORIZE_TRANSFER = 12,
|
|
205
|
+
UNRECOGNIZED = -1,
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function operationTypeThreshold_TypeFromJSON(
|
|
209
|
+
object: any,
|
|
210
|
+
): OperationTypeThreshold_Type {
|
|
211
|
+
switch (object) {
|
|
212
|
+
case 0:
|
|
213
|
+
case "UNKNOWN":
|
|
214
|
+
return OperationTypeThreshold_Type.UNKNOWN;
|
|
215
|
+
case 1:
|
|
216
|
+
case "CREATE_ACCOUNT":
|
|
217
|
+
return OperationTypeThreshold_Type.CREATE_ACCOUNT;
|
|
218
|
+
case 4:
|
|
219
|
+
case "SET_METADATA":
|
|
220
|
+
return OperationTypeThreshold_Type.SET_METADATA;
|
|
221
|
+
case 5:
|
|
222
|
+
case "SET_SIGNER_WEIGHT":
|
|
223
|
+
return OperationTypeThreshold_Type.SET_SIGNER_WEIGHT;
|
|
224
|
+
case 6:
|
|
225
|
+
case "SET_THRESHOLD":
|
|
226
|
+
return OperationTypeThreshold_Type.SET_THRESHOLD;
|
|
227
|
+
case 7:
|
|
228
|
+
case "PAY_COIN":
|
|
229
|
+
return OperationTypeThreshold_Type.PAY_COIN;
|
|
230
|
+
case 8:
|
|
231
|
+
case "LOG":
|
|
232
|
+
return OperationTypeThreshold_Type.LOG;
|
|
233
|
+
case 9:
|
|
234
|
+
case "SET_PRIVILEGE":
|
|
235
|
+
return OperationTypeThreshold_Type.SET_PRIVILEGE;
|
|
236
|
+
case 10:
|
|
237
|
+
case "UPGRADE_CONTRACT":
|
|
238
|
+
return OperationTypeThreshold_Type.UPGRADE_CONTRACT;
|
|
239
|
+
case 11:
|
|
240
|
+
case "SET_CONTROLLED_AREA":
|
|
241
|
+
return OperationTypeThreshold_Type.SET_CONTROLLED_AREA;
|
|
242
|
+
case 12:
|
|
243
|
+
case "AUTHORIZE_TRANSFER":
|
|
244
|
+
return OperationTypeThreshold_Type.AUTHORIZE_TRANSFER;
|
|
245
|
+
case -1:
|
|
246
|
+
case "UNRECOGNIZED":
|
|
247
|
+
default:
|
|
248
|
+
return OperationTypeThreshold_Type.UNRECOGNIZED;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export function operationTypeThreshold_TypeToJSON(
|
|
253
|
+
object: OperationTypeThreshold_Type,
|
|
254
|
+
): string {
|
|
255
|
+
switch (object) {
|
|
256
|
+
case OperationTypeThreshold_Type.UNKNOWN:
|
|
257
|
+
return "UNKNOWN";
|
|
258
|
+
case OperationTypeThreshold_Type.CREATE_ACCOUNT:
|
|
259
|
+
return "CREATE_ACCOUNT";
|
|
260
|
+
case OperationTypeThreshold_Type.SET_METADATA:
|
|
261
|
+
return "SET_METADATA";
|
|
262
|
+
case OperationTypeThreshold_Type.SET_SIGNER_WEIGHT:
|
|
263
|
+
return "SET_SIGNER_WEIGHT";
|
|
264
|
+
case OperationTypeThreshold_Type.SET_THRESHOLD:
|
|
265
|
+
return "SET_THRESHOLD";
|
|
266
|
+
case OperationTypeThreshold_Type.PAY_COIN:
|
|
267
|
+
return "PAY_COIN";
|
|
268
|
+
case OperationTypeThreshold_Type.LOG:
|
|
269
|
+
return "LOG";
|
|
270
|
+
case OperationTypeThreshold_Type.SET_PRIVILEGE:
|
|
271
|
+
return "SET_PRIVILEGE";
|
|
272
|
+
case OperationTypeThreshold_Type.UPGRADE_CONTRACT:
|
|
273
|
+
return "UPGRADE_CONTRACT";
|
|
274
|
+
case OperationTypeThreshold_Type.SET_CONTROLLED_AREA:
|
|
275
|
+
return "SET_CONTROLLED_AREA";
|
|
276
|
+
case OperationTypeThreshold_Type.AUTHORIZE_TRANSFER:
|
|
277
|
+
return "AUTHORIZE_TRANSFER";
|
|
278
|
+
case OperationTypeThreshold_Type.UNRECOGNIZED:
|
|
279
|
+
default:
|
|
280
|
+
return "UNRECOGNIZED";
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export interface AccountThreshold {
|
|
285
|
+
/** required, [-1,MAX(INT64)] -1: indicates no setting */
|
|
286
|
+
txThreshold?: number | undefined;
|
|
287
|
+
typeThresholds?: OperationTypeThreshold[] | undefined;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface OperationCreateAccount {
|
|
291
|
+
destAddress?: string | undefined;
|
|
292
|
+
contract?: Contract | undefined;
|
|
293
|
+
priv?: AccountPrivilege | undefined;
|
|
294
|
+
metadatas?: KeyPair[] | undefined;
|
|
295
|
+
initBalance?: number | undefined;
|
|
296
|
+
initInput?: string | undefined;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface OperationPayCoin {
|
|
300
|
+
destAddress?: string | undefined;
|
|
301
|
+
amount?: number | undefined;
|
|
302
|
+
input?: string | undefined;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export interface OperationSetMetadata {
|
|
306
|
+
key?: string | undefined;
|
|
307
|
+
value?: string | undefined;
|
|
308
|
+
/** optional */
|
|
309
|
+
version?: number | undefined;
|
|
310
|
+
deleteFlag?: boolean | undefined;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export interface OperationUpgradeContract {
|
|
314
|
+
destAddress?: string | undefined;
|
|
315
|
+
payload?: string | undefined;
|
|
316
|
+
type?: number | undefined;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface OperationSetSignerWeight {
|
|
320
|
+
/** required, [-1,MAX(UINT32)] -1: indicates no setting */
|
|
321
|
+
masterWeight?: number | undefined;
|
|
322
|
+
/** address:weight, if weight is 0, it indicates deleting this signer */
|
|
323
|
+
signers?: Signer[] | undefined;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export interface OperationSetThreshold {
|
|
327
|
+
txThreshold?: number | undefined;
|
|
328
|
+
/** type:threshold, threshold:0 indicates deleting this type */
|
|
329
|
+
typeThresholds?: OperationTypeThreshold[] | undefined;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface OperationLog {
|
|
333
|
+
topic?: string | undefined;
|
|
334
|
+
datas?: string[] | undefined;
|
|
335
|
+
/** for evm */
|
|
336
|
+
topics?: string[] | undefined;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export interface OperationSetPrivilege {
|
|
340
|
+
masterWeight?: string | undefined;
|
|
341
|
+
signers?: Signer[] | undefined;
|
|
342
|
+
txThreshold?: string | undefined;
|
|
343
|
+
typeThresholds?: OperationTypeThreshold[] | undefined;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface ControlledArea {
|
|
347
|
+
trusted?: ControlledArea_trustFlag | undefined;
|
|
348
|
+
status?: ControlledArea_statusFalg | undefined;
|
|
349
|
+
attributes?: KeyPair[] | undefined;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export enum ControlledArea_trustFlag {
|
|
353
|
+
UNCERT = 0,
|
|
354
|
+
TRUSTED = 1,
|
|
355
|
+
UNTRUSTED = 2,
|
|
356
|
+
UNRECOGNIZED = -1,
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export function controlledArea_trustFlagFromJSON(
|
|
360
|
+
object: any,
|
|
361
|
+
): ControlledArea_trustFlag {
|
|
362
|
+
switch (object) {
|
|
363
|
+
case 0:
|
|
364
|
+
case "UNCERT":
|
|
365
|
+
return ControlledArea_trustFlag.UNCERT;
|
|
366
|
+
case 1:
|
|
367
|
+
case "TRUSTED":
|
|
368
|
+
return ControlledArea_trustFlag.TRUSTED;
|
|
369
|
+
case 2:
|
|
370
|
+
case "UNTRUSTED":
|
|
371
|
+
return ControlledArea_trustFlag.UNTRUSTED;
|
|
372
|
+
case -1:
|
|
373
|
+
case "UNRECOGNIZED":
|
|
374
|
+
default:
|
|
375
|
+
return ControlledArea_trustFlag.UNRECOGNIZED;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export function controlledArea_trustFlagToJSON(
|
|
380
|
+
object: ControlledArea_trustFlag,
|
|
381
|
+
): string {
|
|
382
|
+
switch (object) {
|
|
383
|
+
case ControlledArea_trustFlag.UNCERT:
|
|
384
|
+
return "UNCERT";
|
|
385
|
+
case ControlledArea_trustFlag.TRUSTED:
|
|
386
|
+
return "TRUSTED";
|
|
387
|
+
case ControlledArea_trustFlag.UNTRUSTED:
|
|
388
|
+
return "UNTRUSTED";
|
|
389
|
+
case ControlledArea_trustFlag.UNRECOGNIZED:
|
|
390
|
+
default:
|
|
391
|
+
return "UNRECOGNIZED";
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export enum ControlledArea_statusFalg {
|
|
396
|
+
ENABLED = 0,
|
|
397
|
+
DISABLED = 1,
|
|
398
|
+
UNRECOGNIZED = -1,
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export function controlledArea_statusFalgFromJSON(
|
|
402
|
+
object: any,
|
|
403
|
+
): ControlledArea_statusFalg {
|
|
404
|
+
switch (object) {
|
|
405
|
+
case 0:
|
|
406
|
+
case "ENABLED":
|
|
407
|
+
return ControlledArea_statusFalg.ENABLED;
|
|
408
|
+
case 1:
|
|
409
|
+
case "DISABLED":
|
|
410
|
+
return ControlledArea_statusFalg.DISABLED;
|
|
411
|
+
case -1:
|
|
412
|
+
case "UNRECOGNIZED":
|
|
413
|
+
default:
|
|
414
|
+
return ControlledArea_statusFalg.UNRECOGNIZED;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export function controlledArea_statusFalgToJSON(
|
|
419
|
+
object: ControlledArea_statusFalg,
|
|
420
|
+
): string {
|
|
421
|
+
switch (object) {
|
|
422
|
+
case ControlledArea_statusFalg.ENABLED:
|
|
423
|
+
return "ENABLED";
|
|
424
|
+
case ControlledArea_statusFalg.DISABLED:
|
|
425
|
+
return "DISABLED";
|
|
426
|
+
case ControlledArea_statusFalg.UNRECOGNIZED:
|
|
427
|
+
default:
|
|
428
|
+
return "UNRECOGNIZED";
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface OperationSetControlledArea {
|
|
433
|
+
destAddress?: string | undefined;
|
|
434
|
+
sTrusted?: boolean | undefined;
|
|
435
|
+
sStatus?: boolean | undefined;
|
|
436
|
+
trusted?: ControlledArea_trustFlag | undefined;
|
|
437
|
+
status?: ControlledArea_statusFalg | undefined;
|
|
438
|
+
attributes?: KeyPair[] | undefined;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export interface OperationAuthorizeTransfer {
|
|
442
|
+
destAddress?: string | undefined;
|
|
443
|
+
auth?: boolean | undefined;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface Operation {
|
|
447
|
+
type?: Operation_Type | undefined;
|
|
448
|
+
sourceAddress?: string | undefined;
|
|
449
|
+
metadata?: string | undefined;
|
|
450
|
+
createAccount?: OperationCreateAccount | undefined;
|
|
451
|
+
setMetadata?: OperationSetMetadata | undefined;
|
|
452
|
+
setSignerWeight?: OperationSetSignerWeight | undefined;
|
|
453
|
+
setThreshold?: OperationSetThreshold | undefined;
|
|
454
|
+
payCoin?: OperationPayCoin | undefined;
|
|
455
|
+
log?: OperationLog | undefined;
|
|
456
|
+
setPrivilege?: OperationSetPrivilege | undefined;
|
|
457
|
+
upgradeContract?: OperationUpgradeContract | undefined;
|
|
458
|
+
setControlledArea?: OperationSetControlledArea | undefined;
|
|
459
|
+
authorizeTransfer?: OperationAuthorizeTransfer | undefined;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export enum Operation_Type {
|
|
463
|
+
UNKNOWN = 0,
|
|
464
|
+
CREATE_ACCOUNT = 1,
|
|
465
|
+
SET_METADATA = 4,
|
|
466
|
+
SET_SIGNER_WEIGHT = 5,
|
|
467
|
+
SET_THRESHOLD = 6,
|
|
468
|
+
PAY_COIN = 7,
|
|
469
|
+
LOG = 8,
|
|
470
|
+
SET_PRIVILEGE = 9,
|
|
471
|
+
UPGRADE_CONTRACT = 10,
|
|
472
|
+
SET_CONTROLLED_AREA = 11,
|
|
473
|
+
AUTHORIZE_TRANSFER = 12,
|
|
474
|
+
UNRECOGNIZED = -1,
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export function operation_TypeFromJSON(object: any): Operation_Type {
|
|
478
|
+
switch (object) {
|
|
479
|
+
case 0:
|
|
480
|
+
case "UNKNOWN":
|
|
481
|
+
return Operation_Type.UNKNOWN;
|
|
482
|
+
case 1:
|
|
483
|
+
case "CREATE_ACCOUNT":
|
|
484
|
+
return Operation_Type.CREATE_ACCOUNT;
|
|
485
|
+
case 4:
|
|
486
|
+
case "SET_METADATA":
|
|
487
|
+
return Operation_Type.SET_METADATA;
|
|
488
|
+
case 5:
|
|
489
|
+
case "SET_SIGNER_WEIGHT":
|
|
490
|
+
return Operation_Type.SET_SIGNER_WEIGHT;
|
|
491
|
+
case 6:
|
|
492
|
+
case "SET_THRESHOLD":
|
|
493
|
+
return Operation_Type.SET_THRESHOLD;
|
|
494
|
+
case 7:
|
|
495
|
+
case "PAY_COIN":
|
|
496
|
+
return Operation_Type.PAY_COIN;
|
|
497
|
+
case 8:
|
|
498
|
+
case "LOG":
|
|
499
|
+
return Operation_Type.LOG;
|
|
500
|
+
case 9:
|
|
501
|
+
case "SET_PRIVILEGE":
|
|
502
|
+
return Operation_Type.SET_PRIVILEGE;
|
|
503
|
+
case 10:
|
|
504
|
+
case "UPGRADE_CONTRACT":
|
|
505
|
+
return Operation_Type.UPGRADE_CONTRACT;
|
|
506
|
+
case 11:
|
|
507
|
+
case "SET_CONTROLLED_AREA":
|
|
508
|
+
return Operation_Type.SET_CONTROLLED_AREA;
|
|
509
|
+
case 12:
|
|
510
|
+
case "AUTHORIZE_TRANSFER":
|
|
511
|
+
return Operation_Type.AUTHORIZE_TRANSFER;
|
|
512
|
+
case -1:
|
|
513
|
+
case "UNRECOGNIZED":
|
|
514
|
+
default:
|
|
515
|
+
return Operation_Type.UNRECOGNIZED;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export function operation_TypeToJSON(object: Operation_Type): string {
|
|
520
|
+
switch (object) {
|
|
521
|
+
case Operation_Type.UNKNOWN:
|
|
522
|
+
return "UNKNOWN";
|
|
523
|
+
case Operation_Type.CREATE_ACCOUNT:
|
|
524
|
+
return "CREATE_ACCOUNT";
|
|
525
|
+
case Operation_Type.SET_METADATA:
|
|
526
|
+
return "SET_METADATA";
|
|
527
|
+
case Operation_Type.SET_SIGNER_WEIGHT:
|
|
528
|
+
return "SET_SIGNER_WEIGHT";
|
|
529
|
+
case Operation_Type.SET_THRESHOLD:
|
|
530
|
+
return "SET_THRESHOLD";
|
|
531
|
+
case Operation_Type.PAY_COIN:
|
|
532
|
+
return "PAY_COIN";
|
|
533
|
+
case Operation_Type.LOG:
|
|
534
|
+
return "LOG";
|
|
535
|
+
case Operation_Type.SET_PRIVILEGE:
|
|
536
|
+
return "SET_PRIVILEGE";
|
|
537
|
+
case Operation_Type.UPGRADE_CONTRACT:
|
|
538
|
+
return "UPGRADE_CONTRACT";
|
|
539
|
+
case Operation_Type.SET_CONTROLLED_AREA:
|
|
540
|
+
return "SET_CONTROLLED_AREA";
|
|
541
|
+
case Operation_Type.AUTHORIZE_TRANSFER:
|
|
542
|
+
return "AUTHORIZE_TRANSFER";
|
|
543
|
+
case Operation_Type.UNRECOGNIZED:
|
|
544
|
+
default:
|
|
545
|
+
return "UNRECOGNIZED";
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export interface Transaction {
|
|
550
|
+
sourceAddress?: string | undefined;
|
|
551
|
+
feeLimit?: number | undefined;
|
|
552
|
+
gasPrice?: number | undefined;
|
|
553
|
+
nonce?: string | undefined;
|
|
554
|
+
metadata?: string | undefined;
|
|
555
|
+
nonceType?: Transaction_TxType | undefined;
|
|
556
|
+
maxLedgerSeq?: number | undefined;
|
|
557
|
+
operations?: Operation[] | undefined;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export enum Transaction_TxType {
|
|
561
|
+
INCREASE_NONCE = 0,
|
|
562
|
+
RANDOM_NONCE = 1,
|
|
563
|
+
UNRECOGNIZED = -1,
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function transaction_TxTypeFromJSON(object: any): Transaction_TxType {
|
|
567
|
+
switch (object) {
|
|
568
|
+
case 0:
|
|
569
|
+
case "INCREASE_NONCE":
|
|
570
|
+
return Transaction_TxType.INCREASE_NONCE;
|
|
571
|
+
case 1:
|
|
572
|
+
case "RANDOM_NONCE":
|
|
573
|
+
return Transaction_TxType.RANDOM_NONCE;
|
|
574
|
+
case -1:
|
|
575
|
+
case "UNRECOGNIZED":
|
|
576
|
+
default:
|
|
577
|
+
return Transaction_TxType.UNRECOGNIZED;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export function transaction_TxTypeToJSON(object: Transaction_TxType): string {
|
|
582
|
+
switch (object) {
|
|
583
|
+
case Transaction_TxType.INCREASE_NONCE:
|
|
584
|
+
return "INCREASE_NONCE";
|
|
585
|
+
case Transaction_TxType.RANDOM_NONCE:
|
|
586
|
+
return "RANDOM_NONCE";
|
|
587
|
+
case Transaction_TxType.UNRECOGNIZED:
|
|
588
|
+
default:
|
|
589
|
+
return "UNRECOGNIZED";
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export interface Trigger {
|
|
594
|
+
transactionType?: Trigger_TransactionType | undefined;
|
|
595
|
+
/** If it is triggered by a specific block (temporarily not provided) */
|
|
596
|
+
ledgerSeq?: number | undefined;
|
|
597
|
+
/** If it's a transaction triggered */
|
|
598
|
+
transaction?: Trigger_OperationTrigger | undefined;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export enum Trigger_TransactionType {
|
|
602
|
+
NORMAL_TRANSACTION = 0,
|
|
603
|
+
CONTRACT_TRANSACTION = 1,
|
|
604
|
+
UNRECOGNIZED = -1,
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export function trigger_TransactionTypeFromJSON(
|
|
608
|
+
object: any,
|
|
609
|
+
): Trigger_TransactionType {
|
|
610
|
+
switch (object) {
|
|
611
|
+
case 0:
|
|
612
|
+
case "NORMAL_TRANSACTION":
|
|
613
|
+
return Trigger_TransactionType.NORMAL_TRANSACTION;
|
|
614
|
+
case 1:
|
|
615
|
+
case "CONTRACT_TRANSACTION":
|
|
616
|
+
return Trigger_TransactionType.CONTRACT_TRANSACTION;
|
|
617
|
+
case -1:
|
|
618
|
+
case "UNRECOGNIZED":
|
|
619
|
+
default:
|
|
620
|
+
return Trigger_TransactionType.UNRECOGNIZED;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export function trigger_TransactionTypeToJSON(
|
|
625
|
+
object: Trigger_TransactionType,
|
|
626
|
+
): string {
|
|
627
|
+
switch (object) {
|
|
628
|
+
case Trigger_TransactionType.NORMAL_TRANSACTION:
|
|
629
|
+
return "NORMAL_TRANSACTION";
|
|
630
|
+
case Trigger_TransactionType.CONTRACT_TRANSACTION:
|
|
631
|
+
return "CONTRACT_TRANSACTION";
|
|
632
|
+
case Trigger_TransactionType.UNRECOGNIZED:
|
|
633
|
+
default:
|
|
634
|
+
return "UNRECOGNIZED";
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export interface Trigger_OperationTrigger {
|
|
639
|
+
hash?: Uint8Array | undefined;
|
|
640
|
+
index?: number | undefined;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
export interface TransactionEnv {
|
|
644
|
+
transaction?: Transaction | undefined;
|
|
645
|
+
signatures?: Signature[] | undefined;
|
|
646
|
+
trigger?: Trigger | undefined;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
export interface TransactionEnvStoreMessage {
|
|
650
|
+
transactionEnv?: TransactionEnv | undefined;
|
|
651
|
+
errorCode?: number | undefined;
|
|
652
|
+
errorDesc?: string | undefined;
|
|
653
|
+
ledgerSeq?: number | undefined;
|
|
654
|
+
closeTime?: number | undefined;
|
|
655
|
+
/** for notify */
|
|
656
|
+
hash?: string | undefined;
|
|
657
|
+
actualFee?: number | undefined;
|
|
658
|
+
contractTxHashes?: string[] | undefined;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export interface Signature {
|
|
662
|
+
publicKey?: string | undefined;
|
|
663
|
+
signData?: string | undefined;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export interface KeyPair {
|
|
667
|
+
key?: string | undefined;
|
|
668
|
+
value?: string | undefined;
|
|
669
|
+
version?: number | undefined;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
export interface DropTxMessage {
|
|
673
|
+
txHash?: string | undefined;
|
|
674
|
+
source?: DropTxMessage_PoolType | undefined;
|
|
675
|
+
timestamp?: number | undefined;
|
|
676
|
+
/** 序列化Transaction数据 */
|
|
677
|
+
tx?: string | undefined;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export enum DropTxMessage_PoolType {
|
|
681
|
+
PLATFORM = 0,
|
|
682
|
+
CHAIN = 1,
|
|
683
|
+
UNRECOGNIZED = -1,
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export function dropTxMessage_PoolTypeFromJSON(
|
|
687
|
+
object: any,
|
|
688
|
+
): DropTxMessage_PoolType {
|
|
689
|
+
switch (object) {
|
|
690
|
+
case 0:
|
|
691
|
+
case "PLATFORM":
|
|
692
|
+
return DropTxMessage_PoolType.PLATFORM;
|
|
693
|
+
case 1:
|
|
694
|
+
case "CHAIN":
|
|
695
|
+
return DropTxMessage_PoolType.CHAIN;
|
|
696
|
+
case -1:
|
|
697
|
+
case "UNRECOGNIZED":
|
|
698
|
+
default:
|
|
699
|
+
return DropTxMessage_PoolType.UNRECOGNIZED;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export function dropTxMessage_PoolTypeToJSON(
|
|
704
|
+
object: DropTxMessage_PoolType,
|
|
705
|
+
): string {
|
|
706
|
+
switch (object) {
|
|
707
|
+
case DropTxMessage_PoolType.PLATFORM:
|
|
708
|
+
return "PLATFORM";
|
|
709
|
+
case DropTxMessage_PoolType.CHAIN:
|
|
710
|
+
return "CHAIN";
|
|
711
|
+
case DropTxMessage_PoolType.UNRECOGNIZED:
|
|
712
|
+
default:
|
|
713
|
+
return "UNRECOGNIZED";
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
function createBaseHeartbeatMessage(): HeartbeatMessage {
|
|
718
|
+
return { message: "" };
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export const HeartbeatMessage: MessageFns<HeartbeatMessage> = {
|
|
722
|
+
encode(
|
|
723
|
+
message: HeartbeatMessage,
|
|
724
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
725
|
+
): BinaryWriter {
|
|
726
|
+
if (message.message !== undefined && message.message !== "") {
|
|
727
|
+
writer.uint32(10).string(message.message);
|
|
728
|
+
}
|
|
729
|
+
return writer;
|
|
730
|
+
},
|
|
731
|
+
|
|
732
|
+
decode(input: BinaryReader | Uint8Array, length?: number): HeartbeatMessage {
|
|
733
|
+
const reader =
|
|
734
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
735
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
736
|
+
const message = createBaseHeartbeatMessage();
|
|
737
|
+
while (reader.pos < end) {
|
|
738
|
+
const tag = reader.uint32();
|
|
739
|
+
switch (tag >>> 3) {
|
|
740
|
+
case 1: {
|
|
741
|
+
if (tag !== 10) {
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
message.message = reader.string();
|
|
746
|
+
continue;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
reader.skip(tag & 7);
|
|
753
|
+
}
|
|
754
|
+
return message;
|
|
755
|
+
},
|
|
756
|
+
|
|
757
|
+
fromJSON(object: any): HeartbeatMessage {
|
|
758
|
+
return {
|
|
759
|
+
message: isSet(object.message) ? globalThis.String(object.message) : "",
|
|
760
|
+
};
|
|
761
|
+
},
|
|
762
|
+
|
|
763
|
+
toJSON(message: HeartbeatMessage): unknown {
|
|
764
|
+
const obj: any = {};
|
|
765
|
+
if (message.message !== undefined && message.message !== "") {
|
|
766
|
+
obj.message = message.message;
|
|
767
|
+
}
|
|
768
|
+
return obj;
|
|
769
|
+
},
|
|
770
|
+
|
|
771
|
+
create<I extends Exact<DeepPartial<HeartbeatMessage>, I>>(
|
|
772
|
+
base?: I,
|
|
773
|
+
): HeartbeatMessage {
|
|
774
|
+
return HeartbeatMessage.fromPartial(base ?? ({} as any));
|
|
775
|
+
},
|
|
776
|
+
fromPartial<I extends Exact<DeepPartial<HeartbeatMessage>, I>>(
|
|
777
|
+
object: I,
|
|
778
|
+
): HeartbeatMessage {
|
|
779
|
+
const message = createBaseHeartbeatMessage();
|
|
780
|
+
message.message = object.message ?? "";
|
|
781
|
+
return message;
|
|
782
|
+
},
|
|
783
|
+
};
|
|
784
|
+
|
|
785
|
+
function createBaseSubscribeRequest(): SubscribeRequest {
|
|
786
|
+
return { message: [] };
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export const SubscribeRequest: MessageFns<SubscribeRequest> = {
|
|
790
|
+
encode(
|
|
791
|
+
message: SubscribeRequest,
|
|
792
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
793
|
+
): BinaryWriter {
|
|
794
|
+
if (message.message !== undefined && message.message.length !== 0) {
|
|
795
|
+
for (const v of message.message) {
|
|
796
|
+
writer.uint32(10).string(v!);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return writer;
|
|
800
|
+
},
|
|
801
|
+
|
|
802
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SubscribeRequest {
|
|
803
|
+
const reader =
|
|
804
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
805
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
806
|
+
const message = createBaseSubscribeRequest();
|
|
807
|
+
while (reader.pos < end) {
|
|
808
|
+
const tag = reader.uint32();
|
|
809
|
+
switch (tag >>> 3) {
|
|
810
|
+
case 1: {
|
|
811
|
+
if (tag !== 10) {
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
const el = reader.string();
|
|
816
|
+
if (el !== undefined) {
|
|
817
|
+
message.message!.push(el);
|
|
818
|
+
}
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
823
|
+
break;
|
|
824
|
+
}
|
|
825
|
+
reader.skip(tag & 7);
|
|
826
|
+
}
|
|
827
|
+
return message;
|
|
828
|
+
},
|
|
829
|
+
|
|
830
|
+
fromJSON(object: any): SubscribeRequest {
|
|
831
|
+
return {
|
|
832
|
+
message: globalThis.Array.isArray(object?.message)
|
|
833
|
+
? object.message.map((e: any) => globalThis.String(e))
|
|
834
|
+
: [],
|
|
835
|
+
};
|
|
836
|
+
},
|
|
837
|
+
|
|
838
|
+
toJSON(message: SubscribeRequest): unknown {
|
|
839
|
+
const obj: any = {};
|
|
840
|
+
if (message.message?.length) {
|
|
841
|
+
obj.message = message.message;
|
|
842
|
+
}
|
|
843
|
+
return obj;
|
|
844
|
+
},
|
|
845
|
+
|
|
846
|
+
create<I extends Exact<DeepPartial<SubscribeRequest>, I>>(
|
|
847
|
+
base?: I,
|
|
848
|
+
): SubscribeRequest {
|
|
849
|
+
return SubscribeRequest.fromPartial(base ?? ({} as any));
|
|
850
|
+
},
|
|
851
|
+
fromPartial<I extends Exact<DeepPartial<SubscribeRequest>, I>>(
|
|
852
|
+
object: I,
|
|
853
|
+
): SubscribeRequest {
|
|
854
|
+
const message = createBaseSubscribeRequest();
|
|
855
|
+
message.message = object.message?.map((e) => e) || [];
|
|
856
|
+
return message;
|
|
857
|
+
},
|
|
858
|
+
};
|
|
859
|
+
|
|
860
|
+
function createBaseLedgerHeaderMessage(): LedgerHeaderMessage {
|
|
861
|
+
return {
|
|
862
|
+
seq: 0,
|
|
863
|
+
hash: "",
|
|
864
|
+
previousHash: "",
|
|
865
|
+
accountTreeHash: "",
|
|
866
|
+
closeTime: 0,
|
|
867
|
+
consensusValueHash: "",
|
|
868
|
+
version: 0,
|
|
869
|
+
txCount: 0,
|
|
870
|
+
validatorsHash: "",
|
|
871
|
+
feesHash: "",
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
export const LedgerHeaderMessage: MessageFns<LedgerHeaderMessage> = {
|
|
876
|
+
encode(
|
|
877
|
+
message: LedgerHeaderMessage,
|
|
878
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
879
|
+
): BinaryWriter {
|
|
880
|
+
if (message.seq !== undefined && message.seq !== 0) {
|
|
881
|
+
writer.uint32(8).int64(message.seq);
|
|
882
|
+
}
|
|
883
|
+
if (message.hash !== undefined && message.hash !== "") {
|
|
884
|
+
writer.uint32(18).string(message.hash);
|
|
885
|
+
}
|
|
886
|
+
if (message.previousHash !== undefined && message.previousHash !== "") {
|
|
887
|
+
writer.uint32(26).string(message.previousHash);
|
|
888
|
+
}
|
|
889
|
+
if (
|
|
890
|
+
message.accountTreeHash !== undefined &&
|
|
891
|
+
message.accountTreeHash !== ""
|
|
892
|
+
) {
|
|
893
|
+
writer.uint32(34).string(message.accountTreeHash);
|
|
894
|
+
}
|
|
895
|
+
if (message.closeTime !== undefined && message.closeTime !== 0) {
|
|
896
|
+
writer.uint32(40).int64(message.closeTime);
|
|
897
|
+
}
|
|
898
|
+
if (
|
|
899
|
+
message.consensusValueHash !== undefined &&
|
|
900
|
+
message.consensusValueHash !== ""
|
|
901
|
+
) {
|
|
902
|
+
writer.uint32(50).string(message.consensusValueHash);
|
|
903
|
+
}
|
|
904
|
+
if (message.version !== undefined && message.version !== 0) {
|
|
905
|
+
writer.uint32(56).int64(message.version);
|
|
906
|
+
}
|
|
907
|
+
if (message.txCount !== undefined && message.txCount !== 0) {
|
|
908
|
+
writer.uint32(64).int64(message.txCount);
|
|
909
|
+
}
|
|
910
|
+
if (message.validatorsHash !== undefined && message.validatorsHash !== "") {
|
|
911
|
+
writer.uint32(74).string(message.validatorsHash);
|
|
912
|
+
}
|
|
913
|
+
if (message.feesHash !== undefined && message.feesHash !== "") {
|
|
914
|
+
writer.uint32(82).string(message.feesHash);
|
|
915
|
+
}
|
|
916
|
+
return writer;
|
|
917
|
+
},
|
|
918
|
+
|
|
919
|
+
decode(
|
|
920
|
+
input: BinaryReader | Uint8Array,
|
|
921
|
+
length?: number,
|
|
922
|
+
): LedgerHeaderMessage {
|
|
923
|
+
const reader =
|
|
924
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
925
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
926
|
+
const message = createBaseLedgerHeaderMessage();
|
|
927
|
+
while (reader.pos < end) {
|
|
928
|
+
const tag = reader.uint32();
|
|
929
|
+
switch (tag >>> 3) {
|
|
930
|
+
case 1: {
|
|
931
|
+
if (tag !== 8) {
|
|
932
|
+
break;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
message.seq = longToNumber(reader.int64());
|
|
936
|
+
continue;
|
|
937
|
+
}
|
|
938
|
+
case 2: {
|
|
939
|
+
if (tag !== 18) {
|
|
940
|
+
break;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
message.hash = reader.string();
|
|
944
|
+
continue;
|
|
945
|
+
}
|
|
946
|
+
case 3: {
|
|
947
|
+
if (tag !== 26) {
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
message.previousHash = reader.string();
|
|
952
|
+
continue;
|
|
953
|
+
}
|
|
954
|
+
case 4: {
|
|
955
|
+
if (tag !== 34) {
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
message.accountTreeHash = reader.string();
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
case 5: {
|
|
963
|
+
if (tag !== 40) {
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
message.closeTime = longToNumber(reader.int64());
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
case 6: {
|
|
971
|
+
if (tag !== 50) {
|
|
972
|
+
break;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
message.consensusValueHash = reader.string();
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
case 7: {
|
|
979
|
+
if (tag !== 56) {
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
message.version = longToNumber(reader.int64());
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
case 8: {
|
|
987
|
+
if (tag !== 64) {
|
|
988
|
+
break;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
message.txCount = longToNumber(reader.int64());
|
|
992
|
+
continue;
|
|
993
|
+
}
|
|
994
|
+
case 9: {
|
|
995
|
+
if (tag !== 74) {
|
|
996
|
+
break;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
message.validatorsHash = reader.string();
|
|
1000
|
+
continue;
|
|
1001
|
+
}
|
|
1002
|
+
case 10: {
|
|
1003
|
+
if (tag !== 82) {
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
message.feesHash = reader.string();
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1012
|
+
break;
|
|
1013
|
+
}
|
|
1014
|
+
reader.skip(tag & 7);
|
|
1015
|
+
}
|
|
1016
|
+
return message;
|
|
1017
|
+
},
|
|
1018
|
+
|
|
1019
|
+
fromJSON(object: any): LedgerHeaderMessage {
|
|
1020
|
+
return {
|
|
1021
|
+
seq: isSet(object.seq) ? globalThis.Number(object.seq) : 0,
|
|
1022
|
+
hash: isSet(object.hash) ? globalThis.String(object.hash) : "",
|
|
1023
|
+
previousHash: isSet(object.previous_hash)
|
|
1024
|
+
? globalThis.String(object.previous_hash)
|
|
1025
|
+
: "",
|
|
1026
|
+
accountTreeHash: isSet(object.account_tree_hash)
|
|
1027
|
+
? globalThis.String(object.account_tree_hash)
|
|
1028
|
+
: "",
|
|
1029
|
+
closeTime: isSet(object.close_time)
|
|
1030
|
+
? globalThis.Number(object.close_time)
|
|
1031
|
+
: 0,
|
|
1032
|
+
consensusValueHash: isSet(object.consensus_value_hash)
|
|
1033
|
+
? globalThis.String(object.consensus_value_hash)
|
|
1034
|
+
: "",
|
|
1035
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
1036
|
+
txCount: isSet(object.tx_count) ? globalThis.Number(object.tx_count) : 0,
|
|
1037
|
+
validatorsHash: isSet(object.validators_hash)
|
|
1038
|
+
? globalThis.String(object.validators_hash)
|
|
1039
|
+
: "",
|
|
1040
|
+
feesHash: isSet(object.fees_hash)
|
|
1041
|
+
? globalThis.String(object.fees_hash)
|
|
1042
|
+
: "",
|
|
1043
|
+
};
|
|
1044
|
+
},
|
|
1045
|
+
|
|
1046
|
+
toJSON(message: LedgerHeaderMessage): unknown {
|
|
1047
|
+
const obj: any = {};
|
|
1048
|
+
if (message.seq !== undefined && message.seq !== 0) {
|
|
1049
|
+
obj.seq = Math.round(message.seq);
|
|
1050
|
+
}
|
|
1051
|
+
if (message.hash !== undefined && message.hash !== "") {
|
|
1052
|
+
obj.hash = message.hash;
|
|
1053
|
+
}
|
|
1054
|
+
if (message.previousHash !== undefined && message.previousHash !== "") {
|
|
1055
|
+
obj.previous_hash = message.previousHash;
|
|
1056
|
+
}
|
|
1057
|
+
if (
|
|
1058
|
+
message.accountTreeHash !== undefined &&
|
|
1059
|
+
message.accountTreeHash !== ""
|
|
1060
|
+
) {
|
|
1061
|
+
obj.account_tree_hash = message.accountTreeHash;
|
|
1062
|
+
}
|
|
1063
|
+
if (message.closeTime !== undefined && message.closeTime !== 0) {
|
|
1064
|
+
obj.close_time = Math.round(message.closeTime);
|
|
1065
|
+
}
|
|
1066
|
+
if (
|
|
1067
|
+
message.consensusValueHash !== undefined &&
|
|
1068
|
+
message.consensusValueHash !== ""
|
|
1069
|
+
) {
|
|
1070
|
+
obj.consensus_value_hash = message.consensusValueHash;
|
|
1071
|
+
}
|
|
1072
|
+
if (message.version !== undefined && message.version !== 0) {
|
|
1073
|
+
obj.version = Math.round(message.version);
|
|
1074
|
+
}
|
|
1075
|
+
if (message.txCount !== undefined && message.txCount !== 0) {
|
|
1076
|
+
obj.tx_count = Math.round(message.txCount);
|
|
1077
|
+
}
|
|
1078
|
+
if (message.validatorsHash !== undefined && message.validatorsHash !== "") {
|
|
1079
|
+
obj.validators_hash = message.validatorsHash;
|
|
1080
|
+
}
|
|
1081
|
+
if (message.feesHash !== undefined && message.feesHash !== "") {
|
|
1082
|
+
obj.fees_hash = message.feesHash;
|
|
1083
|
+
}
|
|
1084
|
+
return obj;
|
|
1085
|
+
},
|
|
1086
|
+
|
|
1087
|
+
create<I extends Exact<DeepPartial<LedgerHeaderMessage>, I>>(
|
|
1088
|
+
base?: I,
|
|
1089
|
+
): LedgerHeaderMessage {
|
|
1090
|
+
return LedgerHeaderMessage.fromPartial(base ?? ({} as any));
|
|
1091
|
+
},
|
|
1092
|
+
fromPartial<I extends Exact<DeepPartial<LedgerHeaderMessage>, I>>(
|
|
1093
|
+
object: I,
|
|
1094
|
+
): LedgerHeaderMessage {
|
|
1095
|
+
const message = createBaseLedgerHeaderMessage();
|
|
1096
|
+
message.seq = object.seq ?? 0;
|
|
1097
|
+
message.hash = object.hash ?? "";
|
|
1098
|
+
message.previousHash = object.previousHash ?? "";
|
|
1099
|
+
message.accountTreeHash = object.accountTreeHash ?? "";
|
|
1100
|
+
message.closeTime = object.closeTime ?? 0;
|
|
1101
|
+
message.consensusValueHash = object.consensusValueHash ?? "";
|
|
1102
|
+
message.version = object.version ?? 0;
|
|
1103
|
+
message.txCount = object.txCount ?? 0;
|
|
1104
|
+
message.validatorsHash = object.validatorsHash ?? "";
|
|
1105
|
+
message.feesHash = object.feesHash ?? "";
|
|
1106
|
+
return message;
|
|
1107
|
+
},
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
function createBaseContract(): Contract {
|
|
1111
|
+
return { type: 0, payload: "" };
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
export const Contract: MessageFns<Contract> = {
|
|
1115
|
+
encode(
|
|
1116
|
+
message: Contract,
|
|
1117
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1118
|
+
): BinaryWriter {
|
|
1119
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
1120
|
+
writer.uint32(8).int32(message.type);
|
|
1121
|
+
}
|
|
1122
|
+
if (message.payload !== undefined && message.payload !== "") {
|
|
1123
|
+
writer.uint32(18).string(message.payload);
|
|
1124
|
+
}
|
|
1125
|
+
return writer;
|
|
1126
|
+
},
|
|
1127
|
+
|
|
1128
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Contract {
|
|
1129
|
+
const reader =
|
|
1130
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1131
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1132
|
+
const message = createBaseContract();
|
|
1133
|
+
while (reader.pos < end) {
|
|
1134
|
+
const tag = reader.uint32();
|
|
1135
|
+
switch (tag >>> 3) {
|
|
1136
|
+
case 1: {
|
|
1137
|
+
if (tag !== 8) {
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
message.type = reader.int32() as any;
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
case 2: {
|
|
1145
|
+
if (tag !== 18) {
|
|
1146
|
+
break;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
message.payload = reader.string();
|
|
1150
|
+
continue;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1154
|
+
break;
|
|
1155
|
+
}
|
|
1156
|
+
reader.skip(tag & 7);
|
|
1157
|
+
}
|
|
1158
|
+
return message;
|
|
1159
|
+
},
|
|
1160
|
+
|
|
1161
|
+
fromJSON(object: any): Contract {
|
|
1162
|
+
return {
|
|
1163
|
+
type: isSet(object.type) ? contract_ContractTypeFromJSON(object.type) : 0,
|
|
1164
|
+
payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
|
|
1165
|
+
};
|
|
1166
|
+
},
|
|
1167
|
+
|
|
1168
|
+
toJSON(message: Contract): unknown {
|
|
1169
|
+
const obj: any = {};
|
|
1170
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
1171
|
+
obj.type = contract_ContractTypeToJSON(message.type);
|
|
1172
|
+
}
|
|
1173
|
+
if (message.payload !== undefined && message.payload !== "") {
|
|
1174
|
+
obj.payload = message.payload;
|
|
1175
|
+
}
|
|
1176
|
+
return obj;
|
|
1177
|
+
},
|
|
1178
|
+
|
|
1179
|
+
create<I extends Exact<DeepPartial<Contract>, I>>(base?: I): Contract {
|
|
1180
|
+
return Contract.fromPartial(base ?? ({} as any));
|
|
1181
|
+
},
|
|
1182
|
+
fromPartial<I extends Exact<DeepPartial<Contract>, I>>(object: I): Contract {
|
|
1183
|
+
const message = createBaseContract();
|
|
1184
|
+
message.type = object.type ?? 0;
|
|
1185
|
+
message.payload = object.payload ?? "";
|
|
1186
|
+
return message;
|
|
1187
|
+
},
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
function createBaseSigner(): Signer {
|
|
1191
|
+
return { address: "", weight: 0 };
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
export const Signer: MessageFns<Signer> = {
|
|
1195
|
+
encode(
|
|
1196
|
+
message: Signer,
|
|
1197
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1198
|
+
): BinaryWriter {
|
|
1199
|
+
if (message.address !== undefined && message.address !== "") {
|
|
1200
|
+
writer.uint32(10).string(message.address);
|
|
1201
|
+
}
|
|
1202
|
+
if (message.weight !== undefined && message.weight !== 0) {
|
|
1203
|
+
writer.uint32(16).int64(message.weight);
|
|
1204
|
+
}
|
|
1205
|
+
return writer;
|
|
1206
|
+
},
|
|
1207
|
+
|
|
1208
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Signer {
|
|
1209
|
+
const reader =
|
|
1210
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1211
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1212
|
+
const message = createBaseSigner();
|
|
1213
|
+
while (reader.pos < end) {
|
|
1214
|
+
const tag = reader.uint32();
|
|
1215
|
+
switch (tag >>> 3) {
|
|
1216
|
+
case 1: {
|
|
1217
|
+
if (tag !== 10) {
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
message.address = reader.string();
|
|
1222
|
+
continue;
|
|
1223
|
+
}
|
|
1224
|
+
case 2: {
|
|
1225
|
+
if (tag !== 16) {
|
|
1226
|
+
break;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
message.weight = longToNumber(reader.int64());
|
|
1230
|
+
continue;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1234
|
+
break;
|
|
1235
|
+
}
|
|
1236
|
+
reader.skip(tag & 7);
|
|
1237
|
+
}
|
|
1238
|
+
return message;
|
|
1239
|
+
},
|
|
1240
|
+
|
|
1241
|
+
fromJSON(object: any): Signer {
|
|
1242
|
+
return {
|
|
1243
|
+
address: isSet(object.address) ? globalThis.String(object.address) : "",
|
|
1244
|
+
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
|
1245
|
+
};
|
|
1246
|
+
},
|
|
1247
|
+
|
|
1248
|
+
toJSON(message: Signer): unknown {
|
|
1249
|
+
const obj: any = {};
|
|
1250
|
+
if (message.address !== undefined && message.address !== "") {
|
|
1251
|
+
obj.address = message.address;
|
|
1252
|
+
}
|
|
1253
|
+
if (message.weight !== undefined && message.weight !== 0) {
|
|
1254
|
+
obj.weight = Math.round(message.weight);
|
|
1255
|
+
}
|
|
1256
|
+
return obj;
|
|
1257
|
+
},
|
|
1258
|
+
|
|
1259
|
+
create<I extends Exact<DeepPartial<Signer>, I>>(base?: I): Signer {
|
|
1260
|
+
return Signer.fromPartial(base ?? ({} as any));
|
|
1261
|
+
},
|
|
1262
|
+
fromPartial<I extends Exact<DeepPartial<Signer>, I>>(object: I): Signer {
|
|
1263
|
+
const message = createBaseSigner();
|
|
1264
|
+
message.address = object.address ?? "";
|
|
1265
|
+
message.weight = object.weight ?? 0;
|
|
1266
|
+
return message;
|
|
1267
|
+
},
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
function createBaseAccountPrivilege(): AccountPrivilege {
|
|
1271
|
+
return { masterWeight: 0, signers: [], thresholds: undefined };
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
export const AccountPrivilege: MessageFns<AccountPrivilege> = {
|
|
1275
|
+
encode(
|
|
1276
|
+
message: AccountPrivilege,
|
|
1277
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1278
|
+
): BinaryWriter {
|
|
1279
|
+
if (message.masterWeight !== undefined && message.masterWeight !== 0) {
|
|
1280
|
+
writer.uint32(8).int64(message.masterWeight);
|
|
1281
|
+
}
|
|
1282
|
+
if (message.signers !== undefined && message.signers.length !== 0) {
|
|
1283
|
+
for (const v of message.signers) {
|
|
1284
|
+
Signer.encode(v!, writer.uint32(18).fork()).join();
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
if (message.thresholds !== undefined) {
|
|
1288
|
+
AccountThreshold.encode(
|
|
1289
|
+
message.thresholds,
|
|
1290
|
+
writer.uint32(26).fork(),
|
|
1291
|
+
).join();
|
|
1292
|
+
}
|
|
1293
|
+
return writer;
|
|
1294
|
+
},
|
|
1295
|
+
|
|
1296
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AccountPrivilege {
|
|
1297
|
+
const reader =
|
|
1298
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1299
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1300
|
+
const message = createBaseAccountPrivilege();
|
|
1301
|
+
while (reader.pos < end) {
|
|
1302
|
+
const tag = reader.uint32();
|
|
1303
|
+
switch (tag >>> 3) {
|
|
1304
|
+
case 1: {
|
|
1305
|
+
if (tag !== 8) {
|
|
1306
|
+
break;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
message.masterWeight = longToNumber(reader.int64());
|
|
1310
|
+
continue;
|
|
1311
|
+
}
|
|
1312
|
+
case 2: {
|
|
1313
|
+
if (tag !== 18) {
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
const el = Signer.decode(reader, reader.uint32());
|
|
1318
|
+
if (el !== undefined) {
|
|
1319
|
+
message.signers!.push(el);
|
|
1320
|
+
}
|
|
1321
|
+
continue;
|
|
1322
|
+
}
|
|
1323
|
+
case 3: {
|
|
1324
|
+
if (tag !== 26) {
|
|
1325
|
+
break;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
message.thresholds = AccountThreshold.decode(reader, reader.uint32());
|
|
1329
|
+
continue;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
reader.skip(tag & 7);
|
|
1336
|
+
}
|
|
1337
|
+
return message;
|
|
1338
|
+
},
|
|
1339
|
+
|
|
1340
|
+
fromJSON(object: any): AccountPrivilege {
|
|
1341
|
+
return {
|
|
1342
|
+
masterWeight: isSet(object.master_weight)
|
|
1343
|
+
? globalThis.Number(object.master_weight)
|
|
1344
|
+
: 0,
|
|
1345
|
+
signers: globalThis.Array.isArray(object?.signers)
|
|
1346
|
+
? object.signers.map((e: any) => Signer.fromJSON(e))
|
|
1347
|
+
: [],
|
|
1348
|
+
thresholds: isSet(object.thresholds)
|
|
1349
|
+
? AccountThreshold.fromJSON(object.thresholds)
|
|
1350
|
+
: undefined,
|
|
1351
|
+
};
|
|
1352
|
+
},
|
|
1353
|
+
|
|
1354
|
+
toJSON(message: AccountPrivilege): unknown {
|
|
1355
|
+
const obj: any = {};
|
|
1356
|
+
if (message.masterWeight !== undefined && message.masterWeight !== 0) {
|
|
1357
|
+
obj.master_weight = Math.round(message.masterWeight);
|
|
1358
|
+
}
|
|
1359
|
+
if (message.signers?.length) {
|
|
1360
|
+
obj.signers = message.signers.map((e) => Signer.toJSON(e));
|
|
1361
|
+
}
|
|
1362
|
+
if (message.thresholds !== undefined) {
|
|
1363
|
+
obj.thresholds = AccountThreshold.toJSON(message.thresholds);
|
|
1364
|
+
}
|
|
1365
|
+
return obj;
|
|
1366
|
+
},
|
|
1367
|
+
|
|
1368
|
+
create<I extends Exact<DeepPartial<AccountPrivilege>, I>>(
|
|
1369
|
+
base?: I,
|
|
1370
|
+
): AccountPrivilege {
|
|
1371
|
+
return AccountPrivilege.fromPartial(base ?? ({} as any));
|
|
1372
|
+
},
|
|
1373
|
+
fromPartial<I extends Exact<DeepPartial<AccountPrivilege>, I>>(
|
|
1374
|
+
object: I,
|
|
1375
|
+
): AccountPrivilege {
|
|
1376
|
+
const message = createBaseAccountPrivilege();
|
|
1377
|
+
message.masterWeight = object.masterWeight ?? 0;
|
|
1378
|
+
message.signers = object.signers?.map((e) => Signer.fromPartial(e)) || [];
|
|
1379
|
+
message.thresholds =
|
|
1380
|
+
object.thresholds !== undefined && object.thresholds !== null
|
|
1381
|
+
? AccountThreshold.fromPartial(object.thresholds)
|
|
1382
|
+
: undefined;
|
|
1383
|
+
return message;
|
|
1384
|
+
},
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
function createBaseOperationTypeThreshold(): OperationTypeThreshold {
|
|
1388
|
+
return { type: 0, threshold: 0 };
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
export const OperationTypeThreshold: MessageFns<OperationTypeThreshold> = {
|
|
1392
|
+
encode(
|
|
1393
|
+
message: OperationTypeThreshold,
|
|
1394
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1395
|
+
): BinaryWriter {
|
|
1396
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
1397
|
+
writer.uint32(8).int32(message.type);
|
|
1398
|
+
}
|
|
1399
|
+
if (message.threshold !== undefined && message.threshold !== 0) {
|
|
1400
|
+
writer.uint32(16).int64(message.threshold);
|
|
1401
|
+
}
|
|
1402
|
+
return writer;
|
|
1403
|
+
},
|
|
1404
|
+
|
|
1405
|
+
decode(
|
|
1406
|
+
input: BinaryReader | Uint8Array,
|
|
1407
|
+
length?: number,
|
|
1408
|
+
): OperationTypeThreshold {
|
|
1409
|
+
const reader =
|
|
1410
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1411
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1412
|
+
const message = createBaseOperationTypeThreshold();
|
|
1413
|
+
while (reader.pos < end) {
|
|
1414
|
+
const tag = reader.uint32();
|
|
1415
|
+
switch (tag >>> 3) {
|
|
1416
|
+
case 1: {
|
|
1417
|
+
if (tag !== 8) {
|
|
1418
|
+
break;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
message.type = reader.int32() as any;
|
|
1422
|
+
continue;
|
|
1423
|
+
}
|
|
1424
|
+
case 2: {
|
|
1425
|
+
if (tag !== 16) {
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
message.threshold = longToNumber(reader.int64());
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1434
|
+
break;
|
|
1435
|
+
}
|
|
1436
|
+
reader.skip(tag & 7);
|
|
1437
|
+
}
|
|
1438
|
+
return message;
|
|
1439
|
+
},
|
|
1440
|
+
|
|
1441
|
+
fromJSON(object: any): OperationTypeThreshold {
|
|
1442
|
+
return {
|
|
1443
|
+
type: isSet(object.type)
|
|
1444
|
+
? operationTypeThreshold_TypeFromJSON(object.type)
|
|
1445
|
+
: 0,
|
|
1446
|
+
threshold: isSet(object.threshold)
|
|
1447
|
+
? globalThis.Number(object.threshold)
|
|
1448
|
+
: 0,
|
|
1449
|
+
};
|
|
1450
|
+
},
|
|
1451
|
+
|
|
1452
|
+
toJSON(message: OperationTypeThreshold): unknown {
|
|
1453
|
+
const obj: any = {};
|
|
1454
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
1455
|
+
obj.type = operationTypeThreshold_TypeToJSON(message.type);
|
|
1456
|
+
}
|
|
1457
|
+
if (message.threshold !== undefined && message.threshold !== 0) {
|
|
1458
|
+
obj.threshold = Math.round(message.threshold);
|
|
1459
|
+
}
|
|
1460
|
+
return obj;
|
|
1461
|
+
},
|
|
1462
|
+
|
|
1463
|
+
create<I extends Exact<DeepPartial<OperationTypeThreshold>, I>>(
|
|
1464
|
+
base?: I,
|
|
1465
|
+
): OperationTypeThreshold {
|
|
1466
|
+
return OperationTypeThreshold.fromPartial(base ?? ({} as any));
|
|
1467
|
+
},
|
|
1468
|
+
fromPartial<I extends Exact<DeepPartial<OperationTypeThreshold>, I>>(
|
|
1469
|
+
object: I,
|
|
1470
|
+
): OperationTypeThreshold {
|
|
1471
|
+
const message = createBaseOperationTypeThreshold();
|
|
1472
|
+
message.type = object.type ?? 0;
|
|
1473
|
+
message.threshold = object.threshold ?? 0;
|
|
1474
|
+
return message;
|
|
1475
|
+
},
|
|
1476
|
+
};
|
|
1477
|
+
|
|
1478
|
+
function createBaseAccountThreshold(): AccountThreshold {
|
|
1479
|
+
return { txThreshold: 0, typeThresholds: [] };
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
export const AccountThreshold: MessageFns<AccountThreshold> = {
|
|
1483
|
+
encode(
|
|
1484
|
+
message: AccountThreshold,
|
|
1485
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1486
|
+
): BinaryWriter {
|
|
1487
|
+
if (message.txThreshold !== undefined && message.txThreshold !== 0) {
|
|
1488
|
+
writer.uint32(8).int64(message.txThreshold);
|
|
1489
|
+
}
|
|
1490
|
+
if (
|
|
1491
|
+
message.typeThresholds !== undefined &&
|
|
1492
|
+
message.typeThresholds.length !== 0
|
|
1493
|
+
) {
|
|
1494
|
+
for (const v of message.typeThresholds) {
|
|
1495
|
+
OperationTypeThreshold.encode(v!, writer.uint32(18).fork()).join();
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
return writer;
|
|
1499
|
+
},
|
|
1500
|
+
|
|
1501
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AccountThreshold {
|
|
1502
|
+
const reader =
|
|
1503
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1504
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1505
|
+
const message = createBaseAccountThreshold();
|
|
1506
|
+
while (reader.pos < end) {
|
|
1507
|
+
const tag = reader.uint32();
|
|
1508
|
+
switch (tag >>> 3) {
|
|
1509
|
+
case 1: {
|
|
1510
|
+
if (tag !== 8) {
|
|
1511
|
+
break;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
message.txThreshold = longToNumber(reader.int64());
|
|
1515
|
+
continue;
|
|
1516
|
+
}
|
|
1517
|
+
case 2: {
|
|
1518
|
+
if (tag !== 18) {
|
|
1519
|
+
break;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
const el = OperationTypeThreshold.decode(reader, reader.uint32());
|
|
1523
|
+
if (el !== undefined) {
|
|
1524
|
+
message.typeThresholds!.push(el);
|
|
1525
|
+
}
|
|
1526
|
+
continue;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1530
|
+
break;
|
|
1531
|
+
}
|
|
1532
|
+
reader.skip(tag & 7);
|
|
1533
|
+
}
|
|
1534
|
+
return message;
|
|
1535
|
+
},
|
|
1536
|
+
|
|
1537
|
+
fromJSON(object: any): AccountThreshold {
|
|
1538
|
+
return {
|
|
1539
|
+
txThreshold: isSet(object.tx_threshold)
|
|
1540
|
+
? globalThis.Number(object.tx_threshold)
|
|
1541
|
+
: 0,
|
|
1542
|
+
typeThresholds: globalThis.Array.isArray(object?.type_thresholds)
|
|
1543
|
+
? object.type_thresholds.map((e: any) =>
|
|
1544
|
+
OperationTypeThreshold.fromJSON(e),
|
|
1545
|
+
)
|
|
1546
|
+
: [],
|
|
1547
|
+
};
|
|
1548
|
+
},
|
|
1549
|
+
|
|
1550
|
+
toJSON(message: AccountThreshold): unknown {
|
|
1551
|
+
const obj: any = {};
|
|
1552
|
+
if (message.txThreshold !== undefined && message.txThreshold !== 0) {
|
|
1553
|
+
obj.tx_threshold = Math.round(message.txThreshold);
|
|
1554
|
+
}
|
|
1555
|
+
if (message.typeThresholds?.length) {
|
|
1556
|
+
obj.type_thresholds = message.typeThresholds.map((e) =>
|
|
1557
|
+
OperationTypeThreshold.toJSON(e),
|
|
1558
|
+
);
|
|
1559
|
+
}
|
|
1560
|
+
return obj;
|
|
1561
|
+
},
|
|
1562
|
+
|
|
1563
|
+
create<I extends Exact<DeepPartial<AccountThreshold>, I>>(
|
|
1564
|
+
base?: I,
|
|
1565
|
+
): AccountThreshold {
|
|
1566
|
+
return AccountThreshold.fromPartial(base ?? ({} as any));
|
|
1567
|
+
},
|
|
1568
|
+
fromPartial<I extends Exact<DeepPartial<AccountThreshold>, I>>(
|
|
1569
|
+
object: I,
|
|
1570
|
+
): AccountThreshold {
|
|
1571
|
+
const message = createBaseAccountThreshold();
|
|
1572
|
+
message.txThreshold = object.txThreshold ?? 0;
|
|
1573
|
+
message.typeThresholds =
|
|
1574
|
+
object.typeThresholds?.map((e) =>
|
|
1575
|
+
OperationTypeThreshold.fromPartial(e),
|
|
1576
|
+
) || [];
|
|
1577
|
+
return message;
|
|
1578
|
+
},
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1581
|
+
function createBaseOperationCreateAccount(): OperationCreateAccount {
|
|
1582
|
+
return {
|
|
1583
|
+
destAddress: "",
|
|
1584
|
+
contract: undefined,
|
|
1585
|
+
priv: undefined,
|
|
1586
|
+
metadatas: [],
|
|
1587
|
+
initBalance: 0,
|
|
1588
|
+
initInput: "",
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
export const OperationCreateAccount: MessageFns<OperationCreateAccount> = {
|
|
1593
|
+
encode(
|
|
1594
|
+
message: OperationCreateAccount,
|
|
1595
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1596
|
+
): BinaryWriter {
|
|
1597
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
1598
|
+
writer.uint32(10).string(message.destAddress);
|
|
1599
|
+
}
|
|
1600
|
+
if (message.contract !== undefined) {
|
|
1601
|
+
Contract.encode(message.contract, writer.uint32(18).fork()).join();
|
|
1602
|
+
}
|
|
1603
|
+
if (message.priv !== undefined) {
|
|
1604
|
+
AccountPrivilege.encode(message.priv, writer.uint32(26).fork()).join();
|
|
1605
|
+
}
|
|
1606
|
+
if (message.metadatas !== undefined && message.metadatas.length !== 0) {
|
|
1607
|
+
for (const v of message.metadatas) {
|
|
1608
|
+
KeyPair.encode(v!, writer.uint32(34).fork()).join();
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
if (message.initBalance !== undefined && message.initBalance !== 0) {
|
|
1612
|
+
writer.uint32(40).int64(message.initBalance);
|
|
1613
|
+
}
|
|
1614
|
+
if (message.initInput !== undefined && message.initInput !== "") {
|
|
1615
|
+
writer.uint32(50).string(message.initInput);
|
|
1616
|
+
}
|
|
1617
|
+
return writer;
|
|
1618
|
+
},
|
|
1619
|
+
|
|
1620
|
+
decode(
|
|
1621
|
+
input: BinaryReader | Uint8Array,
|
|
1622
|
+
length?: number,
|
|
1623
|
+
): OperationCreateAccount {
|
|
1624
|
+
const reader =
|
|
1625
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1626
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1627
|
+
const message = createBaseOperationCreateAccount();
|
|
1628
|
+
while (reader.pos < end) {
|
|
1629
|
+
const tag = reader.uint32();
|
|
1630
|
+
switch (tag >>> 3) {
|
|
1631
|
+
case 1: {
|
|
1632
|
+
if (tag !== 10) {
|
|
1633
|
+
break;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
message.destAddress = reader.string();
|
|
1637
|
+
continue;
|
|
1638
|
+
}
|
|
1639
|
+
case 2: {
|
|
1640
|
+
if (tag !== 18) {
|
|
1641
|
+
break;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
message.contract = Contract.decode(reader, reader.uint32());
|
|
1645
|
+
continue;
|
|
1646
|
+
}
|
|
1647
|
+
case 3: {
|
|
1648
|
+
if (tag !== 26) {
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
message.priv = AccountPrivilege.decode(reader, reader.uint32());
|
|
1653
|
+
continue;
|
|
1654
|
+
}
|
|
1655
|
+
case 4: {
|
|
1656
|
+
if (tag !== 34) {
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
const el = KeyPair.decode(reader, reader.uint32());
|
|
1661
|
+
if (el !== undefined) {
|
|
1662
|
+
message.metadatas!.push(el);
|
|
1663
|
+
}
|
|
1664
|
+
continue;
|
|
1665
|
+
}
|
|
1666
|
+
case 5: {
|
|
1667
|
+
if (tag !== 40) {
|
|
1668
|
+
break;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
message.initBalance = longToNumber(reader.int64());
|
|
1672
|
+
continue;
|
|
1673
|
+
}
|
|
1674
|
+
case 6: {
|
|
1675
|
+
if (tag !== 50) {
|
|
1676
|
+
break;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
message.initInput = reader.string();
|
|
1680
|
+
continue;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1684
|
+
break;
|
|
1685
|
+
}
|
|
1686
|
+
reader.skip(tag & 7);
|
|
1687
|
+
}
|
|
1688
|
+
return message;
|
|
1689
|
+
},
|
|
1690
|
+
|
|
1691
|
+
fromJSON(object: any): OperationCreateAccount {
|
|
1692
|
+
return {
|
|
1693
|
+
destAddress: isSet(object.dest_address)
|
|
1694
|
+
? globalThis.String(object.dest_address)
|
|
1695
|
+
: "",
|
|
1696
|
+
contract: isSet(object.contract)
|
|
1697
|
+
? Contract.fromJSON(object.contract)
|
|
1698
|
+
: undefined,
|
|
1699
|
+
priv: isSet(object.priv)
|
|
1700
|
+
? AccountPrivilege.fromJSON(object.priv)
|
|
1701
|
+
: undefined,
|
|
1702
|
+
metadatas: globalThis.Array.isArray(object?.metadatas)
|
|
1703
|
+
? object.metadatas.map((e: any) => KeyPair.fromJSON(e))
|
|
1704
|
+
: [],
|
|
1705
|
+
initBalance: isSet(object.init_balance)
|
|
1706
|
+
? globalThis.Number(object.init_balance)
|
|
1707
|
+
: 0,
|
|
1708
|
+
initInput: isSet(object.init_input)
|
|
1709
|
+
? globalThis.String(object.init_input)
|
|
1710
|
+
: "",
|
|
1711
|
+
};
|
|
1712
|
+
},
|
|
1713
|
+
|
|
1714
|
+
toJSON(message: OperationCreateAccount): unknown {
|
|
1715
|
+
const obj: any = {};
|
|
1716
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
1717
|
+
obj.dest_address = message.destAddress;
|
|
1718
|
+
}
|
|
1719
|
+
if (message.contract !== undefined) {
|
|
1720
|
+
obj.contract = Contract.toJSON(message.contract);
|
|
1721
|
+
}
|
|
1722
|
+
if (message.priv !== undefined) {
|
|
1723
|
+
obj.priv = AccountPrivilege.toJSON(message.priv);
|
|
1724
|
+
}
|
|
1725
|
+
if (message.metadatas?.length) {
|
|
1726
|
+
obj.metadatas = message.metadatas.map((e) => KeyPair.toJSON(e));
|
|
1727
|
+
}
|
|
1728
|
+
if (message.initBalance !== undefined && message.initBalance !== 0) {
|
|
1729
|
+
obj.init_balance = Math.round(message.initBalance);
|
|
1730
|
+
}
|
|
1731
|
+
if (message.initInput !== undefined && message.initInput !== "") {
|
|
1732
|
+
obj.init_input = message.initInput;
|
|
1733
|
+
}
|
|
1734
|
+
return obj;
|
|
1735
|
+
},
|
|
1736
|
+
|
|
1737
|
+
create<I extends Exact<DeepPartial<OperationCreateAccount>, I>>(
|
|
1738
|
+
base?: I,
|
|
1739
|
+
): OperationCreateAccount {
|
|
1740
|
+
return OperationCreateAccount.fromPartial(base ?? ({} as any));
|
|
1741
|
+
},
|
|
1742
|
+
fromPartial<I extends Exact<DeepPartial<OperationCreateAccount>, I>>(
|
|
1743
|
+
object: I,
|
|
1744
|
+
): OperationCreateAccount {
|
|
1745
|
+
const message = createBaseOperationCreateAccount();
|
|
1746
|
+
message.destAddress = object.destAddress ?? "";
|
|
1747
|
+
message.contract =
|
|
1748
|
+
object.contract !== undefined && object.contract !== null
|
|
1749
|
+
? Contract.fromPartial(object.contract)
|
|
1750
|
+
: undefined;
|
|
1751
|
+
message.priv =
|
|
1752
|
+
object.priv !== undefined && object.priv !== null
|
|
1753
|
+
? AccountPrivilege.fromPartial(object.priv)
|
|
1754
|
+
: undefined;
|
|
1755
|
+
message.metadatas =
|
|
1756
|
+
object.metadatas?.map((e) => KeyPair.fromPartial(e)) || [];
|
|
1757
|
+
message.initBalance = object.initBalance ?? 0;
|
|
1758
|
+
message.initInput = object.initInput ?? "";
|
|
1759
|
+
return message;
|
|
1760
|
+
},
|
|
1761
|
+
};
|
|
1762
|
+
|
|
1763
|
+
function createBaseOperationPayCoin(): OperationPayCoin {
|
|
1764
|
+
return { destAddress: "", amount: 0, input: "" };
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
export const OperationPayCoin: MessageFns<OperationPayCoin> = {
|
|
1768
|
+
encode(
|
|
1769
|
+
message: OperationPayCoin,
|
|
1770
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1771
|
+
): BinaryWriter {
|
|
1772
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
1773
|
+
writer.uint32(10).string(message.destAddress);
|
|
1774
|
+
}
|
|
1775
|
+
if (message.amount !== undefined && message.amount !== 0) {
|
|
1776
|
+
writer.uint32(16).int64(message.amount);
|
|
1777
|
+
}
|
|
1778
|
+
if (message.input !== undefined && message.input !== "") {
|
|
1779
|
+
writer.uint32(26).string(message.input);
|
|
1780
|
+
}
|
|
1781
|
+
return writer;
|
|
1782
|
+
},
|
|
1783
|
+
|
|
1784
|
+
decode(input: BinaryReader | Uint8Array, length?: number): OperationPayCoin {
|
|
1785
|
+
const reader =
|
|
1786
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1787
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1788
|
+
const message = createBaseOperationPayCoin();
|
|
1789
|
+
while (reader.pos < end) {
|
|
1790
|
+
const tag = reader.uint32();
|
|
1791
|
+
switch (tag >>> 3) {
|
|
1792
|
+
case 1: {
|
|
1793
|
+
if (tag !== 10) {
|
|
1794
|
+
break;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
message.destAddress = reader.string();
|
|
1798
|
+
continue;
|
|
1799
|
+
}
|
|
1800
|
+
case 2: {
|
|
1801
|
+
if (tag !== 16) {
|
|
1802
|
+
break;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
message.amount = longToNumber(reader.int64());
|
|
1806
|
+
continue;
|
|
1807
|
+
}
|
|
1808
|
+
case 3: {
|
|
1809
|
+
if (tag !== 26) {
|
|
1810
|
+
break;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
message.input = reader.string();
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1818
|
+
break;
|
|
1819
|
+
}
|
|
1820
|
+
reader.skip(tag & 7);
|
|
1821
|
+
}
|
|
1822
|
+
return message;
|
|
1823
|
+
},
|
|
1824
|
+
|
|
1825
|
+
fromJSON(object: any): OperationPayCoin {
|
|
1826
|
+
return {
|
|
1827
|
+
destAddress: isSet(object.dest_address)
|
|
1828
|
+
? globalThis.String(object.dest_address)
|
|
1829
|
+
: "",
|
|
1830
|
+
amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
|
|
1831
|
+
input: isSet(object.input) ? globalThis.String(object.input) : "",
|
|
1832
|
+
};
|
|
1833
|
+
},
|
|
1834
|
+
|
|
1835
|
+
toJSON(message: OperationPayCoin): unknown {
|
|
1836
|
+
const obj: any = {};
|
|
1837
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
1838
|
+
obj.dest_address = message.destAddress;
|
|
1839
|
+
}
|
|
1840
|
+
if (message.amount !== undefined && message.amount !== 0) {
|
|
1841
|
+
obj.amount = Math.round(message.amount);
|
|
1842
|
+
}
|
|
1843
|
+
if (message.input !== undefined && message.input !== "") {
|
|
1844
|
+
obj.input = message.input;
|
|
1845
|
+
}
|
|
1846
|
+
return obj;
|
|
1847
|
+
},
|
|
1848
|
+
|
|
1849
|
+
create<I extends Exact<DeepPartial<OperationPayCoin>, I>>(
|
|
1850
|
+
base?: I,
|
|
1851
|
+
): OperationPayCoin {
|
|
1852
|
+
return OperationPayCoin.fromPartial(base ?? ({} as any));
|
|
1853
|
+
},
|
|
1854
|
+
fromPartial<I extends Exact<DeepPartial<OperationPayCoin>, I>>(
|
|
1855
|
+
object: I,
|
|
1856
|
+
): OperationPayCoin {
|
|
1857
|
+
const message = createBaseOperationPayCoin();
|
|
1858
|
+
message.destAddress = object.destAddress ?? "";
|
|
1859
|
+
message.amount = object.amount ?? 0;
|
|
1860
|
+
message.input = object.input ?? "";
|
|
1861
|
+
return message;
|
|
1862
|
+
},
|
|
1863
|
+
};
|
|
1864
|
+
|
|
1865
|
+
function createBaseOperationSetMetadata(): OperationSetMetadata {
|
|
1866
|
+
return { key: "", value: "", version: 0, deleteFlag: false };
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
export const OperationSetMetadata: MessageFns<OperationSetMetadata> = {
|
|
1870
|
+
encode(
|
|
1871
|
+
message: OperationSetMetadata,
|
|
1872
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1873
|
+
): BinaryWriter {
|
|
1874
|
+
if (message.key !== undefined && message.key !== "") {
|
|
1875
|
+
writer.uint32(10).string(message.key);
|
|
1876
|
+
}
|
|
1877
|
+
if (message.value !== undefined && message.value !== "") {
|
|
1878
|
+
writer.uint32(18).string(message.value);
|
|
1879
|
+
}
|
|
1880
|
+
if (message.version !== undefined && message.version !== 0) {
|
|
1881
|
+
writer.uint32(24).int64(message.version);
|
|
1882
|
+
}
|
|
1883
|
+
if (message.deleteFlag !== undefined && message.deleteFlag !== false) {
|
|
1884
|
+
writer.uint32(32).bool(message.deleteFlag);
|
|
1885
|
+
}
|
|
1886
|
+
return writer;
|
|
1887
|
+
},
|
|
1888
|
+
|
|
1889
|
+
decode(
|
|
1890
|
+
input: BinaryReader | Uint8Array,
|
|
1891
|
+
length?: number,
|
|
1892
|
+
): OperationSetMetadata {
|
|
1893
|
+
const reader =
|
|
1894
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1895
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1896
|
+
const message = createBaseOperationSetMetadata();
|
|
1897
|
+
while (reader.pos < end) {
|
|
1898
|
+
const tag = reader.uint32();
|
|
1899
|
+
switch (tag >>> 3) {
|
|
1900
|
+
case 1: {
|
|
1901
|
+
if (tag !== 10) {
|
|
1902
|
+
break;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
message.key = reader.string();
|
|
1906
|
+
continue;
|
|
1907
|
+
}
|
|
1908
|
+
case 2: {
|
|
1909
|
+
if (tag !== 18) {
|
|
1910
|
+
break;
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
message.value = reader.string();
|
|
1914
|
+
continue;
|
|
1915
|
+
}
|
|
1916
|
+
case 3: {
|
|
1917
|
+
if (tag !== 24) {
|
|
1918
|
+
break;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
message.version = longToNumber(reader.int64());
|
|
1922
|
+
continue;
|
|
1923
|
+
}
|
|
1924
|
+
case 4: {
|
|
1925
|
+
if (tag !== 32) {
|
|
1926
|
+
break;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
message.deleteFlag = reader.bool();
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1934
|
+
break;
|
|
1935
|
+
}
|
|
1936
|
+
reader.skip(tag & 7);
|
|
1937
|
+
}
|
|
1938
|
+
return message;
|
|
1939
|
+
},
|
|
1940
|
+
|
|
1941
|
+
fromJSON(object: any): OperationSetMetadata {
|
|
1942
|
+
return {
|
|
1943
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1944
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
1945
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
1946
|
+
deleteFlag: isSet(object.delete_flag)
|
|
1947
|
+
? globalThis.Boolean(object.delete_flag)
|
|
1948
|
+
: false,
|
|
1949
|
+
};
|
|
1950
|
+
},
|
|
1951
|
+
|
|
1952
|
+
toJSON(message: OperationSetMetadata): unknown {
|
|
1953
|
+
const obj: any = {};
|
|
1954
|
+
if (message.key !== undefined && message.key !== "") {
|
|
1955
|
+
obj.key = message.key;
|
|
1956
|
+
}
|
|
1957
|
+
if (message.value !== undefined && message.value !== "") {
|
|
1958
|
+
obj.value = message.value;
|
|
1959
|
+
}
|
|
1960
|
+
if (message.version !== undefined && message.version !== 0) {
|
|
1961
|
+
obj.version = Math.round(message.version);
|
|
1962
|
+
}
|
|
1963
|
+
if (message.deleteFlag !== undefined && message.deleteFlag !== false) {
|
|
1964
|
+
obj.delete_flag = message.deleteFlag;
|
|
1965
|
+
}
|
|
1966
|
+
return obj;
|
|
1967
|
+
},
|
|
1968
|
+
|
|
1969
|
+
create<I extends Exact<DeepPartial<OperationSetMetadata>, I>>(
|
|
1970
|
+
base?: I,
|
|
1971
|
+
): OperationSetMetadata {
|
|
1972
|
+
return OperationSetMetadata.fromPartial(base ?? ({} as any));
|
|
1973
|
+
},
|
|
1974
|
+
fromPartial<I extends Exact<DeepPartial<OperationSetMetadata>, I>>(
|
|
1975
|
+
object: I,
|
|
1976
|
+
): OperationSetMetadata {
|
|
1977
|
+
const message = createBaseOperationSetMetadata();
|
|
1978
|
+
message.key = object.key ?? "";
|
|
1979
|
+
message.value = object.value ?? "";
|
|
1980
|
+
message.version = object.version ?? 0;
|
|
1981
|
+
message.deleteFlag = object.deleteFlag ?? false;
|
|
1982
|
+
return message;
|
|
1983
|
+
},
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1986
|
+
function createBaseOperationUpgradeContract(): OperationUpgradeContract {
|
|
1987
|
+
return { destAddress: "", payload: "", type: 0 };
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
export const OperationUpgradeContract: MessageFns<OperationUpgradeContract> = {
|
|
1991
|
+
encode(
|
|
1992
|
+
message: OperationUpgradeContract,
|
|
1993
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
1994
|
+
): BinaryWriter {
|
|
1995
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
1996
|
+
writer.uint32(10).string(message.destAddress);
|
|
1997
|
+
}
|
|
1998
|
+
if (message.payload !== undefined && message.payload !== "") {
|
|
1999
|
+
writer.uint32(18).string(message.payload);
|
|
2000
|
+
}
|
|
2001
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
2002
|
+
writer.uint32(24).int64(message.type);
|
|
2003
|
+
}
|
|
2004
|
+
return writer;
|
|
2005
|
+
},
|
|
2006
|
+
|
|
2007
|
+
decode(
|
|
2008
|
+
input: BinaryReader | Uint8Array,
|
|
2009
|
+
length?: number,
|
|
2010
|
+
): OperationUpgradeContract {
|
|
2011
|
+
const reader =
|
|
2012
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2013
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2014
|
+
const message = createBaseOperationUpgradeContract();
|
|
2015
|
+
while (reader.pos < end) {
|
|
2016
|
+
const tag = reader.uint32();
|
|
2017
|
+
switch (tag >>> 3) {
|
|
2018
|
+
case 1: {
|
|
2019
|
+
if (tag !== 10) {
|
|
2020
|
+
break;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
message.destAddress = reader.string();
|
|
2024
|
+
continue;
|
|
2025
|
+
}
|
|
2026
|
+
case 2: {
|
|
2027
|
+
if (tag !== 18) {
|
|
2028
|
+
break;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
message.payload = reader.string();
|
|
2032
|
+
continue;
|
|
2033
|
+
}
|
|
2034
|
+
case 3: {
|
|
2035
|
+
if (tag !== 24) {
|
|
2036
|
+
break;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
message.type = longToNumber(reader.int64());
|
|
2040
|
+
continue;
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2044
|
+
break;
|
|
2045
|
+
}
|
|
2046
|
+
reader.skip(tag & 7);
|
|
2047
|
+
}
|
|
2048
|
+
return message;
|
|
2049
|
+
},
|
|
2050
|
+
|
|
2051
|
+
fromJSON(object: any): OperationUpgradeContract {
|
|
2052
|
+
return {
|
|
2053
|
+
destAddress: isSet(object.dest_address)
|
|
2054
|
+
? globalThis.String(object.dest_address)
|
|
2055
|
+
: "",
|
|
2056
|
+
payload: isSet(object.payload) ? globalThis.String(object.payload) : "",
|
|
2057
|
+
type: isSet(object.type) ? globalThis.Number(object.type) : 0,
|
|
2058
|
+
};
|
|
2059
|
+
},
|
|
2060
|
+
|
|
2061
|
+
toJSON(message: OperationUpgradeContract): unknown {
|
|
2062
|
+
const obj: any = {};
|
|
2063
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
2064
|
+
obj.dest_address = message.destAddress;
|
|
2065
|
+
}
|
|
2066
|
+
if (message.payload !== undefined && message.payload !== "") {
|
|
2067
|
+
obj.payload = message.payload;
|
|
2068
|
+
}
|
|
2069
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
2070
|
+
obj.type = Math.round(message.type);
|
|
2071
|
+
}
|
|
2072
|
+
return obj;
|
|
2073
|
+
},
|
|
2074
|
+
|
|
2075
|
+
create<I extends Exact<DeepPartial<OperationUpgradeContract>, I>>(
|
|
2076
|
+
base?: I,
|
|
2077
|
+
): OperationUpgradeContract {
|
|
2078
|
+
return OperationUpgradeContract.fromPartial(base ?? ({} as any));
|
|
2079
|
+
},
|
|
2080
|
+
fromPartial<I extends Exact<DeepPartial<OperationUpgradeContract>, I>>(
|
|
2081
|
+
object: I,
|
|
2082
|
+
): OperationUpgradeContract {
|
|
2083
|
+
const message = createBaseOperationUpgradeContract();
|
|
2084
|
+
message.destAddress = object.destAddress ?? "";
|
|
2085
|
+
message.payload = object.payload ?? "";
|
|
2086
|
+
message.type = object.type ?? 0;
|
|
2087
|
+
return message;
|
|
2088
|
+
},
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
function createBaseOperationSetSignerWeight(): OperationSetSignerWeight {
|
|
2092
|
+
return { masterWeight: 0, signers: [] };
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
export const OperationSetSignerWeight: MessageFns<OperationSetSignerWeight> = {
|
|
2096
|
+
encode(
|
|
2097
|
+
message: OperationSetSignerWeight,
|
|
2098
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2099
|
+
): BinaryWriter {
|
|
2100
|
+
if (message.masterWeight !== undefined && message.masterWeight !== 0) {
|
|
2101
|
+
writer.uint32(8).int64(message.masterWeight);
|
|
2102
|
+
}
|
|
2103
|
+
if (message.signers !== undefined && message.signers.length !== 0) {
|
|
2104
|
+
for (const v of message.signers) {
|
|
2105
|
+
Signer.encode(v!, writer.uint32(18).fork()).join();
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
return writer;
|
|
2109
|
+
},
|
|
2110
|
+
|
|
2111
|
+
decode(
|
|
2112
|
+
input: BinaryReader | Uint8Array,
|
|
2113
|
+
length?: number,
|
|
2114
|
+
): OperationSetSignerWeight {
|
|
2115
|
+
const reader =
|
|
2116
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2117
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2118
|
+
const message = createBaseOperationSetSignerWeight();
|
|
2119
|
+
while (reader.pos < end) {
|
|
2120
|
+
const tag = reader.uint32();
|
|
2121
|
+
switch (tag >>> 3) {
|
|
2122
|
+
case 1: {
|
|
2123
|
+
if (tag !== 8) {
|
|
2124
|
+
break;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
message.masterWeight = longToNumber(reader.int64());
|
|
2128
|
+
continue;
|
|
2129
|
+
}
|
|
2130
|
+
case 2: {
|
|
2131
|
+
if (tag !== 18) {
|
|
2132
|
+
break;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
const el = Signer.decode(reader, reader.uint32());
|
|
2136
|
+
if (el !== undefined) {
|
|
2137
|
+
message.signers!.push(el);
|
|
2138
|
+
}
|
|
2139
|
+
continue;
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2143
|
+
break;
|
|
2144
|
+
}
|
|
2145
|
+
reader.skip(tag & 7);
|
|
2146
|
+
}
|
|
2147
|
+
return message;
|
|
2148
|
+
},
|
|
2149
|
+
|
|
2150
|
+
fromJSON(object: any): OperationSetSignerWeight {
|
|
2151
|
+
return {
|
|
2152
|
+
masterWeight: isSet(object.master_weight)
|
|
2153
|
+
? globalThis.Number(object.master_weight)
|
|
2154
|
+
: 0,
|
|
2155
|
+
signers: globalThis.Array.isArray(object?.signers)
|
|
2156
|
+
? object.signers.map((e: any) => Signer.fromJSON(e))
|
|
2157
|
+
: [],
|
|
2158
|
+
};
|
|
2159
|
+
},
|
|
2160
|
+
|
|
2161
|
+
toJSON(message: OperationSetSignerWeight): unknown {
|
|
2162
|
+
const obj: any = {};
|
|
2163
|
+
if (message.masterWeight !== undefined && message.masterWeight !== 0) {
|
|
2164
|
+
obj.master_weight = Math.round(message.masterWeight);
|
|
2165
|
+
}
|
|
2166
|
+
if (message.signers?.length) {
|
|
2167
|
+
obj.signers = message.signers.map((e) => Signer.toJSON(e));
|
|
2168
|
+
}
|
|
2169
|
+
return obj;
|
|
2170
|
+
},
|
|
2171
|
+
|
|
2172
|
+
create<I extends Exact<DeepPartial<OperationSetSignerWeight>, I>>(
|
|
2173
|
+
base?: I,
|
|
2174
|
+
): OperationSetSignerWeight {
|
|
2175
|
+
return OperationSetSignerWeight.fromPartial(base ?? ({} as any));
|
|
2176
|
+
},
|
|
2177
|
+
fromPartial<I extends Exact<DeepPartial<OperationSetSignerWeight>, I>>(
|
|
2178
|
+
object: I,
|
|
2179
|
+
): OperationSetSignerWeight {
|
|
2180
|
+
const message = createBaseOperationSetSignerWeight();
|
|
2181
|
+
message.masterWeight = object.masterWeight ?? 0;
|
|
2182
|
+
message.signers = object.signers?.map((e) => Signer.fromPartial(e)) || [];
|
|
2183
|
+
return message;
|
|
2184
|
+
},
|
|
2185
|
+
};
|
|
2186
|
+
|
|
2187
|
+
function createBaseOperationSetThreshold(): OperationSetThreshold {
|
|
2188
|
+
return { txThreshold: 0, typeThresholds: [] };
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
export const OperationSetThreshold: MessageFns<OperationSetThreshold> = {
|
|
2192
|
+
encode(
|
|
2193
|
+
message: OperationSetThreshold,
|
|
2194
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2195
|
+
): BinaryWriter {
|
|
2196
|
+
if (message.txThreshold !== undefined && message.txThreshold !== 0) {
|
|
2197
|
+
writer.uint32(8).int64(message.txThreshold);
|
|
2198
|
+
}
|
|
2199
|
+
if (
|
|
2200
|
+
message.typeThresholds !== undefined &&
|
|
2201
|
+
message.typeThresholds.length !== 0
|
|
2202
|
+
) {
|
|
2203
|
+
for (const v of message.typeThresholds) {
|
|
2204
|
+
OperationTypeThreshold.encode(v!, writer.uint32(34).fork()).join();
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
return writer;
|
|
2208
|
+
},
|
|
2209
|
+
|
|
2210
|
+
decode(
|
|
2211
|
+
input: BinaryReader | Uint8Array,
|
|
2212
|
+
length?: number,
|
|
2213
|
+
): OperationSetThreshold {
|
|
2214
|
+
const reader =
|
|
2215
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2216
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2217
|
+
const message = createBaseOperationSetThreshold();
|
|
2218
|
+
while (reader.pos < end) {
|
|
2219
|
+
const tag = reader.uint32();
|
|
2220
|
+
switch (tag >>> 3) {
|
|
2221
|
+
case 1: {
|
|
2222
|
+
if (tag !== 8) {
|
|
2223
|
+
break;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
message.txThreshold = longToNumber(reader.int64());
|
|
2227
|
+
continue;
|
|
2228
|
+
}
|
|
2229
|
+
case 4: {
|
|
2230
|
+
if (tag !== 34) {
|
|
2231
|
+
break;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
const el = OperationTypeThreshold.decode(reader, reader.uint32());
|
|
2235
|
+
if (el !== undefined) {
|
|
2236
|
+
message.typeThresholds!.push(el);
|
|
2237
|
+
}
|
|
2238
|
+
continue;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2242
|
+
break;
|
|
2243
|
+
}
|
|
2244
|
+
reader.skip(tag & 7);
|
|
2245
|
+
}
|
|
2246
|
+
return message;
|
|
2247
|
+
},
|
|
2248
|
+
|
|
2249
|
+
fromJSON(object: any): OperationSetThreshold {
|
|
2250
|
+
return {
|
|
2251
|
+
txThreshold: isSet(object.txThreshold)
|
|
2252
|
+
? globalThis.Number(object.txThreshold)
|
|
2253
|
+
: 0,
|
|
2254
|
+
typeThresholds: globalThis.Array.isArray(object?.type_thresholds)
|
|
2255
|
+
? object.type_thresholds.map((e: any) =>
|
|
2256
|
+
OperationTypeThreshold.fromJSON(e),
|
|
2257
|
+
)
|
|
2258
|
+
: [],
|
|
2259
|
+
};
|
|
2260
|
+
},
|
|
2261
|
+
|
|
2262
|
+
toJSON(message: OperationSetThreshold): unknown {
|
|
2263
|
+
const obj: any = {};
|
|
2264
|
+
if (message.txThreshold !== undefined && message.txThreshold !== 0) {
|
|
2265
|
+
obj.txThreshold = Math.round(message.txThreshold);
|
|
2266
|
+
}
|
|
2267
|
+
if (message.typeThresholds?.length) {
|
|
2268
|
+
obj.type_thresholds = message.typeThresholds.map((e) =>
|
|
2269
|
+
OperationTypeThreshold.toJSON(e),
|
|
2270
|
+
);
|
|
2271
|
+
}
|
|
2272
|
+
return obj;
|
|
2273
|
+
},
|
|
2274
|
+
|
|
2275
|
+
create<I extends Exact<DeepPartial<OperationSetThreshold>, I>>(
|
|
2276
|
+
base?: I,
|
|
2277
|
+
): OperationSetThreshold {
|
|
2278
|
+
return OperationSetThreshold.fromPartial(base ?? ({} as any));
|
|
2279
|
+
},
|
|
2280
|
+
fromPartial<I extends Exact<DeepPartial<OperationSetThreshold>, I>>(
|
|
2281
|
+
object: I,
|
|
2282
|
+
): OperationSetThreshold {
|
|
2283
|
+
const message = createBaseOperationSetThreshold();
|
|
2284
|
+
message.txThreshold = object.txThreshold ?? 0;
|
|
2285
|
+
message.typeThresholds =
|
|
2286
|
+
object.typeThresholds?.map((e) =>
|
|
2287
|
+
OperationTypeThreshold.fromPartial(e),
|
|
2288
|
+
) || [];
|
|
2289
|
+
return message;
|
|
2290
|
+
},
|
|
2291
|
+
};
|
|
2292
|
+
|
|
2293
|
+
function createBaseOperationLog(): OperationLog {
|
|
2294
|
+
return { topic: "", datas: [], topics: [] };
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
export const OperationLog: MessageFns<OperationLog> = {
|
|
2298
|
+
encode(
|
|
2299
|
+
message: OperationLog,
|
|
2300
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2301
|
+
): BinaryWriter {
|
|
2302
|
+
if (message.topic !== undefined && message.topic !== "") {
|
|
2303
|
+
writer.uint32(10).string(message.topic);
|
|
2304
|
+
}
|
|
2305
|
+
if (message.datas !== undefined && message.datas.length !== 0) {
|
|
2306
|
+
for (const v of message.datas) {
|
|
2307
|
+
writer.uint32(18).string(v!);
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
if (message.topics !== undefined && message.topics.length !== 0) {
|
|
2311
|
+
for (const v of message.topics) {
|
|
2312
|
+
writer.uint32(26).string(v!);
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
return writer;
|
|
2316
|
+
},
|
|
2317
|
+
|
|
2318
|
+
decode(input: BinaryReader | Uint8Array, length?: number): OperationLog {
|
|
2319
|
+
const reader =
|
|
2320
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2321
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2322
|
+
const message = createBaseOperationLog();
|
|
2323
|
+
while (reader.pos < end) {
|
|
2324
|
+
const tag = reader.uint32();
|
|
2325
|
+
switch (tag >>> 3) {
|
|
2326
|
+
case 1: {
|
|
2327
|
+
if (tag !== 10) {
|
|
2328
|
+
break;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
message.topic = reader.string();
|
|
2332
|
+
continue;
|
|
2333
|
+
}
|
|
2334
|
+
case 2: {
|
|
2335
|
+
if (tag !== 18) {
|
|
2336
|
+
break;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
const el = reader.string();
|
|
2340
|
+
if (el !== undefined) {
|
|
2341
|
+
message.datas!.push(el);
|
|
2342
|
+
}
|
|
2343
|
+
continue;
|
|
2344
|
+
}
|
|
2345
|
+
case 3: {
|
|
2346
|
+
if (tag !== 26) {
|
|
2347
|
+
break;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
const el = reader.string();
|
|
2351
|
+
if (el !== undefined) {
|
|
2352
|
+
message.topics!.push(el);
|
|
2353
|
+
}
|
|
2354
|
+
continue;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2358
|
+
break;
|
|
2359
|
+
}
|
|
2360
|
+
reader.skip(tag & 7);
|
|
2361
|
+
}
|
|
2362
|
+
return message;
|
|
2363
|
+
},
|
|
2364
|
+
|
|
2365
|
+
fromJSON(object: any): OperationLog {
|
|
2366
|
+
return {
|
|
2367
|
+
topic: isSet(object.topic) ? globalThis.String(object.topic) : "",
|
|
2368
|
+
datas: globalThis.Array.isArray(object?.datas)
|
|
2369
|
+
? object.datas.map((e: any) => globalThis.String(e))
|
|
2370
|
+
: [],
|
|
2371
|
+
topics: globalThis.Array.isArray(object?.topics)
|
|
2372
|
+
? object.topics.map((e: any) => globalThis.String(e))
|
|
2373
|
+
: [],
|
|
2374
|
+
};
|
|
2375
|
+
},
|
|
2376
|
+
|
|
2377
|
+
toJSON(message: OperationLog): unknown {
|
|
2378
|
+
const obj: any = {};
|
|
2379
|
+
if (message.topic !== undefined && message.topic !== "") {
|
|
2380
|
+
obj.topic = message.topic;
|
|
2381
|
+
}
|
|
2382
|
+
if (message.datas?.length) {
|
|
2383
|
+
obj.datas = message.datas;
|
|
2384
|
+
}
|
|
2385
|
+
if (message.topics?.length) {
|
|
2386
|
+
obj.topics = message.topics;
|
|
2387
|
+
}
|
|
2388
|
+
return obj;
|
|
2389
|
+
},
|
|
2390
|
+
|
|
2391
|
+
create<I extends Exact<DeepPartial<OperationLog>, I>>(
|
|
2392
|
+
base?: I,
|
|
2393
|
+
): OperationLog {
|
|
2394
|
+
return OperationLog.fromPartial(base ?? ({} as any));
|
|
2395
|
+
},
|
|
2396
|
+
fromPartial<I extends Exact<DeepPartial<OperationLog>, I>>(
|
|
2397
|
+
object: I,
|
|
2398
|
+
): OperationLog {
|
|
2399
|
+
const message = createBaseOperationLog();
|
|
2400
|
+
message.topic = object.topic ?? "";
|
|
2401
|
+
message.datas = object.datas?.map((e) => e) || [];
|
|
2402
|
+
message.topics = object.topics?.map((e) => e) || [];
|
|
2403
|
+
return message;
|
|
2404
|
+
},
|
|
2405
|
+
};
|
|
2406
|
+
|
|
2407
|
+
function createBaseOperationSetPrivilege(): OperationSetPrivilege {
|
|
2408
|
+
return { masterWeight: "", signers: [], txThreshold: "", typeThresholds: [] };
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
export const OperationSetPrivilege: MessageFns<OperationSetPrivilege> = {
|
|
2412
|
+
encode(
|
|
2413
|
+
message: OperationSetPrivilege,
|
|
2414
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2415
|
+
): BinaryWriter {
|
|
2416
|
+
if (message.masterWeight !== undefined && message.masterWeight !== "") {
|
|
2417
|
+
writer.uint32(10).string(message.masterWeight);
|
|
2418
|
+
}
|
|
2419
|
+
if (message.signers !== undefined && message.signers.length !== 0) {
|
|
2420
|
+
for (const v of message.signers) {
|
|
2421
|
+
Signer.encode(v!, writer.uint32(18).fork()).join();
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
if (message.txThreshold !== undefined && message.txThreshold !== "") {
|
|
2425
|
+
writer.uint32(26).string(message.txThreshold);
|
|
2426
|
+
}
|
|
2427
|
+
if (
|
|
2428
|
+
message.typeThresholds !== undefined &&
|
|
2429
|
+
message.typeThresholds.length !== 0
|
|
2430
|
+
) {
|
|
2431
|
+
for (const v of message.typeThresholds) {
|
|
2432
|
+
OperationTypeThreshold.encode(v!, writer.uint32(34).fork()).join();
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
return writer;
|
|
2436
|
+
},
|
|
2437
|
+
|
|
2438
|
+
decode(
|
|
2439
|
+
input: BinaryReader | Uint8Array,
|
|
2440
|
+
length?: number,
|
|
2441
|
+
): OperationSetPrivilege {
|
|
2442
|
+
const reader =
|
|
2443
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2444
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2445
|
+
const message = createBaseOperationSetPrivilege();
|
|
2446
|
+
while (reader.pos < end) {
|
|
2447
|
+
const tag = reader.uint32();
|
|
2448
|
+
switch (tag >>> 3) {
|
|
2449
|
+
case 1: {
|
|
2450
|
+
if (tag !== 10) {
|
|
2451
|
+
break;
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
message.masterWeight = reader.string();
|
|
2455
|
+
continue;
|
|
2456
|
+
}
|
|
2457
|
+
case 2: {
|
|
2458
|
+
if (tag !== 18) {
|
|
2459
|
+
break;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
const el = Signer.decode(reader, reader.uint32());
|
|
2463
|
+
if (el !== undefined) {
|
|
2464
|
+
message.signers!.push(el);
|
|
2465
|
+
}
|
|
2466
|
+
continue;
|
|
2467
|
+
}
|
|
2468
|
+
case 3: {
|
|
2469
|
+
if (tag !== 26) {
|
|
2470
|
+
break;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
message.txThreshold = reader.string();
|
|
2474
|
+
continue;
|
|
2475
|
+
}
|
|
2476
|
+
case 4: {
|
|
2477
|
+
if (tag !== 34) {
|
|
2478
|
+
break;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
const el = OperationTypeThreshold.decode(reader, reader.uint32());
|
|
2482
|
+
if (el !== undefined) {
|
|
2483
|
+
message.typeThresholds!.push(el);
|
|
2484
|
+
}
|
|
2485
|
+
continue;
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2489
|
+
break;
|
|
2490
|
+
}
|
|
2491
|
+
reader.skip(tag & 7);
|
|
2492
|
+
}
|
|
2493
|
+
return message;
|
|
2494
|
+
},
|
|
2495
|
+
|
|
2496
|
+
fromJSON(object: any): OperationSetPrivilege {
|
|
2497
|
+
return {
|
|
2498
|
+
masterWeight: isSet(object.master_weight)
|
|
2499
|
+
? globalThis.String(object.master_weight)
|
|
2500
|
+
: "",
|
|
2501
|
+
signers: globalThis.Array.isArray(object?.signers)
|
|
2502
|
+
? object.signers.map((e: any) => Signer.fromJSON(e))
|
|
2503
|
+
: [],
|
|
2504
|
+
txThreshold: isSet(object.tx_threshold)
|
|
2505
|
+
? globalThis.String(object.tx_threshold)
|
|
2506
|
+
: "",
|
|
2507
|
+
typeThresholds: globalThis.Array.isArray(object?.type_thresholds)
|
|
2508
|
+
? object.type_thresholds.map((e: any) =>
|
|
2509
|
+
OperationTypeThreshold.fromJSON(e),
|
|
2510
|
+
)
|
|
2511
|
+
: [],
|
|
2512
|
+
};
|
|
2513
|
+
},
|
|
2514
|
+
|
|
2515
|
+
toJSON(message: OperationSetPrivilege): unknown {
|
|
2516
|
+
const obj: any = {};
|
|
2517
|
+
if (message.masterWeight !== undefined && message.masterWeight !== "") {
|
|
2518
|
+
obj.master_weight = message.masterWeight;
|
|
2519
|
+
}
|
|
2520
|
+
if (message.signers?.length) {
|
|
2521
|
+
obj.signers = message.signers.map((e) => Signer.toJSON(e));
|
|
2522
|
+
}
|
|
2523
|
+
if (message.txThreshold !== undefined && message.txThreshold !== "") {
|
|
2524
|
+
obj.tx_threshold = message.txThreshold;
|
|
2525
|
+
}
|
|
2526
|
+
if (message.typeThresholds?.length) {
|
|
2527
|
+
obj.type_thresholds = message.typeThresholds.map((e) =>
|
|
2528
|
+
OperationTypeThreshold.toJSON(e),
|
|
2529
|
+
);
|
|
2530
|
+
}
|
|
2531
|
+
return obj;
|
|
2532
|
+
},
|
|
2533
|
+
|
|
2534
|
+
create<I extends Exact<DeepPartial<OperationSetPrivilege>, I>>(
|
|
2535
|
+
base?: I,
|
|
2536
|
+
): OperationSetPrivilege {
|
|
2537
|
+
return OperationSetPrivilege.fromPartial(base ?? ({} as any));
|
|
2538
|
+
},
|
|
2539
|
+
fromPartial<I extends Exact<DeepPartial<OperationSetPrivilege>, I>>(
|
|
2540
|
+
object: I,
|
|
2541
|
+
): OperationSetPrivilege {
|
|
2542
|
+
const message = createBaseOperationSetPrivilege();
|
|
2543
|
+
message.masterWeight = object.masterWeight ?? "";
|
|
2544
|
+
message.signers = object.signers?.map((e) => Signer.fromPartial(e)) || [];
|
|
2545
|
+
message.txThreshold = object.txThreshold ?? "";
|
|
2546
|
+
message.typeThresholds =
|
|
2547
|
+
object.typeThresholds?.map((e) =>
|
|
2548
|
+
OperationTypeThreshold.fromPartial(e),
|
|
2549
|
+
) || [];
|
|
2550
|
+
return message;
|
|
2551
|
+
},
|
|
2552
|
+
};
|
|
2553
|
+
|
|
2554
|
+
function createBaseControlledArea(): ControlledArea {
|
|
2555
|
+
return { trusted: 0, status: 0, attributes: [] };
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
export const ControlledArea: MessageFns<ControlledArea> = {
|
|
2559
|
+
encode(
|
|
2560
|
+
message: ControlledArea,
|
|
2561
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2562
|
+
): BinaryWriter {
|
|
2563
|
+
if (message.trusted !== undefined && message.trusted !== 0) {
|
|
2564
|
+
writer.uint32(8).int32(message.trusted);
|
|
2565
|
+
}
|
|
2566
|
+
if (message.status !== undefined && message.status !== 0) {
|
|
2567
|
+
writer.uint32(16).int32(message.status);
|
|
2568
|
+
}
|
|
2569
|
+
if (message.attributes !== undefined && message.attributes.length !== 0) {
|
|
2570
|
+
for (const v of message.attributes) {
|
|
2571
|
+
KeyPair.encode(v!, writer.uint32(26).fork()).join();
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
return writer;
|
|
2575
|
+
},
|
|
2576
|
+
|
|
2577
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ControlledArea {
|
|
2578
|
+
const reader =
|
|
2579
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2580
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2581
|
+
const message = createBaseControlledArea();
|
|
2582
|
+
while (reader.pos < end) {
|
|
2583
|
+
const tag = reader.uint32();
|
|
2584
|
+
switch (tag >>> 3) {
|
|
2585
|
+
case 1: {
|
|
2586
|
+
if (tag !== 8) {
|
|
2587
|
+
break;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
message.trusted = reader.int32() as any;
|
|
2591
|
+
continue;
|
|
2592
|
+
}
|
|
2593
|
+
case 2: {
|
|
2594
|
+
if (tag !== 16) {
|
|
2595
|
+
break;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
message.status = reader.int32() as any;
|
|
2599
|
+
continue;
|
|
2600
|
+
}
|
|
2601
|
+
case 3: {
|
|
2602
|
+
if (tag !== 26) {
|
|
2603
|
+
break;
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
const el = KeyPair.decode(reader, reader.uint32());
|
|
2607
|
+
if (el !== undefined) {
|
|
2608
|
+
message.attributes!.push(el);
|
|
2609
|
+
}
|
|
2610
|
+
continue;
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2614
|
+
break;
|
|
2615
|
+
}
|
|
2616
|
+
reader.skip(tag & 7);
|
|
2617
|
+
}
|
|
2618
|
+
return message;
|
|
2619
|
+
},
|
|
2620
|
+
|
|
2621
|
+
fromJSON(object: any): ControlledArea {
|
|
2622
|
+
return {
|
|
2623
|
+
trusted: isSet(object.trusted)
|
|
2624
|
+
? controlledArea_trustFlagFromJSON(object.trusted)
|
|
2625
|
+
: 0,
|
|
2626
|
+
status: isSet(object.status)
|
|
2627
|
+
? controlledArea_statusFalgFromJSON(object.status)
|
|
2628
|
+
: 0,
|
|
2629
|
+
attributes: globalThis.Array.isArray(object?.attributes)
|
|
2630
|
+
? object.attributes.map((e: any) => KeyPair.fromJSON(e))
|
|
2631
|
+
: [],
|
|
2632
|
+
};
|
|
2633
|
+
},
|
|
2634
|
+
|
|
2635
|
+
toJSON(message: ControlledArea): unknown {
|
|
2636
|
+
const obj: any = {};
|
|
2637
|
+
if (message.trusted !== undefined && message.trusted !== 0) {
|
|
2638
|
+
obj.trusted = controlledArea_trustFlagToJSON(message.trusted);
|
|
2639
|
+
}
|
|
2640
|
+
if (message.status !== undefined && message.status !== 0) {
|
|
2641
|
+
obj.status = controlledArea_statusFalgToJSON(message.status);
|
|
2642
|
+
}
|
|
2643
|
+
if (message.attributes?.length) {
|
|
2644
|
+
obj.attributes = message.attributes.map((e) => KeyPair.toJSON(e));
|
|
2645
|
+
}
|
|
2646
|
+
return obj;
|
|
2647
|
+
},
|
|
2648
|
+
|
|
2649
|
+
create<I extends Exact<DeepPartial<ControlledArea>, I>>(
|
|
2650
|
+
base?: I,
|
|
2651
|
+
): ControlledArea {
|
|
2652
|
+
return ControlledArea.fromPartial(base ?? ({} as any));
|
|
2653
|
+
},
|
|
2654
|
+
fromPartial<I extends Exact<DeepPartial<ControlledArea>, I>>(
|
|
2655
|
+
object: I,
|
|
2656
|
+
): ControlledArea {
|
|
2657
|
+
const message = createBaseControlledArea();
|
|
2658
|
+
message.trusted = object.trusted ?? 0;
|
|
2659
|
+
message.status = object.status ?? 0;
|
|
2660
|
+
message.attributes =
|
|
2661
|
+
object.attributes?.map((e) => KeyPair.fromPartial(e)) || [];
|
|
2662
|
+
return message;
|
|
2663
|
+
},
|
|
2664
|
+
};
|
|
2665
|
+
|
|
2666
|
+
function createBaseOperationSetControlledArea(): OperationSetControlledArea {
|
|
2667
|
+
return {
|
|
2668
|
+
destAddress: "",
|
|
2669
|
+
sTrusted: false,
|
|
2670
|
+
sStatus: false,
|
|
2671
|
+
trusted: 0,
|
|
2672
|
+
status: 0,
|
|
2673
|
+
attributes: [],
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
export const OperationSetControlledArea: MessageFns<OperationSetControlledArea> =
|
|
2678
|
+
{
|
|
2679
|
+
encode(
|
|
2680
|
+
message: OperationSetControlledArea,
|
|
2681
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2682
|
+
): BinaryWriter {
|
|
2683
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
2684
|
+
writer.uint32(10).string(message.destAddress);
|
|
2685
|
+
}
|
|
2686
|
+
if (message.sTrusted !== undefined && message.sTrusted !== false) {
|
|
2687
|
+
writer.uint32(16).bool(message.sTrusted);
|
|
2688
|
+
}
|
|
2689
|
+
if (message.sStatus !== undefined && message.sStatus !== false) {
|
|
2690
|
+
writer.uint32(24).bool(message.sStatus);
|
|
2691
|
+
}
|
|
2692
|
+
if (message.trusted !== undefined && message.trusted !== 0) {
|
|
2693
|
+
writer.uint32(32).int32(message.trusted);
|
|
2694
|
+
}
|
|
2695
|
+
if (message.status !== undefined && message.status !== 0) {
|
|
2696
|
+
writer.uint32(40).int32(message.status);
|
|
2697
|
+
}
|
|
2698
|
+
if (message.attributes !== undefined && message.attributes.length !== 0) {
|
|
2699
|
+
for (const v of message.attributes) {
|
|
2700
|
+
KeyPair.encode(v!, writer.uint32(50).fork()).join();
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
return writer;
|
|
2704
|
+
},
|
|
2705
|
+
|
|
2706
|
+
decode(
|
|
2707
|
+
input: BinaryReader | Uint8Array,
|
|
2708
|
+
length?: number,
|
|
2709
|
+
): OperationSetControlledArea {
|
|
2710
|
+
const reader =
|
|
2711
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2712
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2713
|
+
const message = createBaseOperationSetControlledArea();
|
|
2714
|
+
while (reader.pos < end) {
|
|
2715
|
+
const tag = reader.uint32();
|
|
2716
|
+
switch (tag >>> 3) {
|
|
2717
|
+
case 1: {
|
|
2718
|
+
if (tag !== 10) {
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
message.destAddress = reader.string();
|
|
2723
|
+
continue;
|
|
2724
|
+
}
|
|
2725
|
+
case 2: {
|
|
2726
|
+
if (tag !== 16) {
|
|
2727
|
+
break;
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
message.sTrusted = reader.bool();
|
|
2731
|
+
continue;
|
|
2732
|
+
}
|
|
2733
|
+
case 3: {
|
|
2734
|
+
if (tag !== 24) {
|
|
2735
|
+
break;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
message.sStatus = reader.bool();
|
|
2739
|
+
continue;
|
|
2740
|
+
}
|
|
2741
|
+
case 4: {
|
|
2742
|
+
if (tag !== 32) {
|
|
2743
|
+
break;
|
|
2744
|
+
}
|
|
2745
|
+
|
|
2746
|
+
message.trusted = reader.int32() as any;
|
|
2747
|
+
continue;
|
|
2748
|
+
}
|
|
2749
|
+
case 5: {
|
|
2750
|
+
if (tag !== 40) {
|
|
2751
|
+
break;
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
message.status = reader.int32() as any;
|
|
2755
|
+
continue;
|
|
2756
|
+
}
|
|
2757
|
+
case 6: {
|
|
2758
|
+
if (tag !== 50) {
|
|
2759
|
+
break;
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
const el = KeyPair.decode(reader, reader.uint32());
|
|
2763
|
+
if (el !== undefined) {
|
|
2764
|
+
message.attributes!.push(el);
|
|
2765
|
+
}
|
|
2766
|
+
continue;
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2770
|
+
break;
|
|
2771
|
+
}
|
|
2772
|
+
reader.skip(tag & 7);
|
|
2773
|
+
}
|
|
2774
|
+
return message;
|
|
2775
|
+
},
|
|
2776
|
+
|
|
2777
|
+
fromJSON(object: any): OperationSetControlledArea {
|
|
2778
|
+
return {
|
|
2779
|
+
destAddress: isSet(object.dest_address)
|
|
2780
|
+
? globalThis.String(object.dest_address)
|
|
2781
|
+
: "",
|
|
2782
|
+
sTrusted: isSet(object.s_trusted)
|
|
2783
|
+
? globalThis.Boolean(object.s_trusted)
|
|
2784
|
+
: false,
|
|
2785
|
+
sStatus: isSet(object.s_status)
|
|
2786
|
+
? globalThis.Boolean(object.s_status)
|
|
2787
|
+
: false,
|
|
2788
|
+
trusted: isSet(object.trusted)
|
|
2789
|
+
? controlledArea_trustFlagFromJSON(object.trusted)
|
|
2790
|
+
: 0,
|
|
2791
|
+
status: isSet(object.status)
|
|
2792
|
+
? controlledArea_statusFalgFromJSON(object.status)
|
|
2793
|
+
: 0,
|
|
2794
|
+
attributes: globalThis.Array.isArray(object?.attributes)
|
|
2795
|
+
? object.attributes.map((e: any) => KeyPair.fromJSON(e))
|
|
2796
|
+
: [],
|
|
2797
|
+
};
|
|
2798
|
+
},
|
|
2799
|
+
|
|
2800
|
+
toJSON(message: OperationSetControlledArea): unknown {
|
|
2801
|
+
const obj: any = {};
|
|
2802
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
2803
|
+
obj.dest_address = message.destAddress;
|
|
2804
|
+
}
|
|
2805
|
+
if (message.sTrusted !== undefined && message.sTrusted !== false) {
|
|
2806
|
+
obj.s_trusted = message.sTrusted;
|
|
2807
|
+
}
|
|
2808
|
+
if (message.sStatus !== undefined && message.sStatus !== false) {
|
|
2809
|
+
obj.s_status = message.sStatus;
|
|
2810
|
+
}
|
|
2811
|
+
if (message.trusted !== undefined && message.trusted !== 0) {
|
|
2812
|
+
obj.trusted = controlledArea_trustFlagToJSON(message.trusted);
|
|
2813
|
+
}
|
|
2814
|
+
if (message.status !== undefined && message.status !== 0) {
|
|
2815
|
+
obj.status = controlledArea_statusFalgToJSON(message.status);
|
|
2816
|
+
}
|
|
2817
|
+
if (message.attributes?.length) {
|
|
2818
|
+
obj.attributes = message.attributes.map((e) => KeyPair.toJSON(e));
|
|
2819
|
+
}
|
|
2820
|
+
return obj;
|
|
2821
|
+
},
|
|
2822
|
+
|
|
2823
|
+
create<I extends Exact<DeepPartial<OperationSetControlledArea>, I>>(
|
|
2824
|
+
base?: I,
|
|
2825
|
+
): OperationSetControlledArea {
|
|
2826
|
+
return OperationSetControlledArea.fromPartial(base ?? ({} as any));
|
|
2827
|
+
},
|
|
2828
|
+
fromPartial<I extends Exact<DeepPartial<OperationSetControlledArea>, I>>(
|
|
2829
|
+
object: I,
|
|
2830
|
+
): OperationSetControlledArea {
|
|
2831
|
+
const message = createBaseOperationSetControlledArea();
|
|
2832
|
+
message.destAddress = object.destAddress ?? "";
|
|
2833
|
+
message.sTrusted = object.sTrusted ?? false;
|
|
2834
|
+
message.sStatus = object.sStatus ?? false;
|
|
2835
|
+
message.trusted = object.trusted ?? 0;
|
|
2836
|
+
message.status = object.status ?? 0;
|
|
2837
|
+
message.attributes =
|
|
2838
|
+
object.attributes?.map((e) => KeyPair.fromPartial(e)) || [];
|
|
2839
|
+
return message;
|
|
2840
|
+
},
|
|
2841
|
+
};
|
|
2842
|
+
|
|
2843
|
+
function createBaseOperationAuthorizeTransfer(): OperationAuthorizeTransfer {
|
|
2844
|
+
return { destAddress: "", auth: false };
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
export const OperationAuthorizeTransfer: MessageFns<OperationAuthorizeTransfer> =
|
|
2848
|
+
{
|
|
2849
|
+
encode(
|
|
2850
|
+
message: OperationAuthorizeTransfer,
|
|
2851
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2852
|
+
): BinaryWriter {
|
|
2853
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
2854
|
+
writer.uint32(10).string(message.destAddress);
|
|
2855
|
+
}
|
|
2856
|
+
if (message.auth !== undefined && message.auth !== false) {
|
|
2857
|
+
writer.uint32(16).bool(message.auth);
|
|
2858
|
+
}
|
|
2859
|
+
return writer;
|
|
2860
|
+
},
|
|
2861
|
+
|
|
2862
|
+
decode(
|
|
2863
|
+
input: BinaryReader | Uint8Array,
|
|
2864
|
+
length?: number,
|
|
2865
|
+
): OperationAuthorizeTransfer {
|
|
2866
|
+
const reader =
|
|
2867
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2868
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2869
|
+
const message = createBaseOperationAuthorizeTransfer();
|
|
2870
|
+
while (reader.pos < end) {
|
|
2871
|
+
const tag = reader.uint32();
|
|
2872
|
+
switch (tag >>> 3) {
|
|
2873
|
+
case 1: {
|
|
2874
|
+
if (tag !== 10) {
|
|
2875
|
+
break;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
message.destAddress = reader.string();
|
|
2879
|
+
continue;
|
|
2880
|
+
}
|
|
2881
|
+
case 2: {
|
|
2882
|
+
if (tag !== 16) {
|
|
2883
|
+
break;
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
message.auth = reader.bool();
|
|
2887
|
+
continue;
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2891
|
+
break;
|
|
2892
|
+
}
|
|
2893
|
+
reader.skip(tag & 7);
|
|
2894
|
+
}
|
|
2895
|
+
return message;
|
|
2896
|
+
},
|
|
2897
|
+
|
|
2898
|
+
fromJSON(object: any): OperationAuthorizeTransfer {
|
|
2899
|
+
return {
|
|
2900
|
+
destAddress: isSet(object.dest_address)
|
|
2901
|
+
? globalThis.String(object.dest_address)
|
|
2902
|
+
: "",
|
|
2903
|
+
auth: isSet(object.auth) ? globalThis.Boolean(object.auth) : false,
|
|
2904
|
+
};
|
|
2905
|
+
},
|
|
2906
|
+
|
|
2907
|
+
toJSON(message: OperationAuthorizeTransfer): unknown {
|
|
2908
|
+
const obj: any = {};
|
|
2909
|
+
if (message.destAddress !== undefined && message.destAddress !== "") {
|
|
2910
|
+
obj.dest_address = message.destAddress;
|
|
2911
|
+
}
|
|
2912
|
+
if (message.auth !== undefined && message.auth !== false) {
|
|
2913
|
+
obj.auth = message.auth;
|
|
2914
|
+
}
|
|
2915
|
+
return obj;
|
|
2916
|
+
},
|
|
2917
|
+
|
|
2918
|
+
create<I extends Exact<DeepPartial<OperationAuthorizeTransfer>, I>>(
|
|
2919
|
+
base?: I,
|
|
2920
|
+
): OperationAuthorizeTransfer {
|
|
2921
|
+
return OperationAuthorizeTransfer.fromPartial(base ?? ({} as any));
|
|
2922
|
+
},
|
|
2923
|
+
fromPartial<I extends Exact<DeepPartial<OperationAuthorizeTransfer>, I>>(
|
|
2924
|
+
object: I,
|
|
2925
|
+
): OperationAuthorizeTransfer {
|
|
2926
|
+
const message = createBaseOperationAuthorizeTransfer();
|
|
2927
|
+
message.destAddress = object.destAddress ?? "";
|
|
2928
|
+
message.auth = object.auth ?? false;
|
|
2929
|
+
return message;
|
|
2930
|
+
},
|
|
2931
|
+
};
|
|
2932
|
+
|
|
2933
|
+
function createBaseOperation(): Operation {
|
|
2934
|
+
return {
|
|
2935
|
+
type: 0,
|
|
2936
|
+
sourceAddress: "",
|
|
2937
|
+
metadata: "",
|
|
2938
|
+
createAccount: undefined,
|
|
2939
|
+
setMetadata: undefined,
|
|
2940
|
+
setSignerWeight: undefined,
|
|
2941
|
+
setThreshold: undefined,
|
|
2942
|
+
payCoin: undefined,
|
|
2943
|
+
log: undefined,
|
|
2944
|
+
setPrivilege: undefined,
|
|
2945
|
+
upgradeContract: undefined,
|
|
2946
|
+
setControlledArea: undefined,
|
|
2947
|
+
authorizeTransfer: undefined,
|
|
2948
|
+
};
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
export const Operation: MessageFns<Operation> = {
|
|
2952
|
+
encode(
|
|
2953
|
+
message: Operation,
|
|
2954
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
2955
|
+
): BinaryWriter {
|
|
2956
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
2957
|
+
writer.uint32(8).int32(message.type);
|
|
2958
|
+
}
|
|
2959
|
+
if (message.sourceAddress !== undefined && message.sourceAddress !== "") {
|
|
2960
|
+
writer.uint32(18).string(message.sourceAddress);
|
|
2961
|
+
}
|
|
2962
|
+
if (message.metadata !== undefined && message.metadata !== "") {
|
|
2963
|
+
writer.uint32(26).string(message.metadata);
|
|
2964
|
+
}
|
|
2965
|
+
if (message.createAccount !== undefined) {
|
|
2966
|
+
OperationCreateAccount.encode(
|
|
2967
|
+
message.createAccount,
|
|
2968
|
+
writer.uint32(34).fork(),
|
|
2969
|
+
).join();
|
|
2970
|
+
}
|
|
2971
|
+
if (message.setMetadata !== undefined) {
|
|
2972
|
+
OperationSetMetadata.encode(
|
|
2973
|
+
message.setMetadata,
|
|
2974
|
+
writer.uint32(58).fork(),
|
|
2975
|
+
).join();
|
|
2976
|
+
}
|
|
2977
|
+
if (message.setSignerWeight !== undefined) {
|
|
2978
|
+
OperationSetSignerWeight.encode(
|
|
2979
|
+
message.setSignerWeight,
|
|
2980
|
+
writer.uint32(66).fork(),
|
|
2981
|
+
).join();
|
|
2982
|
+
}
|
|
2983
|
+
if (message.setThreshold !== undefined) {
|
|
2984
|
+
OperationSetThreshold.encode(
|
|
2985
|
+
message.setThreshold,
|
|
2986
|
+
writer.uint32(74).fork(),
|
|
2987
|
+
).join();
|
|
2988
|
+
}
|
|
2989
|
+
if (message.payCoin !== undefined) {
|
|
2990
|
+
OperationPayCoin.encode(message.payCoin, writer.uint32(82).fork()).join();
|
|
2991
|
+
}
|
|
2992
|
+
if (message.log !== undefined) {
|
|
2993
|
+
OperationLog.encode(message.log, writer.uint32(90).fork()).join();
|
|
2994
|
+
}
|
|
2995
|
+
if (message.setPrivilege !== undefined) {
|
|
2996
|
+
OperationSetPrivilege.encode(
|
|
2997
|
+
message.setPrivilege,
|
|
2998
|
+
writer.uint32(98).fork(),
|
|
2999
|
+
).join();
|
|
3000
|
+
}
|
|
3001
|
+
if (message.upgradeContract !== undefined) {
|
|
3002
|
+
OperationUpgradeContract.encode(
|
|
3003
|
+
message.upgradeContract,
|
|
3004
|
+
writer.uint32(106).fork(),
|
|
3005
|
+
).join();
|
|
3006
|
+
}
|
|
3007
|
+
if (message.setControlledArea !== undefined) {
|
|
3008
|
+
OperationSetControlledArea.encode(
|
|
3009
|
+
message.setControlledArea,
|
|
3010
|
+
writer.uint32(114).fork(),
|
|
3011
|
+
).join();
|
|
3012
|
+
}
|
|
3013
|
+
if (message.authorizeTransfer !== undefined) {
|
|
3014
|
+
OperationAuthorizeTransfer.encode(
|
|
3015
|
+
message.authorizeTransfer,
|
|
3016
|
+
writer.uint32(122).fork(),
|
|
3017
|
+
).join();
|
|
3018
|
+
}
|
|
3019
|
+
return writer;
|
|
3020
|
+
},
|
|
3021
|
+
|
|
3022
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Operation {
|
|
3023
|
+
const reader =
|
|
3024
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3025
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3026
|
+
const message = createBaseOperation();
|
|
3027
|
+
while (reader.pos < end) {
|
|
3028
|
+
const tag = reader.uint32();
|
|
3029
|
+
switch (tag >>> 3) {
|
|
3030
|
+
case 1: {
|
|
3031
|
+
if (tag !== 8) {
|
|
3032
|
+
break;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
message.type = reader.int32() as any;
|
|
3036
|
+
continue;
|
|
3037
|
+
}
|
|
3038
|
+
case 2: {
|
|
3039
|
+
if (tag !== 18) {
|
|
3040
|
+
break;
|
|
3041
|
+
}
|
|
3042
|
+
|
|
3043
|
+
message.sourceAddress = reader.string();
|
|
3044
|
+
continue;
|
|
3045
|
+
}
|
|
3046
|
+
case 3: {
|
|
3047
|
+
if (tag !== 26) {
|
|
3048
|
+
break;
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
message.metadata = reader.string();
|
|
3052
|
+
continue;
|
|
3053
|
+
}
|
|
3054
|
+
case 4: {
|
|
3055
|
+
if (tag !== 34) {
|
|
3056
|
+
break;
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
message.createAccount = OperationCreateAccount.decode(
|
|
3060
|
+
reader,
|
|
3061
|
+
reader.uint32(),
|
|
3062
|
+
);
|
|
3063
|
+
continue;
|
|
3064
|
+
}
|
|
3065
|
+
case 7: {
|
|
3066
|
+
if (tag !== 58) {
|
|
3067
|
+
break;
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3070
|
+
message.setMetadata = OperationSetMetadata.decode(
|
|
3071
|
+
reader,
|
|
3072
|
+
reader.uint32(),
|
|
3073
|
+
);
|
|
3074
|
+
continue;
|
|
3075
|
+
}
|
|
3076
|
+
case 8: {
|
|
3077
|
+
if (tag !== 66) {
|
|
3078
|
+
break;
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
message.setSignerWeight = OperationSetSignerWeight.decode(
|
|
3082
|
+
reader,
|
|
3083
|
+
reader.uint32(),
|
|
3084
|
+
);
|
|
3085
|
+
continue;
|
|
3086
|
+
}
|
|
3087
|
+
case 9: {
|
|
3088
|
+
if (tag !== 74) {
|
|
3089
|
+
break;
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
message.setThreshold = OperationSetThreshold.decode(
|
|
3093
|
+
reader,
|
|
3094
|
+
reader.uint32(),
|
|
3095
|
+
);
|
|
3096
|
+
continue;
|
|
3097
|
+
}
|
|
3098
|
+
case 10: {
|
|
3099
|
+
if (tag !== 82) {
|
|
3100
|
+
break;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
message.payCoin = OperationPayCoin.decode(reader, reader.uint32());
|
|
3104
|
+
continue;
|
|
3105
|
+
}
|
|
3106
|
+
case 11: {
|
|
3107
|
+
if (tag !== 90) {
|
|
3108
|
+
break;
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
message.log = OperationLog.decode(reader, reader.uint32());
|
|
3112
|
+
continue;
|
|
3113
|
+
}
|
|
3114
|
+
case 12: {
|
|
3115
|
+
if (tag !== 98) {
|
|
3116
|
+
break;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
message.setPrivilege = OperationSetPrivilege.decode(
|
|
3120
|
+
reader,
|
|
3121
|
+
reader.uint32(),
|
|
3122
|
+
);
|
|
3123
|
+
continue;
|
|
3124
|
+
}
|
|
3125
|
+
case 13: {
|
|
3126
|
+
if (tag !== 106) {
|
|
3127
|
+
break;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
message.upgradeContract = OperationUpgradeContract.decode(
|
|
3131
|
+
reader,
|
|
3132
|
+
reader.uint32(),
|
|
3133
|
+
);
|
|
3134
|
+
continue;
|
|
3135
|
+
}
|
|
3136
|
+
case 14: {
|
|
3137
|
+
if (tag !== 114) {
|
|
3138
|
+
break;
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
message.setControlledArea = OperationSetControlledArea.decode(
|
|
3142
|
+
reader,
|
|
3143
|
+
reader.uint32(),
|
|
3144
|
+
);
|
|
3145
|
+
continue;
|
|
3146
|
+
}
|
|
3147
|
+
case 15: {
|
|
3148
|
+
if (tag !== 122) {
|
|
3149
|
+
break;
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
message.authorizeTransfer = OperationAuthorizeTransfer.decode(
|
|
3153
|
+
reader,
|
|
3154
|
+
reader.uint32(),
|
|
3155
|
+
);
|
|
3156
|
+
continue;
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3160
|
+
break;
|
|
3161
|
+
}
|
|
3162
|
+
reader.skip(tag & 7);
|
|
3163
|
+
}
|
|
3164
|
+
return message;
|
|
3165
|
+
},
|
|
3166
|
+
|
|
3167
|
+
fromJSON(object: any): Operation {
|
|
3168
|
+
return {
|
|
3169
|
+
type: isSet(object.type) ? operation_TypeFromJSON(object.type) : 0,
|
|
3170
|
+
sourceAddress: isSet(object.source_address)
|
|
3171
|
+
? globalThis.String(object.source_address)
|
|
3172
|
+
: "",
|
|
3173
|
+
metadata: isSet(object.metadata)
|
|
3174
|
+
? globalThis.String(object.metadata)
|
|
3175
|
+
: "",
|
|
3176
|
+
createAccount: isSet(object.create_account)
|
|
3177
|
+
? OperationCreateAccount.fromJSON(object.create_account)
|
|
3178
|
+
: undefined,
|
|
3179
|
+
setMetadata: isSet(object.set_metadata)
|
|
3180
|
+
? OperationSetMetadata.fromJSON(object.set_metadata)
|
|
3181
|
+
: undefined,
|
|
3182
|
+
setSignerWeight: isSet(object.set_signer_weight)
|
|
3183
|
+
? OperationSetSignerWeight.fromJSON(object.set_signer_weight)
|
|
3184
|
+
: undefined,
|
|
3185
|
+
setThreshold: isSet(object.set_threshold)
|
|
3186
|
+
? OperationSetThreshold.fromJSON(object.set_threshold)
|
|
3187
|
+
: undefined,
|
|
3188
|
+
payCoin: isSet(object.pay_coin)
|
|
3189
|
+
? OperationPayCoin.fromJSON(object.pay_coin)
|
|
3190
|
+
: undefined,
|
|
3191
|
+
log: isSet(object.log) ? OperationLog.fromJSON(object.log) : undefined,
|
|
3192
|
+
setPrivilege: isSet(object.set_privilege)
|
|
3193
|
+
? OperationSetPrivilege.fromJSON(object.set_privilege)
|
|
3194
|
+
: undefined,
|
|
3195
|
+
upgradeContract: isSet(object.upgrade_contract)
|
|
3196
|
+
? OperationUpgradeContract.fromJSON(object.upgrade_contract)
|
|
3197
|
+
: undefined,
|
|
3198
|
+
setControlledArea: isSet(object.set_controlled_area)
|
|
3199
|
+
? OperationSetControlledArea.fromJSON(object.set_controlled_area)
|
|
3200
|
+
: undefined,
|
|
3201
|
+
authorizeTransfer: isSet(object.authorize_transfer)
|
|
3202
|
+
? OperationAuthorizeTransfer.fromJSON(object.authorize_transfer)
|
|
3203
|
+
: undefined,
|
|
3204
|
+
};
|
|
3205
|
+
},
|
|
3206
|
+
|
|
3207
|
+
toJSON(message: Operation): unknown {
|
|
3208
|
+
const obj: any = {};
|
|
3209
|
+
if (message.type !== undefined && message.type !== 0) {
|
|
3210
|
+
obj.type = operation_TypeToJSON(message.type);
|
|
3211
|
+
}
|
|
3212
|
+
if (message.sourceAddress !== undefined && message.sourceAddress !== "") {
|
|
3213
|
+
obj.source_address = message.sourceAddress;
|
|
3214
|
+
}
|
|
3215
|
+
if (message.metadata !== undefined && message.metadata !== "") {
|
|
3216
|
+
obj.metadata = message.metadata;
|
|
3217
|
+
}
|
|
3218
|
+
if (message.createAccount !== undefined) {
|
|
3219
|
+
obj.create_account = OperationCreateAccount.toJSON(message.createAccount);
|
|
3220
|
+
}
|
|
3221
|
+
if (message.setMetadata !== undefined) {
|
|
3222
|
+
obj.set_metadata = OperationSetMetadata.toJSON(message.setMetadata);
|
|
3223
|
+
}
|
|
3224
|
+
if (message.setSignerWeight !== undefined) {
|
|
3225
|
+
obj.set_signer_weight = OperationSetSignerWeight.toJSON(
|
|
3226
|
+
message.setSignerWeight,
|
|
3227
|
+
);
|
|
3228
|
+
}
|
|
3229
|
+
if (message.setThreshold !== undefined) {
|
|
3230
|
+
obj.set_threshold = OperationSetThreshold.toJSON(message.setThreshold);
|
|
3231
|
+
}
|
|
3232
|
+
if (message.payCoin !== undefined) {
|
|
3233
|
+
obj.pay_coin = OperationPayCoin.toJSON(message.payCoin);
|
|
3234
|
+
}
|
|
3235
|
+
if (message.log !== undefined) {
|
|
3236
|
+
obj.log = OperationLog.toJSON(message.log);
|
|
3237
|
+
}
|
|
3238
|
+
if (message.setPrivilege !== undefined) {
|
|
3239
|
+
obj.set_privilege = OperationSetPrivilege.toJSON(message.setPrivilege);
|
|
3240
|
+
}
|
|
3241
|
+
if (message.upgradeContract !== undefined) {
|
|
3242
|
+
obj.upgrade_contract = OperationUpgradeContract.toJSON(
|
|
3243
|
+
message.upgradeContract,
|
|
3244
|
+
);
|
|
3245
|
+
}
|
|
3246
|
+
if (message.setControlledArea !== undefined) {
|
|
3247
|
+
obj.set_controlled_area = OperationSetControlledArea.toJSON(
|
|
3248
|
+
message.setControlledArea,
|
|
3249
|
+
);
|
|
3250
|
+
}
|
|
3251
|
+
if (message.authorizeTransfer !== undefined) {
|
|
3252
|
+
obj.authorize_transfer = OperationAuthorizeTransfer.toJSON(
|
|
3253
|
+
message.authorizeTransfer,
|
|
3254
|
+
);
|
|
3255
|
+
}
|
|
3256
|
+
return obj;
|
|
3257
|
+
},
|
|
3258
|
+
|
|
3259
|
+
create<I extends Exact<DeepPartial<Operation>, I>>(base?: I): Operation {
|
|
3260
|
+
return Operation.fromPartial(base ?? ({} as any));
|
|
3261
|
+
},
|
|
3262
|
+
fromPartial<I extends Exact<DeepPartial<Operation>, I>>(
|
|
3263
|
+
object: I,
|
|
3264
|
+
): Operation {
|
|
3265
|
+
const message = createBaseOperation();
|
|
3266
|
+
message.type = object.type ?? 0;
|
|
3267
|
+
message.sourceAddress = object.sourceAddress ?? "";
|
|
3268
|
+
message.metadata = object.metadata ?? "";
|
|
3269
|
+
message.createAccount =
|
|
3270
|
+
object.createAccount !== undefined && object.createAccount !== null
|
|
3271
|
+
? OperationCreateAccount.fromPartial(object.createAccount)
|
|
3272
|
+
: undefined;
|
|
3273
|
+
message.setMetadata =
|
|
3274
|
+
object.setMetadata !== undefined && object.setMetadata !== null
|
|
3275
|
+
? OperationSetMetadata.fromPartial(object.setMetadata)
|
|
3276
|
+
: undefined;
|
|
3277
|
+
message.setSignerWeight =
|
|
3278
|
+
object.setSignerWeight !== undefined && object.setSignerWeight !== null
|
|
3279
|
+
? OperationSetSignerWeight.fromPartial(object.setSignerWeight)
|
|
3280
|
+
: undefined;
|
|
3281
|
+
message.setThreshold =
|
|
3282
|
+
object.setThreshold !== undefined && object.setThreshold !== null
|
|
3283
|
+
? OperationSetThreshold.fromPartial(object.setThreshold)
|
|
3284
|
+
: undefined;
|
|
3285
|
+
message.payCoin =
|
|
3286
|
+
object.payCoin !== undefined && object.payCoin !== null
|
|
3287
|
+
? OperationPayCoin.fromPartial(object.payCoin)
|
|
3288
|
+
: undefined;
|
|
3289
|
+
message.log =
|
|
3290
|
+
object.log !== undefined && object.log !== null
|
|
3291
|
+
? OperationLog.fromPartial(object.log)
|
|
3292
|
+
: undefined;
|
|
3293
|
+
message.setPrivilege =
|
|
3294
|
+
object.setPrivilege !== undefined && object.setPrivilege !== null
|
|
3295
|
+
? OperationSetPrivilege.fromPartial(object.setPrivilege)
|
|
3296
|
+
: undefined;
|
|
3297
|
+
message.upgradeContract =
|
|
3298
|
+
object.upgradeContract !== undefined && object.upgradeContract !== null
|
|
3299
|
+
? OperationUpgradeContract.fromPartial(object.upgradeContract)
|
|
3300
|
+
: undefined;
|
|
3301
|
+
message.setControlledArea =
|
|
3302
|
+
object.setControlledArea !== undefined &&
|
|
3303
|
+
object.setControlledArea !== null
|
|
3304
|
+
? OperationSetControlledArea.fromPartial(object.setControlledArea)
|
|
3305
|
+
: undefined;
|
|
3306
|
+
message.authorizeTransfer =
|
|
3307
|
+
object.authorizeTransfer !== undefined &&
|
|
3308
|
+
object.authorizeTransfer !== null
|
|
3309
|
+
? OperationAuthorizeTransfer.fromPartial(object.authorizeTransfer)
|
|
3310
|
+
: undefined;
|
|
3311
|
+
return message;
|
|
3312
|
+
},
|
|
3313
|
+
};
|
|
3314
|
+
|
|
3315
|
+
function createBaseTransaction(): Transaction {
|
|
3316
|
+
return {
|
|
3317
|
+
sourceAddress: "",
|
|
3318
|
+
feeLimit: 0,
|
|
3319
|
+
gasPrice: 0,
|
|
3320
|
+
nonce: "",
|
|
3321
|
+
metadata: "",
|
|
3322
|
+
nonceType: 0,
|
|
3323
|
+
maxLedgerSeq: 0,
|
|
3324
|
+
operations: [],
|
|
3325
|
+
};
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
export const Transaction: MessageFns<Transaction> = {
|
|
3329
|
+
encode(
|
|
3330
|
+
message: Transaction,
|
|
3331
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
3332
|
+
): BinaryWriter {
|
|
3333
|
+
if (message.sourceAddress !== undefined && message.sourceAddress !== "") {
|
|
3334
|
+
writer.uint32(10).string(message.sourceAddress);
|
|
3335
|
+
}
|
|
3336
|
+
if (message.feeLimit !== undefined && message.feeLimit !== 0) {
|
|
3337
|
+
writer.uint32(16).int64(message.feeLimit);
|
|
3338
|
+
}
|
|
3339
|
+
if (message.gasPrice !== undefined && message.gasPrice !== 0) {
|
|
3340
|
+
writer.uint32(24).int64(message.gasPrice);
|
|
3341
|
+
}
|
|
3342
|
+
if (message.nonce !== undefined && message.nonce !== "") {
|
|
3343
|
+
writer.uint32(34).string(message.nonce);
|
|
3344
|
+
}
|
|
3345
|
+
if (message.metadata !== undefined && message.metadata !== "") {
|
|
3346
|
+
writer.uint32(42).string(message.metadata);
|
|
3347
|
+
}
|
|
3348
|
+
if (message.nonceType !== undefined && message.nonceType !== 0) {
|
|
3349
|
+
writer.uint32(48).int32(message.nonceType);
|
|
3350
|
+
}
|
|
3351
|
+
if (message.maxLedgerSeq !== undefined && message.maxLedgerSeq !== 0) {
|
|
3352
|
+
writer.uint32(56).int64(message.maxLedgerSeq);
|
|
3353
|
+
}
|
|
3354
|
+
if (message.operations !== undefined && message.operations.length !== 0) {
|
|
3355
|
+
for (const v of message.operations) {
|
|
3356
|
+
Operation.encode(v!, writer.uint32(66).fork()).join();
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
return writer;
|
|
3360
|
+
},
|
|
3361
|
+
|
|
3362
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Transaction {
|
|
3363
|
+
const reader =
|
|
3364
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3365
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3366
|
+
const message = createBaseTransaction();
|
|
3367
|
+
while (reader.pos < end) {
|
|
3368
|
+
const tag = reader.uint32();
|
|
3369
|
+
switch (tag >>> 3) {
|
|
3370
|
+
case 1: {
|
|
3371
|
+
if (tag !== 10) {
|
|
3372
|
+
break;
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
message.sourceAddress = reader.string();
|
|
3376
|
+
continue;
|
|
3377
|
+
}
|
|
3378
|
+
case 2: {
|
|
3379
|
+
if (tag !== 16) {
|
|
3380
|
+
break;
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
message.feeLimit = longToNumber(reader.int64());
|
|
3384
|
+
continue;
|
|
3385
|
+
}
|
|
3386
|
+
case 3: {
|
|
3387
|
+
if (tag !== 24) {
|
|
3388
|
+
break;
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3391
|
+
message.gasPrice = longToNumber(reader.int64());
|
|
3392
|
+
continue;
|
|
3393
|
+
}
|
|
3394
|
+
case 4: {
|
|
3395
|
+
if (tag !== 34) {
|
|
3396
|
+
break;
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
message.nonce = reader.string();
|
|
3400
|
+
continue;
|
|
3401
|
+
}
|
|
3402
|
+
case 5: {
|
|
3403
|
+
if (tag !== 42) {
|
|
3404
|
+
break;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
message.metadata = reader.string();
|
|
3408
|
+
continue;
|
|
3409
|
+
}
|
|
3410
|
+
case 6: {
|
|
3411
|
+
if (tag !== 48) {
|
|
3412
|
+
break;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
message.nonceType = reader.int32() as any;
|
|
3416
|
+
continue;
|
|
3417
|
+
}
|
|
3418
|
+
case 7: {
|
|
3419
|
+
if (tag !== 56) {
|
|
3420
|
+
break;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
message.maxLedgerSeq = longToNumber(reader.int64());
|
|
3424
|
+
continue;
|
|
3425
|
+
}
|
|
3426
|
+
case 8: {
|
|
3427
|
+
if (tag !== 66) {
|
|
3428
|
+
break;
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
const el = Operation.decode(reader, reader.uint32());
|
|
3432
|
+
if (el !== undefined) {
|
|
3433
|
+
message.operations!.push(el);
|
|
3434
|
+
}
|
|
3435
|
+
continue;
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3439
|
+
break;
|
|
3440
|
+
}
|
|
3441
|
+
reader.skip(tag & 7);
|
|
3442
|
+
}
|
|
3443
|
+
return message;
|
|
3444
|
+
},
|
|
3445
|
+
|
|
3446
|
+
fromJSON(object: any): Transaction {
|
|
3447
|
+
return {
|
|
3448
|
+
sourceAddress: isSet(object.source_address)
|
|
3449
|
+
? globalThis.String(object.source_address)
|
|
3450
|
+
: "",
|
|
3451
|
+
feeLimit: isSet(object.fee_limit)
|
|
3452
|
+
? globalThis.Number(object.fee_limit)
|
|
3453
|
+
: 0,
|
|
3454
|
+
gasPrice: isSet(object.gas_price)
|
|
3455
|
+
? globalThis.Number(object.gas_price)
|
|
3456
|
+
: 0,
|
|
3457
|
+
nonce: isSet(object.nonce) ? globalThis.String(object.nonce) : "",
|
|
3458
|
+
metadata: isSet(object.metadata)
|
|
3459
|
+
? globalThis.String(object.metadata)
|
|
3460
|
+
: "",
|
|
3461
|
+
nonceType: isSet(object.nonce_type)
|
|
3462
|
+
? transaction_TxTypeFromJSON(object.nonce_type)
|
|
3463
|
+
: 0,
|
|
3464
|
+
maxLedgerSeq: isSet(object.max_ledger_seq)
|
|
3465
|
+
? globalThis.Number(object.max_ledger_seq)
|
|
3466
|
+
: 0,
|
|
3467
|
+
operations: globalThis.Array.isArray(object?.operations)
|
|
3468
|
+
? object.operations.map((e: any) => Operation.fromJSON(e))
|
|
3469
|
+
: [],
|
|
3470
|
+
};
|
|
3471
|
+
},
|
|
3472
|
+
|
|
3473
|
+
toJSON(message: Transaction): unknown {
|
|
3474
|
+
const obj: any = {};
|
|
3475
|
+
if (message.sourceAddress !== undefined && message.sourceAddress !== "") {
|
|
3476
|
+
obj.source_address = message.sourceAddress;
|
|
3477
|
+
}
|
|
3478
|
+
if (message.feeLimit !== undefined && message.feeLimit !== 0) {
|
|
3479
|
+
obj.fee_limit = Math.round(message.feeLimit);
|
|
3480
|
+
}
|
|
3481
|
+
if (message.gasPrice !== undefined && message.gasPrice !== 0) {
|
|
3482
|
+
obj.gas_price = Math.round(message.gasPrice);
|
|
3483
|
+
}
|
|
3484
|
+
if (message.nonce !== undefined && message.nonce !== "") {
|
|
3485
|
+
obj.nonce = message.nonce;
|
|
3486
|
+
}
|
|
3487
|
+
if (message.metadata !== undefined && message.metadata !== "") {
|
|
3488
|
+
obj.metadata = message.metadata;
|
|
3489
|
+
}
|
|
3490
|
+
if (message.nonceType !== undefined && message.nonceType !== 0) {
|
|
3491
|
+
obj.nonce_type = transaction_TxTypeToJSON(message.nonceType);
|
|
3492
|
+
}
|
|
3493
|
+
if (message.maxLedgerSeq !== undefined && message.maxLedgerSeq !== 0) {
|
|
3494
|
+
obj.max_ledger_seq = Math.round(message.maxLedgerSeq);
|
|
3495
|
+
}
|
|
3496
|
+
if (message.operations?.length) {
|
|
3497
|
+
obj.operations = message.operations.map((e) => Operation.toJSON(e));
|
|
3498
|
+
}
|
|
3499
|
+
return obj;
|
|
3500
|
+
},
|
|
3501
|
+
|
|
3502
|
+
create<I extends Exact<DeepPartial<Transaction>, I>>(base?: I): Transaction {
|
|
3503
|
+
return Transaction.fromPartial(base ?? ({} as any));
|
|
3504
|
+
},
|
|
3505
|
+
fromPartial<I extends Exact<DeepPartial<Transaction>, I>>(
|
|
3506
|
+
object: I,
|
|
3507
|
+
): Transaction {
|
|
3508
|
+
const message = createBaseTransaction();
|
|
3509
|
+
message.sourceAddress = object.sourceAddress ?? "";
|
|
3510
|
+
message.feeLimit = object.feeLimit ?? 0;
|
|
3511
|
+
message.gasPrice = object.gasPrice ?? 0;
|
|
3512
|
+
message.nonce = object.nonce ?? "";
|
|
3513
|
+
message.metadata = object.metadata ?? "";
|
|
3514
|
+
message.nonceType = object.nonceType ?? 0;
|
|
3515
|
+
message.maxLedgerSeq = object.maxLedgerSeq ?? 0;
|
|
3516
|
+
message.operations =
|
|
3517
|
+
object.operations?.map((e) => Operation.fromPartial(e)) || [];
|
|
3518
|
+
return message;
|
|
3519
|
+
},
|
|
3520
|
+
};
|
|
3521
|
+
|
|
3522
|
+
function createBaseTrigger(): Trigger {
|
|
3523
|
+
return { transactionType: 0, ledgerSeq: 0, transaction: undefined };
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
export const Trigger: MessageFns<Trigger> = {
|
|
3527
|
+
encode(
|
|
3528
|
+
message: Trigger,
|
|
3529
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
3530
|
+
): BinaryWriter {
|
|
3531
|
+
if (
|
|
3532
|
+
message.transactionType !== undefined &&
|
|
3533
|
+
message.transactionType !== 0
|
|
3534
|
+
) {
|
|
3535
|
+
writer.uint32(8).int32(message.transactionType);
|
|
3536
|
+
}
|
|
3537
|
+
if (message.ledgerSeq !== undefined && message.ledgerSeq !== 0) {
|
|
3538
|
+
writer.uint32(16).int64(message.ledgerSeq);
|
|
3539
|
+
}
|
|
3540
|
+
if (message.transaction !== undefined) {
|
|
3541
|
+
Trigger_OperationTrigger.encode(
|
|
3542
|
+
message.transaction,
|
|
3543
|
+
writer.uint32(26).fork(),
|
|
3544
|
+
).join();
|
|
3545
|
+
}
|
|
3546
|
+
return writer;
|
|
3547
|
+
},
|
|
3548
|
+
|
|
3549
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Trigger {
|
|
3550
|
+
const reader =
|
|
3551
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3552
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3553
|
+
const message = createBaseTrigger();
|
|
3554
|
+
while (reader.pos < end) {
|
|
3555
|
+
const tag = reader.uint32();
|
|
3556
|
+
switch (tag >>> 3) {
|
|
3557
|
+
case 1: {
|
|
3558
|
+
if (tag !== 8) {
|
|
3559
|
+
break;
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3562
|
+
message.transactionType = reader.int32() as any;
|
|
3563
|
+
continue;
|
|
3564
|
+
}
|
|
3565
|
+
case 2: {
|
|
3566
|
+
if (tag !== 16) {
|
|
3567
|
+
break;
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3570
|
+
message.ledgerSeq = longToNumber(reader.int64());
|
|
3571
|
+
continue;
|
|
3572
|
+
}
|
|
3573
|
+
case 3: {
|
|
3574
|
+
if (tag !== 26) {
|
|
3575
|
+
break;
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
message.transaction = Trigger_OperationTrigger.decode(
|
|
3579
|
+
reader,
|
|
3580
|
+
reader.uint32(),
|
|
3581
|
+
);
|
|
3582
|
+
continue;
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3586
|
+
break;
|
|
3587
|
+
}
|
|
3588
|
+
reader.skip(tag & 7);
|
|
3589
|
+
}
|
|
3590
|
+
return message;
|
|
3591
|
+
},
|
|
3592
|
+
|
|
3593
|
+
fromJSON(object: any): Trigger {
|
|
3594
|
+
return {
|
|
3595
|
+
transactionType: isSet(object.transactionType)
|
|
3596
|
+
? trigger_TransactionTypeFromJSON(object.transactionType)
|
|
3597
|
+
: 0,
|
|
3598
|
+
ledgerSeq: isSet(object.ledger_seq)
|
|
3599
|
+
? globalThis.Number(object.ledger_seq)
|
|
3600
|
+
: 0,
|
|
3601
|
+
transaction: isSet(object.transaction)
|
|
3602
|
+
? Trigger_OperationTrigger.fromJSON(object.transaction)
|
|
3603
|
+
: undefined,
|
|
3604
|
+
};
|
|
3605
|
+
},
|
|
3606
|
+
|
|
3607
|
+
toJSON(message: Trigger): unknown {
|
|
3608
|
+
const obj: any = {};
|
|
3609
|
+
if (
|
|
3610
|
+
message.transactionType !== undefined &&
|
|
3611
|
+
message.transactionType !== 0
|
|
3612
|
+
) {
|
|
3613
|
+
obj.transactionType = trigger_TransactionTypeToJSON(
|
|
3614
|
+
message.transactionType,
|
|
3615
|
+
);
|
|
3616
|
+
}
|
|
3617
|
+
if (message.ledgerSeq !== undefined && message.ledgerSeq !== 0) {
|
|
3618
|
+
obj.ledger_seq = Math.round(message.ledgerSeq);
|
|
3619
|
+
}
|
|
3620
|
+
if (message.transaction !== undefined) {
|
|
3621
|
+
obj.transaction = Trigger_OperationTrigger.toJSON(message.transaction);
|
|
3622
|
+
}
|
|
3623
|
+
return obj;
|
|
3624
|
+
},
|
|
3625
|
+
|
|
3626
|
+
create<I extends Exact<DeepPartial<Trigger>, I>>(base?: I): Trigger {
|
|
3627
|
+
return Trigger.fromPartial(base ?? ({} as any));
|
|
3628
|
+
},
|
|
3629
|
+
fromPartial<I extends Exact<DeepPartial<Trigger>, I>>(object: I): Trigger {
|
|
3630
|
+
const message = createBaseTrigger();
|
|
3631
|
+
message.transactionType = object.transactionType ?? 0;
|
|
3632
|
+
message.ledgerSeq = object.ledgerSeq ?? 0;
|
|
3633
|
+
message.transaction =
|
|
3634
|
+
object.transaction !== undefined && object.transaction !== null
|
|
3635
|
+
? Trigger_OperationTrigger.fromPartial(object.transaction)
|
|
3636
|
+
: undefined;
|
|
3637
|
+
return message;
|
|
3638
|
+
},
|
|
3639
|
+
};
|
|
3640
|
+
|
|
3641
|
+
function createBaseTrigger_OperationTrigger(): Trigger_OperationTrigger {
|
|
3642
|
+
return { hash: new Uint8Array(0), index: 0 };
|
|
3643
|
+
}
|
|
3644
|
+
|
|
3645
|
+
export const Trigger_OperationTrigger: MessageFns<Trigger_OperationTrigger> = {
|
|
3646
|
+
encode(
|
|
3647
|
+
message: Trigger_OperationTrigger,
|
|
3648
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
3649
|
+
): BinaryWriter {
|
|
3650
|
+
if (message.hash !== undefined && message.hash.length !== 0) {
|
|
3651
|
+
writer.uint32(10).bytes(message.hash);
|
|
3652
|
+
}
|
|
3653
|
+
if (message.index !== undefined && message.index !== 0) {
|
|
3654
|
+
writer.uint32(16).int64(message.index);
|
|
3655
|
+
}
|
|
3656
|
+
return writer;
|
|
3657
|
+
},
|
|
3658
|
+
|
|
3659
|
+
decode(
|
|
3660
|
+
input: BinaryReader | Uint8Array,
|
|
3661
|
+
length?: number,
|
|
3662
|
+
): Trigger_OperationTrigger {
|
|
3663
|
+
const reader =
|
|
3664
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3665
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3666
|
+
const message = createBaseTrigger_OperationTrigger();
|
|
3667
|
+
while (reader.pos < end) {
|
|
3668
|
+
const tag = reader.uint32();
|
|
3669
|
+
switch (tag >>> 3) {
|
|
3670
|
+
case 1: {
|
|
3671
|
+
if (tag !== 10) {
|
|
3672
|
+
break;
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3675
|
+
message.hash = reader.bytes();
|
|
3676
|
+
continue;
|
|
3677
|
+
}
|
|
3678
|
+
case 2: {
|
|
3679
|
+
if (tag !== 16) {
|
|
3680
|
+
break;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
message.index = longToNumber(reader.int64());
|
|
3684
|
+
continue;
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3688
|
+
break;
|
|
3689
|
+
}
|
|
3690
|
+
reader.skip(tag & 7);
|
|
3691
|
+
}
|
|
3692
|
+
return message;
|
|
3693
|
+
},
|
|
3694
|
+
|
|
3695
|
+
fromJSON(object: any): Trigger_OperationTrigger {
|
|
3696
|
+
return {
|
|
3697
|
+
hash: isSet(object.hash)
|
|
3698
|
+
? bytesFromBase64(object.hash)
|
|
3699
|
+
: new Uint8Array(0),
|
|
3700
|
+
index: isSet(object.index) ? globalThis.Number(object.index) : 0,
|
|
3701
|
+
};
|
|
3702
|
+
},
|
|
3703
|
+
|
|
3704
|
+
toJSON(message: Trigger_OperationTrigger): unknown {
|
|
3705
|
+
const obj: any = {};
|
|
3706
|
+
if (message.hash !== undefined && message.hash.length !== 0) {
|
|
3707
|
+
obj.hash = base64FromBytes(message.hash);
|
|
3708
|
+
}
|
|
3709
|
+
if (message.index !== undefined && message.index !== 0) {
|
|
3710
|
+
obj.index = Math.round(message.index);
|
|
3711
|
+
}
|
|
3712
|
+
return obj;
|
|
3713
|
+
},
|
|
3714
|
+
|
|
3715
|
+
create<I extends Exact<DeepPartial<Trigger_OperationTrigger>, I>>(
|
|
3716
|
+
base?: I,
|
|
3717
|
+
): Trigger_OperationTrigger {
|
|
3718
|
+
return Trigger_OperationTrigger.fromPartial(base ?? ({} as any));
|
|
3719
|
+
},
|
|
3720
|
+
fromPartial<I extends Exact<DeepPartial<Trigger_OperationTrigger>, I>>(
|
|
3721
|
+
object: I,
|
|
3722
|
+
): Trigger_OperationTrigger {
|
|
3723
|
+
const message = createBaseTrigger_OperationTrigger();
|
|
3724
|
+
message.hash = object.hash ?? new Uint8Array(0);
|
|
3725
|
+
message.index = object.index ?? 0;
|
|
3726
|
+
return message;
|
|
3727
|
+
},
|
|
3728
|
+
};
|
|
3729
|
+
|
|
3730
|
+
function createBaseTransactionEnv(): TransactionEnv {
|
|
3731
|
+
return { transaction: undefined, signatures: [], trigger: undefined };
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3734
|
+
export const TransactionEnv: MessageFns<TransactionEnv> = {
|
|
3735
|
+
encode(
|
|
3736
|
+
message: TransactionEnv,
|
|
3737
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
3738
|
+
): BinaryWriter {
|
|
3739
|
+
if (message.transaction !== undefined) {
|
|
3740
|
+
Transaction.encode(message.transaction, writer.uint32(10).fork()).join();
|
|
3741
|
+
}
|
|
3742
|
+
if (message.signatures !== undefined && message.signatures.length !== 0) {
|
|
3743
|
+
for (const v of message.signatures) {
|
|
3744
|
+
Signature.encode(v!, writer.uint32(18).fork()).join();
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
if (message.trigger !== undefined) {
|
|
3748
|
+
Trigger.encode(message.trigger, writer.uint32(26).fork()).join();
|
|
3749
|
+
}
|
|
3750
|
+
return writer;
|
|
3751
|
+
},
|
|
3752
|
+
|
|
3753
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TransactionEnv {
|
|
3754
|
+
const reader =
|
|
3755
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3756
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3757
|
+
const message = createBaseTransactionEnv();
|
|
3758
|
+
while (reader.pos < end) {
|
|
3759
|
+
const tag = reader.uint32();
|
|
3760
|
+
switch (tag >>> 3) {
|
|
3761
|
+
case 1: {
|
|
3762
|
+
if (tag !== 10) {
|
|
3763
|
+
break;
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
message.transaction = Transaction.decode(reader, reader.uint32());
|
|
3767
|
+
continue;
|
|
3768
|
+
}
|
|
3769
|
+
case 2: {
|
|
3770
|
+
if (tag !== 18) {
|
|
3771
|
+
break;
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
const el = Signature.decode(reader, reader.uint32());
|
|
3775
|
+
if (el !== undefined) {
|
|
3776
|
+
message.signatures!.push(el);
|
|
3777
|
+
}
|
|
3778
|
+
continue;
|
|
3779
|
+
}
|
|
3780
|
+
case 3: {
|
|
3781
|
+
if (tag !== 26) {
|
|
3782
|
+
break;
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
message.trigger = Trigger.decode(reader, reader.uint32());
|
|
3786
|
+
continue;
|
|
3787
|
+
}
|
|
3788
|
+
}
|
|
3789
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3790
|
+
break;
|
|
3791
|
+
}
|
|
3792
|
+
reader.skip(tag & 7);
|
|
3793
|
+
}
|
|
3794
|
+
return message;
|
|
3795
|
+
},
|
|
3796
|
+
|
|
3797
|
+
fromJSON(object: any): TransactionEnv {
|
|
3798
|
+
return {
|
|
3799
|
+
transaction: isSet(object.transaction)
|
|
3800
|
+
? Transaction.fromJSON(object.transaction)
|
|
3801
|
+
: undefined,
|
|
3802
|
+
signatures: globalThis.Array.isArray(object?.signatures)
|
|
3803
|
+
? object.signatures.map((e: any) => Signature.fromJSON(e))
|
|
3804
|
+
: [],
|
|
3805
|
+
trigger: isSet(object.trigger)
|
|
3806
|
+
? Trigger.fromJSON(object.trigger)
|
|
3807
|
+
: undefined,
|
|
3808
|
+
};
|
|
3809
|
+
},
|
|
3810
|
+
|
|
3811
|
+
toJSON(message: TransactionEnv): unknown {
|
|
3812
|
+
const obj: any = {};
|
|
3813
|
+
if (message.transaction !== undefined) {
|
|
3814
|
+
obj.transaction = Transaction.toJSON(message.transaction);
|
|
3815
|
+
}
|
|
3816
|
+
if (message.signatures?.length) {
|
|
3817
|
+
obj.signatures = message.signatures.map((e) => Signature.toJSON(e));
|
|
3818
|
+
}
|
|
3819
|
+
if (message.trigger !== undefined) {
|
|
3820
|
+
obj.trigger = Trigger.toJSON(message.trigger);
|
|
3821
|
+
}
|
|
3822
|
+
return obj;
|
|
3823
|
+
},
|
|
3824
|
+
|
|
3825
|
+
create<I extends Exact<DeepPartial<TransactionEnv>, I>>(
|
|
3826
|
+
base?: I,
|
|
3827
|
+
): TransactionEnv {
|
|
3828
|
+
return TransactionEnv.fromPartial(base ?? ({} as any));
|
|
3829
|
+
},
|
|
3830
|
+
fromPartial<I extends Exact<DeepPartial<TransactionEnv>, I>>(
|
|
3831
|
+
object: I,
|
|
3832
|
+
): TransactionEnv {
|
|
3833
|
+
const message = createBaseTransactionEnv();
|
|
3834
|
+
message.transaction =
|
|
3835
|
+
object.transaction !== undefined && object.transaction !== null
|
|
3836
|
+
? Transaction.fromPartial(object.transaction)
|
|
3837
|
+
: undefined;
|
|
3838
|
+
message.signatures =
|
|
3839
|
+
object.signatures?.map((e) => Signature.fromPartial(e)) || [];
|
|
3840
|
+
message.trigger =
|
|
3841
|
+
object.trigger !== undefined && object.trigger !== null
|
|
3842
|
+
? Trigger.fromPartial(object.trigger)
|
|
3843
|
+
: undefined;
|
|
3844
|
+
return message;
|
|
3845
|
+
},
|
|
3846
|
+
};
|
|
3847
|
+
|
|
3848
|
+
function createBaseTransactionEnvStoreMessage(): TransactionEnvStoreMessage {
|
|
3849
|
+
return {
|
|
3850
|
+
transactionEnv: undefined,
|
|
3851
|
+
errorCode: 0,
|
|
3852
|
+
errorDesc: "",
|
|
3853
|
+
ledgerSeq: 0,
|
|
3854
|
+
closeTime: 0,
|
|
3855
|
+
hash: "",
|
|
3856
|
+
actualFee: 0,
|
|
3857
|
+
contractTxHashes: [],
|
|
3858
|
+
};
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
export const TransactionEnvStoreMessage: MessageFns<TransactionEnvStoreMessage> =
|
|
3862
|
+
{
|
|
3863
|
+
encode(
|
|
3864
|
+
message: TransactionEnvStoreMessage,
|
|
3865
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
3866
|
+
): BinaryWriter {
|
|
3867
|
+
if (message.transactionEnv !== undefined) {
|
|
3868
|
+
TransactionEnv.encode(
|
|
3869
|
+
message.transactionEnv,
|
|
3870
|
+
writer.uint32(10).fork(),
|
|
3871
|
+
).join();
|
|
3872
|
+
}
|
|
3873
|
+
if (message.errorCode !== undefined && message.errorCode !== 0) {
|
|
3874
|
+
writer.uint32(16).int32(message.errorCode);
|
|
3875
|
+
}
|
|
3876
|
+
if (message.errorDesc !== undefined && message.errorDesc !== "") {
|
|
3877
|
+
writer.uint32(26).string(message.errorDesc);
|
|
3878
|
+
}
|
|
3879
|
+
if (message.ledgerSeq !== undefined && message.ledgerSeq !== 0) {
|
|
3880
|
+
writer.uint32(32).int64(message.ledgerSeq);
|
|
3881
|
+
}
|
|
3882
|
+
if (message.closeTime !== undefined && message.closeTime !== 0) {
|
|
3883
|
+
writer.uint32(40).int64(message.closeTime);
|
|
3884
|
+
}
|
|
3885
|
+
if (message.hash !== undefined && message.hash !== "") {
|
|
3886
|
+
writer.uint32(50).string(message.hash);
|
|
3887
|
+
}
|
|
3888
|
+
if (message.actualFee !== undefined && message.actualFee !== 0) {
|
|
3889
|
+
writer.uint32(56).int64(message.actualFee);
|
|
3890
|
+
}
|
|
3891
|
+
if (
|
|
3892
|
+
message.contractTxHashes !== undefined &&
|
|
3893
|
+
message.contractTxHashes.length !== 0
|
|
3894
|
+
) {
|
|
3895
|
+
for (const v of message.contractTxHashes) {
|
|
3896
|
+
writer.uint32(66).string(v!);
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
return writer;
|
|
3900
|
+
},
|
|
3901
|
+
|
|
3902
|
+
decode(
|
|
3903
|
+
input: BinaryReader | Uint8Array,
|
|
3904
|
+
length?: number,
|
|
3905
|
+
): TransactionEnvStoreMessage {
|
|
3906
|
+
const reader =
|
|
3907
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3908
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3909
|
+
const message = createBaseTransactionEnvStoreMessage();
|
|
3910
|
+
while (reader.pos < end) {
|
|
3911
|
+
const tag = reader.uint32();
|
|
3912
|
+
switch (tag >>> 3) {
|
|
3913
|
+
case 1: {
|
|
3914
|
+
if (tag !== 10) {
|
|
3915
|
+
break;
|
|
3916
|
+
}
|
|
3917
|
+
|
|
3918
|
+
message.transactionEnv = TransactionEnv.decode(
|
|
3919
|
+
reader,
|
|
3920
|
+
reader.uint32(),
|
|
3921
|
+
);
|
|
3922
|
+
continue;
|
|
3923
|
+
}
|
|
3924
|
+
case 2: {
|
|
3925
|
+
if (tag !== 16) {
|
|
3926
|
+
break;
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3929
|
+
message.errorCode = reader.int32();
|
|
3930
|
+
continue;
|
|
3931
|
+
}
|
|
3932
|
+
case 3: {
|
|
3933
|
+
if (tag !== 26) {
|
|
3934
|
+
break;
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
message.errorDesc = reader.string();
|
|
3938
|
+
continue;
|
|
3939
|
+
}
|
|
3940
|
+
case 4: {
|
|
3941
|
+
if (tag !== 32) {
|
|
3942
|
+
break;
|
|
3943
|
+
}
|
|
3944
|
+
|
|
3945
|
+
message.ledgerSeq = longToNumber(reader.int64());
|
|
3946
|
+
continue;
|
|
3947
|
+
}
|
|
3948
|
+
case 5: {
|
|
3949
|
+
if (tag !== 40) {
|
|
3950
|
+
break;
|
|
3951
|
+
}
|
|
3952
|
+
|
|
3953
|
+
message.closeTime = longToNumber(reader.int64());
|
|
3954
|
+
continue;
|
|
3955
|
+
}
|
|
3956
|
+
case 6: {
|
|
3957
|
+
if (tag !== 50) {
|
|
3958
|
+
break;
|
|
3959
|
+
}
|
|
3960
|
+
|
|
3961
|
+
message.hash = reader.string();
|
|
3962
|
+
continue;
|
|
3963
|
+
}
|
|
3964
|
+
case 7: {
|
|
3965
|
+
if (tag !== 56) {
|
|
3966
|
+
break;
|
|
3967
|
+
}
|
|
3968
|
+
|
|
3969
|
+
message.actualFee = longToNumber(reader.int64());
|
|
3970
|
+
continue;
|
|
3971
|
+
}
|
|
3972
|
+
case 8: {
|
|
3973
|
+
if (tag !== 66) {
|
|
3974
|
+
break;
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
const el = reader.string();
|
|
3978
|
+
if (el !== undefined) {
|
|
3979
|
+
message.contractTxHashes!.push(el);
|
|
3980
|
+
}
|
|
3981
|
+
continue;
|
|
3982
|
+
}
|
|
3983
|
+
}
|
|
3984
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3985
|
+
break;
|
|
3986
|
+
}
|
|
3987
|
+
reader.skip(tag & 7);
|
|
3988
|
+
}
|
|
3989
|
+
return message;
|
|
3990
|
+
},
|
|
3991
|
+
|
|
3992
|
+
fromJSON(object: any): TransactionEnvStoreMessage {
|
|
3993
|
+
return {
|
|
3994
|
+
transactionEnv: isSet(object.transaction_env)
|
|
3995
|
+
? TransactionEnv.fromJSON(object.transaction_env)
|
|
3996
|
+
: undefined,
|
|
3997
|
+
errorCode: isSet(object.error_code)
|
|
3998
|
+
? globalThis.Number(object.error_code)
|
|
3999
|
+
: 0,
|
|
4000
|
+
errorDesc: isSet(object.error_desc)
|
|
4001
|
+
? globalThis.String(object.error_desc)
|
|
4002
|
+
: "",
|
|
4003
|
+
ledgerSeq: isSet(object.ledger_seq)
|
|
4004
|
+
? globalThis.Number(object.ledger_seq)
|
|
4005
|
+
: 0,
|
|
4006
|
+
closeTime: isSet(object.close_time)
|
|
4007
|
+
? globalThis.Number(object.close_time)
|
|
4008
|
+
: 0,
|
|
4009
|
+
hash: isSet(object.hash) ? globalThis.String(object.hash) : "",
|
|
4010
|
+
actualFee: isSet(object.actual_fee)
|
|
4011
|
+
? globalThis.Number(object.actual_fee)
|
|
4012
|
+
: 0,
|
|
4013
|
+
contractTxHashes: globalThis.Array.isArray(object?.contract_tx_hashes)
|
|
4014
|
+
? object.contract_tx_hashes.map((e: any) => globalThis.String(e))
|
|
4015
|
+
: [],
|
|
4016
|
+
};
|
|
4017
|
+
},
|
|
4018
|
+
|
|
4019
|
+
toJSON(message: TransactionEnvStoreMessage): unknown {
|
|
4020
|
+
const obj: any = {};
|
|
4021
|
+
if (message.transactionEnv !== undefined) {
|
|
4022
|
+
obj.transaction_env = TransactionEnv.toJSON(message.transactionEnv);
|
|
4023
|
+
}
|
|
4024
|
+
if (message.errorCode !== undefined && message.errorCode !== 0) {
|
|
4025
|
+
obj.error_code = Math.round(message.errorCode);
|
|
4026
|
+
}
|
|
4027
|
+
if (message.errorDesc !== undefined && message.errorDesc !== "") {
|
|
4028
|
+
obj.error_desc = message.errorDesc;
|
|
4029
|
+
}
|
|
4030
|
+
if (message.ledgerSeq !== undefined && message.ledgerSeq !== 0) {
|
|
4031
|
+
obj.ledger_seq = Math.round(message.ledgerSeq);
|
|
4032
|
+
}
|
|
4033
|
+
if (message.closeTime !== undefined && message.closeTime !== 0) {
|
|
4034
|
+
obj.close_time = Math.round(message.closeTime);
|
|
4035
|
+
}
|
|
4036
|
+
if (message.hash !== undefined && message.hash !== "") {
|
|
4037
|
+
obj.hash = message.hash;
|
|
4038
|
+
}
|
|
4039
|
+
if (message.actualFee !== undefined && message.actualFee !== 0) {
|
|
4040
|
+
obj.actual_fee = Math.round(message.actualFee);
|
|
4041
|
+
}
|
|
4042
|
+
if (message.contractTxHashes?.length) {
|
|
4043
|
+
obj.contract_tx_hashes = message.contractTxHashes;
|
|
4044
|
+
}
|
|
4045
|
+
return obj;
|
|
4046
|
+
},
|
|
4047
|
+
|
|
4048
|
+
create<I extends Exact<DeepPartial<TransactionEnvStoreMessage>, I>>(
|
|
4049
|
+
base?: I,
|
|
4050
|
+
): TransactionEnvStoreMessage {
|
|
4051
|
+
return TransactionEnvStoreMessage.fromPartial(base ?? ({} as any));
|
|
4052
|
+
},
|
|
4053
|
+
fromPartial<I extends Exact<DeepPartial<TransactionEnvStoreMessage>, I>>(
|
|
4054
|
+
object: I,
|
|
4055
|
+
): TransactionEnvStoreMessage {
|
|
4056
|
+
const message = createBaseTransactionEnvStoreMessage();
|
|
4057
|
+
message.transactionEnv =
|
|
4058
|
+
object.transactionEnv !== undefined && object.transactionEnv !== null
|
|
4059
|
+
? TransactionEnv.fromPartial(object.transactionEnv)
|
|
4060
|
+
: undefined;
|
|
4061
|
+
message.errorCode = object.errorCode ?? 0;
|
|
4062
|
+
message.errorDesc = object.errorDesc ?? "";
|
|
4063
|
+
message.ledgerSeq = object.ledgerSeq ?? 0;
|
|
4064
|
+
message.closeTime = object.closeTime ?? 0;
|
|
4065
|
+
message.hash = object.hash ?? "";
|
|
4066
|
+
message.actualFee = object.actualFee ?? 0;
|
|
4067
|
+
message.contractTxHashes = object.contractTxHashes?.map((e) => e) || [];
|
|
4068
|
+
return message;
|
|
4069
|
+
},
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4072
|
+
function createBaseSignature(): Signature {
|
|
4073
|
+
return { publicKey: "", signData: "" };
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
export const Signature: MessageFns<Signature> = {
|
|
4077
|
+
encode(
|
|
4078
|
+
message: Signature,
|
|
4079
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
4080
|
+
): BinaryWriter {
|
|
4081
|
+
if (message.publicKey !== undefined && message.publicKey !== "") {
|
|
4082
|
+
writer.uint32(10).string(message.publicKey);
|
|
4083
|
+
}
|
|
4084
|
+
if (message.signData !== undefined && message.signData !== "") {
|
|
4085
|
+
writer.uint32(18).string(message.signData);
|
|
4086
|
+
}
|
|
4087
|
+
return writer;
|
|
4088
|
+
},
|
|
4089
|
+
|
|
4090
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Signature {
|
|
4091
|
+
const reader =
|
|
4092
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4093
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4094
|
+
const message = createBaseSignature();
|
|
4095
|
+
while (reader.pos < end) {
|
|
4096
|
+
const tag = reader.uint32();
|
|
4097
|
+
switch (tag >>> 3) {
|
|
4098
|
+
case 1: {
|
|
4099
|
+
if (tag !== 10) {
|
|
4100
|
+
break;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
message.publicKey = reader.string();
|
|
4104
|
+
continue;
|
|
4105
|
+
}
|
|
4106
|
+
case 2: {
|
|
4107
|
+
if (tag !== 18) {
|
|
4108
|
+
break;
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
message.signData = reader.string();
|
|
4112
|
+
continue;
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
4115
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4116
|
+
break;
|
|
4117
|
+
}
|
|
4118
|
+
reader.skip(tag & 7);
|
|
4119
|
+
}
|
|
4120
|
+
return message;
|
|
4121
|
+
},
|
|
4122
|
+
|
|
4123
|
+
fromJSON(object: any): Signature {
|
|
4124
|
+
return {
|
|
4125
|
+
publicKey: isSet(object.public_key)
|
|
4126
|
+
? globalThis.String(object.public_key)
|
|
4127
|
+
: "",
|
|
4128
|
+
signData: isSet(object.sign_data)
|
|
4129
|
+
? globalThis.String(object.sign_data)
|
|
4130
|
+
: "",
|
|
4131
|
+
};
|
|
4132
|
+
},
|
|
4133
|
+
|
|
4134
|
+
toJSON(message: Signature): unknown {
|
|
4135
|
+
const obj: any = {};
|
|
4136
|
+
if (message.publicKey !== undefined && message.publicKey !== "") {
|
|
4137
|
+
obj.public_key = message.publicKey;
|
|
4138
|
+
}
|
|
4139
|
+
if (message.signData !== undefined && message.signData !== "") {
|
|
4140
|
+
obj.sign_data = message.signData;
|
|
4141
|
+
}
|
|
4142
|
+
return obj;
|
|
4143
|
+
},
|
|
4144
|
+
|
|
4145
|
+
create<I extends Exact<DeepPartial<Signature>, I>>(base?: I): Signature {
|
|
4146
|
+
return Signature.fromPartial(base ?? ({} as any));
|
|
4147
|
+
},
|
|
4148
|
+
fromPartial<I extends Exact<DeepPartial<Signature>, I>>(
|
|
4149
|
+
object: I,
|
|
4150
|
+
): Signature {
|
|
4151
|
+
const message = createBaseSignature();
|
|
4152
|
+
message.publicKey = object.publicKey ?? "";
|
|
4153
|
+
message.signData = object.signData ?? "";
|
|
4154
|
+
return message;
|
|
4155
|
+
},
|
|
4156
|
+
};
|
|
4157
|
+
|
|
4158
|
+
function createBaseKeyPair(): KeyPair {
|
|
4159
|
+
return { key: "", value: "", version: 0 };
|
|
4160
|
+
}
|
|
4161
|
+
|
|
4162
|
+
export const KeyPair: MessageFns<KeyPair> = {
|
|
4163
|
+
encode(
|
|
4164
|
+
message: KeyPair,
|
|
4165
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
4166
|
+
): BinaryWriter {
|
|
4167
|
+
if (message.key !== undefined && message.key !== "") {
|
|
4168
|
+
writer.uint32(10).string(message.key);
|
|
4169
|
+
}
|
|
4170
|
+
if (message.value !== undefined && message.value !== "") {
|
|
4171
|
+
writer.uint32(18).string(message.value);
|
|
4172
|
+
}
|
|
4173
|
+
if (message.version !== undefined && message.version !== 0) {
|
|
4174
|
+
writer.uint32(24).int64(message.version);
|
|
4175
|
+
}
|
|
4176
|
+
return writer;
|
|
4177
|
+
},
|
|
4178
|
+
|
|
4179
|
+
decode(input: BinaryReader | Uint8Array, length?: number): KeyPair {
|
|
4180
|
+
const reader =
|
|
4181
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4182
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4183
|
+
const message = createBaseKeyPair();
|
|
4184
|
+
while (reader.pos < end) {
|
|
4185
|
+
const tag = reader.uint32();
|
|
4186
|
+
switch (tag >>> 3) {
|
|
4187
|
+
case 1: {
|
|
4188
|
+
if (tag !== 10) {
|
|
4189
|
+
break;
|
|
4190
|
+
}
|
|
4191
|
+
|
|
4192
|
+
message.key = reader.string();
|
|
4193
|
+
continue;
|
|
4194
|
+
}
|
|
4195
|
+
case 2: {
|
|
4196
|
+
if (tag !== 18) {
|
|
4197
|
+
break;
|
|
4198
|
+
}
|
|
4199
|
+
|
|
4200
|
+
message.value = reader.string();
|
|
4201
|
+
continue;
|
|
4202
|
+
}
|
|
4203
|
+
case 3: {
|
|
4204
|
+
if (tag !== 24) {
|
|
4205
|
+
break;
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4208
|
+
message.version = longToNumber(reader.int64());
|
|
4209
|
+
continue;
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4213
|
+
break;
|
|
4214
|
+
}
|
|
4215
|
+
reader.skip(tag & 7);
|
|
4216
|
+
}
|
|
4217
|
+
return message;
|
|
4218
|
+
},
|
|
4219
|
+
|
|
4220
|
+
fromJSON(object: any): KeyPair {
|
|
4221
|
+
return {
|
|
4222
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
4223
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
4224
|
+
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
4225
|
+
};
|
|
4226
|
+
},
|
|
4227
|
+
|
|
4228
|
+
toJSON(message: KeyPair): unknown {
|
|
4229
|
+
const obj: any = {};
|
|
4230
|
+
if (message.key !== undefined && message.key !== "") {
|
|
4231
|
+
obj.key = message.key;
|
|
4232
|
+
}
|
|
4233
|
+
if (message.value !== undefined && message.value !== "") {
|
|
4234
|
+
obj.value = message.value;
|
|
4235
|
+
}
|
|
4236
|
+
if (message.version !== undefined && message.version !== 0) {
|
|
4237
|
+
obj.version = Math.round(message.version);
|
|
4238
|
+
}
|
|
4239
|
+
return obj;
|
|
4240
|
+
},
|
|
4241
|
+
|
|
4242
|
+
create<I extends Exact<DeepPartial<KeyPair>, I>>(base?: I): KeyPair {
|
|
4243
|
+
return KeyPair.fromPartial(base ?? ({} as any));
|
|
4244
|
+
},
|
|
4245
|
+
fromPartial<I extends Exact<DeepPartial<KeyPair>, I>>(object: I): KeyPair {
|
|
4246
|
+
const message = createBaseKeyPair();
|
|
4247
|
+
message.key = object.key ?? "";
|
|
4248
|
+
message.value = object.value ?? "";
|
|
4249
|
+
message.version = object.version ?? 0;
|
|
4250
|
+
return message;
|
|
4251
|
+
},
|
|
4252
|
+
};
|
|
4253
|
+
|
|
4254
|
+
function createBaseDropTxMessage(): DropTxMessage {
|
|
4255
|
+
return { txHash: "", source: 0, timestamp: 0, tx: "" };
|
|
4256
|
+
}
|
|
4257
|
+
|
|
4258
|
+
export const DropTxMessage: MessageFns<DropTxMessage> = {
|
|
4259
|
+
encode(
|
|
4260
|
+
message: DropTxMessage,
|
|
4261
|
+
writer: BinaryWriter = new BinaryWriter(),
|
|
4262
|
+
): BinaryWriter {
|
|
4263
|
+
if (message.txHash !== undefined && message.txHash !== "") {
|
|
4264
|
+
writer.uint32(10).string(message.txHash);
|
|
4265
|
+
}
|
|
4266
|
+
if (message.source !== undefined && message.source !== 0) {
|
|
4267
|
+
writer.uint32(16).int32(message.source);
|
|
4268
|
+
}
|
|
4269
|
+
if (message.timestamp !== undefined && message.timestamp !== 0) {
|
|
4270
|
+
writer.uint32(24).int64(message.timestamp);
|
|
4271
|
+
}
|
|
4272
|
+
if (message.tx !== undefined && message.tx !== "") {
|
|
4273
|
+
writer.uint32(34).string(message.tx);
|
|
4274
|
+
}
|
|
4275
|
+
return writer;
|
|
4276
|
+
},
|
|
4277
|
+
|
|
4278
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DropTxMessage {
|
|
4279
|
+
const reader =
|
|
4280
|
+
input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4281
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4282
|
+
const message = createBaseDropTxMessage();
|
|
4283
|
+
while (reader.pos < end) {
|
|
4284
|
+
const tag = reader.uint32();
|
|
4285
|
+
switch (tag >>> 3) {
|
|
4286
|
+
case 1: {
|
|
4287
|
+
if (tag !== 10) {
|
|
4288
|
+
break;
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4291
|
+
message.txHash = reader.string();
|
|
4292
|
+
continue;
|
|
4293
|
+
}
|
|
4294
|
+
case 2: {
|
|
4295
|
+
if (tag !== 16) {
|
|
4296
|
+
break;
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
message.source = reader.int32() as any;
|
|
4300
|
+
continue;
|
|
4301
|
+
}
|
|
4302
|
+
case 3: {
|
|
4303
|
+
if (tag !== 24) {
|
|
4304
|
+
break;
|
|
4305
|
+
}
|
|
4306
|
+
|
|
4307
|
+
message.timestamp = longToNumber(reader.int64());
|
|
4308
|
+
continue;
|
|
4309
|
+
}
|
|
4310
|
+
case 4: {
|
|
4311
|
+
if (tag !== 34) {
|
|
4312
|
+
break;
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4315
|
+
message.tx = reader.string();
|
|
4316
|
+
continue;
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4320
|
+
break;
|
|
4321
|
+
}
|
|
4322
|
+
reader.skip(tag & 7);
|
|
4323
|
+
}
|
|
4324
|
+
return message;
|
|
4325
|
+
},
|
|
4326
|
+
|
|
4327
|
+
fromJSON(object: any): DropTxMessage {
|
|
4328
|
+
return {
|
|
4329
|
+
txHash: isSet(object.tx_hash) ? globalThis.String(object.tx_hash) : "",
|
|
4330
|
+
source: isSet(object.source)
|
|
4331
|
+
? dropTxMessage_PoolTypeFromJSON(object.source)
|
|
4332
|
+
: 0,
|
|
4333
|
+
timestamp: isSet(object.timestamp)
|
|
4334
|
+
? globalThis.Number(object.timestamp)
|
|
4335
|
+
: 0,
|
|
4336
|
+
tx: isSet(object.tx) ? globalThis.String(object.tx) : "",
|
|
4337
|
+
};
|
|
4338
|
+
},
|
|
4339
|
+
|
|
4340
|
+
toJSON(message: DropTxMessage): unknown {
|
|
4341
|
+
const obj: any = {};
|
|
4342
|
+
if (message.txHash !== undefined && message.txHash !== "") {
|
|
4343
|
+
obj.tx_hash = message.txHash;
|
|
4344
|
+
}
|
|
4345
|
+
if (message.source !== undefined && message.source !== 0) {
|
|
4346
|
+
obj.source = dropTxMessage_PoolTypeToJSON(message.source);
|
|
4347
|
+
}
|
|
4348
|
+
if (message.timestamp !== undefined && message.timestamp !== 0) {
|
|
4349
|
+
obj.timestamp = Math.round(message.timestamp);
|
|
4350
|
+
}
|
|
4351
|
+
if (message.tx !== undefined && message.tx !== "") {
|
|
4352
|
+
obj.tx = message.tx;
|
|
4353
|
+
}
|
|
4354
|
+
return obj;
|
|
4355
|
+
},
|
|
4356
|
+
|
|
4357
|
+
create<I extends Exact<DeepPartial<DropTxMessage>, I>>(
|
|
4358
|
+
base?: I,
|
|
4359
|
+
): DropTxMessage {
|
|
4360
|
+
return DropTxMessage.fromPartial(base ?? ({} as any));
|
|
4361
|
+
},
|
|
4362
|
+
fromPartial<I extends Exact<DeepPartial<DropTxMessage>, I>>(
|
|
4363
|
+
object: I,
|
|
4364
|
+
): DropTxMessage {
|
|
4365
|
+
const message = createBaseDropTxMessage();
|
|
4366
|
+
message.txHash = object.txHash ?? "";
|
|
4367
|
+
message.source = object.source ?? 0;
|
|
4368
|
+
message.timestamp = object.timestamp ?? 0;
|
|
4369
|
+
message.tx = object.tx ?? "";
|
|
4370
|
+
return message;
|
|
4371
|
+
},
|
|
4372
|
+
};
|
|
4373
|
+
|
|
4374
|
+
function bytesFromBase64(b64: string): Uint8Array {
|
|
4375
|
+
if ((globalThis as any).Buffer) {
|
|
4376
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
4377
|
+
} else {
|
|
4378
|
+
const bin = globalThis.atob(b64);
|
|
4379
|
+
const arr = new Uint8Array(bin.length);
|
|
4380
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
4381
|
+
arr[i] = bin.charCodeAt(i);
|
|
4382
|
+
}
|
|
4383
|
+
return arr;
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4387
|
+
function base64FromBytes(arr: Uint8Array): string {
|
|
4388
|
+
if ((globalThis as any).Buffer) {
|
|
4389
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
4390
|
+
} else {
|
|
4391
|
+
const bin: string[] = [];
|
|
4392
|
+
arr.forEach((byte) => {
|
|
4393
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
4394
|
+
});
|
|
4395
|
+
return globalThis.btoa(bin.join(""));
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
|
|
4399
|
+
type Builtin =
|
|
4400
|
+
| Date
|
|
4401
|
+
| Function
|
|
4402
|
+
| Uint8Array
|
|
4403
|
+
| string
|
|
4404
|
+
| number
|
|
4405
|
+
| boolean
|
|
4406
|
+
| undefined;
|
|
4407
|
+
|
|
4408
|
+
export type DeepPartial<T> = T extends Builtin
|
|
4409
|
+
? T
|
|
4410
|
+
: T extends globalThis.Array<infer U>
|
|
4411
|
+
? globalThis.Array<DeepPartial<U>>
|
|
4412
|
+
: T extends ReadonlyArray<infer U>
|
|
4413
|
+
? ReadonlyArray<DeepPartial<U>>
|
|
4414
|
+
: T extends {}
|
|
4415
|
+
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
4416
|
+
: Partial<T>;
|
|
4417
|
+
|
|
4418
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
4419
|
+
export type Exact<P, I extends P> = P extends Builtin
|
|
4420
|
+
? P
|
|
4421
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
|
4422
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
4423
|
+
};
|
|
4424
|
+
|
|
4425
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
4426
|
+
const num = globalThis.Number(int64.toString());
|
|
4427
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
4428
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
4429
|
+
}
|
|
4430
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
4431
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
4432
|
+
}
|
|
4433
|
+
return num;
|
|
4434
|
+
}
|
|
4435
|
+
|
|
4436
|
+
function isSet(value: any): boolean {
|
|
4437
|
+
return value !== null && value !== undefined;
|
|
4438
|
+
}
|
|
4439
|
+
|
|
4440
|
+
export interface MessageFns<T> {
|
|
4441
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
4442
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
4443
|
+
fromJSON(object: any): T;
|
|
4444
|
+
toJSON(message: T): unknown;
|
|
4445
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
4446
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
4447
|
+
}
|