blue-js-sdk 2.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +446 -0
  2. package/LICENSE +21 -0
  3. package/README.md +75 -0
  4. package/ai-path/ADMIN-ELEVATION.md +116 -0
  5. package/ai-path/AI-MANIFESTO.md +185 -0
  6. package/ai-path/BREAKING.md +74 -0
  7. package/ai-path/CHECKLIST.md +619 -0
  8. package/ai-path/CONNECTION-STEPS.md +724 -0
  9. package/ai-path/DECISION-TREE.md +378 -0
  10. package/ai-path/DEPENDENCIES.md +459 -0
  11. package/ai-path/E2E-FLOW.md +1555 -0
  12. package/ai-path/FAILURES.md +403 -0
  13. package/ai-path/GUIDE.md +1217 -0
  14. package/ai-path/README.md +558 -0
  15. package/ai-path/SPLIT-TUNNEL.md +266 -0
  16. package/ai-path/cli.js +535 -0
  17. package/ai-path/connect.js +884 -0
  18. package/ai-path/discover.js +178 -0
  19. package/ai-path/environment.js +266 -0
  20. package/ai-path/errors.js +86 -0
  21. package/ai-path/examples/autonomous-agent.mjs +220 -0
  22. package/ai-path/examples/multi-region.mjs +174 -0
  23. package/ai-path/examples/one-shot.mjs +31 -0
  24. package/ai-path/index.js +60 -0
  25. package/ai-path/pricing.js +136 -0
  26. package/ai-path/recommend.js +413 -0
  27. package/ai-path/run-admin.vbs +25 -0
  28. package/ai-path/setup.js +291 -0
  29. package/ai-path/wallet.js +137 -0
  30. package/app-helpers.js +363 -0
  31. package/app-settings.js +95 -0
  32. package/app-types.js +267 -0
  33. package/audit.js +847 -0
  34. package/batch.js +293 -0
  35. package/bin/setup.js +376 -0
  36. package/chain/authz.js +109 -0
  37. package/chain/broadcast.js +472 -0
  38. package/chain/client.js +160 -0
  39. package/chain/fee-grants.js +305 -0
  40. package/chain/index.js +891 -0
  41. package/chain/lcd.js +313 -0
  42. package/chain/queries.js +547 -0
  43. package/chain/rpc.js +408 -0
  44. package/chain/wallet.js +141 -0
  45. package/cli/config.js +143 -0
  46. package/cli/index.js +463 -0
  47. package/cli/output.js +182 -0
  48. package/cli.js +491 -0
  49. package/client/index.js +251 -0
  50. package/client.js +271 -0
  51. package/config/index.js +255 -0
  52. package/connection/connect.js +849 -0
  53. package/connection/disconnect.js +180 -0
  54. package/connection/discovery.js +321 -0
  55. package/connection/index.js +76 -0
  56. package/connection/proxy.js +148 -0
  57. package/connection/resilience.js +428 -0
  58. package/connection/security.js +232 -0
  59. package/connection/state.js +369 -0
  60. package/connection/tunnel.js +691 -0
  61. package/consumer.js +132 -0
  62. package/cosmjs-setup.js +1884 -0
  63. package/defaults.js +366 -0
  64. package/disk-cache.js +107 -0
  65. package/dist/client.d.ts +108 -0
  66. package/dist/client.d.ts.map +1 -0
  67. package/dist/client.js +400 -0
  68. package/dist/client.js.map +1 -0
  69. package/dist/index.d.ts +8 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +8 -0
  72. package/dist/index.js.map +1 -0
  73. package/errors/index.js +112 -0
  74. package/errors.js +218 -0
  75. package/examples/README.md +64 -0
  76. package/examples/connect-direct.mjs +106 -0
  77. package/examples/connect-plan.mjs +125 -0
  78. package/examples/error-handling.mjs +109 -0
  79. package/examples/query-nodes.mjs +94 -0
  80. package/examples/wallet-basics.mjs +61 -0
  81. package/generated/amino/amino.ts +9 -0
  82. package/generated/cosmos/base/v1beta1/coin.ts +365 -0
  83. package/generated/cosmos_proto/cosmos.ts +323 -0
  84. package/generated/gogoproto/gogo.ts +9 -0
  85. package/generated/google/protobuf/descriptor.ts +7601 -0
  86. package/generated/google/protobuf/duration.ts +208 -0
  87. package/generated/google/protobuf/timestamp.ts +238 -0
  88. package/generated/sentinel/lease/v1/events.ts +924 -0
  89. package/generated/sentinel/lease/v1/lease.ts +292 -0
  90. package/generated/sentinel/lease/v1/msg.ts +949 -0
  91. package/generated/sentinel/lease/v1/params.ts +164 -0
  92. package/generated/sentinel/node/v3/events.ts +881 -0
  93. package/generated/sentinel/node/v3/msg.ts +1002 -0
  94. package/generated/sentinel/node/v3/node.ts +263 -0
  95. package/generated/sentinel/node/v3/params.ts +183 -0
  96. package/generated/sentinel/plan/v3/events.ts +675 -0
  97. package/generated/sentinel/plan/v3/msg.ts +1191 -0
  98. package/generated/sentinel/plan/v3/plan.ts +283 -0
  99. package/generated/sentinel/provider/v2/events.ts +171 -0
  100. package/generated/sentinel/provider/v2/msg.ts +480 -0
  101. package/generated/sentinel/provider/v2/params.ts +131 -0
  102. package/generated/sentinel/provider/v2/provider.ts +246 -0
  103. package/generated/sentinel/session/v3/events.ts +480 -0
  104. package/generated/sentinel/session/v3/msg.ts +616 -0
  105. package/generated/sentinel/session/v3/params.ts +260 -0
  106. package/generated/sentinel/session/v3/proof.ts +180 -0
  107. package/generated/sentinel/session/v3/session.ts +384 -0
  108. package/generated/sentinel/subscription/v3/events.ts +1181 -0
  109. package/generated/sentinel/subscription/v3/msg.ts +1305 -0
  110. package/generated/sentinel/subscription/v3/params.ts +167 -0
  111. package/generated/sentinel/subscription/v3/subscription.ts +315 -0
  112. package/generated/sentinel/types/v1/bandwidth.ts +124 -0
  113. package/generated/sentinel/types/v1/price.ts +149 -0
  114. package/generated/sentinel/types/v1/renewal.ts +87 -0
  115. package/generated/sentinel/types/v1/status.ts +54 -0
  116. package/generated/typeRegistry.ts +27 -0
  117. package/index.js +486 -0
  118. package/node-connect.js +3015 -0
  119. package/operator.js +134 -0
  120. package/package.json +113 -0
  121. package/plan-operations.js +199 -0
  122. package/preflight.js +352 -0
  123. package/pricing/index.js +262 -0
  124. package/proto/amino/amino.proto +84 -0
  125. package/proto/cosmos/base/v1beta1/coin.proto +61 -0
  126. package/proto/cosmos_proto/cosmos.proto +112 -0
  127. package/proto/gogoproto/gogo.proto +145 -0
  128. package/proto/google/api/annotations.proto +31 -0
  129. package/proto/google/api/http.proto +370 -0
  130. package/proto/google/protobuf/any.proto +106 -0
  131. package/proto/google/protobuf/duration.proto +115 -0
  132. package/proto/google/protobuf/timestamp.proto +145 -0
  133. package/proto/sentinel/lease/v1/events.proto +52 -0
  134. package/proto/sentinel/lease/v1/genesis.proto +15 -0
  135. package/proto/sentinel/lease/v1/lease.proto +25 -0
  136. package/proto/sentinel/lease/v1/msg.proto +62 -0
  137. package/proto/sentinel/lease/v1/params.proto +17 -0
  138. package/proto/sentinel/node/v3/events.proto +50 -0
  139. package/proto/sentinel/node/v3/genesis.proto +15 -0
  140. package/proto/sentinel/node/v3/msg.proto +63 -0
  141. package/proto/sentinel/node/v3/node.proto +27 -0
  142. package/proto/sentinel/node/v3/params.proto +21 -0
  143. package/proto/sentinel/node/v3/querier.proto +63 -0
  144. package/proto/sentinel/plan/v3/events.proto +41 -0
  145. package/proto/sentinel/plan/v3/genesis.proto +21 -0
  146. package/proto/sentinel/plan/v3/msg.proto +83 -0
  147. package/proto/sentinel/plan/v3/plan.proto +32 -0
  148. package/proto/sentinel/plan/v3/querier.proto +53 -0
  149. package/proto/sentinel/provider/v2/events.proto +16 -0
  150. package/proto/sentinel/provider/v2/genesis.proto +15 -0
  151. package/proto/sentinel/provider/v2/msg.proto +35 -0
  152. package/proto/sentinel/provider/v2/params.proto +17 -0
  153. package/proto/sentinel/provider/v2/provider.proto +24 -0
  154. package/proto/sentinel/provider/v3/genesis.proto +15 -0
  155. package/proto/sentinel/provider/v3/params.proto +13 -0
  156. package/proto/sentinel/session/v3/events.proto +30 -0
  157. package/proto/sentinel/session/v3/genesis.proto +15 -0
  158. package/proto/sentinel/session/v3/msg.proto +50 -0
  159. package/proto/sentinel/session/v3/params.proto +25 -0
  160. package/proto/sentinel/session/v3/proof.proto +25 -0
  161. package/proto/sentinel/session/v3/querier.proto +100 -0
  162. package/proto/sentinel/session/v3/session.proto +50 -0
  163. package/proto/sentinel/subscription/v2/allocation.proto +21 -0
  164. package/proto/sentinel/subscription/v2/payout.proto +22 -0
  165. package/proto/sentinel/subscription/v3/events.proto +65 -0
  166. package/proto/sentinel/subscription/v3/genesis.proto +17 -0
  167. package/proto/sentinel/subscription/v3/msg.proto +83 -0
  168. package/proto/sentinel/subscription/v3/params.proto +21 -0
  169. package/proto/sentinel/subscription/v3/subscription.proto +33 -0
  170. package/proto/sentinel/types/v1/bandwidth.proto +19 -0
  171. package/proto/sentinel/types/v1/price.proto +21 -0
  172. package/proto/sentinel/types/v1/renewal.proto +21 -0
  173. package/proto/sentinel/types/v1/status.proto +16 -0
  174. package/protocol/encoding.js +341 -0
  175. package/protocol/events.js +361 -0
  176. package/protocol/handshake.js +297 -0
  177. package/protocol/index.js +15 -0
  178. package/protocol/messages.js +346 -0
  179. package/protocol/plans.js +199 -0
  180. package/protocol/v2ray.js +268 -0
  181. package/protocol/v3.js +723 -0
  182. package/protocol/wireguard.js +125 -0
  183. package/security/index.js +132 -0
  184. package/session-manager.js +329 -0
  185. package/session-tracker.js +80 -0
  186. package/setup.js +376 -0
  187. package/speedtest/index.js +528 -0
  188. package/speedtest.js +567 -0
  189. package/src/client.ts +502 -0
  190. package/src/index.ts +20 -0
  191. package/state/index.js +347 -0
  192. package/state.js +516 -0
  193. package/test-all-chain-ops.js +493 -0
  194. package/test-all-logic.js +199 -0
  195. package/test-all-msg-types.js +292 -0
  196. package/test-every-connection.js +208 -0
  197. package/test-feegrant-connect.js +98 -0
  198. package/test-logic.js +148 -0
  199. package/test-mainnet.js +176 -0
  200. package/test-plan-lifecycle.js +335 -0
  201. package/tls-trust.js +132 -0
  202. package/tsconfig.build.json +20 -0
  203. package/tsconfig.json +34 -0
  204. package/types/chain.d.ts +746 -0
  205. package/types/connection.d.ts +425 -0
  206. package/types/errors.d.ts +174 -0
  207. package/types/index.d.ts +1380 -0
  208. package/types/nodes.d.ts +187 -0
  209. package/types/pricing.d.ts +156 -0
  210. package/types/protocol.d.ts +332 -0
  211. package/types/session.d.ts +236 -0
  212. package/types/settings.d.ts +192 -0
  213. package/v3protocol.js +1053 -0
  214. package/wallet/index.js +153 -0
  215. package/wireguard.js +307 -0
@@ -0,0 +1,480 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v7.34.0
5
+ // source: sentinel/session/v3/events.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import { messageTypeRegistry } from "../../../typeRegistry";
10
+
11
+ export const protobufPackage = "sentinel.session.v3";
12
+
13
+ export interface EventEnd {
14
+ $type: "sentinel.session.v3.EventEnd";
15
+ sessionId: number;
16
+ accAddress: string;
17
+ nodeAddress: string;
18
+ }
19
+
20
+ export interface EventUpdateDetails {
21
+ $type: "sentinel.session.v3.EventUpdateDetails";
22
+ sessionId: number;
23
+ accAddress: string;
24
+ nodeAddress: string;
25
+ downloadBytes: string;
26
+ uploadBytes: string;
27
+ duration: string;
28
+ }
29
+
30
+ export interface EventUpdateStatus {
31
+ $type: "sentinel.session.v3.EventUpdateStatus";
32
+ sessionId: number;
33
+ accAddress: string;
34
+ nodeAddress: string;
35
+ status: string;
36
+ }
37
+
38
+ function createBaseEventEnd(): EventEnd {
39
+ return { $type: "sentinel.session.v3.EventEnd", sessionId: 0, accAddress: "", nodeAddress: "" };
40
+ }
41
+
42
+ export const EventEnd: MessageFns<EventEnd, "sentinel.session.v3.EventEnd"> = {
43
+ $type: "sentinel.session.v3.EventEnd" as const,
44
+
45
+ encode(message: EventEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
46
+ if (message.sessionId !== 0) {
47
+ writer.uint32(8).uint64(message.sessionId);
48
+ }
49
+ if (message.accAddress !== "") {
50
+ writer.uint32(18).string(message.accAddress);
51
+ }
52
+ if (message.nodeAddress !== "") {
53
+ writer.uint32(26).string(message.nodeAddress);
54
+ }
55
+ return writer;
56
+ },
57
+
58
+ decode(input: BinaryReader | Uint8Array, length?: number): EventEnd {
59
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
60
+ const end = length === undefined ? reader.len : reader.pos + length;
61
+ const message = createBaseEventEnd();
62
+ while (reader.pos < end) {
63
+ const tag = reader.uint32();
64
+ switch (tag >>> 3) {
65
+ case 1: {
66
+ if (tag !== 8) {
67
+ break;
68
+ }
69
+
70
+ message.sessionId = longToNumber(reader.uint64());
71
+ continue;
72
+ }
73
+ case 2: {
74
+ if (tag !== 18) {
75
+ break;
76
+ }
77
+
78
+ message.accAddress = reader.string();
79
+ continue;
80
+ }
81
+ case 3: {
82
+ if (tag !== 26) {
83
+ break;
84
+ }
85
+
86
+ message.nodeAddress = reader.string();
87
+ continue;
88
+ }
89
+ }
90
+ if ((tag & 7) === 4 || tag === 0) {
91
+ break;
92
+ }
93
+ reader.skip(tag & 7);
94
+ }
95
+ return message;
96
+ },
97
+
98
+ fromJSON(object: any): EventEnd {
99
+ return {
100
+ $type: EventEnd.$type,
101
+ sessionId: isSet(object.sessionId)
102
+ ? globalThis.Number(object.sessionId)
103
+ : isSet(object.session_id)
104
+ ? globalThis.Number(object.session_id)
105
+ : 0,
106
+ accAddress: isSet(object.accAddress)
107
+ ? globalThis.String(object.accAddress)
108
+ : isSet(object.acc_address)
109
+ ? globalThis.String(object.acc_address)
110
+ : "",
111
+ nodeAddress: isSet(object.nodeAddress)
112
+ ? globalThis.String(object.nodeAddress)
113
+ : isSet(object.node_address)
114
+ ? globalThis.String(object.node_address)
115
+ : "",
116
+ };
117
+ },
118
+
119
+ toJSON(message: EventEnd): unknown {
120
+ const obj: any = {};
121
+ if (message.sessionId !== 0) {
122
+ obj.sessionId = Math.round(message.sessionId);
123
+ }
124
+ if (message.accAddress !== "") {
125
+ obj.accAddress = message.accAddress;
126
+ }
127
+ if (message.nodeAddress !== "") {
128
+ obj.nodeAddress = message.nodeAddress;
129
+ }
130
+ return obj;
131
+ },
132
+
133
+ create<I extends Exact<DeepPartial<EventEnd>, I>>(base?: I): EventEnd {
134
+ return EventEnd.fromPartial(base ?? ({} as any));
135
+ },
136
+ fromPartial<I extends Exact<DeepPartial<EventEnd>, I>>(object: I): EventEnd {
137
+ const message = createBaseEventEnd();
138
+ message.sessionId = object.sessionId ?? 0;
139
+ message.accAddress = object.accAddress ?? "";
140
+ message.nodeAddress = object.nodeAddress ?? "";
141
+ return message;
142
+ },
143
+ };
144
+
145
+ messageTypeRegistry.set(EventEnd.$type, EventEnd);
146
+
147
+ function createBaseEventUpdateDetails(): EventUpdateDetails {
148
+ return {
149
+ $type: "sentinel.session.v3.EventUpdateDetails",
150
+ sessionId: 0,
151
+ accAddress: "",
152
+ nodeAddress: "",
153
+ downloadBytes: "",
154
+ uploadBytes: "",
155
+ duration: "",
156
+ };
157
+ }
158
+
159
+ export const EventUpdateDetails: MessageFns<EventUpdateDetails, "sentinel.session.v3.EventUpdateDetails"> = {
160
+ $type: "sentinel.session.v3.EventUpdateDetails" as const,
161
+
162
+ encode(message: EventUpdateDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
163
+ if (message.sessionId !== 0) {
164
+ writer.uint32(8).uint64(message.sessionId);
165
+ }
166
+ if (message.accAddress !== "") {
167
+ writer.uint32(18).string(message.accAddress);
168
+ }
169
+ if (message.nodeAddress !== "") {
170
+ writer.uint32(26).string(message.nodeAddress);
171
+ }
172
+ if (message.downloadBytes !== "") {
173
+ writer.uint32(34).string(message.downloadBytes);
174
+ }
175
+ if (message.uploadBytes !== "") {
176
+ writer.uint32(42).string(message.uploadBytes);
177
+ }
178
+ if (message.duration !== "") {
179
+ writer.uint32(50).string(message.duration);
180
+ }
181
+ return writer;
182
+ },
183
+
184
+ decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateDetails {
185
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
186
+ const end = length === undefined ? reader.len : reader.pos + length;
187
+ const message = createBaseEventUpdateDetails();
188
+ while (reader.pos < end) {
189
+ const tag = reader.uint32();
190
+ switch (tag >>> 3) {
191
+ case 1: {
192
+ if (tag !== 8) {
193
+ break;
194
+ }
195
+
196
+ message.sessionId = longToNumber(reader.uint64());
197
+ continue;
198
+ }
199
+ case 2: {
200
+ if (tag !== 18) {
201
+ break;
202
+ }
203
+
204
+ message.accAddress = reader.string();
205
+ continue;
206
+ }
207
+ case 3: {
208
+ if (tag !== 26) {
209
+ break;
210
+ }
211
+
212
+ message.nodeAddress = reader.string();
213
+ continue;
214
+ }
215
+ case 4: {
216
+ if (tag !== 34) {
217
+ break;
218
+ }
219
+
220
+ message.downloadBytes = reader.string();
221
+ continue;
222
+ }
223
+ case 5: {
224
+ if (tag !== 42) {
225
+ break;
226
+ }
227
+
228
+ message.uploadBytes = reader.string();
229
+ continue;
230
+ }
231
+ case 6: {
232
+ if (tag !== 50) {
233
+ break;
234
+ }
235
+
236
+ message.duration = reader.string();
237
+ continue;
238
+ }
239
+ }
240
+ if ((tag & 7) === 4 || tag === 0) {
241
+ break;
242
+ }
243
+ reader.skip(tag & 7);
244
+ }
245
+ return message;
246
+ },
247
+
248
+ fromJSON(object: any): EventUpdateDetails {
249
+ return {
250
+ $type: EventUpdateDetails.$type,
251
+ sessionId: isSet(object.sessionId)
252
+ ? globalThis.Number(object.sessionId)
253
+ : isSet(object.session_id)
254
+ ? globalThis.Number(object.session_id)
255
+ : 0,
256
+ accAddress: isSet(object.accAddress)
257
+ ? globalThis.String(object.accAddress)
258
+ : isSet(object.acc_address)
259
+ ? globalThis.String(object.acc_address)
260
+ : "",
261
+ nodeAddress: isSet(object.nodeAddress)
262
+ ? globalThis.String(object.nodeAddress)
263
+ : isSet(object.node_address)
264
+ ? globalThis.String(object.node_address)
265
+ : "",
266
+ downloadBytes: isSet(object.downloadBytes)
267
+ ? globalThis.String(object.downloadBytes)
268
+ : isSet(object.download_bytes)
269
+ ? globalThis.String(object.download_bytes)
270
+ : "",
271
+ uploadBytes: isSet(object.uploadBytes)
272
+ ? globalThis.String(object.uploadBytes)
273
+ : isSet(object.upload_bytes)
274
+ ? globalThis.String(object.upload_bytes)
275
+ : "",
276
+ duration: isSet(object.duration) ? globalThis.String(object.duration) : "",
277
+ };
278
+ },
279
+
280
+ toJSON(message: EventUpdateDetails): unknown {
281
+ const obj: any = {};
282
+ if (message.sessionId !== 0) {
283
+ obj.sessionId = Math.round(message.sessionId);
284
+ }
285
+ if (message.accAddress !== "") {
286
+ obj.accAddress = message.accAddress;
287
+ }
288
+ if (message.nodeAddress !== "") {
289
+ obj.nodeAddress = message.nodeAddress;
290
+ }
291
+ if (message.downloadBytes !== "") {
292
+ obj.downloadBytes = message.downloadBytes;
293
+ }
294
+ if (message.uploadBytes !== "") {
295
+ obj.uploadBytes = message.uploadBytes;
296
+ }
297
+ if (message.duration !== "") {
298
+ obj.duration = message.duration;
299
+ }
300
+ return obj;
301
+ },
302
+
303
+ create<I extends Exact<DeepPartial<EventUpdateDetails>, I>>(base?: I): EventUpdateDetails {
304
+ return EventUpdateDetails.fromPartial(base ?? ({} as any));
305
+ },
306
+ fromPartial<I extends Exact<DeepPartial<EventUpdateDetails>, I>>(object: I): EventUpdateDetails {
307
+ const message = createBaseEventUpdateDetails();
308
+ message.sessionId = object.sessionId ?? 0;
309
+ message.accAddress = object.accAddress ?? "";
310
+ message.nodeAddress = object.nodeAddress ?? "";
311
+ message.downloadBytes = object.downloadBytes ?? "";
312
+ message.uploadBytes = object.uploadBytes ?? "";
313
+ message.duration = object.duration ?? "";
314
+ return message;
315
+ },
316
+ };
317
+
318
+ messageTypeRegistry.set(EventUpdateDetails.$type, EventUpdateDetails);
319
+
320
+ function createBaseEventUpdateStatus(): EventUpdateStatus {
321
+ return { $type: "sentinel.session.v3.EventUpdateStatus", sessionId: 0, accAddress: "", nodeAddress: "", status: "" };
322
+ }
323
+
324
+ export const EventUpdateStatus: MessageFns<EventUpdateStatus, "sentinel.session.v3.EventUpdateStatus"> = {
325
+ $type: "sentinel.session.v3.EventUpdateStatus" as const,
326
+
327
+ encode(message: EventUpdateStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
328
+ if (message.sessionId !== 0) {
329
+ writer.uint32(8).uint64(message.sessionId);
330
+ }
331
+ if (message.accAddress !== "") {
332
+ writer.uint32(18).string(message.accAddress);
333
+ }
334
+ if (message.nodeAddress !== "") {
335
+ writer.uint32(26).string(message.nodeAddress);
336
+ }
337
+ if (message.status !== "") {
338
+ writer.uint32(34).string(message.status);
339
+ }
340
+ return writer;
341
+ },
342
+
343
+ decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateStatus {
344
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
345
+ const end = length === undefined ? reader.len : reader.pos + length;
346
+ const message = createBaseEventUpdateStatus();
347
+ while (reader.pos < end) {
348
+ const tag = reader.uint32();
349
+ switch (tag >>> 3) {
350
+ case 1: {
351
+ if (tag !== 8) {
352
+ break;
353
+ }
354
+
355
+ message.sessionId = longToNumber(reader.uint64());
356
+ continue;
357
+ }
358
+ case 2: {
359
+ if (tag !== 18) {
360
+ break;
361
+ }
362
+
363
+ message.accAddress = reader.string();
364
+ continue;
365
+ }
366
+ case 3: {
367
+ if (tag !== 26) {
368
+ break;
369
+ }
370
+
371
+ message.nodeAddress = reader.string();
372
+ continue;
373
+ }
374
+ case 4: {
375
+ if (tag !== 34) {
376
+ break;
377
+ }
378
+
379
+ message.status = reader.string();
380
+ continue;
381
+ }
382
+ }
383
+ if ((tag & 7) === 4 || tag === 0) {
384
+ break;
385
+ }
386
+ reader.skip(tag & 7);
387
+ }
388
+ return message;
389
+ },
390
+
391
+ fromJSON(object: any): EventUpdateStatus {
392
+ return {
393
+ $type: EventUpdateStatus.$type,
394
+ sessionId: isSet(object.sessionId)
395
+ ? globalThis.Number(object.sessionId)
396
+ : isSet(object.session_id)
397
+ ? globalThis.Number(object.session_id)
398
+ : 0,
399
+ accAddress: isSet(object.accAddress)
400
+ ? globalThis.String(object.accAddress)
401
+ : isSet(object.acc_address)
402
+ ? globalThis.String(object.acc_address)
403
+ : "",
404
+ nodeAddress: isSet(object.nodeAddress)
405
+ ? globalThis.String(object.nodeAddress)
406
+ : isSet(object.node_address)
407
+ ? globalThis.String(object.node_address)
408
+ : "",
409
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
410
+ };
411
+ },
412
+
413
+ toJSON(message: EventUpdateStatus): unknown {
414
+ const obj: any = {};
415
+ if (message.sessionId !== 0) {
416
+ obj.sessionId = Math.round(message.sessionId);
417
+ }
418
+ if (message.accAddress !== "") {
419
+ obj.accAddress = message.accAddress;
420
+ }
421
+ if (message.nodeAddress !== "") {
422
+ obj.nodeAddress = message.nodeAddress;
423
+ }
424
+ if (message.status !== "") {
425
+ obj.status = message.status;
426
+ }
427
+ return obj;
428
+ },
429
+
430
+ create<I extends Exact<DeepPartial<EventUpdateStatus>, I>>(base?: I): EventUpdateStatus {
431
+ return EventUpdateStatus.fromPartial(base ?? ({} as any));
432
+ },
433
+ fromPartial<I extends Exact<DeepPartial<EventUpdateStatus>, I>>(object: I): EventUpdateStatus {
434
+ const message = createBaseEventUpdateStatus();
435
+ message.sessionId = object.sessionId ?? 0;
436
+ message.accAddress = object.accAddress ?? "";
437
+ message.nodeAddress = object.nodeAddress ?? "";
438
+ message.status = object.status ?? "";
439
+ return message;
440
+ },
441
+ };
442
+
443
+ messageTypeRegistry.set(EventUpdateStatus.$type, EventUpdateStatus);
444
+
445
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
446
+
447
+ export type DeepPartial<T> = T extends Builtin ? T
448
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
449
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
450
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
451
+ : Partial<T>;
452
+
453
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
454
+ export type Exact<P, I extends P> = P extends Builtin ? P
455
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
456
+
457
+ function longToNumber(int64: { toString(): string }): number {
458
+ const num = globalThis.Number(int64.toString());
459
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
460
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
461
+ }
462
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
463
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
464
+ }
465
+ return num;
466
+ }
467
+
468
+ function isSet(value: any): boolean {
469
+ return value !== null && value !== undefined;
470
+ }
471
+
472
+ export interface MessageFns<T, V extends string> {
473
+ readonly $type: V;
474
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
475
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
476
+ fromJSON(object: any): T;
477
+ toJSON(message: T): unknown;
478
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
479
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
480
+ }