@miradorlabs/web-grpc 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/README.md +5 -0
- package/google/protobuf/timestamp.ts +229 -0
- package/package.json +11 -0
- package/proto/gateway/common/v1/status.ts +179 -0
- package/proto/gateway/common/v1/status_grpc_pb.js +1 -0
- package/proto/gateway/common/v1/status_pb.js +237 -0
- package/proto/gateway/common/v1/types.ts +176 -0
- package/proto/gateway/common/v1/types_grpc_pb.js +1 -0
- package/proto/gateway/common/v1/types_pb.js +216 -0
- package/proto/gateway/web/v1/account_gateway.ts +7037 -0
- package/proto/gateway/web/v1/account_gateway_grpc_pb.js +813 -0
- package/proto/gateway/web/v1/account_gateway_pb.js +14338 -0
- package/proto/gateway/web/v1/automation_gateway.ts +5605 -0
- package/proto/gateway/web/v1/automation_gateway_grpc_pb.js +485 -0
- package/proto/gateway/web/v1/automation_gateway_pb.js +11618 -0
- package/proto/gateway/web/v1/chain_gateway.ts +3805 -0
- package/proto/gateway/web/v1/chain_gateway_grpc_pb.js +115 -0
- package/proto/gateway/web/v1/chain_gateway_pb.js +7049 -0
- package/proto/gateway/web/v1/market_gateway.ts +492 -0
- package/proto/gateway/web/v1/market_gateway_grpc_pb.js +45 -0
- package/proto/gateway/web/v1/market_gateway_pb.js +1063 -0
- package/proto/gateway/web/v1/oauth_gateway.ts +1163 -0
- package/proto/gateway/web/v1/oauth_gateway_grpc_pb.js +150 -0
- package/proto/gateway/web/v1/oauth_gateway_pb.js +2316 -0
- package/proto/gateway/web/v1/plan_gateway.ts +2463 -0
- package/proto/gateway/web/v1/plan_gateway_grpc_pb.js +152 -0
- package/proto/gateway/web/v1/plan_gateway_pb.js +4840 -0
- package/proto/gateway/web/v1/stream_gateway.ts +2354 -0
- package/proto/gateway/web/v1/stream_gateway_grpc_pb.js +145 -0
- package/proto/gateway/web/v1/stream_gateway_pb.js +4593 -0
- package/proto/gateway/web/v1/trace_gateway.ts +16320 -0
- package/proto/gateway/web/v1/trace_gateway_grpc_pb.js +280 -0
- package/proto/gateway/web/v1/trace_gateway_pb.js +28667 -0
|
@@ -0,0 +1,3805 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: proto/gateway/web/v1/chain_gateway.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
10
|
+
import { Observable } from "rxjs";
|
|
11
|
+
import { map } from "rxjs/operators";
|
|
12
|
+
import { ResponseStatus } from "../../common/v1/status";
|
|
13
|
+
import { BridgeLegType, bridgeLegTypeFromJSON, bridgeLegTypeToJSON } from "../../common/v1/types";
|
|
14
|
+
|
|
15
|
+
export const protobufPackage = "gateway.web.v1";
|
|
16
|
+
|
|
17
|
+
export enum ActivityType {
|
|
18
|
+
ACTIVITY_TYPE_UNSPECIFIED = 0,
|
|
19
|
+
ACTIVITY_TYPE_SWAP = 1,
|
|
20
|
+
ACTIVITY_TYPE_NFT_MINT = 2,
|
|
21
|
+
ACTIVITY_TYPE_NFT_TRANSFER = 3,
|
|
22
|
+
ACTIVITY_TYPE_TOKEN_TRANSFER = 4,
|
|
23
|
+
ACTIVITY_TYPE_APPROVAL = 5,
|
|
24
|
+
ACTIVITY_TYPE_BRIDGE = 6,
|
|
25
|
+
ACTIVITY_TYPE_CONTRACT_INTERACTION = 7,
|
|
26
|
+
UNRECOGNIZED = -1,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function activityTypeFromJSON(object: any): ActivityType {
|
|
30
|
+
switch (object) {
|
|
31
|
+
case 0:
|
|
32
|
+
case "ACTIVITY_TYPE_UNSPECIFIED":
|
|
33
|
+
return ActivityType.ACTIVITY_TYPE_UNSPECIFIED;
|
|
34
|
+
case 1:
|
|
35
|
+
case "ACTIVITY_TYPE_SWAP":
|
|
36
|
+
return ActivityType.ACTIVITY_TYPE_SWAP;
|
|
37
|
+
case 2:
|
|
38
|
+
case "ACTIVITY_TYPE_NFT_MINT":
|
|
39
|
+
return ActivityType.ACTIVITY_TYPE_NFT_MINT;
|
|
40
|
+
case 3:
|
|
41
|
+
case "ACTIVITY_TYPE_NFT_TRANSFER":
|
|
42
|
+
return ActivityType.ACTIVITY_TYPE_NFT_TRANSFER;
|
|
43
|
+
case 4:
|
|
44
|
+
case "ACTIVITY_TYPE_TOKEN_TRANSFER":
|
|
45
|
+
return ActivityType.ACTIVITY_TYPE_TOKEN_TRANSFER;
|
|
46
|
+
case 5:
|
|
47
|
+
case "ACTIVITY_TYPE_APPROVAL":
|
|
48
|
+
return ActivityType.ACTIVITY_TYPE_APPROVAL;
|
|
49
|
+
case 6:
|
|
50
|
+
case "ACTIVITY_TYPE_BRIDGE":
|
|
51
|
+
return ActivityType.ACTIVITY_TYPE_BRIDGE;
|
|
52
|
+
case 7:
|
|
53
|
+
case "ACTIVITY_TYPE_CONTRACT_INTERACTION":
|
|
54
|
+
return ActivityType.ACTIVITY_TYPE_CONTRACT_INTERACTION;
|
|
55
|
+
case -1:
|
|
56
|
+
case "UNRECOGNIZED":
|
|
57
|
+
default:
|
|
58
|
+
return ActivityType.UNRECOGNIZED;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function activityTypeToJSON(object: ActivityType): string {
|
|
63
|
+
switch (object) {
|
|
64
|
+
case ActivityType.ACTIVITY_TYPE_UNSPECIFIED:
|
|
65
|
+
return "ACTIVITY_TYPE_UNSPECIFIED";
|
|
66
|
+
case ActivityType.ACTIVITY_TYPE_SWAP:
|
|
67
|
+
return "ACTIVITY_TYPE_SWAP";
|
|
68
|
+
case ActivityType.ACTIVITY_TYPE_NFT_MINT:
|
|
69
|
+
return "ACTIVITY_TYPE_NFT_MINT";
|
|
70
|
+
case ActivityType.ACTIVITY_TYPE_NFT_TRANSFER:
|
|
71
|
+
return "ACTIVITY_TYPE_NFT_TRANSFER";
|
|
72
|
+
case ActivityType.ACTIVITY_TYPE_TOKEN_TRANSFER:
|
|
73
|
+
return "ACTIVITY_TYPE_TOKEN_TRANSFER";
|
|
74
|
+
case ActivityType.ACTIVITY_TYPE_APPROVAL:
|
|
75
|
+
return "ACTIVITY_TYPE_APPROVAL";
|
|
76
|
+
case ActivityType.ACTIVITY_TYPE_BRIDGE:
|
|
77
|
+
return "ACTIVITY_TYPE_BRIDGE";
|
|
78
|
+
case ActivityType.ACTIVITY_TYPE_CONTRACT_INTERACTION:
|
|
79
|
+
return "ACTIVITY_TYPE_CONTRACT_INTERACTION";
|
|
80
|
+
case ActivityType.UNRECOGNIZED:
|
|
81
|
+
default:
|
|
82
|
+
return "UNRECOGNIZED";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export enum NftStandard {
|
|
87
|
+
NFT_STANDARD_UNSPECIFIED = 0,
|
|
88
|
+
NFT_STANDARD_ERC721 = 1,
|
|
89
|
+
NFT_STANDARD_ERC1155 = 2,
|
|
90
|
+
UNRECOGNIZED = -1,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function nftStandardFromJSON(object: any): NftStandard {
|
|
94
|
+
switch (object) {
|
|
95
|
+
case 0:
|
|
96
|
+
case "NFT_STANDARD_UNSPECIFIED":
|
|
97
|
+
return NftStandard.NFT_STANDARD_UNSPECIFIED;
|
|
98
|
+
case 1:
|
|
99
|
+
case "NFT_STANDARD_ERC721":
|
|
100
|
+
return NftStandard.NFT_STANDARD_ERC721;
|
|
101
|
+
case 2:
|
|
102
|
+
case "NFT_STANDARD_ERC1155":
|
|
103
|
+
return NftStandard.NFT_STANDARD_ERC1155;
|
|
104
|
+
case -1:
|
|
105
|
+
case "UNRECOGNIZED":
|
|
106
|
+
default:
|
|
107
|
+
return NftStandard.UNRECOGNIZED;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function nftStandardToJSON(object: NftStandard): string {
|
|
112
|
+
switch (object) {
|
|
113
|
+
case NftStandard.NFT_STANDARD_UNSPECIFIED:
|
|
114
|
+
return "NFT_STANDARD_UNSPECIFIED";
|
|
115
|
+
case NftStandard.NFT_STANDARD_ERC721:
|
|
116
|
+
return "NFT_STANDARD_ERC721";
|
|
117
|
+
case NftStandard.NFT_STANDARD_ERC1155:
|
|
118
|
+
return "NFT_STANDARD_ERC1155";
|
|
119
|
+
case NftStandard.UNRECOGNIZED:
|
|
120
|
+
default:
|
|
121
|
+
return "UNRECOGNIZED";
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export enum ApprovalStandard {
|
|
126
|
+
APPROVAL_STANDARD_UNSPECIFIED = 0,
|
|
127
|
+
APPROVAL_STANDARD_ERC20 = 1,
|
|
128
|
+
APPROVAL_STANDARD_ERC721 = 2,
|
|
129
|
+
APPROVAL_STANDARD_ERC1155 = 3,
|
|
130
|
+
UNRECOGNIZED = -1,
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function approvalStandardFromJSON(object: any): ApprovalStandard {
|
|
134
|
+
switch (object) {
|
|
135
|
+
case 0:
|
|
136
|
+
case "APPROVAL_STANDARD_UNSPECIFIED":
|
|
137
|
+
return ApprovalStandard.APPROVAL_STANDARD_UNSPECIFIED;
|
|
138
|
+
case 1:
|
|
139
|
+
case "APPROVAL_STANDARD_ERC20":
|
|
140
|
+
return ApprovalStandard.APPROVAL_STANDARD_ERC20;
|
|
141
|
+
case 2:
|
|
142
|
+
case "APPROVAL_STANDARD_ERC721":
|
|
143
|
+
return ApprovalStandard.APPROVAL_STANDARD_ERC721;
|
|
144
|
+
case 3:
|
|
145
|
+
case "APPROVAL_STANDARD_ERC1155":
|
|
146
|
+
return ApprovalStandard.APPROVAL_STANDARD_ERC1155;
|
|
147
|
+
case -1:
|
|
148
|
+
case "UNRECOGNIZED":
|
|
149
|
+
default:
|
|
150
|
+
return ApprovalStandard.UNRECOGNIZED;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function approvalStandardToJSON(object: ApprovalStandard): string {
|
|
155
|
+
switch (object) {
|
|
156
|
+
case ApprovalStandard.APPROVAL_STANDARD_UNSPECIFIED:
|
|
157
|
+
return "APPROVAL_STANDARD_UNSPECIFIED";
|
|
158
|
+
case ApprovalStandard.APPROVAL_STANDARD_ERC20:
|
|
159
|
+
return "APPROVAL_STANDARD_ERC20";
|
|
160
|
+
case ApprovalStandard.APPROVAL_STANDARD_ERC721:
|
|
161
|
+
return "APPROVAL_STANDARD_ERC721";
|
|
162
|
+
case ApprovalStandard.APPROVAL_STANDARD_ERC1155:
|
|
163
|
+
return "APPROVAL_STANDARD_ERC1155";
|
|
164
|
+
case ApprovalStandard.UNRECOGNIZED:
|
|
165
|
+
default:
|
|
166
|
+
return "UNRECOGNIZED";
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface StreamEvmBlockRequest {
|
|
171
|
+
evmChainId: number;
|
|
172
|
+
txHash: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface EvmBlockUpdate {
|
|
176
|
+
blockNumber: number;
|
|
177
|
+
confirmedBlocks: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface GetEvmActivityRequest {
|
|
181
|
+
txHash: string;
|
|
182
|
+
chainId: number;
|
|
183
|
+
/** ISO 4217 code (e.g., "USD", "EUR"), default "USD" */
|
|
184
|
+
fiatCurrency?: string | undefined;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface GetEvmActivityResponse {
|
|
188
|
+
status:
|
|
189
|
+
| ResponseStatus
|
|
190
|
+
| undefined;
|
|
191
|
+
/** Overall intent (single tx or bridge pair) */
|
|
192
|
+
transactionIntent: string;
|
|
193
|
+
/** 1 for single tx, 2 for bridge (source + dest) */
|
|
194
|
+
activities: TransactionActivity[];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** TransactionActivity contains all activity data for a single transaction */
|
|
198
|
+
export interface TransactionActivity {
|
|
199
|
+
fromAddress: string;
|
|
200
|
+
toAddress: string;
|
|
201
|
+
/** Raw native token amount in smallest unit */
|
|
202
|
+
nativeValueRaw: string;
|
|
203
|
+
/** Human-readable native value (e.g., "0.5 ETH") */
|
|
204
|
+
nativeValueFormatted: string;
|
|
205
|
+
/** High-level activity cards */
|
|
206
|
+
activities: Activity[];
|
|
207
|
+
tokens: TokenInfo[];
|
|
208
|
+
/** Fiat equivalent of native value (spot price) */
|
|
209
|
+
nativeValueFiat:
|
|
210
|
+
| FiatValue
|
|
211
|
+
| undefined;
|
|
212
|
+
/** Decoded transaction input data (function call) */
|
|
213
|
+
calldata:
|
|
214
|
+
| CalldataInfo
|
|
215
|
+
| undefined;
|
|
216
|
+
/** All decoded event logs from receipt */
|
|
217
|
+
eventLogs: EventLog[];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Activity card representing a single semantic action */
|
|
221
|
+
export interface Activity {
|
|
222
|
+
type: ActivityType;
|
|
223
|
+
primaryLogIndex: number;
|
|
224
|
+
/** Human-readable summary (e.g., "Bridged out 0.077 ETH via Across") */
|
|
225
|
+
summary: string;
|
|
226
|
+
swap?: SwapActivity | undefined;
|
|
227
|
+
nftMint?: NftMintActivity | undefined;
|
|
228
|
+
nftTransfer?: NftTransferActivity | undefined;
|
|
229
|
+
tokenTransfer?: TokenTransferActivity | undefined;
|
|
230
|
+
approval?: ApprovalActivity | undefined;
|
|
231
|
+
bridge?: BridgeActivity | undefined;
|
|
232
|
+
contractInteraction?:
|
|
233
|
+
| ContractInteractionActivity
|
|
234
|
+
| undefined;
|
|
235
|
+
/** Sub-activities (e.g., token transfers within a swap) */
|
|
236
|
+
children: Activity[];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface SwapActivity {
|
|
240
|
+
protocol: string;
|
|
241
|
+
inputTokenAddress: string;
|
|
242
|
+
inputAmountRaw: string;
|
|
243
|
+
inputAmountFormatted: string;
|
|
244
|
+
outputTokenAddress: string;
|
|
245
|
+
outputAmountRaw: string;
|
|
246
|
+
outputAmountFormatted: string;
|
|
247
|
+
sender: string;
|
|
248
|
+
recipient: string;
|
|
249
|
+
inputFiatValue: FiatValue | undefined;
|
|
250
|
+
outputFiatValue: FiatValue | undefined;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface NftMintActivity {
|
|
254
|
+
collectionAddress: string;
|
|
255
|
+
collectionName: string;
|
|
256
|
+
tokenIds: string[];
|
|
257
|
+
quantity: number;
|
|
258
|
+
recipient: string;
|
|
259
|
+
standard: NftStandard;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface NftTransferActivity {
|
|
263
|
+
collectionAddress: string;
|
|
264
|
+
collectionName: string;
|
|
265
|
+
tokenIds: string[];
|
|
266
|
+
quantity: number;
|
|
267
|
+
fromAddress: string;
|
|
268
|
+
toAddress: string;
|
|
269
|
+
standard: NftStandard;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface TokenTransferActivity {
|
|
273
|
+
tokenAddress: string;
|
|
274
|
+
amountRaw: string;
|
|
275
|
+
amountFormatted: string;
|
|
276
|
+
fromAddress: string;
|
|
277
|
+
toAddress: string;
|
|
278
|
+
fiatValue: FiatValue | undefined;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface ApprovalActivity {
|
|
282
|
+
tokenAddress: string;
|
|
283
|
+
spenderAddress: string;
|
|
284
|
+
amountRaw: string;
|
|
285
|
+
amountFormatted: string;
|
|
286
|
+
owner: string;
|
|
287
|
+
standard: ApprovalStandard;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface BridgeActivity {
|
|
291
|
+
bridgeName: string;
|
|
292
|
+
legType: BridgeLegType;
|
|
293
|
+
tokenAddress: string;
|
|
294
|
+
amountRaw: string;
|
|
295
|
+
amountFormatted: string;
|
|
296
|
+
fiatValue: FiatValue | undefined;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface ContractInteractionActivity {
|
|
300
|
+
contractAddress: string;
|
|
301
|
+
methodName: string;
|
|
302
|
+
/** Decoded event fields for this log */
|
|
303
|
+
decodedFields: DecodedParam[];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface GetContractInfoRequest {
|
|
307
|
+
contractAddress: string;
|
|
308
|
+
chainId: number;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface GetContractInfoResponse {
|
|
312
|
+
status: ResponseStatus | undefined;
|
|
313
|
+
contractInfo: ContractInfo | undefined;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface ContractInfo {
|
|
317
|
+
contractAddress: string;
|
|
318
|
+
chainId: number;
|
|
319
|
+
contractName: string;
|
|
320
|
+
isVerified: boolean;
|
|
321
|
+
compilerVersion: string;
|
|
322
|
+
optimizationUsed: boolean;
|
|
323
|
+
optimizationRuns: number;
|
|
324
|
+
evmVersion: string;
|
|
325
|
+
licenseType: string;
|
|
326
|
+
isProxy: boolean;
|
|
327
|
+
implementationAddress: string;
|
|
328
|
+
sourceFiles: ContractSourceFile[];
|
|
329
|
+
abiJson: string;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface ContractSourceFile {
|
|
333
|
+
fileName: string;
|
|
334
|
+
content: string;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface TokenInfo {
|
|
338
|
+
address: string;
|
|
339
|
+
symbol: string;
|
|
340
|
+
name: string;
|
|
341
|
+
decimals: number;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** FiatValue represents a fiat currency amount with formatting. */
|
|
345
|
+
export interface FiatValue {
|
|
346
|
+
/** ISO 4217 code (e.g., "USD", "EUR") */
|
|
347
|
+
currency: string;
|
|
348
|
+
/** Numeric amount (e.g., 1750.42) */
|
|
349
|
+
amount: number;
|
|
350
|
+
/** Human-readable formatted string (e.g., "$1,750.42") */
|
|
351
|
+
formatted: string;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/** CalldataInfo represents decoded transaction input data (function call) */
|
|
355
|
+
export interface CalldataInfo {
|
|
356
|
+
/** Full calldata hex (0x-prefixed) */
|
|
357
|
+
rawHex: string;
|
|
358
|
+
/** 4-byte selector hex (e.g., "0xa9059cbb") */
|
|
359
|
+
functionSelector: string;
|
|
360
|
+
/** Decoded function name (e.g., "transfer") */
|
|
361
|
+
functionName: string;
|
|
362
|
+
/** Full signature (e.g., "transfer(address,uint256)") */
|
|
363
|
+
functionSignature: string;
|
|
364
|
+
/** Decoded parameters */
|
|
365
|
+
params: DecodedParam[];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** DecodedParam represents a decoded function or event parameter */
|
|
369
|
+
export interface DecodedParam {
|
|
370
|
+
/** Parameter name from ABI (e.g., "to") */
|
|
371
|
+
name: string;
|
|
372
|
+
/** Solidity type (e.g., "address", "uint256") */
|
|
373
|
+
solidityType: string;
|
|
374
|
+
/** Stringified value */
|
|
375
|
+
value: string;
|
|
376
|
+
/** Whether this is an indexed event parameter */
|
|
377
|
+
indexed: boolean;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** EventLog represents a decoded event log from a transaction receipt */
|
|
381
|
+
export interface EventLog {
|
|
382
|
+
/** Position in receipt */
|
|
383
|
+
logIndex: number;
|
|
384
|
+
/** Emitting contract address */
|
|
385
|
+
address: string;
|
|
386
|
+
/** Decoded event name (empty if undecoded) */
|
|
387
|
+
eventName: string;
|
|
388
|
+
/** Full event signature (e.g., "Transfer(address,address,uint256)") */
|
|
389
|
+
eventSignature: string;
|
|
390
|
+
/** Decoded event parameters */
|
|
391
|
+
params: DecodedParam[];
|
|
392
|
+
/** Raw topic hashes (always included as fallback) */
|
|
393
|
+
rawTopics: string[];
|
|
394
|
+
/** Raw log data hex (always included as fallback) */
|
|
395
|
+
rawData: string;
|
|
396
|
+
/** Whether decoding succeeded */
|
|
397
|
+
decoded: boolean;
|
|
398
|
+
/** Links to Activity card if matched (primary_log_index) */
|
|
399
|
+
activityIndex?: number | undefined;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function createBaseStreamEvmBlockRequest(): StreamEvmBlockRequest {
|
|
403
|
+
return { evmChainId: 0, txHash: "" };
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export const StreamEvmBlockRequest: MessageFns<StreamEvmBlockRequest> = {
|
|
407
|
+
encode(message: StreamEvmBlockRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
408
|
+
if (message.evmChainId !== 0) {
|
|
409
|
+
writer.uint32(8).uint64(message.evmChainId);
|
|
410
|
+
}
|
|
411
|
+
if (message.txHash !== "") {
|
|
412
|
+
writer.uint32(18).string(message.txHash);
|
|
413
|
+
}
|
|
414
|
+
return writer;
|
|
415
|
+
},
|
|
416
|
+
|
|
417
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamEvmBlockRequest {
|
|
418
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
419
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
420
|
+
const message = createBaseStreamEvmBlockRequest();
|
|
421
|
+
while (reader.pos < end) {
|
|
422
|
+
const tag = reader.uint32();
|
|
423
|
+
switch (tag >>> 3) {
|
|
424
|
+
case 1: {
|
|
425
|
+
if (tag !== 8) {
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
message.evmChainId = longToNumber(reader.uint64());
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
case 2: {
|
|
433
|
+
if (tag !== 18) {
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
message.txHash = reader.string();
|
|
438
|
+
continue;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
reader.skip(tag & 7);
|
|
445
|
+
}
|
|
446
|
+
return message;
|
|
447
|
+
},
|
|
448
|
+
|
|
449
|
+
fromJSON(object: any): StreamEvmBlockRequest {
|
|
450
|
+
return {
|
|
451
|
+
evmChainId: isSet(object.evmChainId)
|
|
452
|
+
? globalThis.Number(object.evmChainId)
|
|
453
|
+
: isSet(object.evm_chain_id)
|
|
454
|
+
? globalThis.Number(object.evm_chain_id)
|
|
455
|
+
: 0,
|
|
456
|
+
txHash: isSet(object.txHash)
|
|
457
|
+
? globalThis.String(object.txHash)
|
|
458
|
+
: isSet(object.tx_hash)
|
|
459
|
+
? globalThis.String(object.tx_hash)
|
|
460
|
+
: "",
|
|
461
|
+
};
|
|
462
|
+
},
|
|
463
|
+
|
|
464
|
+
toJSON(message: StreamEvmBlockRequest): unknown {
|
|
465
|
+
const obj: any = {};
|
|
466
|
+
if (message.evmChainId !== 0) {
|
|
467
|
+
obj.evmChainId = Math.round(message.evmChainId);
|
|
468
|
+
}
|
|
469
|
+
if (message.txHash !== "") {
|
|
470
|
+
obj.txHash = message.txHash;
|
|
471
|
+
}
|
|
472
|
+
return obj;
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
create<I extends Exact<DeepPartial<StreamEvmBlockRequest>, I>>(base?: I): StreamEvmBlockRequest {
|
|
476
|
+
return StreamEvmBlockRequest.fromPartial(base ?? ({} as any));
|
|
477
|
+
},
|
|
478
|
+
fromPartial<I extends Exact<DeepPartial<StreamEvmBlockRequest>, I>>(object: I): StreamEvmBlockRequest {
|
|
479
|
+
const message = createBaseStreamEvmBlockRequest();
|
|
480
|
+
message.evmChainId = object.evmChainId ?? 0;
|
|
481
|
+
message.txHash = object.txHash ?? "";
|
|
482
|
+
return message;
|
|
483
|
+
},
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
function createBaseEvmBlockUpdate(): EvmBlockUpdate {
|
|
487
|
+
return { blockNumber: 0, confirmedBlocks: 0 };
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export const EvmBlockUpdate: MessageFns<EvmBlockUpdate> = {
|
|
491
|
+
encode(message: EvmBlockUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
492
|
+
if (message.blockNumber !== 0) {
|
|
493
|
+
writer.uint32(8).uint64(message.blockNumber);
|
|
494
|
+
}
|
|
495
|
+
if (message.confirmedBlocks !== 0) {
|
|
496
|
+
writer.uint32(16).uint64(message.confirmedBlocks);
|
|
497
|
+
}
|
|
498
|
+
return writer;
|
|
499
|
+
},
|
|
500
|
+
|
|
501
|
+
decode(input: BinaryReader | Uint8Array, length?: number): EvmBlockUpdate {
|
|
502
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
503
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
504
|
+
const message = createBaseEvmBlockUpdate();
|
|
505
|
+
while (reader.pos < end) {
|
|
506
|
+
const tag = reader.uint32();
|
|
507
|
+
switch (tag >>> 3) {
|
|
508
|
+
case 1: {
|
|
509
|
+
if (tag !== 8) {
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
message.blockNumber = longToNumber(reader.uint64());
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
case 2: {
|
|
517
|
+
if (tag !== 16) {
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
message.confirmedBlocks = longToNumber(reader.uint64());
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
reader.skip(tag & 7);
|
|
529
|
+
}
|
|
530
|
+
return message;
|
|
531
|
+
},
|
|
532
|
+
|
|
533
|
+
fromJSON(object: any): EvmBlockUpdate {
|
|
534
|
+
return {
|
|
535
|
+
blockNumber: isSet(object.blockNumber)
|
|
536
|
+
? globalThis.Number(object.blockNumber)
|
|
537
|
+
: isSet(object.block_number)
|
|
538
|
+
? globalThis.Number(object.block_number)
|
|
539
|
+
: 0,
|
|
540
|
+
confirmedBlocks: isSet(object.confirmedBlocks)
|
|
541
|
+
? globalThis.Number(object.confirmedBlocks)
|
|
542
|
+
: isSet(object.confirmed_blocks)
|
|
543
|
+
? globalThis.Number(object.confirmed_blocks)
|
|
544
|
+
: 0,
|
|
545
|
+
};
|
|
546
|
+
},
|
|
547
|
+
|
|
548
|
+
toJSON(message: EvmBlockUpdate): unknown {
|
|
549
|
+
const obj: any = {};
|
|
550
|
+
if (message.blockNumber !== 0) {
|
|
551
|
+
obj.blockNumber = Math.round(message.blockNumber);
|
|
552
|
+
}
|
|
553
|
+
if (message.confirmedBlocks !== 0) {
|
|
554
|
+
obj.confirmedBlocks = Math.round(message.confirmedBlocks);
|
|
555
|
+
}
|
|
556
|
+
return obj;
|
|
557
|
+
},
|
|
558
|
+
|
|
559
|
+
create<I extends Exact<DeepPartial<EvmBlockUpdate>, I>>(base?: I): EvmBlockUpdate {
|
|
560
|
+
return EvmBlockUpdate.fromPartial(base ?? ({} as any));
|
|
561
|
+
},
|
|
562
|
+
fromPartial<I extends Exact<DeepPartial<EvmBlockUpdate>, I>>(object: I): EvmBlockUpdate {
|
|
563
|
+
const message = createBaseEvmBlockUpdate();
|
|
564
|
+
message.blockNumber = object.blockNumber ?? 0;
|
|
565
|
+
message.confirmedBlocks = object.confirmedBlocks ?? 0;
|
|
566
|
+
return message;
|
|
567
|
+
},
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
function createBaseGetEvmActivityRequest(): GetEvmActivityRequest {
|
|
571
|
+
return { txHash: "", chainId: 0, fiatCurrency: undefined };
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export const GetEvmActivityRequest: MessageFns<GetEvmActivityRequest> = {
|
|
575
|
+
encode(message: GetEvmActivityRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
576
|
+
if (message.txHash !== "") {
|
|
577
|
+
writer.uint32(10).string(message.txHash);
|
|
578
|
+
}
|
|
579
|
+
if (message.chainId !== 0) {
|
|
580
|
+
writer.uint32(16).uint64(message.chainId);
|
|
581
|
+
}
|
|
582
|
+
if (message.fiatCurrency !== undefined) {
|
|
583
|
+
writer.uint32(26).string(message.fiatCurrency);
|
|
584
|
+
}
|
|
585
|
+
return writer;
|
|
586
|
+
},
|
|
587
|
+
|
|
588
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetEvmActivityRequest {
|
|
589
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
590
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
591
|
+
const message = createBaseGetEvmActivityRequest();
|
|
592
|
+
while (reader.pos < end) {
|
|
593
|
+
const tag = reader.uint32();
|
|
594
|
+
switch (tag >>> 3) {
|
|
595
|
+
case 1: {
|
|
596
|
+
if (tag !== 10) {
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
message.txHash = reader.string();
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
case 2: {
|
|
604
|
+
if (tag !== 16) {
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
message.chainId = longToNumber(reader.uint64());
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
case 3: {
|
|
612
|
+
if (tag !== 26) {
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
message.fiatCurrency = reader.string();
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
reader.skip(tag & 7);
|
|
624
|
+
}
|
|
625
|
+
return message;
|
|
626
|
+
},
|
|
627
|
+
|
|
628
|
+
fromJSON(object: any): GetEvmActivityRequest {
|
|
629
|
+
return {
|
|
630
|
+
txHash: isSet(object.txHash)
|
|
631
|
+
? globalThis.String(object.txHash)
|
|
632
|
+
: isSet(object.tx_hash)
|
|
633
|
+
? globalThis.String(object.tx_hash)
|
|
634
|
+
: "",
|
|
635
|
+
chainId: isSet(object.chainId)
|
|
636
|
+
? globalThis.Number(object.chainId)
|
|
637
|
+
: isSet(object.chain_id)
|
|
638
|
+
? globalThis.Number(object.chain_id)
|
|
639
|
+
: 0,
|
|
640
|
+
fiatCurrency: isSet(object.fiatCurrency)
|
|
641
|
+
? globalThis.String(object.fiatCurrency)
|
|
642
|
+
: isSet(object.fiat_currency)
|
|
643
|
+
? globalThis.String(object.fiat_currency)
|
|
644
|
+
: undefined,
|
|
645
|
+
};
|
|
646
|
+
},
|
|
647
|
+
|
|
648
|
+
toJSON(message: GetEvmActivityRequest): unknown {
|
|
649
|
+
const obj: any = {};
|
|
650
|
+
if (message.txHash !== "") {
|
|
651
|
+
obj.txHash = message.txHash;
|
|
652
|
+
}
|
|
653
|
+
if (message.chainId !== 0) {
|
|
654
|
+
obj.chainId = Math.round(message.chainId);
|
|
655
|
+
}
|
|
656
|
+
if (message.fiatCurrency !== undefined) {
|
|
657
|
+
obj.fiatCurrency = message.fiatCurrency;
|
|
658
|
+
}
|
|
659
|
+
return obj;
|
|
660
|
+
},
|
|
661
|
+
|
|
662
|
+
create<I extends Exact<DeepPartial<GetEvmActivityRequest>, I>>(base?: I): GetEvmActivityRequest {
|
|
663
|
+
return GetEvmActivityRequest.fromPartial(base ?? ({} as any));
|
|
664
|
+
},
|
|
665
|
+
fromPartial<I extends Exact<DeepPartial<GetEvmActivityRequest>, I>>(object: I): GetEvmActivityRequest {
|
|
666
|
+
const message = createBaseGetEvmActivityRequest();
|
|
667
|
+
message.txHash = object.txHash ?? "";
|
|
668
|
+
message.chainId = object.chainId ?? 0;
|
|
669
|
+
message.fiatCurrency = object.fiatCurrency ?? undefined;
|
|
670
|
+
return message;
|
|
671
|
+
},
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
function createBaseGetEvmActivityResponse(): GetEvmActivityResponse {
|
|
675
|
+
return { status: undefined, transactionIntent: "", activities: [] };
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export const GetEvmActivityResponse: MessageFns<GetEvmActivityResponse> = {
|
|
679
|
+
encode(message: GetEvmActivityResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
680
|
+
if (message.status !== undefined) {
|
|
681
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
682
|
+
}
|
|
683
|
+
if (message.transactionIntent !== "") {
|
|
684
|
+
writer.uint32(18).string(message.transactionIntent);
|
|
685
|
+
}
|
|
686
|
+
for (const v of message.activities) {
|
|
687
|
+
TransactionActivity.encode(v!, writer.uint32(26).fork()).join();
|
|
688
|
+
}
|
|
689
|
+
return writer;
|
|
690
|
+
},
|
|
691
|
+
|
|
692
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetEvmActivityResponse {
|
|
693
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
694
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
695
|
+
const message = createBaseGetEvmActivityResponse();
|
|
696
|
+
while (reader.pos < end) {
|
|
697
|
+
const tag = reader.uint32();
|
|
698
|
+
switch (tag >>> 3) {
|
|
699
|
+
case 1: {
|
|
700
|
+
if (tag !== 10) {
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
case 2: {
|
|
708
|
+
if (tag !== 18) {
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
message.transactionIntent = reader.string();
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
case 3: {
|
|
716
|
+
if (tag !== 26) {
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
message.activities.push(TransactionActivity.decode(reader, reader.uint32()));
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
reader.skip(tag & 7);
|
|
728
|
+
}
|
|
729
|
+
return message;
|
|
730
|
+
},
|
|
731
|
+
|
|
732
|
+
fromJSON(object: any): GetEvmActivityResponse {
|
|
733
|
+
return {
|
|
734
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
735
|
+
transactionIntent: isSet(object.transactionIntent)
|
|
736
|
+
? globalThis.String(object.transactionIntent)
|
|
737
|
+
: isSet(object.transaction_intent)
|
|
738
|
+
? globalThis.String(object.transaction_intent)
|
|
739
|
+
: "",
|
|
740
|
+
activities: globalThis.Array.isArray(object?.activities)
|
|
741
|
+
? object.activities.map((e: any) => TransactionActivity.fromJSON(e))
|
|
742
|
+
: [],
|
|
743
|
+
};
|
|
744
|
+
},
|
|
745
|
+
|
|
746
|
+
toJSON(message: GetEvmActivityResponse): unknown {
|
|
747
|
+
const obj: any = {};
|
|
748
|
+
if (message.status !== undefined) {
|
|
749
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
750
|
+
}
|
|
751
|
+
if (message.transactionIntent !== "") {
|
|
752
|
+
obj.transactionIntent = message.transactionIntent;
|
|
753
|
+
}
|
|
754
|
+
if (message.activities?.length) {
|
|
755
|
+
obj.activities = message.activities.map((e) => TransactionActivity.toJSON(e));
|
|
756
|
+
}
|
|
757
|
+
return obj;
|
|
758
|
+
},
|
|
759
|
+
|
|
760
|
+
create<I extends Exact<DeepPartial<GetEvmActivityResponse>, I>>(base?: I): GetEvmActivityResponse {
|
|
761
|
+
return GetEvmActivityResponse.fromPartial(base ?? ({} as any));
|
|
762
|
+
},
|
|
763
|
+
fromPartial<I extends Exact<DeepPartial<GetEvmActivityResponse>, I>>(object: I): GetEvmActivityResponse {
|
|
764
|
+
const message = createBaseGetEvmActivityResponse();
|
|
765
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
766
|
+
? ResponseStatus.fromPartial(object.status)
|
|
767
|
+
: undefined;
|
|
768
|
+
message.transactionIntent = object.transactionIntent ?? "";
|
|
769
|
+
message.activities = object.activities?.map((e) => TransactionActivity.fromPartial(e)) || [];
|
|
770
|
+
return message;
|
|
771
|
+
},
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
function createBaseTransactionActivity(): TransactionActivity {
|
|
775
|
+
return {
|
|
776
|
+
fromAddress: "",
|
|
777
|
+
toAddress: "",
|
|
778
|
+
nativeValueRaw: "",
|
|
779
|
+
nativeValueFormatted: "",
|
|
780
|
+
activities: [],
|
|
781
|
+
tokens: [],
|
|
782
|
+
nativeValueFiat: undefined,
|
|
783
|
+
calldata: undefined,
|
|
784
|
+
eventLogs: [],
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export const TransactionActivity: MessageFns<TransactionActivity> = {
|
|
789
|
+
encode(message: TransactionActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
790
|
+
if (message.fromAddress !== "") {
|
|
791
|
+
writer.uint32(18).string(message.fromAddress);
|
|
792
|
+
}
|
|
793
|
+
if (message.toAddress !== "") {
|
|
794
|
+
writer.uint32(26).string(message.toAddress);
|
|
795
|
+
}
|
|
796
|
+
if (message.nativeValueRaw !== "") {
|
|
797
|
+
writer.uint32(34).string(message.nativeValueRaw);
|
|
798
|
+
}
|
|
799
|
+
if (message.nativeValueFormatted !== "") {
|
|
800
|
+
writer.uint32(42).string(message.nativeValueFormatted);
|
|
801
|
+
}
|
|
802
|
+
for (const v of message.activities) {
|
|
803
|
+
Activity.encode(v!, writer.uint32(50).fork()).join();
|
|
804
|
+
}
|
|
805
|
+
for (const v of message.tokens) {
|
|
806
|
+
TokenInfo.encode(v!, writer.uint32(58).fork()).join();
|
|
807
|
+
}
|
|
808
|
+
if (message.nativeValueFiat !== undefined) {
|
|
809
|
+
FiatValue.encode(message.nativeValueFiat, writer.uint32(66).fork()).join();
|
|
810
|
+
}
|
|
811
|
+
if (message.calldata !== undefined) {
|
|
812
|
+
CalldataInfo.encode(message.calldata, writer.uint32(74).fork()).join();
|
|
813
|
+
}
|
|
814
|
+
for (const v of message.eventLogs) {
|
|
815
|
+
EventLog.encode(v!, writer.uint32(82).fork()).join();
|
|
816
|
+
}
|
|
817
|
+
return writer;
|
|
818
|
+
},
|
|
819
|
+
|
|
820
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TransactionActivity {
|
|
821
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
822
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
823
|
+
const message = createBaseTransactionActivity();
|
|
824
|
+
while (reader.pos < end) {
|
|
825
|
+
const tag = reader.uint32();
|
|
826
|
+
switch (tag >>> 3) {
|
|
827
|
+
case 2: {
|
|
828
|
+
if (tag !== 18) {
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
message.fromAddress = reader.string();
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
case 3: {
|
|
836
|
+
if (tag !== 26) {
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
message.toAddress = reader.string();
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
843
|
+
case 4: {
|
|
844
|
+
if (tag !== 34) {
|
|
845
|
+
break;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
message.nativeValueRaw = reader.string();
|
|
849
|
+
continue;
|
|
850
|
+
}
|
|
851
|
+
case 5: {
|
|
852
|
+
if (tag !== 42) {
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
message.nativeValueFormatted = reader.string();
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
case 6: {
|
|
860
|
+
if (tag !== 50) {
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
message.activities.push(Activity.decode(reader, reader.uint32()));
|
|
865
|
+
continue;
|
|
866
|
+
}
|
|
867
|
+
case 7: {
|
|
868
|
+
if (tag !== 58) {
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
message.tokens.push(TokenInfo.decode(reader, reader.uint32()));
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
case 8: {
|
|
876
|
+
if (tag !== 66) {
|
|
877
|
+
break;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
message.nativeValueFiat = FiatValue.decode(reader, reader.uint32());
|
|
881
|
+
continue;
|
|
882
|
+
}
|
|
883
|
+
case 9: {
|
|
884
|
+
if (tag !== 74) {
|
|
885
|
+
break;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
message.calldata = CalldataInfo.decode(reader, reader.uint32());
|
|
889
|
+
continue;
|
|
890
|
+
}
|
|
891
|
+
case 10: {
|
|
892
|
+
if (tag !== 82) {
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
message.eventLogs.push(EventLog.decode(reader, reader.uint32()));
|
|
897
|
+
continue;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
901
|
+
break;
|
|
902
|
+
}
|
|
903
|
+
reader.skip(tag & 7);
|
|
904
|
+
}
|
|
905
|
+
return message;
|
|
906
|
+
},
|
|
907
|
+
|
|
908
|
+
fromJSON(object: any): TransactionActivity {
|
|
909
|
+
return {
|
|
910
|
+
fromAddress: isSet(object.fromAddress)
|
|
911
|
+
? globalThis.String(object.fromAddress)
|
|
912
|
+
: isSet(object.from_address)
|
|
913
|
+
? globalThis.String(object.from_address)
|
|
914
|
+
: "",
|
|
915
|
+
toAddress: isSet(object.toAddress)
|
|
916
|
+
? globalThis.String(object.toAddress)
|
|
917
|
+
: isSet(object.to_address)
|
|
918
|
+
? globalThis.String(object.to_address)
|
|
919
|
+
: "",
|
|
920
|
+
nativeValueRaw: isSet(object.nativeValueRaw)
|
|
921
|
+
? globalThis.String(object.nativeValueRaw)
|
|
922
|
+
: isSet(object.native_value_raw)
|
|
923
|
+
? globalThis.String(object.native_value_raw)
|
|
924
|
+
: "",
|
|
925
|
+
nativeValueFormatted: isSet(object.nativeValueFormatted)
|
|
926
|
+
? globalThis.String(object.nativeValueFormatted)
|
|
927
|
+
: isSet(object.native_value_formatted)
|
|
928
|
+
? globalThis.String(object.native_value_formatted)
|
|
929
|
+
: "",
|
|
930
|
+
activities: globalThis.Array.isArray(object?.activities)
|
|
931
|
+
? object.activities.map((e: any) => Activity.fromJSON(e))
|
|
932
|
+
: [],
|
|
933
|
+
tokens: globalThis.Array.isArray(object?.tokens) ? object.tokens.map((e: any) => TokenInfo.fromJSON(e)) : [],
|
|
934
|
+
nativeValueFiat: isSet(object.nativeValueFiat)
|
|
935
|
+
? FiatValue.fromJSON(object.nativeValueFiat)
|
|
936
|
+
: isSet(object.native_value_fiat)
|
|
937
|
+
? FiatValue.fromJSON(object.native_value_fiat)
|
|
938
|
+
: undefined,
|
|
939
|
+
calldata: isSet(object.calldata) ? CalldataInfo.fromJSON(object.calldata) : undefined,
|
|
940
|
+
eventLogs: globalThis.Array.isArray(object?.eventLogs)
|
|
941
|
+
? object.eventLogs.map((e: any) => EventLog.fromJSON(e))
|
|
942
|
+
: globalThis.Array.isArray(object?.event_logs)
|
|
943
|
+
? object.event_logs.map((e: any) => EventLog.fromJSON(e))
|
|
944
|
+
: [],
|
|
945
|
+
};
|
|
946
|
+
},
|
|
947
|
+
|
|
948
|
+
toJSON(message: TransactionActivity): unknown {
|
|
949
|
+
const obj: any = {};
|
|
950
|
+
if (message.fromAddress !== "") {
|
|
951
|
+
obj.fromAddress = message.fromAddress;
|
|
952
|
+
}
|
|
953
|
+
if (message.toAddress !== "") {
|
|
954
|
+
obj.toAddress = message.toAddress;
|
|
955
|
+
}
|
|
956
|
+
if (message.nativeValueRaw !== "") {
|
|
957
|
+
obj.nativeValueRaw = message.nativeValueRaw;
|
|
958
|
+
}
|
|
959
|
+
if (message.nativeValueFormatted !== "") {
|
|
960
|
+
obj.nativeValueFormatted = message.nativeValueFormatted;
|
|
961
|
+
}
|
|
962
|
+
if (message.activities?.length) {
|
|
963
|
+
obj.activities = message.activities.map((e) => Activity.toJSON(e));
|
|
964
|
+
}
|
|
965
|
+
if (message.tokens?.length) {
|
|
966
|
+
obj.tokens = message.tokens.map((e) => TokenInfo.toJSON(e));
|
|
967
|
+
}
|
|
968
|
+
if (message.nativeValueFiat !== undefined) {
|
|
969
|
+
obj.nativeValueFiat = FiatValue.toJSON(message.nativeValueFiat);
|
|
970
|
+
}
|
|
971
|
+
if (message.calldata !== undefined) {
|
|
972
|
+
obj.calldata = CalldataInfo.toJSON(message.calldata);
|
|
973
|
+
}
|
|
974
|
+
if (message.eventLogs?.length) {
|
|
975
|
+
obj.eventLogs = message.eventLogs.map((e) => EventLog.toJSON(e));
|
|
976
|
+
}
|
|
977
|
+
return obj;
|
|
978
|
+
},
|
|
979
|
+
|
|
980
|
+
create<I extends Exact<DeepPartial<TransactionActivity>, I>>(base?: I): TransactionActivity {
|
|
981
|
+
return TransactionActivity.fromPartial(base ?? ({} as any));
|
|
982
|
+
},
|
|
983
|
+
fromPartial<I extends Exact<DeepPartial<TransactionActivity>, I>>(object: I): TransactionActivity {
|
|
984
|
+
const message = createBaseTransactionActivity();
|
|
985
|
+
message.fromAddress = object.fromAddress ?? "";
|
|
986
|
+
message.toAddress = object.toAddress ?? "";
|
|
987
|
+
message.nativeValueRaw = object.nativeValueRaw ?? "";
|
|
988
|
+
message.nativeValueFormatted = object.nativeValueFormatted ?? "";
|
|
989
|
+
message.activities = object.activities?.map((e) => Activity.fromPartial(e)) || [];
|
|
990
|
+
message.tokens = object.tokens?.map((e) => TokenInfo.fromPartial(e)) || [];
|
|
991
|
+
message.nativeValueFiat = (object.nativeValueFiat !== undefined && object.nativeValueFiat !== null)
|
|
992
|
+
? FiatValue.fromPartial(object.nativeValueFiat)
|
|
993
|
+
: undefined;
|
|
994
|
+
message.calldata = (object.calldata !== undefined && object.calldata !== null)
|
|
995
|
+
? CalldataInfo.fromPartial(object.calldata)
|
|
996
|
+
: undefined;
|
|
997
|
+
message.eventLogs = object.eventLogs?.map((e) => EventLog.fromPartial(e)) || [];
|
|
998
|
+
return message;
|
|
999
|
+
},
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
function createBaseActivity(): Activity {
|
|
1003
|
+
return {
|
|
1004
|
+
type: 0,
|
|
1005
|
+
primaryLogIndex: 0,
|
|
1006
|
+
summary: "",
|
|
1007
|
+
swap: undefined,
|
|
1008
|
+
nftMint: undefined,
|
|
1009
|
+
nftTransfer: undefined,
|
|
1010
|
+
tokenTransfer: undefined,
|
|
1011
|
+
approval: undefined,
|
|
1012
|
+
bridge: undefined,
|
|
1013
|
+
contractInteraction: undefined,
|
|
1014
|
+
children: [],
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
export const Activity: MessageFns<Activity> = {
|
|
1019
|
+
encode(message: Activity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1020
|
+
if (message.type !== 0) {
|
|
1021
|
+
writer.uint32(8).int32(message.type);
|
|
1022
|
+
}
|
|
1023
|
+
if (message.primaryLogIndex !== 0) {
|
|
1024
|
+
writer.uint32(16).uint32(message.primaryLogIndex);
|
|
1025
|
+
}
|
|
1026
|
+
if (message.summary !== "") {
|
|
1027
|
+
writer.uint32(82).string(message.summary);
|
|
1028
|
+
}
|
|
1029
|
+
if (message.swap !== undefined) {
|
|
1030
|
+
SwapActivity.encode(message.swap, writer.uint32(26).fork()).join();
|
|
1031
|
+
}
|
|
1032
|
+
if (message.nftMint !== undefined) {
|
|
1033
|
+
NftMintActivity.encode(message.nftMint, writer.uint32(34).fork()).join();
|
|
1034
|
+
}
|
|
1035
|
+
if (message.nftTransfer !== undefined) {
|
|
1036
|
+
NftTransferActivity.encode(message.nftTransfer, writer.uint32(42).fork()).join();
|
|
1037
|
+
}
|
|
1038
|
+
if (message.tokenTransfer !== undefined) {
|
|
1039
|
+
TokenTransferActivity.encode(message.tokenTransfer, writer.uint32(50).fork()).join();
|
|
1040
|
+
}
|
|
1041
|
+
if (message.approval !== undefined) {
|
|
1042
|
+
ApprovalActivity.encode(message.approval, writer.uint32(58).fork()).join();
|
|
1043
|
+
}
|
|
1044
|
+
if (message.bridge !== undefined) {
|
|
1045
|
+
BridgeActivity.encode(message.bridge, writer.uint32(66).fork()).join();
|
|
1046
|
+
}
|
|
1047
|
+
if (message.contractInteraction !== undefined) {
|
|
1048
|
+
ContractInteractionActivity.encode(message.contractInteraction, writer.uint32(74).fork()).join();
|
|
1049
|
+
}
|
|
1050
|
+
for (const v of message.children) {
|
|
1051
|
+
Activity.encode(v!, writer.uint32(90).fork()).join();
|
|
1052
|
+
}
|
|
1053
|
+
return writer;
|
|
1054
|
+
},
|
|
1055
|
+
|
|
1056
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Activity {
|
|
1057
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1058
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1059
|
+
const message = createBaseActivity();
|
|
1060
|
+
while (reader.pos < end) {
|
|
1061
|
+
const tag = reader.uint32();
|
|
1062
|
+
switch (tag >>> 3) {
|
|
1063
|
+
case 1: {
|
|
1064
|
+
if (tag !== 8) {
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
message.type = reader.int32() as any;
|
|
1069
|
+
continue;
|
|
1070
|
+
}
|
|
1071
|
+
case 2: {
|
|
1072
|
+
if (tag !== 16) {
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
message.primaryLogIndex = reader.uint32();
|
|
1077
|
+
continue;
|
|
1078
|
+
}
|
|
1079
|
+
case 10: {
|
|
1080
|
+
if (tag !== 82) {
|
|
1081
|
+
break;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
message.summary = reader.string();
|
|
1085
|
+
continue;
|
|
1086
|
+
}
|
|
1087
|
+
case 3: {
|
|
1088
|
+
if (tag !== 26) {
|
|
1089
|
+
break;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
message.swap = SwapActivity.decode(reader, reader.uint32());
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
case 4: {
|
|
1096
|
+
if (tag !== 34) {
|
|
1097
|
+
break;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
message.nftMint = NftMintActivity.decode(reader, reader.uint32());
|
|
1101
|
+
continue;
|
|
1102
|
+
}
|
|
1103
|
+
case 5: {
|
|
1104
|
+
if (tag !== 42) {
|
|
1105
|
+
break;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
message.nftTransfer = NftTransferActivity.decode(reader, reader.uint32());
|
|
1109
|
+
continue;
|
|
1110
|
+
}
|
|
1111
|
+
case 6: {
|
|
1112
|
+
if (tag !== 50) {
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
message.tokenTransfer = TokenTransferActivity.decode(reader, reader.uint32());
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
case 7: {
|
|
1120
|
+
if (tag !== 58) {
|
|
1121
|
+
break;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
message.approval = ApprovalActivity.decode(reader, reader.uint32());
|
|
1125
|
+
continue;
|
|
1126
|
+
}
|
|
1127
|
+
case 8: {
|
|
1128
|
+
if (tag !== 66) {
|
|
1129
|
+
break;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
message.bridge = BridgeActivity.decode(reader, reader.uint32());
|
|
1133
|
+
continue;
|
|
1134
|
+
}
|
|
1135
|
+
case 9: {
|
|
1136
|
+
if (tag !== 74) {
|
|
1137
|
+
break;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
message.contractInteraction = ContractInteractionActivity.decode(reader, reader.uint32());
|
|
1141
|
+
continue;
|
|
1142
|
+
}
|
|
1143
|
+
case 11: {
|
|
1144
|
+
if (tag !== 90) {
|
|
1145
|
+
break;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
message.children.push(Activity.decode(reader, reader.uint32()));
|
|
1149
|
+
continue;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
reader.skip(tag & 7);
|
|
1156
|
+
}
|
|
1157
|
+
return message;
|
|
1158
|
+
},
|
|
1159
|
+
|
|
1160
|
+
fromJSON(object: any): Activity {
|
|
1161
|
+
return {
|
|
1162
|
+
type: isSet(object.type) ? activityTypeFromJSON(object.type) : 0,
|
|
1163
|
+
primaryLogIndex: isSet(object.primaryLogIndex)
|
|
1164
|
+
? globalThis.Number(object.primaryLogIndex)
|
|
1165
|
+
: isSet(object.primary_log_index)
|
|
1166
|
+
? globalThis.Number(object.primary_log_index)
|
|
1167
|
+
: 0,
|
|
1168
|
+
summary: isSet(object.summary) ? globalThis.String(object.summary) : "",
|
|
1169
|
+
swap: isSet(object.swap) ? SwapActivity.fromJSON(object.swap) : undefined,
|
|
1170
|
+
nftMint: isSet(object.nftMint)
|
|
1171
|
+
? NftMintActivity.fromJSON(object.nftMint)
|
|
1172
|
+
: isSet(object.nft_mint)
|
|
1173
|
+
? NftMintActivity.fromJSON(object.nft_mint)
|
|
1174
|
+
: undefined,
|
|
1175
|
+
nftTransfer: isSet(object.nftTransfer)
|
|
1176
|
+
? NftTransferActivity.fromJSON(object.nftTransfer)
|
|
1177
|
+
: isSet(object.nft_transfer)
|
|
1178
|
+
? NftTransferActivity.fromJSON(object.nft_transfer)
|
|
1179
|
+
: undefined,
|
|
1180
|
+
tokenTransfer: isSet(object.tokenTransfer)
|
|
1181
|
+
? TokenTransferActivity.fromJSON(object.tokenTransfer)
|
|
1182
|
+
: isSet(object.token_transfer)
|
|
1183
|
+
? TokenTransferActivity.fromJSON(object.token_transfer)
|
|
1184
|
+
: undefined,
|
|
1185
|
+
approval: isSet(object.approval) ? ApprovalActivity.fromJSON(object.approval) : undefined,
|
|
1186
|
+
bridge: isSet(object.bridge) ? BridgeActivity.fromJSON(object.bridge) : undefined,
|
|
1187
|
+
contractInteraction: isSet(object.contractInteraction)
|
|
1188
|
+
? ContractInteractionActivity.fromJSON(object.contractInteraction)
|
|
1189
|
+
: isSet(object.contract_interaction)
|
|
1190
|
+
? ContractInteractionActivity.fromJSON(object.contract_interaction)
|
|
1191
|
+
: undefined,
|
|
1192
|
+
children: globalThis.Array.isArray(object?.children)
|
|
1193
|
+
? object.children.map((e: any) => Activity.fromJSON(e))
|
|
1194
|
+
: [],
|
|
1195
|
+
};
|
|
1196
|
+
},
|
|
1197
|
+
|
|
1198
|
+
toJSON(message: Activity): unknown {
|
|
1199
|
+
const obj: any = {};
|
|
1200
|
+
if (message.type !== 0) {
|
|
1201
|
+
obj.type = activityTypeToJSON(message.type);
|
|
1202
|
+
}
|
|
1203
|
+
if (message.primaryLogIndex !== 0) {
|
|
1204
|
+
obj.primaryLogIndex = Math.round(message.primaryLogIndex);
|
|
1205
|
+
}
|
|
1206
|
+
if (message.summary !== "") {
|
|
1207
|
+
obj.summary = message.summary;
|
|
1208
|
+
}
|
|
1209
|
+
if (message.swap !== undefined) {
|
|
1210
|
+
obj.swap = SwapActivity.toJSON(message.swap);
|
|
1211
|
+
}
|
|
1212
|
+
if (message.nftMint !== undefined) {
|
|
1213
|
+
obj.nftMint = NftMintActivity.toJSON(message.nftMint);
|
|
1214
|
+
}
|
|
1215
|
+
if (message.nftTransfer !== undefined) {
|
|
1216
|
+
obj.nftTransfer = NftTransferActivity.toJSON(message.nftTransfer);
|
|
1217
|
+
}
|
|
1218
|
+
if (message.tokenTransfer !== undefined) {
|
|
1219
|
+
obj.tokenTransfer = TokenTransferActivity.toJSON(message.tokenTransfer);
|
|
1220
|
+
}
|
|
1221
|
+
if (message.approval !== undefined) {
|
|
1222
|
+
obj.approval = ApprovalActivity.toJSON(message.approval);
|
|
1223
|
+
}
|
|
1224
|
+
if (message.bridge !== undefined) {
|
|
1225
|
+
obj.bridge = BridgeActivity.toJSON(message.bridge);
|
|
1226
|
+
}
|
|
1227
|
+
if (message.contractInteraction !== undefined) {
|
|
1228
|
+
obj.contractInteraction = ContractInteractionActivity.toJSON(message.contractInteraction);
|
|
1229
|
+
}
|
|
1230
|
+
if (message.children?.length) {
|
|
1231
|
+
obj.children = message.children.map((e) => Activity.toJSON(e));
|
|
1232
|
+
}
|
|
1233
|
+
return obj;
|
|
1234
|
+
},
|
|
1235
|
+
|
|
1236
|
+
create<I extends Exact<DeepPartial<Activity>, I>>(base?: I): Activity {
|
|
1237
|
+
return Activity.fromPartial(base ?? ({} as any));
|
|
1238
|
+
},
|
|
1239
|
+
fromPartial<I extends Exact<DeepPartial<Activity>, I>>(object: I): Activity {
|
|
1240
|
+
const message = createBaseActivity();
|
|
1241
|
+
message.type = object.type ?? 0;
|
|
1242
|
+
message.primaryLogIndex = object.primaryLogIndex ?? 0;
|
|
1243
|
+
message.summary = object.summary ?? "";
|
|
1244
|
+
message.swap = (object.swap !== undefined && object.swap !== null)
|
|
1245
|
+
? SwapActivity.fromPartial(object.swap)
|
|
1246
|
+
: undefined;
|
|
1247
|
+
message.nftMint = (object.nftMint !== undefined && object.nftMint !== null)
|
|
1248
|
+
? NftMintActivity.fromPartial(object.nftMint)
|
|
1249
|
+
: undefined;
|
|
1250
|
+
message.nftTransfer = (object.nftTransfer !== undefined && object.nftTransfer !== null)
|
|
1251
|
+
? NftTransferActivity.fromPartial(object.nftTransfer)
|
|
1252
|
+
: undefined;
|
|
1253
|
+
message.tokenTransfer = (object.tokenTransfer !== undefined && object.tokenTransfer !== null)
|
|
1254
|
+
? TokenTransferActivity.fromPartial(object.tokenTransfer)
|
|
1255
|
+
: undefined;
|
|
1256
|
+
message.approval = (object.approval !== undefined && object.approval !== null)
|
|
1257
|
+
? ApprovalActivity.fromPartial(object.approval)
|
|
1258
|
+
: undefined;
|
|
1259
|
+
message.bridge = (object.bridge !== undefined && object.bridge !== null)
|
|
1260
|
+
? BridgeActivity.fromPartial(object.bridge)
|
|
1261
|
+
: undefined;
|
|
1262
|
+
message.contractInteraction = (object.contractInteraction !== undefined && object.contractInteraction !== null)
|
|
1263
|
+
? ContractInteractionActivity.fromPartial(object.contractInteraction)
|
|
1264
|
+
: undefined;
|
|
1265
|
+
message.children = object.children?.map((e) => Activity.fromPartial(e)) || [];
|
|
1266
|
+
return message;
|
|
1267
|
+
},
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
function createBaseSwapActivity(): SwapActivity {
|
|
1271
|
+
return {
|
|
1272
|
+
protocol: "",
|
|
1273
|
+
inputTokenAddress: "",
|
|
1274
|
+
inputAmountRaw: "",
|
|
1275
|
+
inputAmountFormatted: "",
|
|
1276
|
+
outputTokenAddress: "",
|
|
1277
|
+
outputAmountRaw: "",
|
|
1278
|
+
outputAmountFormatted: "",
|
|
1279
|
+
sender: "",
|
|
1280
|
+
recipient: "",
|
|
1281
|
+
inputFiatValue: undefined,
|
|
1282
|
+
outputFiatValue: undefined,
|
|
1283
|
+
};
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
export const SwapActivity: MessageFns<SwapActivity> = {
|
|
1287
|
+
encode(message: SwapActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1288
|
+
if (message.protocol !== "") {
|
|
1289
|
+
writer.uint32(10).string(message.protocol);
|
|
1290
|
+
}
|
|
1291
|
+
if (message.inputTokenAddress !== "") {
|
|
1292
|
+
writer.uint32(18).string(message.inputTokenAddress);
|
|
1293
|
+
}
|
|
1294
|
+
if (message.inputAmountRaw !== "") {
|
|
1295
|
+
writer.uint32(26).string(message.inputAmountRaw);
|
|
1296
|
+
}
|
|
1297
|
+
if (message.inputAmountFormatted !== "") {
|
|
1298
|
+
writer.uint32(34).string(message.inputAmountFormatted);
|
|
1299
|
+
}
|
|
1300
|
+
if (message.outputTokenAddress !== "") {
|
|
1301
|
+
writer.uint32(42).string(message.outputTokenAddress);
|
|
1302
|
+
}
|
|
1303
|
+
if (message.outputAmountRaw !== "") {
|
|
1304
|
+
writer.uint32(50).string(message.outputAmountRaw);
|
|
1305
|
+
}
|
|
1306
|
+
if (message.outputAmountFormatted !== "") {
|
|
1307
|
+
writer.uint32(58).string(message.outputAmountFormatted);
|
|
1308
|
+
}
|
|
1309
|
+
if (message.sender !== "") {
|
|
1310
|
+
writer.uint32(66).string(message.sender);
|
|
1311
|
+
}
|
|
1312
|
+
if (message.recipient !== "") {
|
|
1313
|
+
writer.uint32(74).string(message.recipient);
|
|
1314
|
+
}
|
|
1315
|
+
if (message.inputFiatValue !== undefined) {
|
|
1316
|
+
FiatValue.encode(message.inputFiatValue, writer.uint32(82).fork()).join();
|
|
1317
|
+
}
|
|
1318
|
+
if (message.outputFiatValue !== undefined) {
|
|
1319
|
+
FiatValue.encode(message.outputFiatValue, writer.uint32(90).fork()).join();
|
|
1320
|
+
}
|
|
1321
|
+
return writer;
|
|
1322
|
+
},
|
|
1323
|
+
|
|
1324
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SwapActivity {
|
|
1325
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1326
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1327
|
+
const message = createBaseSwapActivity();
|
|
1328
|
+
while (reader.pos < end) {
|
|
1329
|
+
const tag = reader.uint32();
|
|
1330
|
+
switch (tag >>> 3) {
|
|
1331
|
+
case 1: {
|
|
1332
|
+
if (tag !== 10) {
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
message.protocol = reader.string();
|
|
1337
|
+
continue;
|
|
1338
|
+
}
|
|
1339
|
+
case 2: {
|
|
1340
|
+
if (tag !== 18) {
|
|
1341
|
+
break;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
message.inputTokenAddress = reader.string();
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
case 3: {
|
|
1348
|
+
if (tag !== 26) {
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
message.inputAmountRaw = reader.string();
|
|
1353
|
+
continue;
|
|
1354
|
+
}
|
|
1355
|
+
case 4: {
|
|
1356
|
+
if (tag !== 34) {
|
|
1357
|
+
break;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
message.inputAmountFormatted = reader.string();
|
|
1361
|
+
continue;
|
|
1362
|
+
}
|
|
1363
|
+
case 5: {
|
|
1364
|
+
if (tag !== 42) {
|
|
1365
|
+
break;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
message.outputTokenAddress = reader.string();
|
|
1369
|
+
continue;
|
|
1370
|
+
}
|
|
1371
|
+
case 6: {
|
|
1372
|
+
if (tag !== 50) {
|
|
1373
|
+
break;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
message.outputAmountRaw = reader.string();
|
|
1377
|
+
continue;
|
|
1378
|
+
}
|
|
1379
|
+
case 7: {
|
|
1380
|
+
if (tag !== 58) {
|
|
1381
|
+
break;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
message.outputAmountFormatted = reader.string();
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
case 8: {
|
|
1388
|
+
if (tag !== 66) {
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
message.sender = reader.string();
|
|
1393
|
+
continue;
|
|
1394
|
+
}
|
|
1395
|
+
case 9: {
|
|
1396
|
+
if (tag !== 74) {
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
message.recipient = reader.string();
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
case 10: {
|
|
1404
|
+
if (tag !== 82) {
|
|
1405
|
+
break;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
message.inputFiatValue = FiatValue.decode(reader, reader.uint32());
|
|
1409
|
+
continue;
|
|
1410
|
+
}
|
|
1411
|
+
case 11: {
|
|
1412
|
+
if (tag !== 90) {
|
|
1413
|
+
break;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
message.outputFiatValue = FiatValue.decode(reader, reader.uint32());
|
|
1417
|
+
continue;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1421
|
+
break;
|
|
1422
|
+
}
|
|
1423
|
+
reader.skip(tag & 7);
|
|
1424
|
+
}
|
|
1425
|
+
return message;
|
|
1426
|
+
},
|
|
1427
|
+
|
|
1428
|
+
fromJSON(object: any): SwapActivity {
|
|
1429
|
+
return {
|
|
1430
|
+
protocol: isSet(object.protocol) ? globalThis.String(object.protocol) : "",
|
|
1431
|
+
inputTokenAddress: isSet(object.inputTokenAddress)
|
|
1432
|
+
? globalThis.String(object.inputTokenAddress)
|
|
1433
|
+
: isSet(object.input_token_address)
|
|
1434
|
+
? globalThis.String(object.input_token_address)
|
|
1435
|
+
: "",
|
|
1436
|
+
inputAmountRaw: isSet(object.inputAmountRaw)
|
|
1437
|
+
? globalThis.String(object.inputAmountRaw)
|
|
1438
|
+
: isSet(object.input_amount_raw)
|
|
1439
|
+
? globalThis.String(object.input_amount_raw)
|
|
1440
|
+
: "",
|
|
1441
|
+
inputAmountFormatted: isSet(object.inputAmountFormatted)
|
|
1442
|
+
? globalThis.String(object.inputAmountFormatted)
|
|
1443
|
+
: isSet(object.input_amount_formatted)
|
|
1444
|
+
? globalThis.String(object.input_amount_formatted)
|
|
1445
|
+
: "",
|
|
1446
|
+
outputTokenAddress: isSet(object.outputTokenAddress)
|
|
1447
|
+
? globalThis.String(object.outputTokenAddress)
|
|
1448
|
+
: isSet(object.output_token_address)
|
|
1449
|
+
? globalThis.String(object.output_token_address)
|
|
1450
|
+
: "",
|
|
1451
|
+
outputAmountRaw: isSet(object.outputAmountRaw)
|
|
1452
|
+
? globalThis.String(object.outputAmountRaw)
|
|
1453
|
+
: isSet(object.output_amount_raw)
|
|
1454
|
+
? globalThis.String(object.output_amount_raw)
|
|
1455
|
+
: "",
|
|
1456
|
+
outputAmountFormatted: isSet(object.outputAmountFormatted)
|
|
1457
|
+
? globalThis.String(object.outputAmountFormatted)
|
|
1458
|
+
: isSet(object.output_amount_formatted)
|
|
1459
|
+
? globalThis.String(object.output_amount_formatted)
|
|
1460
|
+
: "",
|
|
1461
|
+
sender: isSet(object.sender) ? globalThis.String(object.sender) : "",
|
|
1462
|
+
recipient: isSet(object.recipient) ? globalThis.String(object.recipient) : "",
|
|
1463
|
+
inputFiatValue: isSet(object.inputFiatValue)
|
|
1464
|
+
? FiatValue.fromJSON(object.inputFiatValue)
|
|
1465
|
+
: isSet(object.input_fiat_value)
|
|
1466
|
+
? FiatValue.fromJSON(object.input_fiat_value)
|
|
1467
|
+
: undefined,
|
|
1468
|
+
outputFiatValue: isSet(object.outputFiatValue)
|
|
1469
|
+
? FiatValue.fromJSON(object.outputFiatValue)
|
|
1470
|
+
: isSet(object.output_fiat_value)
|
|
1471
|
+
? FiatValue.fromJSON(object.output_fiat_value)
|
|
1472
|
+
: undefined,
|
|
1473
|
+
};
|
|
1474
|
+
},
|
|
1475
|
+
|
|
1476
|
+
toJSON(message: SwapActivity): unknown {
|
|
1477
|
+
const obj: any = {};
|
|
1478
|
+
if (message.protocol !== "") {
|
|
1479
|
+
obj.protocol = message.protocol;
|
|
1480
|
+
}
|
|
1481
|
+
if (message.inputTokenAddress !== "") {
|
|
1482
|
+
obj.inputTokenAddress = message.inputTokenAddress;
|
|
1483
|
+
}
|
|
1484
|
+
if (message.inputAmountRaw !== "") {
|
|
1485
|
+
obj.inputAmountRaw = message.inputAmountRaw;
|
|
1486
|
+
}
|
|
1487
|
+
if (message.inputAmountFormatted !== "") {
|
|
1488
|
+
obj.inputAmountFormatted = message.inputAmountFormatted;
|
|
1489
|
+
}
|
|
1490
|
+
if (message.outputTokenAddress !== "") {
|
|
1491
|
+
obj.outputTokenAddress = message.outputTokenAddress;
|
|
1492
|
+
}
|
|
1493
|
+
if (message.outputAmountRaw !== "") {
|
|
1494
|
+
obj.outputAmountRaw = message.outputAmountRaw;
|
|
1495
|
+
}
|
|
1496
|
+
if (message.outputAmountFormatted !== "") {
|
|
1497
|
+
obj.outputAmountFormatted = message.outputAmountFormatted;
|
|
1498
|
+
}
|
|
1499
|
+
if (message.sender !== "") {
|
|
1500
|
+
obj.sender = message.sender;
|
|
1501
|
+
}
|
|
1502
|
+
if (message.recipient !== "") {
|
|
1503
|
+
obj.recipient = message.recipient;
|
|
1504
|
+
}
|
|
1505
|
+
if (message.inputFiatValue !== undefined) {
|
|
1506
|
+
obj.inputFiatValue = FiatValue.toJSON(message.inputFiatValue);
|
|
1507
|
+
}
|
|
1508
|
+
if (message.outputFiatValue !== undefined) {
|
|
1509
|
+
obj.outputFiatValue = FiatValue.toJSON(message.outputFiatValue);
|
|
1510
|
+
}
|
|
1511
|
+
return obj;
|
|
1512
|
+
},
|
|
1513
|
+
|
|
1514
|
+
create<I extends Exact<DeepPartial<SwapActivity>, I>>(base?: I): SwapActivity {
|
|
1515
|
+
return SwapActivity.fromPartial(base ?? ({} as any));
|
|
1516
|
+
},
|
|
1517
|
+
fromPartial<I extends Exact<DeepPartial<SwapActivity>, I>>(object: I): SwapActivity {
|
|
1518
|
+
const message = createBaseSwapActivity();
|
|
1519
|
+
message.protocol = object.protocol ?? "";
|
|
1520
|
+
message.inputTokenAddress = object.inputTokenAddress ?? "";
|
|
1521
|
+
message.inputAmountRaw = object.inputAmountRaw ?? "";
|
|
1522
|
+
message.inputAmountFormatted = object.inputAmountFormatted ?? "";
|
|
1523
|
+
message.outputTokenAddress = object.outputTokenAddress ?? "";
|
|
1524
|
+
message.outputAmountRaw = object.outputAmountRaw ?? "";
|
|
1525
|
+
message.outputAmountFormatted = object.outputAmountFormatted ?? "";
|
|
1526
|
+
message.sender = object.sender ?? "";
|
|
1527
|
+
message.recipient = object.recipient ?? "";
|
|
1528
|
+
message.inputFiatValue = (object.inputFiatValue !== undefined && object.inputFiatValue !== null)
|
|
1529
|
+
? FiatValue.fromPartial(object.inputFiatValue)
|
|
1530
|
+
: undefined;
|
|
1531
|
+
message.outputFiatValue = (object.outputFiatValue !== undefined && object.outputFiatValue !== null)
|
|
1532
|
+
? FiatValue.fromPartial(object.outputFiatValue)
|
|
1533
|
+
: undefined;
|
|
1534
|
+
return message;
|
|
1535
|
+
},
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1538
|
+
function createBaseNftMintActivity(): NftMintActivity {
|
|
1539
|
+
return { collectionAddress: "", collectionName: "", tokenIds: [], quantity: 0, recipient: "", standard: 0 };
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
export const NftMintActivity: MessageFns<NftMintActivity> = {
|
|
1543
|
+
encode(message: NftMintActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1544
|
+
if (message.collectionAddress !== "") {
|
|
1545
|
+
writer.uint32(10).string(message.collectionAddress);
|
|
1546
|
+
}
|
|
1547
|
+
if (message.collectionName !== "") {
|
|
1548
|
+
writer.uint32(18).string(message.collectionName);
|
|
1549
|
+
}
|
|
1550
|
+
for (const v of message.tokenIds) {
|
|
1551
|
+
writer.uint32(26).string(v!);
|
|
1552
|
+
}
|
|
1553
|
+
if (message.quantity !== 0) {
|
|
1554
|
+
writer.uint32(32).uint32(message.quantity);
|
|
1555
|
+
}
|
|
1556
|
+
if (message.recipient !== "") {
|
|
1557
|
+
writer.uint32(42).string(message.recipient);
|
|
1558
|
+
}
|
|
1559
|
+
if (message.standard !== 0) {
|
|
1560
|
+
writer.uint32(48).int32(message.standard);
|
|
1561
|
+
}
|
|
1562
|
+
return writer;
|
|
1563
|
+
},
|
|
1564
|
+
|
|
1565
|
+
decode(input: BinaryReader | Uint8Array, length?: number): NftMintActivity {
|
|
1566
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1567
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1568
|
+
const message = createBaseNftMintActivity();
|
|
1569
|
+
while (reader.pos < end) {
|
|
1570
|
+
const tag = reader.uint32();
|
|
1571
|
+
switch (tag >>> 3) {
|
|
1572
|
+
case 1: {
|
|
1573
|
+
if (tag !== 10) {
|
|
1574
|
+
break;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
message.collectionAddress = reader.string();
|
|
1578
|
+
continue;
|
|
1579
|
+
}
|
|
1580
|
+
case 2: {
|
|
1581
|
+
if (tag !== 18) {
|
|
1582
|
+
break;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
message.collectionName = reader.string();
|
|
1586
|
+
continue;
|
|
1587
|
+
}
|
|
1588
|
+
case 3: {
|
|
1589
|
+
if (tag !== 26) {
|
|
1590
|
+
break;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
message.tokenIds.push(reader.string());
|
|
1594
|
+
continue;
|
|
1595
|
+
}
|
|
1596
|
+
case 4: {
|
|
1597
|
+
if (tag !== 32) {
|
|
1598
|
+
break;
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
message.quantity = reader.uint32();
|
|
1602
|
+
continue;
|
|
1603
|
+
}
|
|
1604
|
+
case 5: {
|
|
1605
|
+
if (tag !== 42) {
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
message.recipient = reader.string();
|
|
1610
|
+
continue;
|
|
1611
|
+
}
|
|
1612
|
+
case 6: {
|
|
1613
|
+
if (tag !== 48) {
|
|
1614
|
+
break;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
message.standard = reader.int32() as any;
|
|
1618
|
+
continue;
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1622
|
+
break;
|
|
1623
|
+
}
|
|
1624
|
+
reader.skip(tag & 7);
|
|
1625
|
+
}
|
|
1626
|
+
return message;
|
|
1627
|
+
},
|
|
1628
|
+
|
|
1629
|
+
fromJSON(object: any): NftMintActivity {
|
|
1630
|
+
return {
|
|
1631
|
+
collectionAddress: isSet(object.collectionAddress)
|
|
1632
|
+
? globalThis.String(object.collectionAddress)
|
|
1633
|
+
: isSet(object.collection_address)
|
|
1634
|
+
? globalThis.String(object.collection_address)
|
|
1635
|
+
: "",
|
|
1636
|
+
collectionName: isSet(object.collectionName)
|
|
1637
|
+
? globalThis.String(object.collectionName)
|
|
1638
|
+
: isSet(object.collection_name)
|
|
1639
|
+
? globalThis.String(object.collection_name)
|
|
1640
|
+
: "",
|
|
1641
|
+
tokenIds: globalThis.Array.isArray(object?.tokenIds)
|
|
1642
|
+
? object.tokenIds.map((e: any) => globalThis.String(e))
|
|
1643
|
+
: globalThis.Array.isArray(object?.token_ids)
|
|
1644
|
+
? object.token_ids.map((e: any) => globalThis.String(e))
|
|
1645
|
+
: [],
|
|
1646
|
+
quantity: isSet(object.quantity) ? globalThis.Number(object.quantity) : 0,
|
|
1647
|
+
recipient: isSet(object.recipient) ? globalThis.String(object.recipient) : "",
|
|
1648
|
+
standard: isSet(object.standard) ? nftStandardFromJSON(object.standard) : 0,
|
|
1649
|
+
};
|
|
1650
|
+
},
|
|
1651
|
+
|
|
1652
|
+
toJSON(message: NftMintActivity): unknown {
|
|
1653
|
+
const obj: any = {};
|
|
1654
|
+
if (message.collectionAddress !== "") {
|
|
1655
|
+
obj.collectionAddress = message.collectionAddress;
|
|
1656
|
+
}
|
|
1657
|
+
if (message.collectionName !== "") {
|
|
1658
|
+
obj.collectionName = message.collectionName;
|
|
1659
|
+
}
|
|
1660
|
+
if (message.tokenIds?.length) {
|
|
1661
|
+
obj.tokenIds = message.tokenIds;
|
|
1662
|
+
}
|
|
1663
|
+
if (message.quantity !== 0) {
|
|
1664
|
+
obj.quantity = Math.round(message.quantity);
|
|
1665
|
+
}
|
|
1666
|
+
if (message.recipient !== "") {
|
|
1667
|
+
obj.recipient = message.recipient;
|
|
1668
|
+
}
|
|
1669
|
+
if (message.standard !== 0) {
|
|
1670
|
+
obj.standard = nftStandardToJSON(message.standard);
|
|
1671
|
+
}
|
|
1672
|
+
return obj;
|
|
1673
|
+
},
|
|
1674
|
+
|
|
1675
|
+
create<I extends Exact<DeepPartial<NftMintActivity>, I>>(base?: I): NftMintActivity {
|
|
1676
|
+
return NftMintActivity.fromPartial(base ?? ({} as any));
|
|
1677
|
+
},
|
|
1678
|
+
fromPartial<I extends Exact<DeepPartial<NftMintActivity>, I>>(object: I): NftMintActivity {
|
|
1679
|
+
const message = createBaseNftMintActivity();
|
|
1680
|
+
message.collectionAddress = object.collectionAddress ?? "";
|
|
1681
|
+
message.collectionName = object.collectionName ?? "";
|
|
1682
|
+
message.tokenIds = object.tokenIds?.map((e) => e) || [];
|
|
1683
|
+
message.quantity = object.quantity ?? 0;
|
|
1684
|
+
message.recipient = object.recipient ?? "";
|
|
1685
|
+
message.standard = object.standard ?? 0;
|
|
1686
|
+
return message;
|
|
1687
|
+
},
|
|
1688
|
+
};
|
|
1689
|
+
|
|
1690
|
+
function createBaseNftTransferActivity(): NftTransferActivity {
|
|
1691
|
+
return {
|
|
1692
|
+
collectionAddress: "",
|
|
1693
|
+
collectionName: "",
|
|
1694
|
+
tokenIds: [],
|
|
1695
|
+
quantity: 0,
|
|
1696
|
+
fromAddress: "",
|
|
1697
|
+
toAddress: "",
|
|
1698
|
+
standard: 0,
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
export const NftTransferActivity: MessageFns<NftTransferActivity> = {
|
|
1703
|
+
encode(message: NftTransferActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1704
|
+
if (message.collectionAddress !== "") {
|
|
1705
|
+
writer.uint32(10).string(message.collectionAddress);
|
|
1706
|
+
}
|
|
1707
|
+
if (message.collectionName !== "") {
|
|
1708
|
+
writer.uint32(18).string(message.collectionName);
|
|
1709
|
+
}
|
|
1710
|
+
for (const v of message.tokenIds) {
|
|
1711
|
+
writer.uint32(26).string(v!);
|
|
1712
|
+
}
|
|
1713
|
+
if (message.quantity !== 0) {
|
|
1714
|
+
writer.uint32(32).uint32(message.quantity);
|
|
1715
|
+
}
|
|
1716
|
+
if (message.fromAddress !== "") {
|
|
1717
|
+
writer.uint32(42).string(message.fromAddress);
|
|
1718
|
+
}
|
|
1719
|
+
if (message.toAddress !== "") {
|
|
1720
|
+
writer.uint32(50).string(message.toAddress);
|
|
1721
|
+
}
|
|
1722
|
+
if (message.standard !== 0) {
|
|
1723
|
+
writer.uint32(56).int32(message.standard);
|
|
1724
|
+
}
|
|
1725
|
+
return writer;
|
|
1726
|
+
},
|
|
1727
|
+
|
|
1728
|
+
decode(input: BinaryReader | Uint8Array, length?: number): NftTransferActivity {
|
|
1729
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1730
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1731
|
+
const message = createBaseNftTransferActivity();
|
|
1732
|
+
while (reader.pos < end) {
|
|
1733
|
+
const tag = reader.uint32();
|
|
1734
|
+
switch (tag >>> 3) {
|
|
1735
|
+
case 1: {
|
|
1736
|
+
if (tag !== 10) {
|
|
1737
|
+
break;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
message.collectionAddress = reader.string();
|
|
1741
|
+
continue;
|
|
1742
|
+
}
|
|
1743
|
+
case 2: {
|
|
1744
|
+
if (tag !== 18) {
|
|
1745
|
+
break;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
message.collectionName = reader.string();
|
|
1749
|
+
continue;
|
|
1750
|
+
}
|
|
1751
|
+
case 3: {
|
|
1752
|
+
if (tag !== 26) {
|
|
1753
|
+
break;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
message.tokenIds.push(reader.string());
|
|
1757
|
+
continue;
|
|
1758
|
+
}
|
|
1759
|
+
case 4: {
|
|
1760
|
+
if (tag !== 32) {
|
|
1761
|
+
break;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
message.quantity = reader.uint32();
|
|
1765
|
+
continue;
|
|
1766
|
+
}
|
|
1767
|
+
case 5: {
|
|
1768
|
+
if (tag !== 42) {
|
|
1769
|
+
break;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
message.fromAddress = reader.string();
|
|
1773
|
+
continue;
|
|
1774
|
+
}
|
|
1775
|
+
case 6: {
|
|
1776
|
+
if (tag !== 50) {
|
|
1777
|
+
break;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
message.toAddress = reader.string();
|
|
1781
|
+
continue;
|
|
1782
|
+
}
|
|
1783
|
+
case 7: {
|
|
1784
|
+
if (tag !== 56) {
|
|
1785
|
+
break;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
message.standard = reader.int32() as any;
|
|
1789
|
+
continue;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1793
|
+
break;
|
|
1794
|
+
}
|
|
1795
|
+
reader.skip(tag & 7);
|
|
1796
|
+
}
|
|
1797
|
+
return message;
|
|
1798
|
+
},
|
|
1799
|
+
|
|
1800
|
+
fromJSON(object: any): NftTransferActivity {
|
|
1801
|
+
return {
|
|
1802
|
+
collectionAddress: isSet(object.collectionAddress)
|
|
1803
|
+
? globalThis.String(object.collectionAddress)
|
|
1804
|
+
: isSet(object.collection_address)
|
|
1805
|
+
? globalThis.String(object.collection_address)
|
|
1806
|
+
: "",
|
|
1807
|
+
collectionName: isSet(object.collectionName)
|
|
1808
|
+
? globalThis.String(object.collectionName)
|
|
1809
|
+
: isSet(object.collection_name)
|
|
1810
|
+
? globalThis.String(object.collection_name)
|
|
1811
|
+
: "",
|
|
1812
|
+
tokenIds: globalThis.Array.isArray(object?.tokenIds)
|
|
1813
|
+
? object.tokenIds.map((e: any) => globalThis.String(e))
|
|
1814
|
+
: globalThis.Array.isArray(object?.token_ids)
|
|
1815
|
+
? object.token_ids.map((e: any) => globalThis.String(e))
|
|
1816
|
+
: [],
|
|
1817
|
+
quantity: isSet(object.quantity) ? globalThis.Number(object.quantity) : 0,
|
|
1818
|
+
fromAddress: isSet(object.fromAddress)
|
|
1819
|
+
? globalThis.String(object.fromAddress)
|
|
1820
|
+
: isSet(object.from_address)
|
|
1821
|
+
? globalThis.String(object.from_address)
|
|
1822
|
+
: "",
|
|
1823
|
+
toAddress: isSet(object.toAddress)
|
|
1824
|
+
? globalThis.String(object.toAddress)
|
|
1825
|
+
: isSet(object.to_address)
|
|
1826
|
+
? globalThis.String(object.to_address)
|
|
1827
|
+
: "",
|
|
1828
|
+
standard: isSet(object.standard) ? nftStandardFromJSON(object.standard) : 0,
|
|
1829
|
+
};
|
|
1830
|
+
},
|
|
1831
|
+
|
|
1832
|
+
toJSON(message: NftTransferActivity): unknown {
|
|
1833
|
+
const obj: any = {};
|
|
1834
|
+
if (message.collectionAddress !== "") {
|
|
1835
|
+
obj.collectionAddress = message.collectionAddress;
|
|
1836
|
+
}
|
|
1837
|
+
if (message.collectionName !== "") {
|
|
1838
|
+
obj.collectionName = message.collectionName;
|
|
1839
|
+
}
|
|
1840
|
+
if (message.tokenIds?.length) {
|
|
1841
|
+
obj.tokenIds = message.tokenIds;
|
|
1842
|
+
}
|
|
1843
|
+
if (message.quantity !== 0) {
|
|
1844
|
+
obj.quantity = Math.round(message.quantity);
|
|
1845
|
+
}
|
|
1846
|
+
if (message.fromAddress !== "") {
|
|
1847
|
+
obj.fromAddress = message.fromAddress;
|
|
1848
|
+
}
|
|
1849
|
+
if (message.toAddress !== "") {
|
|
1850
|
+
obj.toAddress = message.toAddress;
|
|
1851
|
+
}
|
|
1852
|
+
if (message.standard !== 0) {
|
|
1853
|
+
obj.standard = nftStandardToJSON(message.standard);
|
|
1854
|
+
}
|
|
1855
|
+
return obj;
|
|
1856
|
+
},
|
|
1857
|
+
|
|
1858
|
+
create<I extends Exact<DeepPartial<NftTransferActivity>, I>>(base?: I): NftTransferActivity {
|
|
1859
|
+
return NftTransferActivity.fromPartial(base ?? ({} as any));
|
|
1860
|
+
},
|
|
1861
|
+
fromPartial<I extends Exact<DeepPartial<NftTransferActivity>, I>>(object: I): NftTransferActivity {
|
|
1862
|
+
const message = createBaseNftTransferActivity();
|
|
1863
|
+
message.collectionAddress = object.collectionAddress ?? "";
|
|
1864
|
+
message.collectionName = object.collectionName ?? "";
|
|
1865
|
+
message.tokenIds = object.tokenIds?.map((e) => e) || [];
|
|
1866
|
+
message.quantity = object.quantity ?? 0;
|
|
1867
|
+
message.fromAddress = object.fromAddress ?? "";
|
|
1868
|
+
message.toAddress = object.toAddress ?? "";
|
|
1869
|
+
message.standard = object.standard ?? 0;
|
|
1870
|
+
return message;
|
|
1871
|
+
},
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
function createBaseTokenTransferActivity(): TokenTransferActivity {
|
|
1875
|
+
return { tokenAddress: "", amountRaw: "", amountFormatted: "", fromAddress: "", toAddress: "", fiatValue: undefined };
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
export const TokenTransferActivity: MessageFns<TokenTransferActivity> = {
|
|
1879
|
+
encode(message: TokenTransferActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1880
|
+
if (message.tokenAddress !== "") {
|
|
1881
|
+
writer.uint32(10).string(message.tokenAddress);
|
|
1882
|
+
}
|
|
1883
|
+
if (message.amountRaw !== "") {
|
|
1884
|
+
writer.uint32(18).string(message.amountRaw);
|
|
1885
|
+
}
|
|
1886
|
+
if (message.amountFormatted !== "") {
|
|
1887
|
+
writer.uint32(26).string(message.amountFormatted);
|
|
1888
|
+
}
|
|
1889
|
+
if (message.fromAddress !== "") {
|
|
1890
|
+
writer.uint32(34).string(message.fromAddress);
|
|
1891
|
+
}
|
|
1892
|
+
if (message.toAddress !== "") {
|
|
1893
|
+
writer.uint32(42).string(message.toAddress);
|
|
1894
|
+
}
|
|
1895
|
+
if (message.fiatValue !== undefined) {
|
|
1896
|
+
FiatValue.encode(message.fiatValue, writer.uint32(50).fork()).join();
|
|
1897
|
+
}
|
|
1898
|
+
return writer;
|
|
1899
|
+
},
|
|
1900
|
+
|
|
1901
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TokenTransferActivity {
|
|
1902
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1903
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1904
|
+
const message = createBaseTokenTransferActivity();
|
|
1905
|
+
while (reader.pos < end) {
|
|
1906
|
+
const tag = reader.uint32();
|
|
1907
|
+
switch (tag >>> 3) {
|
|
1908
|
+
case 1: {
|
|
1909
|
+
if (tag !== 10) {
|
|
1910
|
+
break;
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
message.tokenAddress = reader.string();
|
|
1914
|
+
continue;
|
|
1915
|
+
}
|
|
1916
|
+
case 2: {
|
|
1917
|
+
if (tag !== 18) {
|
|
1918
|
+
break;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
message.amountRaw = reader.string();
|
|
1922
|
+
continue;
|
|
1923
|
+
}
|
|
1924
|
+
case 3: {
|
|
1925
|
+
if (tag !== 26) {
|
|
1926
|
+
break;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
message.amountFormatted = reader.string();
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1932
|
+
case 4: {
|
|
1933
|
+
if (tag !== 34) {
|
|
1934
|
+
break;
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
message.fromAddress = reader.string();
|
|
1938
|
+
continue;
|
|
1939
|
+
}
|
|
1940
|
+
case 5: {
|
|
1941
|
+
if (tag !== 42) {
|
|
1942
|
+
break;
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
message.toAddress = reader.string();
|
|
1946
|
+
continue;
|
|
1947
|
+
}
|
|
1948
|
+
case 6: {
|
|
1949
|
+
if (tag !== 50) {
|
|
1950
|
+
break;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
message.fiatValue = FiatValue.decode(reader, reader.uint32());
|
|
1954
|
+
continue;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1958
|
+
break;
|
|
1959
|
+
}
|
|
1960
|
+
reader.skip(tag & 7);
|
|
1961
|
+
}
|
|
1962
|
+
return message;
|
|
1963
|
+
},
|
|
1964
|
+
|
|
1965
|
+
fromJSON(object: any): TokenTransferActivity {
|
|
1966
|
+
return {
|
|
1967
|
+
tokenAddress: isSet(object.tokenAddress)
|
|
1968
|
+
? globalThis.String(object.tokenAddress)
|
|
1969
|
+
: isSet(object.token_address)
|
|
1970
|
+
? globalThis.String(object.token_address)
|
|
1971
|
+
: "",
|
|
1972
|
+
amountRaw: isSet(object.amountRaw)
|
|
1973
|
+
? globalThis.String(object.amountRaw)
|
|
1974
|
+
: isSet(object.amount_raw)
|
|
1975
|
+
? globalThis.String(object.amount_raw)
|
|
1976
|
+
: "",
|
|
1977
|
+
amountFormatted: isSet(object.amountFormatted)
|
|
1978
|
+
? globalThis.String(object.amountFormatted)
|
|
1979
|
+
: isSet(object.amount_formatted)
|
|
1980
|
+
? globalThis.String(object.amount_formatted)
|
|
1981
|
+
: "",
|
|
1982
|
+
fromAddress: isSet(object.fromAddress)
|
|
1983
|
+
? globalThis.String(object.fromAddress)
|
|
1984
|
+
: isSet(object.from_address)
|
|
1985
|
+
? globalThis.String(object.from_address)
|
|
1986
|
+
: "",
|
|
1987
|
+
toAddress: isSet(object.toAddress)
|
|
1988
|
+
? globalThis.String(object.toAddress)
|
|
1989
|
+
: isSet(object.to_address)
|
|
1990
|
+
? globalThis.String(object.to_address)
|
|
1991
|
+
: "",
|
|
1992
|
+
fiatValue: isSet(object.fiatValue)
|
|
1993
|
+
? FiatValue.fromJSON(object.fiatValue)
|
|
1994
|
+
: isSet(object.fiat_value)
|
|
1995
|
+
? FiatValue.fromJSON(object.fiat_value)
|
|
1996
|
+
: undefined,
|
|
1997
|
+
};
|
|
1998
|
+
},
|
|
1999
|
+
|
|
2000
|
+
toJSON(message: TokenTransferActivity): unknown {
|
|
2001
|
+
const obj: any = {};
|
|
2002
|
+
if (message.tokenAddress !== "") {
|
|
2003
|
+
obj.tokenAddress = message.tokenAddress;
|
|
2004
|
+
}
|
|
2005
|
+
if (message.amountRaw !== "") {
|
|
2006
|
+
obj.amountRaw = message.amountRaw;
|
|
2007
|
+
}
|
|
2008
|
+
if (message.amountFormatted !== "") {
|
|
2009
|
+
obj.amountFormatted = message.amountFormatted;
|
|
2010
|
+
}
|
|
2011
|
+
if (message.fromAddress !== "") {
|
|
2012
|
+
obj.fromAddress = message.fromAddress;
|
|
2013
|
+
}
|
|
2014
|
+
if (message.toAddress !== "") {
|
|
2015
|
+
obj.toAddress = message.toAddress;
|
|
2016
|
+
}
|
|
2017
|
+
if (message.fiatValue !== undefined) {
|
|
2018
|
+
obj.fiatValue = FiatValue.toJSON(message.fiatValue);
|
|
2019
|
+
}
|
|
2020
|
+
return obj;
|
|
2021
|
+
},
|
|
2022
|
+
|
|
2023
|
+
create<I extends Exact<DeepPartial<TokenTransferActivity>, I>>(base?: I): TokenTransferActivity {
|
|
2024
|
+
return TokenTransferActivity.fromPartial(base ?? ({} as any));
|
|
2025
|
+
},
|
|
2026
|
+
fromPartial<I extends Exact<DeepPartial<TokenTransferActivity>, I>>(object: I): TokenTransferActivity {
|
|
2027
|
+
const message = createBaseTokenTransferActivity();
|
|
2028
|
+
message.tokenAddress = object.tokenAddress ?? "";
|
|
2029
|
+
message.amountRaw = object.amountRaw ?? "";
|
|
2030
|
+
message.amountFormatted = object.amountFormatted ?? "";
|
|
2031
|
+
message.fromAddress = object.fromAddress ?? "";
|
|
2032
|
+
message.toAddress = object.toAddress ?? "";
|
|
2033
|
+
message.fiatValue = (object.fiatValue !== undefined && object.fiatValue !== null)
|
|
2034
|
+
? FiatValue.fromPartial(object.fiatValue)
|
|
2035
|
+
: undefined;
|
|
2036
|
+
return message;
|
|
2037
|
+
},
|
|
2038
|
+
};
|
|
2039
|
+
|
|
2040
|
+
function createBaseApprovalActivity(): ApprovalActivity {
|
|
2041
|
+
return { tokenAddress: "", spenderAddress: "", amountRaw: "", amountFormatted: "", owner: "", standard: 0 };
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
export const ApprovalActivity: MessageFns<ApprovalActivity> = {
|
|
2045
|
+
encode(message: ApprovalActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2046
|
+
if (message.tokenAddress !== "") {
|
|
2047
|
+
writer.uint32(10).string(message.tokenAddress);
|
|
2048
|
+
}
|
|
2049
|
+
if (message.spenderAddress !== "") {
|
|
2050
|
+
writer.uint32(18).string(message.spenderAddress);
|
|
2051
|
+
}
|
|
2052
|
+
if (message.amountRaw !== "") {
|
|
2053
|
+
writer.uint32(26).string(message.amountRaw);
|
|
2054
|
+
}
|
|
2055
|
+
if (message.amountFormatted !== "") {
|
|
2056
|
+
writer.uint32(34).string(message.amountFormatted);
|
|
2057
|
+
}
|
|
2058
|
+
if (message.owner !== "") {
|
|
2059
|
+
writer.uint32(42).string(message.owner);
|
|
2060
|
+
}
|
|
2061
|
+
if (message.standard !== 0) {
|
|
2062
|
+
writer.uint32(48).int32(message.standard);
|
|
2063
|
+
}
|
|
2064
|
+
return writer;
|
|
2065
|
+
},
|
|
2066
|
+
|
|
2067
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ApprovalActivity {
|
|
2068
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2069
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2070
|
+
const message = createBaseApprovalActivity();
|
|
2071
|
+
while (reader.pos < end) {
|
|
2072
|
+
const tag = reader.uint32();
|
|
2073
|
+
switch (tag >>> 3) {
|
|
2074
|
+
case 1: {
|
|
2075
|
+
if (tag !== 10) {
|
|
2076
|
+
break;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
message.tokenAddress = reader.string();
|
|
2080
|
+
continue;
|
|
2081
|
+
}
|
|
2082
|
+
case 2: {
|
|
2083
|
+
if (tag !== 18) {
|
|
2084
|
+
break;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
message.spenderAddress = reader.string();
|
|
2088
|
+
continue;
|
|
2089
|
+
}
|
|
2090
|
+
case 3: {
|
|
2091
|
+
if (tag !== 26) {
|
|
2092
|
+
break;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
message.amountRaw = reader.string();
|
|
2096
|
+
continue;
|
|
2097
|
+
}
|
|
2098
|
+
case 4: {
|
|
2099
|
+
if (tag !== 34) {
|
|
2100
|
+
break;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
message.amountFormatted = reader.string();
|
|
2104
|
+
continue;
|
|
2105
|
+
}
|
|
2106
|
+
case 5: {
|
|
2107
|
+
if (tag !== 42) {
|
|
2108
|
+
break;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
message.owner = reader.string();
|
|
2112
|
+
continue;
|
|
2113
|
+
}
|
|
2114
|
+
case 6: {
|
|
2115
|
+
if (tag !== 48) {
|
|
2116
|
+
break;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
message.standard = reader.int32() as any;
|
|
2120
|
+
continue;
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2124
|
+
break;
|
|
2125
|
+
}
|
|
2126
|
+
reader.skip(tag & 7);
|
|
2127
|
+
}
|
|
2128
|
+
return message;
|
|
2129
|
+
},
|
|
2130
|
+
|
|
2131
|
+
fromJSON(object: any): ApprovalActivity {
|
|
2132
|
+
return {
|
|
2133
|
+
tokenAddress: isSet(object.tokenAddress)
|
|
2134
|
+
? globalThis.String(object.tokenAddress)
|
|
2135
|
+
: isSet(object.token_address)
|
|
2136
|
+
? globalThis.String(object.token_address)
|
|
2137
|
+
: "",
|
|
2138
|
+
spenderAddress: isSet(object.spenderAddress)
|
|
2139
|
+
? globalThis.String(object.spenderAddress)
|
|
2140
|
+
: isSet(object.spender_address)
|
|
2141
|
+
? globalThis.String(object.spender_address)
|
|
2142
|
+
: "",
|
|
2143
|
+
amountRaw: isSet(object.amountRaw)
|
|
2144
|
+
? globalThis.String(object.amountRaw)
|
|
2145
|
+
: isSet(object.amount_raw)
|
|
2146
|
+
? globalThis.String(object.amount_raw)
|
|
2147
|
+
: "",
|
|
2148
|
+
amountFormatted: isSet(object.amountFormatted)
|
|
2149
|
+
? globalThis.String(object.amountFormatted)
|
|
2150
|
+
: isSet(object.amount_formatted)
|
|
2151
|
+
? globalThis.String(object.amount_formatted)
|
|
2152
|
+
: "",
|
|
2153
|
+
owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
|
|
2154
|
+
standard: isSet(object.standard) ? approvalStandardFromJSON(object.standard) : 0,
|
|
2155
|
+
};
|
|
2156
|
+
},
|
|
2157
|
+
|
|
2158
|
+
toJSON(message: ApprovalActivity): unknown {
|
|
2159
|
+
const obj: any = {};
|
|
2160
|
+
if (message.tokenAddress !== "") {
|
|
2161
|
+
obj.tokenAddress = message.tokenAddress;
|
|
2162
|
+
}
|
|
2163
|
+
if (message.spenderAddress !== "") {
|
|
2164
|
+
obj.spenderAddress = message.spenderAddress;
|
|
2165
|
+
}
|
|
2166
|
+
if (message.amountRaw !== "") {
|
|
2167
|
+
obj.amountRaw = message.amountRaw;
|
|
2168
|
+
}
|
|
2169
|
+
if (message.amountFormatted !== "") {
|
|
2170
|
+
obj.amountFormatted = message.amountFormatted;
|
|
2171
|
+
}
|
|
2172
|
+
if (message.owner !== "") {
|
|
2173
|
+
obj.owner = message.owner;
|
|
2174
|
+
}
|
|
2175
|
+
if (message.standard !== 0) {
|
|
2176
|
+
obj.standard = approvalStandardToJSON(message.standard);
|
|
2177
|
+
}
|
|
2178
|
+
return obj;
|
|
2179
|
+
},
|
|
2180
|
+
|
|
2181
|
+
create<I extends Exact<DeepPartial<ApprovalActivity>, I>>(base?: I): ApprovalActivity {
|
|
2182
|
+
return ApprovalActivity.fromPartial(base ?? ({} as any));
|
|
2183
|
+
},
|
|
2184
|
+
fromPartial<I extends Exact<DeepPartial<ApprovalActivity>, I>>(object: I): ApprovalActivity {
|
|
2185
|
+
const message = createBaseApprovalActivity();
|
|
2186
|
+
message.tokenAddress = object.tokenAddress ?? "";
|
|
2187
|
+
message.spenderAddress = object.spenderAddress ?? "";
|
|
2188
|
+
message.amountRaw = object.amountRaw ?? "";
|
|
2189
|
+
message.amountFormatted = object.amountFormatted ?? "";
|
|
2190
|
+
message.owner = object.owner ?? "";
|
|
2191
|
+
message.standard = object.standard ?? 0;
|
|
2192
|
+
return message;
|
|
2193
|
+
},
|
|
2194
|
+
};
|
|
2195
|
+
|
|
2196
|
+
function createBaseBridgeActivity(): BridgeActivity {
|
|
2197
|
+
return { bridgeName: "", legType: 0, tokenAddress: "", amountRaw: "", amountFormatted: "", fiatValue: undefined };
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
export const BridgeActivity: MessageFns<BridgeActivity> = {
|
|
2201
|
+
encode(message: BridgeActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2202
|
+
if (message.bridgeName !== "") {
|
|
2203
|
+
writer.uint32(10).string(message.bridgeName);
|
|
2204
|
+
}
|
|
2205
|
+
if (message.legType !== 0) {
|
|
2206
|
+
writer.uint32(16).int32(message.legType);
|
|
2207
|
+
}
|
|
2208
|
+
if (message.tokenAddress !== "") {
|
|
2209
|
+
writer.uint32(26).string(message.tokenAddress);
|
|
2210
|
+
}
|
|
2211
|
+
if (message.amountRaw !== "") {
|
|
2212
|
+
writer.uint32(34).string(message.amountRaw);
|
|
2213
|
+
}
|
|
2214
|
+
if (message.amountFormatted !== "") {
|
|
2215
|
+
writer.uint32(42).string(message.amountFormatted);
|
|
2216
|
+
}
|
|
2217
|
+
if (message.fiatValue !== undefined) {
|
|
2218
|
+
FiatValue.encode(message.fiatValue, writer.uint32(50).fork()).join();
|
|
2219
|
+
}
|
|
2220
|
+
return writer;
|
|
2221
|
+
},
|
|
2222
|
+
|
|
2223
|
+
decode(input: BinaryReader | Uint8Array, length?: number): BridgeActivity {
|
|
2224
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2225
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2226
|
+
const message = createBaseBridgeActivity();
|
|
2227
|
+
while (reader.pos < end) {
|
|
2228
|
+
const tag = reader.uint32();
|
|
2229
|
+
switch (tag >>> 3) {
|
|
2230
|
+
case 1: {
|
|
2231
|
+
if (tag !== 10) {
|
|
2232
|
+
break;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
message.bridgeName = reader.string();
|
|
2236
|
+
continue;
|
|
2237
|
+
}
|
|
2238
|
+
case 2: {
|
|
2239
|
+
if (tag !== 16) {
|
|
2240
|
+
break;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
message.legType = reader.int32() as any;
|
|
2244
|
+
continue;
|
|
2245
|
+
}
|
|
2246
|
+
case 3: {
|
|
2247
|
+
if (tag !== 26) {
|
|
2248
|
+
break;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
message.tokenAddress = reader.string();
|
|
2252
|
+
continue;
|
|
2253
|
+
}
|
|
2254
|
+
case 4: {
|
|
2255
|
+
if (tag !== 34) {
|
|
2256
|
+
break;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
message.amountRaw = reader.string();
|
|
2260
|
+
continue;
|
|
2261
|
+
}
|
|
2262
|
+
case 5: {
|
|
2263
|
+
if (tag !== 42) {
|
|
2264
|
+
break;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
message.amountFormatted = reader.string();
|
|
2268
|
+
continue;
|
|
2269
|
+
}
|
|
2270
|
+
case 6: {
|
|
2271
|
+
if (tag !== 50) {
|
|
2272
|
+
break;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
message.fiatValue = FiatValue.decode(reader, reader.uint32());
|
|
2276
|
+
continue;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2280
|
+
break;
|
|
2281
|
+
}
|
|
2282
|
+
reader.skip(tag & 7);
|
|
2283
|
+
}
|
|
2284
|
+
return message;
|
|
2285
|
+
},
|
|
2286
|
+
|
|
2287
|
+
fromJSON(object: any): BridgeActivity {
|
|
2288
|
+
return {
|
|
2289
|
+
bridgeName: isSet(object.bridgeName)
|
|
2290
|
+
? globalThis.String(object.bridgeName)
|
|
2291
|
+
: isSet(object.bridge_name)
|
|
2292
|
+
? globalThis.String(object.bridge_name)
|
|
2293
|
+
: "",
|
|
2294
|
+
legType: isSet(object.legType)
|
|
2295
|
+
? bridgeLegTypeFromJSON(object.legType)
|
|
2296
|
+
: isSet(object.leg_type)
|
|
2297
|
+
? bridgeLegTypeFromJSON(object.leg_type)
|
|
2298
|
+
: 0,
|
|
2299
|
+
tokenAddress: isSet(object.tokenAddress)
|
|
2300
|
+
? globalThis.String(object.tokenAddress)
|
|
2301
|
+
: isSet(object.token_address)
|
|
2302
|
+
? globalThis.String(object.token_address)
|
|
2303
|
+
: "",
|
|
2304
|
+
amountRaw: isSet(object.amountRaw)
|
|
2305
|
+
? globalThis.String(object.amountRaw)
|
|
2306
|
+
: isSet(object.amount_raw)
|
|
2307
|
+
? globalThis.String(object.amount_raw)
|
|
2308
|
+
: "",
|
|
2309
|
+
amountFormatted: isSet(object.amountFormatted)
|
|
2310
|
+
? globalThis.String(object.amountFormatted)
|
|
2311
|
+
: isSet(object.amount_formatted)
|
|
2312
|
+
? globalThis.String(object.amount_formatted)
|
|
2313
|
+
: "",
|
|
2314
|
+
fiatValue: isSet(object.fiatValue)
|
|
2315
|
+
? FiatValue.fromJSON(object.fiatValue)
|
|
2316
|
+
: isSet(object.fiat_value)
|
|
2317
|
+
? FiatValue.fromJSON(object.fiat_value)
|
|
2318
|
+
: undefined,
|
|
2319
|
+
};
|
|
2320
|
+
},
|
|
2321
|
+
|
|
2322
|
+
toJSON(message: BridgeActivity): unknown {
|
|
2323
|
+
const obj: any = {};
|
|
2324
|
+
if (message.bridgeName !== "") {
|
|
2325
|
+
obj.bridgeName = message.bridgeName;
|
|
2326
|
+
}
|
|
2327
|
+
if (message.legType !== 0) {
|
|
2328
|
+
obj.legType = bridgeLegTypeToJSON(message.legType);
|
|
2329
|
+
}
|
|
2330
|
+
if (message.tokenAddress !== "") {
|
|
2331
|
+
obj.tokenAddress = message.tokenAddress;
|
|
2332
|
+
}
|
|
2333
|
+
if (message.amountRaw !== "") {
|
|
2334
|
+
obj.amountRaw = message.amountRaw;
|
|
2335
|
+
}
|
|
2336
|
+
if (message.amountFormatted !== "") {
|
|
2337
|
+
obj.amountFormatted = message.amountFormatted;
|
|
2338
|
+
}
|
|
2339
|
+
if (message.fiatValue !== undefined) {
|
|
2340
|
+
obj.fiatValue = FiatValue.toJSON(message.fiatValue);
|
|
2341
|
+
}
|
|
2342
|
+
return obj;
|
|
2343
|
+
},
|
|
2344
|
+
|
|
2345
|
+
create<I extends Exact<DeepPartial<BridgeActivity>, I>>(base?: I): BridgeActivity {
|
|
2346
|
+
return BridgeActivity.fromPartial(base ?? ({} as any));
|
|
2347
|
+
},
|
|
2348
|
+
fromPartial<I extends Exact<DeepPartial<BridgeActivity>, I>>(object: I): BridgeActivity {
|
|
2349
|
+
const message = createBaseBridgeActivity();
|
|
2350
|
+
message.bridgeName = object.bridgeName ?? "";
|
|
2351
|
+
message.legType = object.legType ?? 0;
|
|
2352
|
+
message.tokenAddress = object.tokenAddress ?? "";
|
|
2353
|
+
message.amountRaw = object.amountRaw ?? "";
|
|
2354
|
+
message.amountFormatted = object.amountFormatted ?? "";
|
|
2355
|
+
message.fiatValue = (object.fiatValue !== undefined && object.fiatValue !== null)
|
|
2356
|
+
? FiatValue.fromPartial(object.fiatValue)
|
|
2357
|
+
: undefined;
|
|
2358
|
+
return message;
|
|
2359
|
+
},
|
|
2360
|
+
};
|
|
2361
|
+
|
|
2362
|
+
function createBaseContractInteractionActivity(): ContractInteractionActivity {
|
|
2363
|
+
return { contractAddress: "", methodName: "", decodedFields: [] };
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
export const ContractInteractionActivity: MessageFns<ContractInteractionActivity> = {
|
|
2367
|
+
encode(message: ContractInteractionActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2368
|
+
if (message.contractAddress !== "") {
|
|
2369
|
+
writer.uint32(10).string(message.contractAddress);
|
|
2370
|
+
}
|
|
2371
|
+
if (message.methodName !== "") {
|
|
2372
|
+
writer.uint32(18).string(message.methodName);
|
|
2373
|
+
}
|
|
2374
|
+
for (const v of message.decodedFields) {
|
|
2375
|
+
DecodedParam.encode(v!, writer.uint32(26).fork()).join();
|
|
2376
|
+
}
|
|
2377
|
+
return writer;
|
|
2378
|
+
},
|
|
2379
|
+
|
|
2380
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ContractInteractionActivity {
|
|
2381
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2382
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2383
|
+
const message = createBaseContractInteractionActivity();
|
|
2384
|
+
while (reader.pos < end) {
|
|
2385
|
+
const tag = reader.uint32();
|
|
2386
|
+
switch (tag >>> 3) {
|
|
2387
|
+
case 1: {
|
|
2388
|
+
if (tag !== 10) {
|
|
2389
|
+
break;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
message.contractAddress = reader.string();
|
|
2393
|
+
continue;
|
|
2394
|
+
}
|
|
2395
|
+
case 2: {
|
|
2396
|
+
if (tag !== 18) {
|
|
2397
|
+
break;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
message.methodName = reader.string();
|
|
2401
|
+
continue;
|
|
2402
|
+
}
|
|
2403
|
+
case 3: {
|
|
2404
|
+
if (tag !== 26) {
|
|
2405
|
+
break;
|
|
2406
|
+
}
|
|
2407
|
+
|
|
2408
|
+
message.decodedFields.push(DecodedParam.decode(reader, reader.uint32()));
|
|
2409
|
+
continue;
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2413
|
+
break;
|
|
2414
|
+
}
|
|
2415
|
+
reader.skip(tag & 7);
|
|
2416
|
+
}
|
|
2417
|
+
return message;
|
|
2418
|
+
},
|
|
2419
|
+
|
|
2420
|
+
fromJSON(object: any): ContractInteractionActivity {
|
|
2421
|
+
return {
|
|
2422
|
+
contractAddress: isSet(object.contractAddress)
|
|
2423
|
+
? globalThis.String(object.contractAddress)
|
|
2424
|
+
: isSet(object.contract_address)
|
|
2425
|
+
? globalThis.String(object.contract_address)
|
|
2426
|
+
: "",
|
|
2427
|
+
methodName: isSet(object.methodName)
|
|
2428
|
+
? globalThis.String(object.methodName)
|
|
2429
|
+
: isSet(object.method_name)
|
|
2430
|
+
? globalThis.String(object.method_name)
|
|
2431
|
+
: "",
|
|
2432
|
+
decodedFields: globalThis.Array.isArray(object?.decodedFields)
|
|
2433
|
+
? object.decodedFields.map((e: any) => DecodedParam.fromJSON(e))
|
|
2434
|
+
: globalThis.Array.isArray(object?.decoded_fields)
|
|
2435
|
+
? object.decoded_fields.map((e: any) => DecodedParam.fromJSON(e))
|
|
2436
|
+
: [],
|
|
2437
|
+
};
|
|
2438
|
+
},
|
|
2439
|
+
|
|
2440
|
+
toJSON(message: ContractInteractionActivity): unknown {
|
|
2441
|
+
const obj: any = {};
|
|
2442
|
+
if (message.contractAddress !== "") {
|
|
2443
|
+
obj.contractAddress = message.contractAddress;
|
|
2444
|
+
}
|
|
2445
|
+
if (message.methodName !== "") {
|
|
2446
|
+
obj.methodName = message.methodName;
|
|
2447
|
+
}
|
|
2448
|
+
if (message.decodedFields?.length) {
|
|
2449
|
+
obj.decodedFields = message.decodedFields.map((e) => DecodedParam.toJSON(e));
|
|
2450
|
+
}
|
|
2451
|
+
return obj;
|
|
2452
|
+
},
|
|
2453
|
+
|
|
2454
|
+
create<I extends Exact<DeepPartial<ContractInteractionActivity>, I>>(base?: I): ContractInteractionActivity {
|
|
2455
|
+
return ContractInteractionActivity.fromPartial(base ?? ({} as any));
|
|
2456
|
+
},
|
|
2457
|
+
fromPartial<I extends Exact<DeepPartial<ContractInteractionActivity>, I>>(object: I): ContractInteractionActivity {
|
|
2458
|
+
const message = createBaseContractInteractionActivity();
|
|
2459
|
+
message.contractAddress = object.contractAddress ?? "";
|
|
2460
|
+
message.methodName = object.methodName ?? "";
|
|
2461
|
+
message.decodedFields = object.decodedFields?.map((e) => DecodedParam.fromPartial(e)) || [];
|
|
2462
|
+
return message;
|
|
2463
|
+
},
|
|
2464
|
+
};
|
|
2465
|
+
|
|
2466
|
+
function createBaseGetContractInfoRequest(): GetContractInfoRequest {
|
|
2467
|
+
return { contractAddress: "", chainId: 0 };
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
export const GetContractInfoRequest: MessageFns<GetContractInfoRequest> = {
|
|
2471
|
+
encode(message: GetContractInfoRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2472
|
+
if (message.contractAddress !== "") {
|
|
2473
|
+
writer.uint32(10).string(message.contractAddress);
|
|
2474
|
+
}
|
|
2475
|
+
if (message.chainId !== 0) {
|
|
2476
|
+
writer.uint32(16).uint64(message.chainId);
|
|
2477
|
+
}
|
|
2478
|
+
return writer;
|
|
2479
|
+
},
|
|
2480
|
+
|
|
2481
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetContractInfoRequest {
|
|
2482
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2483
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2484
|
+
const message = createBaseGetContractInfoRequest();
|
|
2485
|
+
while (reader.pos < end) {
|
|
2486
|
+
const tag = reader.uint32();
|
|
2487
|
+
switch (tag >>> 3) {
|
|
2488
|
+
case 1: {
|
|
2489
|
+
if (tag !== 10) {
|
|
2490
|
+
break;
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
message.contractAddress = reader.string();
|
|
2494
|
+
continue;
|
|
2495
|
+
}
|
|
2496
|
+
case 2: {
|
|
2497
|
+
if (tag !== 16) {
|
|
2498
|
+
break;
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
message.chainId = longToNumber(reader.uint64());
|
|
2502
|
+
continue;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2506
|
+
break;
|
|
2507
|
+
}
|
|
2508
|
+
reader.skip(tag & 7);
|
|
2509
|
+
}
|
|
2510
|
+
return message;
|
|
2511
|
+
},
|
|
2512
|
+
|
|
2513
|
+
fromJSON(object: any): GetContractInfoRequest {
|
|
2514
|
+
return {
|
|
2515
|
+
contractAddress: isSet(object.contractAddress)
|
|
2516
|
+
? globalThis.String(object.contractAddress)
|
|
2517
|
+
: isSet(object.contract_address)
|
|
2518
|
+
? globalThis.String(object.contract_address)
|
|
2519
|
+
: "",
|
|
2520
|
+
chainId: isSet(object.chainId)
|
|
2521
|
+
? globalThis.Number(object.chainId)
|
|
2522
|
+
: isSet(object.chain_id)
|
|
2523
|
+
? globalThis.Number(object.chain_id)
|
|
2524
|
+
: 0,
|
|
2525
|
+
};
|
|
2526
|
+
},
|
|
2527
|
+
|
|
2528
|
+
toJSON(message: GetContractInfoRequest): unknown {
|
|
2529
|
+
const obj: any = {};
|
|
2530
|
+
if (message.contractAddress !== "") {
|
|
2531
|
+
obj.contractAddress = message.contractAddress;
|
|
2532
|
+
}
|
|
2533
|
+
if (message.chainId !== 0) {
|
|
2534
|
+
obj.chainId = Math.round(message.chainId);
|
|
2535
|
+
}
|
|
2536
|
+
return obj;
|
|
2537
|
+
},
|
|
2538
|
+
|
|
2539
|
+
create<I extends Exact<DeepPartial<GetContractInfoRequest>, I>>(base?: I): GetContractInfoRequest {
|
|
2540
|
+
return GetContractInfoRequest.fromPartial(base ?? ({} as any));
|
|
2541
|
+
},
|
|
2542
|
+
fromPartial<I extends Exact<DeepPartial<GetContractInfoRequest>, I>>(object: I): GetContractInfoRequest {
|
|
2543
|
+
const message = createBaseGetContractInfoRequest();
|
|
2544
|
+
message.contractAddress = object.contractAddress ?? "";
|
|
2545
|
+
message.chainId = object.chainId ?? 0;
|
|
2546
|
+
return message;
|
|
2547
|
+
},
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2550
|
+
function createBaseGetContractInfoResponse(): GetContractInfoResponse {
|
|
2551
|
+
return { status: undefined, contractInfo: undefined };
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
export const GetContractInfoResponse: MessageFns<GetContractInfoResponse> = {
|
|
2555
|
+
encode(message: GetContractInfoResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2556
|
+
if (message.status !== undefined) {
|
|
2557
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
2558
|
+
}
|
|
2559
|
+
if (message.contractInfo !== undefined) {
|
|
2560
|
+
ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).join();
|
|
2561
|
+
}
|
|
2562
|
+
return writer;
|
|
2563
|
+
},
|
|
2564
|
+
|
|
2565
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetContractInfoResponse {
|
|
2566
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2567
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2568
|
+
const message = createBaseGetContractInfoResponse();
|
|
2569
|
+
while (reader.pos < end) {
|
|
2570
|
+
const tag = reader.uint32();
|
|
2571
|
+
switch (tag >>> 3) {
|
|
2572
|
+
case 1: {
|
|
2573
|
+
if (tag !== 10) {
|
|
2574
|
+
break;
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
2578
|
+
continue;
|
|
2579
|
+
}
|
|
2580
|
+
case 2: {
|
|
2581
|
+
if (tag !== 18) {
|
|
2582
|
+
break;
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
message.contractInfo = ContractInfo.decode(reader, reader.uint32());
|
|
2586
|
+
continue;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2590
|
+
break;
|
|
2591
|
+
}
|
|
2592
|
+
reader.skip(tag & 7);
|
|
2593
|
+
}
|
|
2594
|
+
return message;
|
|
2595
|
+
},
|
|
2596
|
+
|
|
2597
|
+
fromJSON(object: any): GetContractInfoResponse {
|
|
2598
|
+
return {
|
|
2599
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
2600
|
+
contractInfo: isSet(object.contractInfo)
|
|
2601
|
+
? ContractInfo.fromJSON(object.contractInfo)
|
|
2602
|
+
: isSet(object.contract_info)
|
|
2603
|
+
? ContractInfo.fromJSON(object.contract_info)
|
|
2604
|
+
: undefined,
|
|
2605
|
+
};
|
|
2606
|
+
},
|
|
2607
|
+
|
|
2608
|
+
toJSON(message: GetContractInfoResponse): unknown {
|
|
2609
|
+
const obj: any = {};
|
|
2610
|
+
if (message.status !== undefined) {
|
|
2611
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
2612
|
+
}
|
|
2613
|
+
if (message.contractInfo !== undefined) {
|
|
2614
|
+
obj.contractInfo = ContractInfo.toJSON(message.contractInfo);
|
|
2615
|
+
}
|
|
2616
|
+
return obj;
|
|
2617
|
+
},
|
|
2618
|
+
|
|
2619
|
+
create<I extends Exact<DeepPartial<GetContractInfoResponse>, I>>(base?: I): GetContractInfoResponse {
|
|
2620
|
+
return GetContractInfoResponse.fromPartial(base ?? ({} as any));
|
|
2621
|
+
},
|
|
2622
|
+
fromPartial<I extends Exact<DeepPartial<GetContractInfoResponse>, I>>(object: I): GetContractInfoResponse {
|
|
2623
|
+
const message = createBaseGetContractInfoResponse();
|
|
2624
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
2625
|
+
? ResponseStatus.fromPartial(object.status)
|
|
2626
|
+
: undefined;
|
|
2627
|
+
message.contractInfo = (object.contractInfo !== undefined && object.contractInfo !== null)
|
|
2628
|
+
? ContractInfo.fromPartial(object.contractInfo)
|
|
2629
|
+
: undefined;
|
|
2630
|
+
return message;
|
|
2631
|
+
},
|
|
2632
|
+
};
|
|
2633
|
+
|
|
2634
|
+
function createBaseContractInfo(): ContractInfo {
|
|
2635
|
+
return {
|
|
2636
|
+
contractAddress: "",
|
|
2637
|
+
chainId: 0,
|
|
2638
|
+
contractName: "",
|
|
2639
|
+
isVerified: false,
|
|
2640
|
+
compilerVersion: "",
|
|
2641
|
+
optimizationUsed: false,
|
|
2642
|
+
optimizationRuns: 0,
|
|
2643
|
+
evmVersion: "",
|
|
2644
|
+
licenseType: "",
|
|
2645
|
+
isProxy: false,
|
|
2646
|
+
implementationAddress: "",
|
|
2647
|
+
sourceFiles: [],
|
|
2648
|
+
abiJson: "",
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
export const ContractInfo: MessageFns<ContractInfo> = {
|
|
2653
|
+
encode(message: ContractInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2654
|
+
if (message.contractAddress !== "") {
|
|
2655
|
+
writer.uint32(10).string(message.contractAddress);
|
|
2656
|
+
}
|
|
2657
|
+
if (message.chainId !== 0) {
|
|
2658
|
+
writer.uint32(16).uint64(message.chainId);
|
|
2659
|
+
}
|
|
2660
|
+
if (message.contractName !== "") {
|
|
2661
|
+
writer.uint32(26).string(message.contractName);
|
|
2662
|
+
}
|
|
2663
|
+
if (message.isVerified !== false) {
|
|
2664
|
+
writer.uint32(32).bool(message.isVerified);
|
|
2665
|
+
}
|
|
2666
|
+
if (message.compilerVersion !== "") {
|
|
2667
|
+
writer.uint32(42).string(message.compilerVersion);
|
|
2668
|
+
}
|
|
2669
|
+
if (message.optimizationUsed !== false) {
|
|
2670
|
+
writer.uint32(48).bool(message.optimizationUsed);
|
|
2671
|
+
}
|
|
2672
|
+
if (message.optimizationRuns !== 0) {
|
|
2673
|
+
writer.uint32(56).uint32(message.optimizationRuns);
|
|
2674
|
+
}
|
|
2675
|
+
if (message.evmVersion !== "") {
|
|
2676
|
+
writer.uint32(66).string(message.evmVersion);
|
|
2677
|
+
}
|
|
2678
|
+
if (message.licenseType !== "") {
|
|
2679
|
+
writer.uint32(74).string(message.licenseType);
|
|
2680
|
+
}
|
|
2681
|
+
if (message.isProxy !== false) {
|
|
2682
|
+
writer.uint32(80).bool(message.isProxy);
|
|
2683
|
+
}
|
|
2684
|
+
if (message.implementationAddress !== "") {
|
|
2685
|
+
writer.uint32(90).string(message.implementationAddress);
|
|
2686
|
+
}
|
|
2687
|
+
for (const v of message.sourceFiles) {
|
|
2688
|
+
ContractSourceFile.encode(v!, writer.uint32(98).fork()).join();
|
|
2689
|
+
}
|
|
2690
|
+
if (message.abiJson !== "") {
|
|
2691
|
+
writer.uint32(106).string(message.abiJson);
|
|
2692
|
+
}
|
|
2693
|
+
return writer;
|
|
2694
|
+
},
|
|
2695
|
+
|
|
2696
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ContractInfo {
|
|
2697
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2698
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2699
|
+
const message = createBaseContractInfo();
|
|
2700
|
+
while (reader.pos < end) {
|
|
2701
|
+
const tag = reader.uint32();
|
|
2702
|
+
switch (tag >>> 3) {
|
|
2703
|
+
case 1: {
|
|
2704
|
+
if (tag !== 10) {
|
|
2705
|
+
break;
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
message.contractAddress = reader.string();
|
|
2709
|
+
continue;
|
|
2710
|
+
}
|
|
2711
|
+
case 2: {
|
|
2712
|
+
if (tag !== 16) {
|
|
2713
|
+
break;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
message.chainId = longToNumber(reader.uint64());
|
|
2717
|
+
continue;
|
|
2718
|
+
}
|
|
2719
|
+
case 3: {
|
|
2720
|
+
if (tag !== 26) {
|
|
2721
|
+
break;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
message.contractName = reader.string();
|
|
2725
|
+
continue;
|
|
2726
|
+
}
|
|
2727
|
+
case 4: {
|
|
2728
|
+
if (tag !== 32) {
|
|
2729
|
+
break;
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
message.isVerified = reader.bool();
|
|
2733
|
+
continue;
|
|
2734
|
+
}
|
|
2735
|
+
case 5: {
|
|
2736
|
+
if (tag !== 42) {
|
|
2737
|
+
break;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
message.compilerVersion = reader.string();
|
|
2741
|
+
continue;
|
|
2742
|
+
}
|
|
2743
|
+
case 6: {
|
|
2744
|
+
if (tag !== 48) {
|
|
2745
|
+
break;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
message.optimizationUsed = reader.bool();
|
|
2749
|
+
continue;
|
|
2750
|
+
}
|
|
2751
|
+
case 7: {
|
|
2752
|
+
if (tag !== 56) {
|
|
2753
|
+
break;
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
message.optimizationRuns = reader.uint32();
|
|
2757
|
+
continue;
|
|
2758
|
+
}
|
|
2759
|
+
case 8: {
|
|
2760
|
+
if (tag !== 66) {
|
|
2761
|
+
break;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
message.evmVersion = reader.string();
|
|
2765
|
+
continue;
|
|
2766
|
+
}
|
|
2767
|
+
case 9: {
|
|
2768
|
+
if (tag !== 74) {
|
|
2769
|
+
break;
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
message.licenseType = reader.string();
|
|
2773
|
+
continue;
|
|
2774
|
+
}
|
|
2775
|
+
case 10: {
|
|
2776
|
+
if (tag !== 80) {
|
|
2777
|
+
break;
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
message.isProxy = reader.bool();
|
|
2781
|
+
continue;
|
|
2782
|
+
}
|
|
2783
|
+
case 11: {
|
|
2784
|
+
if (tag !== 90) {
|
|
2785
|
+
break;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
message.implementationAddress = reader.string();
|
|
2789
|
+
continue;
|
|
2790
|
+
}
|
|
2791
|
+
case 12: {
|
|
2792
|
+
if (tag !== 98) {
|
|
2793
|
+
break;
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
message.sourceFiles.push(ContractSourceFile.decode(reader, reader.uint32()));
|
|
2797
|
+
continue;
|
|
2798
|
+
}
|
|
2799
|
+
case 13: {
|
|
2800
|
+
if (tag !== 106) {
|
|
2801
|
+
break;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
message.abiJson = reader.string();
|
|
2805
|
+
continue;
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2809
|
+
break;
|
|
2810
|
+
}
|
|
2811
|
+
reader.skip(tag & 7);
|
|
2812
|
+
}
|
|
2813
|
+
return message;
|
|
2814
|
+
},
|
|
2815
|
+
|
|
2816
|
+
fromJSON(object: any): ContractInfo {
|
|
2817
|
+
return {
|
|
2818
|
+
contractAddress: isSet(object.contractAddress)
|
|
2819
|
+
? globalThis.String(object.contractAddress)
|
|
2820
|
+
: isSet(object.contract_address)
|
|
2821
|
+
? globalThis.String(object.contract_address)
|
|
2822
|
+
: "",
|
|
2823
|
+
chainId: isSet(object.chainId)
|
|
2824
|
+
? globalThis.Number(object.chainId)
|
|
2825
|
+
: isSet(object.chain_id)
|
|
2826
|
+
? globalThis.Number(object.chain_id)
|
|
2827
|
+
: 0,
|
|
2828
|
+
contractName: isSet(object.contractName)
|
|
2829
|
+
? globalThis.String(object.contractName)
|
|
2830
|
+
: isSet(object.contract_name)
|
|
2831
|
+
? globalThis.String(object.contract_name)
|
|
2832
|
+
: "",
|
|
2833
|
+
isVerified: isSet(object.isVerified)
|
|
2834
|
+
? globalThis.Boolean(object.isVerified)
|
|
2835
|
+
: isSet(object.is_verified)
|
|
2836
|
+
? globalThis.Boolean(object.is_verified)
|
|
2837
|
+
: false,
|
|
2838
|
+
compilerVersion: isSet(object.compilerVersion)
|
|
2839
|
+
? globalThis.String(object.compilerVersion)
|
|
2840
|
+
: isSet(object.compiler_version)
|
|
2841
|
+
? globalThis.String(object.compiler_version)
|
|
2842
|
+
: "",
|
|
2843
|
+
optimizationUsed: isSet(object.optimizationUsed)
|
|
2844
|
+
? globalThis.Boolean(object.optimizationUsed)
|
|
2845
|
+
: isSet(object.optimization_used)
|
|
2846
|
+
? globalThis.Boolean(object.optimization_used)
|
|
2847
|
+
: false,
|
|
2848
|
+
optimizationRuns: isSet(object.optimizationRuns)
|
|
2849
|
+
? globalThis.Number(object.optimizationRuns)
|
|
2850
|
+
: isSet(object.optimization_runs)
|
|
2851
|
+
? globalThis.Number(object.optimization_runs)
|
|
2852
|
+
: 0,
|
|
2853
|
+
evmVersion: isSet(object.evmVersion)
|
|
2854
|
+
? globalThis.String(object.evmVersion)
|
|
2855
|
+
: isSet(object.evm_version)
|
|
2856
|
+
? globalThis.String(object.evm_version)
|
|
2857
|
+
: "",
|
|
2858
|
+
licenseType: isSet(object.licenseType)
|
|
2859
|
+
? globalThis.String(object.licenseType)
|
|
2860
|
+
: isSet(object.license_type)
|
|
2861
|
+
? globalThis.String(object.license_type)
|
|
2862
|
+
: "",
|
|
2863
|
+
isProxy: isSet(object.isProxy)
|
|
2864
|
+
? globalThis.Boolean(object.isProxy)
|
|
2865
|
+
: isSet(object.is_proxy)
|
|
2866
|
+
? globalThis.Boolean(object.is_proxy)
|
|
2867
|
+
: false,
|
|
2868
|
+
implementationAddress: isSet(object.implementationAddress)
|
|
2869
|
+
? globalThis.String(object.implementationAddress)
|
|
2870
|
+
: isSet(object.implementation_address)
|
|
2871
|
+
? globalThis.String(object.implementation_address)
|
|
2872
|
+
: "",
|
|
2873
|
+
sourceFiles: globalThis.Array.isArray(object?.sourceFiles)
|
|
2874
|
+
? object.sourceFiles.map((e: any) => ContractSourceFile.fromJSON(e))
|
|
2875
|
+
: globalThis.Array.isArray(object?.source_files)
|
|
2876
|
+
? object.source_files.map((e: any) => ContractSourceFile.fromJSON(e))
|
|
2877
|
+
: [],
|
|
2878
|
+
abiJson: isSet(object.abiJson)
|
|
2879
|
+
? globalThis.String(object.abiJson)
|
|
2880
|
+
: isSet(object.abi_json)
|
|
2881
|
+
? globalThis.String(object.abi_json)
|
|
2882
|
+
: "",
|
|
2883
|
+
};
|
|
2884
|
+
},
|
|
2885
|
+
|
|
2886
|
+
toJSON(message: ContractInfo): unknown {
|
|
2887
|
+
const obj: any = {};
|
|
2888
|
+
if (message.contractAddress !== "") {
|
|
2889
|
+
obj.contractAddress = message.contractAddress;
|
|
2890
|
+
}
|
|
2891
|
+
if (message.chainId !== 0) {
|
|
2892
|
+
obj.chainId = Math.round(message.chainId);
|
|
2893
|
+
}
|
|
2894
|
+
if (message.contractName !== "") {
|
|
2895
|
+
obj.contractName = message.contractName;
|
|
2896
|
+
}
|
|
2897
|
+
if (message.isVerified !== false) {
|
|
2898
|
+
obj.isVerified = message.isVerified;
|
|
2899
|
+
}
|
|
2900
|
+
if (message.compilerVersion !== "") {
|
|
2901
|
+
obj.compilerVersion = message.compilerVersion;
|
|
2902
|
+
}
|
|
2903
|
+
if (message.optimizationUsed !== false) {
|
|
2904
|
+
obj.optimizationUsed = message.optimizationUsed;
|
|
2905
|
+
}
|
|
2906
|
+
if (message.optimizationRuns !== 0) {
|
|
2907
|
+
obj.optimizationRuns = Math.round(message.optimizationRuns);
|
|
2908
|
+
}
|
|
2909
|
+
if (message.evmVersion !== "") {
|
|
2910
|
+
obj.evmVersion = message.evmVersion;
|
|
2911
|
+
}
|
|
2912
|
+
if (message.licenseType !== "") {
|
|
2913
|
+
obj.licenseType = message.licenseType;
|
|
2914
|
+
}
|
|
2915
|
+
if (message.isProxy !== false) {
|
|
2916
|
+
obj.isProxy = message.isProxy;
|
|
2917
|
+
}
|
|
2918
|
+
if (message.implementationAddress !== "") {
|
|
2919
|
+
obj.implementationAddress = message.implementationAddress;
|
|
2920
|
+
}
|
|
2921
|
+
if (message.sourceFiles?.length) {
|
|
2922
|
+
obj.sourceFiles = message.sourceFiles.map((e) => ContractSourceFile.toJSON(e));
|
|
2923
|
+
}
|
|
2924
|
+
if (message.abiJson !== "") {
|
|
2925
|
+
obj.abiJson = message.abiJson;
|
|
2926
|
+
}
|
|
2927
|
+
return obj;
|
|
2928
|
+
},
|
|
2929
|
+
|
|
2930
|
+
create<I extends Exact<DeepPartial<ContractInfo>, I>>(base?: I): ContractInfo {
|
|
2931
|
+
return ContractInfo.fromPartial(base ?? ({} as any));
|
|
2932
|
+
},
|
|
2933
|
+
fromPartial<I extends Exact<DeepPartial<ContractInfo>, I>>(object: I): ContractInfo {
|
|
2934
|
+
const message = createBaseContractInfo();
|
|
2935
|
+
message.contractAddress = object.contractAddress ?? "";
|
|
2936
|
+
message.chainId = object.chainId ?? 0;
|
|
2937
|
+
message.contractName = object.contractName ?? "";
|
|
2938
|
+
message.isVerified = object.isVerified ?? false;
|
|
2939
|
+
message.compilerVersion = object.compilerVersion ?? "";
|
|
2940
|
+
message.optimizationUsed = object.optimizationUsed ?? false;
|
|
2941
|
+
message.optimizationRuns = object.optimizationRuns ?? 0;
|
|
2942
|
+
message.evmVersion = object.evmVersion ?? "";
|
|
2943
|
+
message.licenseType = object.licenseType ?? "";
|
|
2944
|
+
message.isProxy = object.isProxy ?? false;
|
|
2945
|
+
message.implementationAddress = object.implementationAddress ?? "";
|
|
2946
|
+
message.sourceFiles = object.sourceFiles?.map((e) => ContractSourceFile.fromPartial(e)) || [];
|
|
2947
|
+
message.abiJson = object.abiJson ?? "";
|
|
2948
|
+
return message;
|
|
2949
|
+
},
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
function createBaseContractSourceFile(): ContractSourceFile {
|
|
2953
|
+
return { fileName: "", content: "" };
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
export const ContractSourceFile: MessageFns<ContractSourceFile> = {
|
|
2957
|
+
encode(message: ContractSourceFile, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
2958
|
+
if (message.fileName !== "") {
|
|
2959
|
+
writer.uint32(10).string(message.fileName);
|
|
2960
|
+
}
|
|
2961
|
+
if (message.content !== "") {
|
|
2962
|
+
writer.uint32(18).string(message.content);
|
|
2963
|
+
}
|
|
2964
|
+
return writer;
|
|
2965
|
+
},
|
|
2966
|
+
|
|
2967
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ContractSourceFile {
|
|
2968
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2969
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2970
|
+
const message = createBaseContractSourceFile();
|
|
2971
|
+
while (reader.pos < end) {
|
|
2972
|
+
const tag = reader.uint32();
|
|
2973
|
+
switch (tag >>> 3) {
|
|
2974
|
+
case 1: {
|
|
2975
|
+
if (tag !== 10) {
|
|
2976
|
+
break;
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
message.fileName = reader.string();
|
|
2980
|
+
continue;
|
|
2981
|
+
}
|
|
2982
|
+
case 2: {
|
|
2983
|
+
if (tag !== 18) {
|
|
2984
|
+
break;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
message.content = reader.string();
|
|
2988
|
+
continue;
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2992
|
+
break;
|
|
2993
|
+
}
|
|
2994
|
+
reader.skip(tag & 7);
|
|
2995
|
+
}
|
|
2996
|
+
return message;
|
|
2997
|
+
},
|
|
2998
|
+
|
|
2999
|
+
fromJSON(object: any): ContractSourceFile {
|
|
3000
|
+
return {
|
|
3001
|
+
fileName: isSet(object.fileName)
|
|
3002
|
+
? globalThis.String(object.fileName)
|
|
3003
|
+
: isSet(object.file_name)
|
|
3004
|
+
? globalThis.String(object.file_name)
|
|
3005
|
+
: "",
|
|
3006
|
+
content: isSet(object.content) ? globalThis.String(object.content) : "",
|
|
3007
|
+
};
|
|
3008
|
+
},
|
|
3009
|
+
|
|
3010
|
+
toJSON(message: ContractSourceFile): unknown {
|
|
3011
|
+
const obj: any = {};
|
|
3012
|
+
if (message.fileName !== "") {
|
|
3013
|
+
obj.fileName = message.fileName;
|
|
3014
|
+
}
|
|
3015
|
+
if (message.content !== "") {
|
|
3016
|
+
obj.content = message.content;
|
|
3017
|
+
}
|
|
3018
|
+
return obj;
|
|
3019
|
+
},
|
|
3020
|
+
|
|
3021
|
+
create<I extends Exact<DeepPartial<ContractSourceFile>, I>>(base?: I): ContractSourceFile {
|
|
3022
|
+
return ContractSourceFile.fromPartial(base ?? ({} as any));
|
|
3023
|
+
},
|
|
3024
|
+
fromPartial<I extends Exact<DeepPartial<ContractSourceFile>, I>>(object: I): ContractSourceFile {
|
|
3025
|
+
const message = createBaseContractSourceFile();
|
|
3026
|
+
message.fileName = object.fileName ?? "";
|
|
3027
|
+
message.content = object.content ?? "";
|
|
3028
|
+
return message;
|
|
3029
|
+
},
|
|
3030
|
+
};
|
|
3031
|
+
|
|
3032
|
+
function createBaseTokenInfo(): TokenInfo {
|
|
3033
|
+
return { address: "", symbol: "", name: "", decimals: 0 };
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
export const TokenInfo: MessageFns<TokenInfo> = {
|
|
3037
|
+
encode(message: TokenInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3038
|
+
if (message.address !== "") {
|
|
3039
|
+
writer.uint32(10).string(message.address);
|
|
3040
|
+
}
|
|
3041
|
+
if (message.symbol !== "") {
|
|
3042
|
+
writer.uint32(18).string(message.symbol);
|
|
3043
|
+
}
|
|
3044
|
+
if (message.name !== "") {
|
|
3045
|
+
writer.uint32(26).string(message.name);
|
|
3046
|
+
}
|
|
3047
|
+
if (message.decimals !== 0) {
|
|
3048
|
+
writer.uint32(32).uint32(message.decimals);
|
|
3049
|
+
}
|
|
3050
|
+
return writer;
|
|
3051
|
+
},
|
|
3052
|
+
|
|
3053
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TokenInfo {
|
|
3054
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3055
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3056
|
+
const message = createBaseTokenInfo();
|
|
3057
|
+
while (reader.pos < end) {
|
|
3058
|
+
const tag = reader.uint32();
|
|
3059
|
+
switch (tag >>> 3) {
|
|
3060
|
+
case 1: {
|
|
3061
|
+
if (tag !== 10) {
|
|
3062
|
+
break;
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
message.address = reader.string();
|
|
3066
|
+
continue;
|
|
3067
|
+
}
|
|
3068
|
+
case 2: {
|
|
3069
|
+
if (tag !== 18) {
|
|
3070
|
+
break;
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
message.symbol = reader.string();
|
|
3074
|
+
continue;
|
|
3075
|
+
}
|
|
3076
|
+
case 3: {
|
|
3077
|
+
if (tag !== 26) {
|
|
3078
|
+
break;
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
message.name = reader.string();
|
|
3082
|
+
continue;
|
|
3083
|
+
}
|
|
3084
|
+
case 4: {
|
|
3085
|
+
if (tag !== 32) {
|
|
3086
|
+
break;
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
message.decimals = reader.uint32();
|
|
3090
|
+
continue;
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3094
|
+
break;
|
|
3095
|
+
}
|
|
3096
|
+
reader.skip(tag & 7);
|
|
3097
|
+
}
|
|
3098
|
+
return message;
|
|
3099
|
+
},
|
|
3100
|
+
|
|
3101
|
+
fromJSON(object: any): TokenInfo {
|
|
3102
|
+
return {
|
|
3103
|
+
address: isSet(object.address) ? globalThis.String(object.address) : "",
|
|
3104
|
+
symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
|
|
3105
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
3106
|
+
decimals: isSet(object.decimals) ? globalThis.Number(object.decimals) : 0,
|
|
3107
|
+
};
|
|
3108
|
+
},
|
|
3109
|
+
|
|
3110
|
+
toJSON(message: TokenInfo): unknown {
|
|
3111
|
+
const obj: any = {};
|
|
3112
|
+
if (message.address !== "") {
|
|
3113
|
+
obj.address = message.address;
|
|
3114
|
+
}
|
|
3115
|
+
if (message.symbol !== "") {
|
|
3116
|
+
obj.symbol = message.symbol;
|
|
3117
|
+
}
|
|
3118
|
+
if (message.name !== "") {
|
|
3119
|
+
obj.name = message.name;
|
|
3120
|
+
}
|
|
3121
|
+
if (message.decimals !== 0) {
|
|
3122
|
+
obj.decimals = Math.round(message.decimals);
|
|
3123
|
+
}
|
|
3124
|
+
return obj;
|
|
3125
|
+
},
|
|
3126
|
+
|
|
3127
|
+
create<I extends Exact<DeepPartial<TokenInfo>, I>>(base?: I): TokenInfo {
|
|
3128
|
+
return TokenInfo.fromPartial(base ?? ({} as any));
|
|
3129
|
+
},
|
|
3130
|
+
fromPartial<I extends Exact<DeepPartial<TokenInfo>, I>>(object: I): TokenInfo {
|
|
3131
|
+
const message = createBaseTokenInfo();
|
|
3132
|
+
message.address = object.address ?? "";
|
|
3133
|
+
message.symbol = object.symbol ?? "";
|
|
3134
|
+
message.name = object.name ?? "";
|
|
3135
|
+
message.decimals = object.decimals ?? 0;
|
|
3136
|
+
return message;
|
|
3137
|
+
},
|
|
3138
|
+
};
|
|
3139
|
+
|
|
3140
|
+
function createBaseFiatValue(): FiatValue {
|
|
3141
|
+
return { currency: "", amount: 0, formatted: "" };
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
export const FiatValue: MessageFns<FiatValue> = {
|
|
3145
|
+
encode(message: FiatValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3146
|
+
if (message.currency !== "") {
|
|
3147
|
+
writer.uint32(10).string(message.currency);
|
|
3148
|
+
}
|
|
3149
|
+
if (message.amount !== 0) {
|
|
3150
|
+
writer.uint32(17).double(message.amount);
|
|
3151
|
+
}
|
|
3152
|
+
if (message.formatted !== "") {
|
|
3153
|
+
writer.uint32(26).string(message.formatted);
|
|
3154
|
+
}
|
|
3155
|
+
return writer;
|
|
3156
|
+
},
|
|
3157
|
+
|
|
3158
|
+
decode(input: BinaryReader | Uint8Array, length?: number): FiatValue {
|
|
3159
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3160
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3161
|
+
const message = createBaseFiatValue();
|
|
3162
|
+
while (reader.pos < end) {
|
|
3163
|
+
const tag = reader.uint32();
|
|
3164
|
+
switch (tag >>> 3) {
|
|
3165
|
+
case 1: {
|
|
3166
|
+
if (tag !== 10) {
|
|
3167
|
+
break;
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
message.currency = reader.string();
|
|
3171
|
+
continue;
|
|
3172
|
+
}
|
|
3173
|
+
case 2: {
|
|
3174
|
+
if (tag !== 17) {
|
|
3175
|
+
break;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
message.amount = reader.double();
|
|
3179
|
+
continue;
|
|
3180
|
+
}
|
|
3181
|
+
case 3: {
|
|
3182
|
+
if (tag !== 26) {
|
|
3183
|
+
break;
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
message.formatted = reader.string();
|
|
3187
|
+
continue;
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3191
|
+
break;
|
|
3192
|
+
}
|
|
3193
|
+
reader.skip(tag & 7);
|
|
3194
|
+
}
|
|
3195
|
+
return message;
|
|
3196
|
+
},
|
|
3197
|
+
|
|
3198
|
+
fromJSON(object: any): FiatValue {
|
|
3199
|
+
return {
|
|
3200
|
+
currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
|
|
3201
|
+
amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
|
|
3202
|
+
formatted: isSet(object.formatted) ? globalThis.String(object.formatted) : "",
|
|
3203
|
+
};
|
|
3204
|
+
},
|
|
3205
|
+
|
|
3206
|
+
toJSON(message: FiatValue): unknown {
|
|
3207
|
+
const obj: any = {};
|
|
3208
|
+
if (message.currency !== "") {
|
|
3209
|
+
obj.currency = message.currency;
|
|
3210
|
+
}
|
|
3211
|
+
if (message.amount !== 0) {
|
|
3212
|
+
obj.amount = message.amount;
|
|
3213
|
+
}
|
|
3214
|
+
if (message.formatted !== "") {
|
|
3215
|
+
obj.formatted = message.formatted;
|
|
3216
|
+
}
|
|
3217
|
+
return obj;
|
|
3218
|
+
},
|
|
3219
|
+
|
|
3220
|
+
create<I extends Exact<DeepPartial<FiatValue>, I>>(base?: I): FiatValue {
|
|
3221
|
+
return FiatValue.fromPartial(base ?? ({} as any));
|
|
3222
|
+
},
|
|
3223
|
+
fromPartial<I extends Exact<DeepPartial<FiatValue>, I>>(object: I): FiatValue {
|
|
3224
|
+
const message = createBaseFiatValue();
|
|
3225
|
+
message.currency = object.currency ?? "";
|
|
3226
|
+
message.amount = object.amount ?? 0;
|
|
3227
|
+
message.formatted = object.formatted ?? "";
|
|
3228
|
+
return message;
|
|
3229
|
+
},
|
|
3230
|
+
};
|
|
3231
|
+
|
|
3232
|
+
function createBaseCalldataInfo(): CalldataInfo {
|
|
3233
|
+
return { rawHex: "", functionSelector: "", functionName: "", functionSignature: "", params: [] };
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
export const CalldataInfo: MessageFns<CalldataInfo> = {
|
|
3237
|
+
encode(message: CalldataInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3238
|
+
if (message.rawHex !== "") {
|
|
3239
|
+
writer.uint32(10).string(message.rawHex);
|
|
3240
|
+
}
|
|
3241
|
+
if (message.functionSelector !== "") {
|
|
3242
|
+
writer.uint32(18).string(message.functionSelector);
|
|
3243
|
+
}
|
|
3244
|
+
if (message.functionName !== "") {
|
|
3245
|
+
writer.uint32(26).string(message.functionName);
|
|
3246
|
+
}
|
|
3247
|
+
if (message.functionSignature !== "") {
|
|
3248
|
+
writer.uint32(34).string(message.functionSignature);
|
|
3249
|
+
}
|
|
3250
|
+
for (const v of message.params) {
|
|
3251
|
+
DecodedParam.encode(v!, writer.uint32(42).fork()).join();
|
|
3252
|
+
}
|
|
3253
|
+
return writer;
|
|
3254
|
+
},
|
|
3255
|
+
|
|
3256
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CalldataInfo {
|
|
3257
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3258
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3259
|
+
const message = createBaseCalldataInfo();
|
|
3260
|
+
while (reader.pos < end) {
|
|
3261
|
+
const tag = reader.uint32();
|
|
3262
|
+
switch (tag >>> 3) {
|
|
3263
|
+
case 1: {
|
|
3264
|
+
if (tag !== 10) {
|
|
3265
|
+
break;
|
|
3266
|
+
}
|
|
3267
|
+
|
|
3268
|
+
message.rawHex = reader.string();
|
|
3269
|
+
continue;
|
|
3270
|
+
}
|
|
3271
|
+
case 2: {
|
|
3272
|
+
if (tag !== 18) {
|
|
3273
|
+
break;
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
message.functionSelector = reader.string();
|
|
3277
|
+
continue;
|
|
3278
|
+
}
|
|
3279
|
+
case 3: {
|
|
3280
|
+
if (tag !== 26) {
|
|
3281
|
+
break;
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
message.functionName = reader.string();
|
|
3285
|
+
continue;
|
|
3286
|
+
}
|
|
3287
|
+
case 4: {
|
|
3288
|
+
if (tag !== 34) {
|
|
3289
|
+
break;
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
message.functionSignature = reader.string();
|
|
3293
|
+
continue;
|
|
3294
|
+
}
|
|
3295
|
+
case 5: {
|
|
3296
|
+
if (tag !== 42) {
|
|
3297
|
+
break;
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
message.params.push(DecodedParam.decode(reader, reader.uint32()));
|
|
3301
|
+
continue;
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3305
|
+
break;
|
|
3306
|
+
}
|
|
3307
|
+
reader.skip(tag & 7);
|
|
3308
|
+
}
|
|
3309
|
+
return message;
|
|
3310
|
+
},
|
|
3311
|
+
|
|
3312
|
+
fromJSON(object: any): CalldataInfo {
|
|
3313
|
+
return {
|
|
3314
|
+
rawHex: isSet(object.rawHex)
|
|
3315
|
+
? globalThis.String(object.rawHex)
|
|
3316
|
+
: isSet(object.raw_hex)
|
|
3317
|
+
? globalThis.String(object.raw_hex)
|
|
3318
|
+
: "",
|
|
3319
|
+
functionSelector: isSet(object.functionSelector)
|
|
3320
|
+
? globalThis.String(object.functionSelector)
|
|
3321
|
+
: isSet(object.function_selector)
|
|
3322
|
+
? globalThis.String(object.function_selector)
|
|
3323
|
+
: "",
|
|
3324
|
+
functionName: isSet(object.functionName)
|
|
3325
|
+
? globalThis.String(object.functionName)
|
|
3326
|
+
: isSet(object.function_name)
|
|
3327
|
+
? globalThis.String(object.function_name)
|
|
3328
|
+
: "",
|
|
3329
|
+
functionSignature: isSet(object.functionSignature)
|
|
3330
|
+
? globalThis.String(object.functionSignature)
|
|
3331
|
+
: isSet(object.function_signature)
|
|
3332
|
+
? globalThis.String(object.function_signature)
|
|
3333
|
+
: "",
|
|
3334
|
+
params: globalThis.Array.isArray(object?.params)
|
|
3335
|
+
? object.params.map((e: any) => DecodedParam.fromJSON(e))
|
|
3336
|
+
: [],
|
|
3337
|
+
};
|
|
3338
|
+
},
|
|
3339
|
+
|
|
3340
|
+
toJSON(message: CalldataInfo): unknown {
|
|
3341
|
+
const obj: any = {};
|
|
3342
|
+
if (message.rawHex !== "") {
|
|
3343
|
+
obj.rawHex = message.rawHex;
|
|
3344
|
+
}
|
|
3345
|
+
if (message.functionSelector !== "") {
|
|
3346
|
+
obj.functionSelector = message.functionSelector;
|
|
3347
|
+
}
|
|
3348
|
+
if (message.functionName !== "") {
|
|
3349
|
+
obj.functionName = message.functionName;
|
|
3350
|
+
}
|
|
3351
|
+
if (message.functionSignature !== "") {
|
|
3352
|
+
obj.functionSignature = message.functionSignature;
|
|
3353
|
+
}
|
|
3354
|
+
if (message.params?.length) {
|
|
3355
|
+
obj.params = message.params.map((e) => DecodedParam.toJSON(e));
|
|
3356
|
+
}
|
|
3357
|
+
return obj;
|
|
3358
|
+
},
|
|
3359
|
+
|
|
3360
|
+
create<I extends Exact<DeepPartial<CalldataInfo>, I>>(base?: I): CalldataInfo {
|
|
3361
|
+
return CalldataInfo.fromPartial(base ?? ({} as any));
|
|
3362
|
+
},
|
|
3363
|
+
fromPartial<I extends Exact<DeepPartial<CalldataInfo>, I>>(object: I): CalldataInfo {
|
|
3364
|
+
const message = createBaseCalldataInfo();
|
|
3365
|
+
message.rawHex = object.rawHex ?? "";
|
|
3366
|
+
message.functionSelector = object.functionSelector ?? "";
|
|
3367
|
+
message.functionName = object.functionName ?? "";
|
|
3368
|
+
message.functionSignature = object.functionSignature ?? "";
|
|
3369
|
+
message.params = object.params?.map((e) => DecodedParam.fromPartial(e)) || [];
|
|
3370
|
+
return message;
|
|
3371
|
+
},
|
|
3372
|
+
};
|
|
3373
|
+
|
|
3374
|
+
function createBaseDecodedParam(): DecodedParam {
|
|
3375
|
+
return { name: "", solidityType: "", value: "", indexed: false };
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
export const DecodedParam: MessageFns<DecodedParam> = {
|
|
3379
|
+
encode(message: DecodedParam, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3380
|
+
if (message.name !== "") {
|
|
3381
|
+
writer.uint32(10).string(message.name);
|
|
3382
|
+
}
|
|
3383
|
+
if (message.solidityType !== "") {
|
|
3384
|
+
writer.uint32(18).string(message.solidityType);
|
|
3385
|
+
}
|
|
3386
|
+
if (message.value !== "") {
|
|
3387
|
+
writer.uint32(26).string(message.value);
|
|
3388
|
+
}
|
|
3389
|
+
if (message.indexed !== false) {
|
|
3390
|
+
writer.uint32(32).bool(message.indexed);
|
|
3391
|
+
}
|
|
3392
|
+
return writer;
|
|
3393
|
+
},
|
|
3394
|
+
|
|
3395
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DecodedParam {
|
|
3396
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3397
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3398
|
+
const message = createBaseDecodedParam();
|
|
3399
|
+
while (reader.pos < end) {
|
|
3400
|
+
const tag = reader.uint32();
|
|
3401
|
+
switch (tag >>> 3) {
|
|
3402
|
+
case 1: {
|
|
3403
|
+
if (tag !== 10) {
|
|
3404
|
+
break;
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
message.name = reader.string();
|
|
3408
|
+
continue;
|
|
3409
|
+
}
|
|
3410
|
+
case 2: {
|
|
3411
|
+
if (tag !== 18) {
|
|
3412
|
+
break;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
message.solidityType = reader.string();
|
|
3416
|
+
continue;
|
|
3417
|
+
}
|
|
3418
|
+
case 3: {
|
|
3419
|
+
if (tag !== 26) {
|
|
3420
|
+
break;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
message.value = reader.string();
|
|
3424
|
+
continue;
|
|
3425
|
+
}
|
|
3426
|
+
case 4: {
|
|
3427
|
+
if (tag !== 32) {
|
|
3428
|
+
break;
|
|
3429
|
+
}
|
|
3430
|
+
|
|
3431
|
+
message.indexed = reader.bool();
|
|
3432
|
+
continue;
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3436
|
+
break;
|
|
3437
|
+
}
|
|
3438
|
+
reader.skip(tag & 7);
|
|
3439
|
+
}
|
|
3440
|
+
return message;
|
|
3441
|
+
},
|
|
3442
|
+
|
|
3443
|
+
fromJSON(object: any): DecodedParam {
|
|
3444
|
+
return {
|
|
3445
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
3446
|
+
solidityType: isSet(object.solidityType)
|
|
3447
|
+
? globalThis.String(object.solidityType)
|
|
3448
|
+
: isSet(object.solidity_type)
|
|
3449
|
+
? globalThis.String(object.solidity_type)
|
|
3450
|
+
: "",
|
|
3451
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
3452
|
+
indexed: isSet(object.indexed) ? globalThis.Boolean(object.indexed) : false,
|
|
3453
|
+
};
|
|
3454
|
+
},
|
|
3455
|
+
|
|
3456
|
+
toJSON(message: DecodedParam): unknown {
|
|
3457
|
+
const obj: any = {};
|
|
3458
|
+
if (message.name !== "") {
|
|
3459
|
+
obj.name = message.name;
|
|
3460
|
+
}
|
|
3461
|
+
if (message.solidityType !== "") {
|
|
3462
|
+
obj.solidityType = message.solidityType;
|
|
3463
|
+
}
|
|
3464
|
+
if (message.value !== "") {
|
|
3465
|
+
obj.value = message.value;
|
|
3466
|
+
}
|
|
3467
|
+
if (message.indexed !== false) {
|
|
3468
|
+
obj.indexed = message.indexed;
|
|
3469
|
+
}
|
|
3470
|
+
return obj;
|
|
3471
|
+
},
|
|
3472
|
+
|
|
3473
|
+
create<I extends Exact<DeepPartial<DecodedParam>, I>>(base?: I): DecodedParam {
|
|
3474
|
+
return DecodedParam.fromPartial(base ?? ({} as any));
|
|
3475
|
+
},
|
|
3476
|
+
fromPartial<I extends Exact<DeepPartial<DecodedParam>, I>>(object: I): DecodedParam {
|
|
3477
|
+
const message = createBaseDecodedParam();
|
|
3478
|
+
message.name = object.name ?? "";
|
|
3479
|
+
message.solidityType = object.solidityType ?? "";
|
|
3480
|
+
message.value = object.value ?? "";
|
|
3481
|
+
message.indexed = object.indexed ?? false;
|
|
3482
|
+
return message;
|
|
3483
|
+
},
|
|
3484
|
+
};
|
|
3485
|
+
|
|
3486
|
+
function createBaseEventLog(): EventLog {
|
|
3487
|
+
return {
|
|
3488
|
+
logIndex: 0,
|
|
3489
|
+
address: "",
|
|
3490
|
+
eventName: "",
|
|
3491
|
+
eventSignature: "",
|
|
3492
|
+
params: [],
|
|
3493
|
+
rawTopics: [],
|
|
3494
|
+
rawData: "",
|
|
3495
|
+
decoded: false,
|
|
3496
|
+
activityIndex: undefined,
|
|
3497
|
+
};
|
|
3498
|
+
}
|
|
3499
|
+
|
|
3500
|
+
export const EventLog: MessageFns<EventLog> = {
|
|
3501
|
+
encode(message: EventLog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
3502
|
+
if (message.logIndex !== 0) {
|
|
3503
|
+
writer.uint32(8).uint32(message.logIndex);
|
|
3504
|
+
}
|
|
3505
|
+
if (message.address !== "") {
|
|
3506
|
+
writer.uint32(18).string(message.address);
|
|
3507
|
+
}
|
|
3508
|
+
if (message.eventName !== "") {
|
|
3509
|
+
writer.uint32(26).string(message.eventName);
|
|
3510
|
+
}
|
|
3511
|
+
if (message.eventSignature !== "") {
|
|
3512
|
+
writer.uint32(34).string(message.eventSignature);
|
|
3513
|
+
}
|
|
3514
|
+
for (const v of message.params) {
|
|
3515
|
+
DecodedParam.encode(v!, writer.uint32(42).fork()).join();
|
|
3516
|
+
}
|
|
3517
|
+
for (const v of message.rawTopics) {
|
|
3518
|
+
writer.uint32(50).string(v!);
|
|
3519
|
+
}
|
|
3520
|
+
if (message.rawData !== "") {
|
|
3521
|
+
writer.uint32(58).string(message.rawData);
|
|
3522
|
+
}
|
|
3523
|
+
if (message.decoded !== false) {
|
|
3524
|
+
writer.uint32(64).bool(message.decoded);
|
|
3525
|
+
}
|
|
3526
|
+
if (message.activityIndex !== undefined) {
|
|
3527
|
+
writer.uint32(72).uint32(message.activityIndex);
|
|
3528
|
+
}
|
|
3529
|
+
return writer;
|
|
3530
|
+
},
|
|
3531
|
+
|
|
3532
|
+
decode(input: BinaryReader | Uint8Array, length?: number): EventLog {
|
|
3533
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3534
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3535
|
+
const message = createBaseEventLog();
|
|
3536
|
+
while (reader.pos < end) {
|
|
3537
|
+
const tag = reader.uint32();
|
|
3538
|
+
switch (tag >>> 3) {
|
|
3539
|
+
case 1: {
|
|
3540
|
+
if (tag !== 8) {
|
|
3541
|
+
break;
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
message.logIndex = reader.uint32();
|
|
3545
|
+
continue;
|
|
3546
|
+
}
|
|
3547
|
+
case 2: {
|
|
3548
|
+
if (tag !== 18) {
|
|
3549
|
+
break;
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
message.address = reader.string();
|
|
3553
|
+
continue;
|
|
3554
|
+
}
|
|
3555
|
+
case 3: {
|
|
3556
|
+
if (tag !== 26) {
|
|
3557
|
+
break;
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
message.eventName = reader.string();
|
|
3561
|
+
continue;
|
|
3562
|
+
}
|
|
3563
|
+
case 4: {
|
|
3564
|
+
if (tag !== 34) {
|
|
3565
|
+
break;
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
message.eventSignature = reader.string();
|
|
3569
|
+
continue;
|
|
3570
|
+
}
|
|
3571
|
+
case 5: {
|
|
3572
|
+
if (tag !== 42) {
|
|
3573
|
+
break;
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
message.params.push(DecodedParam.decode(reader, reader.uint32()));
|
|
3577
|
+
continue;
|
|
3578
|
+
}
|
|
3579
|
+
case 6: {
|
|
3580
|
+
if (tag !== 50) {
|
|
3581
|
+
break;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
message.rawTopics.push(reader.string());
|
|
3585
|
+
continue;
|
|
3586
|
+
}
|
|
3587
|
+
case 7: {
|
|
3588
|
+
if (tag !== 58) {
|
|
3589
|
+
break;
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3592
|
+
message.rawData = reader.string();
|
|
3593
|
+
continue;
|
|
3594
|
+
}
|
|
3595
|
+
case 8: {
|
|
3596
|
+
if (tag !== 64) {
|
|
3597
|
+
break;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
message.decoded = reader.bool();
|
|
3601
|
+
continue;
|
|
3602
|
+
}
|
|
3603
|
+
case 9: {
|
|
3604
|
+
if (tag !== 72) {
|
|
3605
|
+
break;
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
message.activityIndex = reader.uint32();
|
|
3609
|
+
continue;
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3613
|
+
break;
|
|
3614
|
+
}
|
|
3615
|
+
reader.skip(tag & 7);
|
|
3616
|
+
}
|
|
3617
|
+
return message;
|
|
3618
|
+
},
|
|
3619
|
+
|
|
3620
|
+
fromJSON(object: any): EventLog {
|
|
3621
|
+
return {
|
|
3622
|
+
logIndex: isSet(object.logIndex)
|
|
3623
|
+
? globalThis.Number(object.logIndex)
|
|
3624
|
+
: isSet(object.log_index)
|
|
3625
|
+
? globalThis.Number(object.log_index)
|
|
3626
|
+
: 0,
|
|
3627
|
+
address: isSet(object.address) ? globalThis.String(object.address) : "",
|
|
3628
|
+
eventName: isSet(object.eventName)
|
|
3629
|
+
? globalThis.String(object.eventName)
|
|
3630
|
+
: isSet(object.event_name)
|
|
3631
|
+
? globalThis.String(object.event_name)
|
|
3632
|
+
: "",
|
|
3633
|
+
eventSignature: isSet(object.eventSignature)
|
|
3634
|
+
? globalThis.String(object.eventSignature)
|
|
3635
|
+
: isSet(object.event_signature)
|
|
3636
|
+
? globalThis.String(object.event_signature)
|
|
3637
|
+
: "",
|
|
3638
|
+
params: globalThis.Array.isArray(object?.params)
|
|
3639
|
+
? object.params.map((e: any) => DecodedParam.fromJSON(e))
|
|
3640
|
+
: [],
|
|
3641
|
+
rawTopics: globalThis.Array.isArray(object?.rawTopics)
|
|
3642
|
+
? object.rawTopics.map((e: any) => globalThis.String(e))
|
|
3643
|
+
: globalThis.Array.isArray(object?.raw_topics)
|
|
3644
|
+
? object.raw_topics.map((e: any) => globalThis.String(e))
|
|
3645
|
+
: [],
|
|
3646
|
+
rawData: isSet(object.rawData)
|
|
3647
|
+
? globalThis.String(object.rawData)
|
|
3648
|
+
: isSet(object.raw_data)
|
|
3649
|
+
? globalThis.String(object.raw_data)
|
|
3650
|
+
: "",
|
|
3651
|
+
decoded: isSet(object.decoded) ? globalThis.Boolean(object.decoded) : false,
|
|
3652
|
+
activityIndex: isSet(object.activityIndex)
|
|
3653
|
+
? globalThis.Number(object.activityIndex)
|
|
3654
|
+
: isSet(object.activity_index)
|
|
3655
|
+
? globalThis.Number(object.activity_index)
|
|
3656
|
+
: undefined,
|
|
3657
|
+
};
|
|
3658
|
+
},
|
|
3659
|
+
|
|
3660
|
+
toJSON(message: EventLog): unknown {
|
|
3661
|
+
const obj: any = {};
|
|
3662
|
+
if (message.logIndex !== 0) {
|
|
3663
|
+
obj.logIndex = Math.round(message.logIndex);
|
|
3664
|
+
}
|
|
3665
|
+
if (message.address !== "") {
|
|
3666
|
+
obj.address = message.address;
|
|
3667
|
+
}
|
|
3668
|
+
if (message.eventName !== "") {
|
|
3669
|
+
obj.eventName = message.eventName;
|
|
3670
|
+
}
|
|
3671
|
+
if (message.eventSignature !== "") {
|
|
3672
|
+
obj.eventSignature = message.eventSignature;
|
|
3673
|
+
}
|
|
3674
|
+
if (message.params?.length) {
|
|
3675
|
+
obj.params = message.params.map((e) => DecodedParam.toJSON(e));
|
|
3676
|
+
}
|
|
3677
|
+
if (message.rawTopics?.length) {
|
|
3678
|
+
obj.rawTopics = message.rawTopics;
|
|
3679
|
+
}
|
|
3680
|
+
if (message.rawData !== "") {
|
|
3681
|
+
obj.rawData = message.rawData;
|
|
3682
|
+
}
|
|
3683
|
+
if (message.decoded !== false) {
|
|
3684
|
+
obj.decoded = message.decoded;
|
|
3685
|
+
}
|
|
3686
|
+
if (message.activityIndex !== undefined) {
|
|
3687
|
+
obj.activityIndex = Math.round(message.activityIndex);
|
|
3688
|
+
}
|
|
3689
|
+
return obj;
|
|
3690
|
+
},
|
|
3691
|
+
|
|
3692
|
+
create<I extends Exact<DeepPartial<EventLog>, I>>(base?: I): EventLog {
|
|
3693
|
+
return EventLog.fromPartial(base ?? ({} as any));
|
|
3694
|
+
},
|
|
3695
|
+
fromPartial<I extends Exact<DeepPartial<EventLog>, I>>(object: I): EventLog {
|
|
3696
|
+
const message = createBaseEventLog();
|
|
3697
|
+
message.logIndex = object.logIndex ?? 0;
|
|
3698
|
+
message.address = object.address ?? "";
|
|
3699
|
+
message.eventName = object.eventName ?? "";
|
|
3700
|
+
message.eventSignature = object.eventSignature ?? "";
|
|
3701
|
+
message.params = object.params?.map((e) => DecodedParam.fromPartial(e)) || [];
|
|
3702
|
+
message.rawTopics = object.rawTopics?.map((e) => e) || [];
|
|
3703
|
+
message.rawData = object.rawData ?? "";
|
|
3704
|
+
message.decoded = object.decoded ?? false;
|
|
3705
|
+
message.activityIndex = object.activityIndex ?? undefined;
|
|
3706
|
+
return message;
|
|
3707
|
+
},
|
|
3708
|
+
};
|
|
3709
|
+
|
|
3710
|
+
export interface ChainGatewayService {
|
|
3711
|
+
/** Block number streaming per chain */
|
|
3712
|
+
StreamEvmBlock(request: StreamEvmBlockRequest, metadata?: Metadata): Observable<EvmBlockUpdate>;
|
|
3713
|
+
/** Transaction activity cards (high-level semantic activities) */
|
|
3714
|
+
GetEvmActivity(request: GetEvmActivityRequest, metadata?: Metadata): Promise<GetEvmActivityResponse>;
|
|
3715
|
+
/** Contract source code and metadata */
|
|
3716
|
+
GetContractInfo(request: GetContractInfoRequest, metadata?: Metadata): Promise<GetContractInfoResponse>;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
export const ChainGatewayServiceServiceName = "gateway.web.v1.ChainGatewayService";
|
|
3720
|
+
export class ChainGatewayServiceClientImpl implements ChainGatewayService {
|
|
3721
|
+
private readonly rpc: Rpc;
|
|
3722
|
+
private readonly service: string;
|
|
3723
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
3724
|
+
this.service = opts?.service || ChainGatewayServiceServiceName;
|
|
3725
|
+
this.rpc = rpc;
|
|
3726
|
+
this.StreamEvmBlock = this.StreamEvmBlock.bind(this);
|
|
3727
|
+
this.GetEvmActivity = this.GetEvmActivity.bind(this);
|
|
3728
|
+
this.GetContractInfo = this.GetContractInfo.bind(this);
|
|
3729
|
+
}
|
|
3730
|
+
StreamEvmBlock(request: StreamEvmBlockRequest, metadata?: Metadata): Observable<EvmBlockUpdate> {
|
|
3731
|
+
const data = StreamEvmBlockRequest.encode(request).finish();
|
|
3732
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamEvmBlock", data, metadata);
|
|
3733
|
+
return result.pipe(map((data) => EvmBlockUpdate.decode(new BinaryReader(data))));
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
GetEvmActivity(request: GetEvmActivityRequest, metadata?: Metadata): Promise<GetEvmActivityResponse> {
|
|
3737
|
+
const data = GetEvmActivityRequest.encode(request).finish();
|
|
3738
|
+
const promise = this.rpc.request(this.service, "GetEvmActivity", data, metadata);
|
|
3739
|
+
return promise.then((data) => GetEvmActivityResponse.decode(new BinaryReader(data)));
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
GetContractInfo(request: GetContractInfoRequest, metadata?: Metadata): Promise<GetContractInfoResponse> {
|
|
3743
|
+
const data = GetContractInfoRequest.encode(request).finish();
|
|
3744
|
+
const promise = this.rpc.request(this.service, "GetContractInfo", data, metadata);
|
|
3745
|
+
return promise.then((data) => GetContractInfoResponse.decode(new BinaryReader(data)));
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
interface Rpc {
|
|
3750
|
+
request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
|
|
3751
|
+
clientStreamingRequest(
|
|
3752
|
+
service: string,
|
|
3753
|
+
method: string,
|
|
3754
|
+
data: Observable<Uint8Array>,
|
|
3755
|
+
metadata?: Metadata,
|
|
3756
|
+
): Promise<Uint8Array>;
|
|
3757
|
+
serverStreamingRequest(
|
|
3758
|
+
service: string,
|
|
3759
|
+
method: string,
|
|
3760
|
+
data: Uint8Array,
|
|
3761
|
+
metadata?: Metadata,
|
|
3762
|
+
): Observable<Uint8Array>;
|
|
3763
|
+
bidirectionalStreamingRequest(
|
|
3764
|
+
service: string,
|
|
3765
|
+
method: string,
|
|
3766
|
+
data: Observable<Uint8Array>,
|
|
3767
|
+
metadata?: Metadata,
|
|
3768
|
+
): Observable<Uint8Array>;
|
|
3769
|
+
}
|
|
3770
|
+
|
|
3771
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
3772
|
+
|
|
3773
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
3774
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
3775
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
3776
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
3777
|
+
: Partial<T>;
|
|
3778
|
+
|
|
3779
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
3780
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
3781
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
3782
|
+
|
|
3783
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
3784
|
+
const num = globalThis.Number(int64.toString());
|
|
3785
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
3786
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
3787
|
+
}
|
|
3788
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
3789
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
3790
|
+
}
|
|
3791
|
+
return num;
|
|
3792
|
+
}
|
|
3793
|
+
|
|
3794
|
+
function isSet(value: any): boolean {
|
|
3795
|
+
return value !== null && value !== undefined;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
export interface MessageFns<T> {
|
|
3799
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
3800
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
3801
|
+
fromJSON(object: any): T;
|
|
3802
|
+
toJSON(message: T): unknown;
|
|
3803
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
3804
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
3805
|
+
}
|