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,1181 @@
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/subscription/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.subscription.v3";
12
+
13
+ export interface EventAllocate {
14
+ $type: "sentinel.subscription.v3.EventAllocate";
15
+ subscriptionId: number;
16
+ accAddress: string;
17
+ grantedBytes: string;
18
+ utilisedBytes: string;
19
+ }
20
+
21
+ export interface EventCreate {
22
+ $type: "sentinel.subscription.v3.EventCreate";
23
+ subscriptionId: number;
24
+ planId: number;
25
+ accAddress: string;
26
+ price: string;
27
+ }
28
+
29
+ export interface EventCreateSession {
30
+ $type: "sentinel.subscription.v3.EventCreateSession";
31
+ sessionId: number;
32
+ subscriptionId: number;
33
+ accAddress: string;
34
+ nodeAddress: string;
35
+ }
36
+
37
+ export interface EventEnd {
38
+ $type: "sentinel.subscription.v3.EventEnd";
39
+ subscriptionId: number;
40
+ planId: number;
41
+ accAddress: string;
42
+ }
43
+
44
+ export interface EventPay {
45
+ $type: "sentinel.subscription.v3.EventPay";
46
+ subscriptionId: number;
47
+ planId: number;
48
+ accAddress: string;
49
+ provAddress: string;
50
+ payment: string;
51
+ stakingReward: string;
52
+ }
53
+
54
+ export interface EventRenew {
55
+ $type: "sentinel.subscription.v3.EventRenew";
56
+ subscriptionId: number;
57
+ planId: number;
58
+ accAddress: string;
59
+ price: string;
60
+ }
61
+
62
+ export interface EventUpdateDetails {
63
+ $type: "sentinel.subscription.v3.EventUpdateDetails";
64
+ subscriptionId: number;
65
+ planId: number;
66
+ accAddress: string;
67
+ renewalPricePolicy: string;
68
+ }
69
+
70
+ export interface EventUpdateStatus {
71
+ $type: "sentinel.subscription.v3.EventUpdateStatus";
72
+ subscriptionId: number;
73
+ planId: number;
74
+ accAddress: string;
75
+ status: string;
76
+ }
77
+
78
+ function createBaseEventAllocate(): EventAllocate {
79
+ return {
80
+ $type: "sentinel.subscription.v3.EventAllocate",
81
+ subscriptionId: 0,
82
+ accAddress: "",
83
+ grantedBytes: "",
84
+ utilisedBytes: "",
85
+ };
86
+ }
87
+
88
+ export const EventAllocate: MessageFns<EventAllocate, "sentinel.subscription.v3.EventAllocate"> = {
89
+ $type: "sentinel.subscription.v3.EventAllocate" as const,
90
+
91
+ encode(message: EventAllocate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
92
+ if (message.subscriptionId !== 0) {
93
+ writer.uint32(8).uint64(message.subscriptionId);
94
+ }
95
+ if (message.accAddress !== "") {
96
+ writer.uint32(18).string(message.accAddress);
97
+ }
98
+ if (message.grantedBytes !== "") {
99
+ writer.uint32(26).string(message.grantedBytes);
100
+ }
101
+ if (message.utilisedBytes !== "") {
102
+ writer.uint32(34).string(message.utilisedBytes);
103
+ }
104
+ return writer;
105
+ },
106
+
107
+ decode(input: BinaryReader | Uint8Array, length?: number): EventAllocate {
108
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
109
+ const end = length === undefined ? reader.len : reader.pos + length;
110
+ const message = createBaseEventAllocate();
111
+ while (reader.pos < end) {
112
+ const tag = reader.uint32();
113
+ switch (tag >>> 3) {
114
+ case 1: {
115
+ if (tag !== 8) {
116
+ break;
117
+ }
118
+
119
+ message.subscriptionId = longToNumber(reader.uint64());
120
+ continue;
121
+ }
122
+ case 2: {
123
+ if (tag !== 18) {
124
+ break;
125
+ }
126
+
127
+ message.accAddress = reader.string();
128
+ continue;
129
+ }
130
+ case 3: {
131
+ if (tag !== 26) {
132
+ break;
133
+ }
134
+
135
+ message.grantedBytes = reader.string();
136
+ continue;
137
+ }
138
+ case 4: {
139
+ if (tag !== 34) {
140
+ break;
141
+ }
142
+
143
+ message.utilisedBytes = reader.string();
144
+ continue;
145
+ }
146
+ }
147
+ if ((tag & 7) === 4 || tag === 0) {
148
+ break;
149
+ }
150
+ reader.skip(tag & 7);
151
+ }
152
+ return message;
153
+ },
154
+
155
+ fromJSON(object: any): EventAllocate {
156
+ return {
157
+ $type: EventAllocate.$type,
158
+ subscriptionId: isSet(object.subscriptionId)
159
+ ? globalThis.Number(object.subscriptionId)
160
+ : isSet(object.subscription_id)
161
+ ? globalThis.Number(object.subscription_id)
162
+ : 0,
163
+ accAddress: isSet(object.accAddress)
164
+ ? globalThis.String(object.accAddress)
165
+ : isSet(object.acc_address)
166
+ ? globalThis.String(object.acc_address)
167
+ : "",
168
+ grantedBytes: isSet(object.grantedBytes)
169
+ ? globalThis.String(object.grantedBytes)
170
+ : isSet(object.granted_bytes)
171
+ ? globalThis.String(object.granted_bytes)
172
+ : "",
173
+ utilisedBytes: isSet(object.utilisedBytes)
174
+ ? globalThis.String(object.utilisedBytes)
175
+ : isSet(object.utilised_bytes)
176
+ ? globalThis.String(object.utilised_bytes)
177
+ : "",
178
+ };
179
+ },
180
+
181
+ toJSON(message: EventAllocate): unknown {
182
+ const obj: any = {};
183
+ if (message.subscriptionId !== 0) {
184
+ obj.subscriptionId = Math.round(message.subscriptionId);
185
+ }
186
+ if (message.accAddress !== "") {
187
+ obj.accAddress = message.accAddress;
188
+ }
189
+ if (message.grantedBytes !== "") {
190
+ obj.grantedBytes = message.grantedBytes;
191
+ }
192
+ if (message.utilisedBytes !== "") {
193
+ obj.utilisedBytes = message.utilisedBytes;
194
+ }
195
+ return obj;
196
+ },
197
+
198
+ create<I extends Exact<DeepPartial<EventAllocate>, I>>(base?: I): EventAllocate {
199
+ return EventAllocate.fromPartial(base ?? ({} as any));
200
+ },
201
+ fromPartial<I extends Exact<DeepPartial<EventAllocate>, I>>(object: I): EventAllocate {
202
+ const message = createBaseEventAllocate();
203
+ message.subscriptionId = object.subscriptionId ?? 0;
204
+ message.accAddress = object.accAddress ?? "";
205
+ message.grantedBytes = object.grantedBytes ?? "";
206
+ message.utilisedBytes = object.utilisedBytes ?? "";
207
+ return message;
208
+ },
209
+ };
210
+
211
+ messageTypeRegistry.set(EventAllocate.$type, EventAllocate);
212
+
213
+ function createBaseEventCreate(): EventCreate {
214
+ return { $type: "sentinel.subscription.v3.EventCreate", subscriptionId: 0, planId: 0, accAddress: "", price: "" };
215
+ }
216
+
217
+ export const EventCreate: MessageFns<EventCreate, "sentinel.subscription.v3.EventCreate"> = {
218
+ $type: "sentinel.subscription.v3.EventCreate" as const,
219
+
220
+ encode(message: EventCreate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
221
+ if (message.subscriptionId !== 0) {
222
+ writer.uint32(8).uint64(message.subscriptionId);
223
+ }
224
+ if (message.planId !== 0) {
225
+ writer.uint32(16).uint64(message.planId);
226
+ }
227
+ if (message.accAddress !== "") {
228
+ writer.uint32(26).string(message.accAddress);
229
+ }
230
+ if (message.price !== "") {
231
+ writer.uint32(34).string(message.price);
232
+ }
233
+ return writer;
234
+ },
235
+
236
+ decode(input: BinaryReader | Uint8Array, length?: number): EventCreate {
237
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
238
+ const end = length === undefined ? reader.len : reader.pos + length;
239
+ const message = createBaseEventCreate();
240
+ while (reader.pos < end) {
241
+ const tag = reader.uint32();
242
+ switch (tag >>> 3) {
243
+ case 1: {
244
+ if (tag !== 8) {
245
+ break;
246
+ }
247
+
248
+ message.subscriptionId = longToNumber(reader.uint64());
249
+ continue;
250
+ }
251
+ case 2: {
252
+ if (tag !== 16) {
253
+ break;
254
+ }
255
+
256
+ message.planId = longToNumber(reader.uint64());
257
+ continue;
258
+ }
259
+ case 3: {
260
+ if (tag !== 26) {
261
+ break;
262
+ }
263
+
264
+ message.accAddress = reader.string();
265
+ continue;
266
+ }
267
+ case 4: {
268
+ if (tag !== 34) {
269
+ break;
270
+ }
271
+
272
+ message.price = reader.string();
273
+ continue;
274
+ }
275
+ }
276
+ if ((tag & 7) === 4 || tag === 0) {
277
+ break;
278
+ }
279
+ reader.skip(tag & 7);
280
+ }
281
+ return message;
282
+ },
283
+
284
+ fromJSON(object: any): EventCreate {
285
+ return {
286
+ $type: EventCreate.$type,
287
+ subscriptionId: isSet(object.subscriptionId)
288
+ ? globalThis.Number(object.subscriptionId)
289
+ : isSet(object.subscription_id)
290
+ ? globalThis.Number(object.subscription_id)
291
+ : 0,
292
+ planId: isSet(object.planId)
293
+ ? globalThis.Number(object.planId)
294
+ : isSet(object.plan_id)
295
+ ? globalThis.Number(object.plan_id)
296
+ : 0,
297
+ accAddress: isSet(object.accAddress)
298
+ ? globalThis.String(object.accAddress)
299
+ : isSet(object.acc_address)
300
+ ? globalThis.String(object.acc_address)
301
+ : "",
302
+ price: isSet(object.price) ? globalThis.String(object.price) : "",
303
+ };
304
+ },
305
+
306
+ toJSON(message: EventCreate): unknown {
307
+ const obj: any = {};
308
+ if (message.subscriptionId !== 0) {
309
+ obj.subscriptionId = Math.round(message.subscriptionId);
310
+ }
311
+ if (message.planId !== 0) {
312
+ obj.planId = Math.round(message.planId);
313
+ }
314
+ if (message.accAddress !== "") {
315
+ obj.accAddress = message.accAddress;
316
+ }
317
+ if (message.price !== "") {
318
+ obj.price = message.price;
319
+ }
320
+ return obj;
321
+ },
322
+
323
+ create<I extends Exact<DeepPartial<EventCreate>, I>>(base?: I): EventCreate {
324
+ return EventCreate.fromPartial(base ?? ({} as any));
325
+ },
326
+ fromPartial<I extends Exact<DeepPartial<EventCreate>, I>>(object: I): EventCreate {
327
+ const message = createBaseEventCreate();
328
+ message.subscriptionId = object.subscriptionId ?? 0;
329
+ message.planId = object.planId ?? 0;
330
+ message.accAddress = object.accAddress ?? "";
331
+ message.price = object.price ?? "";
332
+ return message;
333
+ },
334
+ };
335
+
336
+ messageTypeRegistry.set(EventCreate.$type, EventCreate);
337
+
338
+ function createBaseEventCreateSession(): EventCreateSession {
339
+ return {
340
+ $type: "sentinel.subscription.v3.EventCreateSession",
341
+ sessionId: 0,
342
+ subscriptionId: 0,
343
+ accAddress: "",
344
+ nodeAddress: "",
345
+ };
346
+ }
347
+
348
+ export const EventCreateSession: MessageFns<EventCreateSession, "sentinel.subscription.v3.EventCreateSession"> = {
349
+ $type: "sentinel.subscription.v3.EventCreateSession" as const,
350
+
351
+ encode(message: EventCreateSession, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
352
+ if (message.sessionId !== 0) {
353
+ writer.uint32(8).uint64(message.sessionId);
354
+ }
355
+ if (message.subscriptionId !== 0) {
356
+ writer.uint32(32).uint64(message.subscriptionId);
357
+ }
358
+ if (message.accAddress !== "") {
359
+ writer.uint32(18).string(message.accAddress);
360
+ }
361
+ if (message.nodeAddress !== "") {
362
+ writer.uint32(26).string(message.nodeAddress);
363
+ }
364
+ return writer;
365
+ },
366
+
367
+ decode(input: BinaryReader | Uint8Array, length?: number): EventCreateSession {
368
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
369
+ const end = length === undefined ? reader.len : reader.pos + length;
370
+ const message = createBaseEventCreateSession();
371
+ while (reader.pos < end) {
372
+ const tag = reader.uint32();
373
+ switch (tag >>> 3) {
374
+ case 1: {
375
+ if (tag !== 8) {
376
+ break;
377
+ }
378
+
379
+ message.sessionId = longToNumber(reader.uint64());
380
+ continue;
381
+ }
382
+ case 4: {
383
+ if (tag !== 32) {
384
+ break;
385
+ }
386
+
387
+ message.subscriptionId = longToNumber(reader.uint64());
388
+ continue;
389
+ }
390
+ case 2: {
391
+ if (tag !== 18) {
392
+ break;
393
+ }
394
+
395
+ message.accAddress = reader.string();
396
+ continue;
397
+ }
398
+ case 3: {
399
+ if (tag !== 26) {
400
+ break;
401
+ }
402
+
403
+ message.nodeAddress = reader.string();
404
+ continue;
405
+ }
406
+ }
407
+ if ((tag & 7) === 4 || tag === 0) {
408
+ break;
409
+ }
410
+ reader.skip(tag & 7);
411
+ }
412
+ return message;
413
+ },
414
+
415
+ fromJSON(object: any): EventCreateSession {
416
+ return {
417
+ $type: EventCreateSession.$type,
418
+ sessionId: isSet(object.sessionId)
419
+ ? globalThis.Number(object.sessionId)
420
+ : isSet(object.session_id)
421
+ ? globalThis.Number(object.session_id)
422
+ : 0,
423
+ subscriptionId: isSet(object.subscriptionId)
424
+ ? globalThis.Number(object.subscriptionId)
425
+ : isSet(object.subscription_id)
426
+ ? globalThis.Number(object.subscription_id)
427
+ : 0,
428
+ accAddress: isSet(object.accAddress)
429
+ ? globalThis.String(object.accAddress)
430
+ : isSet(object.acc_address)
431
+ ? globalThis.String(object.acc_address)
432
+ : "",
433
+ nodeAddress: isSet(object.nodeAddress)
434
+ ? globalThis.String(object.nodeAddress)
435
+ : isSet(object.node_address)
436
+ ? globalThis.String(object.node_address)
437
+ : "",
438
+ };
439
+ },
440
+
441
+ toJSON(message: EventCreateSession): unknown {
442
+ const obj: any = {};
443
+ if (message.sessionId !== 0) {
444
+ obj.sessionId = Math.round(message.sessionId);
445
+ }
446
+ if (message.subscriptionId !== 0) {
447
+ obj.subscriptionId = Math.round(message.subscriptionId);
448
+ }
449
+ if (message.accAddress !== "") {
450
+ obj.accAddress = message.accAddress;
451
+ }
452
+ if (message.nodeAddress !== "") {
453
+ obj.nodeAddress = message.nodeAddress;
454
+ }
455
+ return obj;
456
+ },
457
+
458
+ create<I extends Exact<DeepPartial<EventCreateSession>, I>>(base?: I): EventCreateSession {
459
+ return EventCreateSession.fromPartial(base ?? ({} as any));
460
+ },
461
+ fromPartial<I extends Exact<DeepPartial<EventCreateSession>, I>>(object: I): EventCreateSession {
462
+ const message = createBaseEventCreateSession();
463
+ message.sessionId = object.sessionId ?? 0;
464
+ message.subscriptionId = object.subscriptionId ?? 0;
465
+ message.accAddress = object.accAddress ?? "";
466
+ message.nodeAddress = object.nodeAddress ?? "";
467
+ return message;
468
+ },
469
+ };
470
+
471
+ messageTypeRegistry.set(EventCreateSession.$type, EventCreateSession);
472
+
473
+ function createBaseEventEnd(): EventEnd {
474
+ return { $type: "sentinel.subscription.v3.EventEnd", subscriptionId: 0, planId: 0, accAddress: "" };
475
+ }
476
+
477
+ export const EventEnd: MessageFns<EventEnd, "sentinel.subscription.v3.EventEnd"> = {
478
+ $type: "sentinel.subscription.v3.EventEnd" as const,
479
+
480
+ encode(message: EventEnd, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
481
+ if (message.subscriptionId !== 0) {
482
+ writer.uint32(8).uint64(message.subscriptionId);
483
+ }
484
+ if (message.planId !== 0) {
485
+ writer.uint32(16).uint64(message.planId);
486
+ }
487
+ if (message.accAddress !== "") {
488
+ writer.uint32(26).string(message.accAddress);
489
+ }
490
+ return writer;
491
+ },
492
+
493
+ decode(input: BinaryReader | Uint8Array, length?: number): EventEnd {
494
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
495
+ const end = length === undefined ? reader.len : reader.pos + length;
496
+ const message = createBaseEventEnd();
497
+ while (reader.pos < end) {
498
+ const tag = reader.uint32();
499
+ switch (tag >>> 3) {
500
+ case 1: {
501
+ if (tag !== 8) {
502
+ break;
503
+ }
504
+
505
+ message.subscriptionId = longToNumber(reader.uint64());
506
+ continue;
507
+ }
508
+ case 2: {
509
+ if (tag !== 16) {
510
+ break;
511
+ }
512
+
513
+ message.planId = longToNumber(reader.uint64());
514
+ continue;
515
+ }
516
+ case 3: {
517
+ if (tag !== 26) {
518
+ break;
519
+ }
520
+
521
+ message.accAddress = reader.string();
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): EventEnd {
534
+ return {
535
+ $type: EventEnd.$type,
536
+ subscriptionId: isSet(object.subscriptionId)
537
+ ? globalThis.Number(object.subscriptionId)
538
+ : isSet(object.subscription_id)
539
+ ? globalThis.Number(object.subscription_id)
540
+ : 0,
541
+ planId: isSet(object.planId)
542
+ ? globalThis.Number(object.planId)
543
+ : isSet(object.plan_id)
544
+ ? globalThis.Number(object.plan_id)
545
+ : 0,
546
+ accAddress: isSet(object.accAddress)
547
+ ? globalThis.String(object.accAddress)
548
+ : isSet(object.acc_address)
549
+ ? globalThis.String(object.acc_address)
550
+ : "",
551
+ };
552
+ },
553
+
554
+ toJSON(message: EventEnd): unknown {
555
+ const obj: any = {};
556
+ if (message.subscriptionId !== 0) {
557
+ obj.subscriptionId = Math.round(message.subscriptionId);
558
+ }
559
+ if (message.planId !== 0) {
560
+ obj.planId = Math.round(message.planId);
561
+ }
562
+ if (message.accAddress !== "") {
563
+ obj.accAddress = message.accAddress;
564
+ }
565
+ return obj;
566
+ },
567
+
568
+ create<I extends Exact<DeepPartial<EventEnd>, I>>(base?: I): EventEnd {
569
+ return EventEnd.fromPartial(base ?? ({} as any));
570
+ },
571
+ fromPartial<I extends Exact<DeepPartial<EventEnd>, I>>(object: I): EventEnd {
572
+ const message = createBaseEventEnd();
573
+ message.subscriptionId = object.subscriptionId ?? 0;
574
+ message.planId = object.planId ?? 0;
575
+ message.accAddress = object.accAddress ?? "";
576
+ return message;
577
+ },
578
+ };
579
+
580
+ messageTypeRegistry.set(EventEnd.$type, EventEnd);
581
+
582
+ function createBaseEventPay(): EventPay {
583
+ return {
584
+ $type: "sentinel.subscription.v3.EventPay",
585
+ subscriptionId: 0,
586
+ planId: 0,
587
+ accAddress: "",
588
+ provAddress: "",
589
+ payment: "",
590
+ stakingReward: "",
591
+ };
592
+ }
593
+
594
+ export const EventPay: MessageFns<EventPay, "sentinel.subscription.v3.EventPay"> = {
595
+ $type: "sentinel.subscription.v3.EventPay" as const,
596
+
597
+ encode(message: EventPay, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
598
+ if (message.subscriptionId !== 0) {
599
+ writer.uint32(8).uint64(message.subscriptionId);
600
+ }
601
+ if (message.planId !== 0) {
602
+ writer.uint32(16).uint64(message.planId);
603
+ }
604
+ if (message.accAddress !== "") {
605
+ writer.uint32(26).string(message.accAddress);
606
+ }
607
+ if (message.provAddress !== "") {
608
+ writer.uint32(34).string(message.provAddress);
609
+ }
610
+ if (message.payment !== "") {
611
+ writer.uint32(42).string(message.payment);
612
+ }
613
+ if (message.stakingReward !== "") {
614
+ writer.uint32(50).string(message.stakingReward);
615
+ }
616
+ return writer;
617
+ },
618
+
619
+ decode(input: BinaryReader | Uint8Array, length?: number): EventPay {
620
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
621
+ const end = length === undefined ? reader.len : reader.pos + length;
622
+ const message = createBaseEventPay();
623
+ while (reader.pos < end) {
624
+ const tag = reader.uint32();
625
+ switch (tag >>> 3) {
626
+ case 1: {
627
+ if (tag !== 8) {
628
+ break;
629
+ }
630
+
631
+ message.subscriptionId = longToNumber(reader.uint64());
632
+ continue;
633
+ }
634
+ case 2: {
635
+ if (tag !== 16) {
636
+ break;
637
+ }
638
+
639
+ message.planId = longToNumber(reader.uint64());
640
+ continue;
641
+ }
642
+ case 3: {
643
+ if (tag !== 26) {
644
+ break;
645
+ }
646
+
647
+ message.accAddress = reader.string();
648
+ continue;
649
+ }
650
+ case 4: {
651
+ if (tag !== 34) {
652
+ break;
653
+ }
654
+
655
+ message.provAddress = reader.string();
656
+ continue;
657
+ }
658
+ case 5: {
659
+ if (tag !== 42) {
660
+ break;
661
+ }
662
+
663
+ message.payment = reader.string();
664
+ continue;
665
+ }
666
+ case 6: {
667
+ if (tag !== 50) {
668
+ break;
669
+ }
670
+
671
+ message.stakingReward = reader.string();
672
+ continue;
673
+ }
674
+ }
675
+ if ((tag & 7) === 4 || tag === 0) {
676
+ break;
677
+ }
678
+ reader.skip(tag & 7);
679
+ }
680
+ return message;
681
+ },
682
+
683
+ fromJSON(object: any): EventPay {
684
+ return {
685
+ $type: EventPay.$type,
686
+ subscriptionId: isSet(object.subscriptionId)
687
+ ? globalThis.Number(object.subscriptionId)
688
+ : isSet(object.subscription_id)
689
+ ? globalThis.Number(object.subscription_id)
690
+ : 0,
691
+ planId: isSet(object.planId)
692
+ ? globalThis.Number(object.planId)
693
+ : isSet(object.plan_id)
694
+ ? globalThis.Number(object.plan_id)
695
+ : 0,
696
+ accAddress: isSet(object.accAddress)
697
+ ? globalThis.String(object.accAddress)
698
+ : isSet(object.acc_address)
699
+ ? globalThis.String(object.acc_address)
700
+ : "",
701
+ provAddress: isSet(object.provAddress)
702
+ ? globalThis.String(object.provAddress)
703
+ : isSet(object.prov_address)
704
+ ? globalThis.String(object.prov_address)
705
+ : "",
706
+ payment: isSet(object.payment) ? globalThis.String(object.payment) : "",
707
+ stakingReward: isSet(object.stakingReward)
708
+ ? globalThis.String(object.stakingReward)
709
+ : isSet(object.staking_reward)
710
+ ? globalThis.String(object.staking_reward)
711
+ : "",
712
+ };
713
+ },
714
+
715
+ toJSON(message: EventPay): unknown {
716
+ const obj: any = {};
717
+ if (message.subscriptionId !== 0) {
718
+ obj.subscriptionId = Math.round(message.subscriptionId);
719
+ }
720
+ if (message.planId !== 0) {
721
+ obj.planId = Math.round(message.planId);
722
+ }
723
+ if (message.accAddress !== "") {
724
+ obj.accAddress = message.accAddress;
725
+ }
726
+ if (message.provAddress !== "") {
727
+ obj.provAddress = message.provAddress;
728
+ }
729
+ if (message.payment !== "") {
730
+ obj.payment = message.payment;
731
+ }
732
+ if (message.stakingReward !== "") {
733
+ obj.stakingReward = message.stakingReward;
734
+ }
735
+ return obj;
736
+ },
737
+
738
+ create<I extends Exact<DeepPartial<EventPay>, I>>(base?: I): EventPay {
739
+ return EventPay.fromPartial(base ?? ({} as any));
740
+ },
741
+ fromPartial<I extends Exact<DeepPartial<EventPay>, I>>(object: I): EventPay {
742
+ const message = createBaseEventPay();
743
+ message.subscriptionId = object.subscriptionId ?? 0;
744
+ message.planId = object.planId ?? 0;
745
+ message.accAddress = object.accAddress ?? "";
746
+ message.provAddress = object.provAddress ?? "";
747
+ message.payment = object.payment ?? "";
748
+ message.stakingReward = object.stakingReward ?? "";
749
+ return message;
750
+ },
751
+ };
752
+
753
+ messageTypeRegistry.set(EventPay.$type, EventPay);
754
+
755
+ function createBaseEventRenew(): EventRenew {
756
+ return { $type: "sentinel.subscription.v3.EventRenew", subscriptionId: 0, planId: 0, accAddress: "", price: "" };
757
+ }
758
+
759
+ export const EventRenew: MessageFns<EventRenew, "sentinel.subscription.v3.EventRenew"> = {
760
+ $type: "sentinel.subscription.v3.EventRenew" as const,
761
+
762
+ encode(message: EventRenew, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
763
+ if (message.subscriptionId !== 0) {
764
+ writer.uint32(8).uint64(message.subscriptionId);
765
+ }
766
+ if (message.planId !== 0) {
767
+ writer.uint32(16).uint64(message.planId);
768
+ }
769
+ if (message.accAddress !== "") {
770
+ writer.uint32(26).string(message.accAddress);
771
+ }
772
+ if (message.price !== "") {
773
+ writer.uint32(34).string(message.price);
774
+ }
775
+ return writer;
776
+ },
777
+
778
+ decode(input: BinaryReader | Uint8Array, length?: number): EventRenew {
779
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
780
+ const end = length === undefined ? reader.len : reader.pos + length;
781
+ const message = createBaseEventRenew();
782
+ while (reader.pos < end) {
783
+ const tag = reader.uint32();
784
+ switch (tag >>> 3) {
785
+ case 1: {
786
+ if (tag !== 8) {
787
+ break;
788
+ }
789
+
790
+ message.subscriptionId = longToNumber(reader.uint64());
791
+ continue;
792
+ }
793
+ case 2: {
794
+ if (tag !== 16) {
795
+ break;
796
+ }
797
+
798
+ message.planId = longToNumber(reader.uint64());
799
+ continue;
800
+ }
801
+ case 3: {
802
+ if (tag !== 26) {
803
+ break;
804
+ }
805
+
806
+ message.accAddress = reader.string();
807
+ continue;
808
+ }
809
+ case 4: {
810
+ if (tag !== 34) {
811
+ break;
812
+ }
813
+
814
+ message.price = reader.string();
815
+ continue;
816
+ }
817
+ }
818
+ if ((tag & 7) === 4 || tag === 0) {
819
+ break;
820
+ }
821
+ reader.skip(tag & 7);
822
+ }
823
+ return message;
824
+ },
825
+
826
+ fromJSON(object: any): EventRenew {
827
+ return {
828
+ $type: EventRenew.$type,
829
+ subscriptionId: isSet(object.subscriptionId)
830
+ ? globalThis.Number(object.subscriptionId)
831
+ : isSet(object.subscription_id)
832
+ ? globalThis.Number(object.subscription_id)
833
+ : 0,
834
+ planId: isSet(object.planId)
835
+ ? globalThis.Number(object.planId)
836
+ : isSet(object.plan_id)
837
+ ? globalThis.Number(object.plan_id)
838
+ : 0,
839
+ accAddress: isSet(object.accAddress)
840
+ ? globalThis.String(object.accAddress)
841
+ : isSet(object.acc_address)
842
+ ? globalThis.String(object.acc_address)
843
+ : "",
844
+ price: isSet(object.price) ? globalThis.String(object.price) : "",
845
+ };
846
+ },
847
+
848
+ toJSON(message: EventRenew): unknown {
849
+ const obj: any = {};
850
+ if (message.subscriptionId !== 0) {
851
+ obj.subscriptionId = Math.round(message.subscriptionId);
852
+ }
853
+ if (message.planId !== 0) {
854
+ obj.planId = Math.round(message.planId);
855
+ }
856
+ if (message.accAddress !== "") {
857
+ obj.accAddress = message.accAddress;
858
+ }
859
+ if (message.price !== "") {
860
+ obj.price = message.price;
861
+ }
862
+ return obj;
863
+ },
864
+
865
+ create<I extends Exact<DeepPartial<EventRenew>, I>>(base?: I): EventRenew {
866
+ return EventRenew.fromPartial(base ?? ({} as any));
867
+ },
868
+ fromPartial<I extends Exact<DeepPartial<EventRenew>, I>>(object: I): EventRenew {
869
+ const message = createBaseEventRenew();
870
+ message.subscriptionId = object.subscriptionId ?? 0;
871
+ message.planId = object.planId ?? 0;
872
+ message.accAddress = object.accAddress ?? "";
873
+ message.price = object.price ?? "";
874
+ return message;
875
+ },
876
+ };
877
+
878
+ messageTypeRegistry.set(EventRenew.$type, EventRenew);
879
+
880
+ function createBaseEventUpdateDetails(): EventUpdateDetails {
881
+ return {
882
+ $type: "sentinel.subscription.v3.EventUpdateDetails",
883
+ subscriptionId: 0,
884
+ planId: 0,
885
+ accAddress: "",
886
+ renewalPricePolicy: "",
887
+ };
888
+ }
889
+
890
+ export const EventUpdateDetails: MessageFns<EventUpdateDetails, "sentinel.subscription.v3.EventUpdateDetails"> = {
891
+ $type: "sentinel.subscription.v3.EventUpdateDetails" as const,
892
+
893
+ encode(message: EventUpdateDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
894
+ if (message.subscriptionId !== 0) {
895
+ writer.uint32(8).uint64(message.subscriptionId);
896
+ }
897
+ if (message.planId !== 0) {
898
+ writer.uint32(16).uint64(message.planId);
899
+ }
900
+ if (message.accAddress !== "") {
901
+ writer.uint32(26).string(message.accAddress);
902
+ }
903
+ if (message.renewalPricePolicy !== "") {
904
+ writer.uint32(34).string(message.renewalPricePolicy);
905
+ }
906
+ return writer;
907
+ },
908
+
909
+ decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateDetails {
910
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
911
+ const end = length === undefined ? reader.len : reader.pos + length;
912
+ const message = createBaseEventUpdateDetails();
913
+ while (reader.pos < end) {
914
+ const tag = reader.uint32();
915
+ switch (tag >>> 3) {
916
+ case 1: {
917
+ if (tag !== 8) {
918
+ break;
919
+ }
920
+
921
+ message.subscriptionId = longToNumber(reader.uint64());
922
+ continue;
923
+ }
924
+ case 2: {
925
+ if (tag !== 16) {
926
+ break;
927
+ }
928
+
929
+ message.planId = longToNumber(reader.uint64());
930
+ continue;
931
+ }
932
+ case 3: {
933
+ if (tag !== 26) {
934
+ break;
935
+ }
936
+
937
+ message.accAddress = reader.string();
938
+ continue;
939
+ }
940
+ case 4: {
941
+ if (tag !== 34) {
942
+ break;
943
+ }
944
+
945
+ message.renewalPricePolicy = reader.string();
946
+ continue;
947
+ }
948
+ }
949
+ if ((tag & 7) === 4 || tag === 0) {
950
+ break;
951
+ }
952
+ reader.skip(tag & 7);
953
+ }
954
+ return message;
955
+ },
956
+
957
+ fromJSON(object: any): EventUpdateDetails {
958
+ return {
959
+ $type: EventUpdateDetails.$type,
960
+ subscriptionId: isSet(object.subscriptionId)
961
+ ? globalThis.Number(object.subscriptionId)
962
+ : isSet(object.subscription_id)
963
+ ? globalThis.Number(object.subscription_id)
964
+ : 0,
965
+ planId: isSet(object.planId)
966
+ ? globalThis.Number(object.planId)
967
+ : isSet(object.plan_id)
968
+ ? globalThis.Number(object.plan_id)
969
+ : 0,
970
+ accAddress: isSet(object.accAddress)
971
+ ? globalThis.String(object.accAddress)
972
+ : isSet(object.acc_address)
973
+ ? globalThis.String(object.acc_address)
974
+ : "",
975
+ renewalPricePolicy: isSet(object.renewalPricePolicy)
976
+ ? globalThis.String(object.renewalPricePolicy)
977
+ : isSet(object.renewal_price_policy)
978
+ ? globalThis.String(object.renewal_price_policy)
979
+ : "",
980
+ };
981
+ },
982
+
983
+ toJSON(message: EventUpdateDetails): unknown {
984
+ const obj: any = {};
985
+ if (message.subscriptionId !== 0) {
986
+ obj.subscriptionId = Math.round(message.subscriptionId);
987
+ }
988
+ if (message.planId !== 0) {
989
+ obj.planId = Math.round(message.planId);
990
+ }
991
+ if (message.accAddress !== "") {
992
+ obj.accAddress = message.accAddress;
993
+ }
994
+ if (message.renewalPricePolicy !== "") {
995
+ obj.renewalPricePolicy = message.renewalPricePolicy;
996
+ }
997
+ return obj;
998
+ },
999
+
1000
+ create<I extends Exact<DeepPartial<EventUpdateDetails>, I>>(base?: I): EventUpdateDetails {
1001
+ return EventUpdateDetails.fromPartial(base ?? ({} as any));
1002
+ },
1003
+ fromPartial<I extends Exact<DeepPartial<EventUpdateDetails>, I>>(object: I): EventUpdateDetails {
1004
+ const message = createBaseEventUpdateDetails();
1005
+ message.subscriptionId = object.subscriptionId ?? 0;
1006
+ message.planId = object.planId ?? 0;
1007
+ message.accAddress = object.accAddress ?? "";
1008
+ message.renewalPricePolicy = object.renewalPricePolicy ?? "";
1009
+ return message;
1010
+ },
1011
+ };
1012
+
1013
+ messageTypeRegistry.set(EventUpdateDetails.$type, EventUpdateDetails);
1014
+
1015
+ function createBaseEventUpdateStatus(): EventUpdateStatus {
1016
+ return {
1017
+ $type: "sentinel.subscription.v3.EventUpdateStatus",
1018
+ subscriptionId: 0,
1019
+ planId: 0,
1020
+ accAddress: "",
1021
+ status: "",
1022
+ };
1023
+ }
1024
+
1025
+ export const EventUpdateStatus: MessageFns<EventUpdateStatus, "sentinel.subscription.v3.EventUpdateStatus"> = {
1026
+ $type: "sentinel.subscription.v3.EventUpdateStatus" as const,
1027
+
1028
+ encode(message: EventUpdateStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1029
+ if (message.subscriptionId !== 0) {
1030
+ writer.uint32(8).uint64(message.subscriptionId);
1031
+ }
1032
+ if (message.planId !== 0) {
1033
+ writer.uint32(16).uint64(message.planId);
1034
+ }
1035
+ if (message.accAddress !== "") {
1036
+ writer.uint32(26).string(message.accAddress);
1037
+ }
1038
+ if (message.status !== "") {
1039
+ writer.uint32(34).string(message.status);
1040
+ }
1041
+ return writer;
1042
+ },
1043
+
1044
+ decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateStatus {
1045
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1046
+ const end = length === undefined ? reader.len : reader.pos + length;
1047
+ const message = createBaseEventUpdateStatus();
1048
+ while (reader.pos < end) {
1049
+ const tag = reader.uint32();
1050
+ switch (tag >>> 3) {
1051
+ case 1: {
1052
+ if (tag !== 8) {
1053
+ break;
1054
+ }
1055
+
1056
+ message.subscriptionId = longToNumber(reader.uint64());
1057
+ continue;
1058
+ }
1059
+ case 2: {
1060
+ if (tag !== 16) {
1061
+ break;
1062
+ }
1063
+
1064
+ message.planId = longToNumber(reader.uint64());
1065
+ continue;
1066
+ }
1067
+ case 3: {
1068
+ if (tag !== 26) {
1069
+ break;
1070
+ }
1071
+
1072
+ message.accAddress = reader.string();
1073
+ continue;
1074
+ }
1075
+ case 4: {
1076
+ if (tag !== 34) {
1077
+ break;
1078
+ }
1079
+
1080
+ message.status = reader.string();
1081
+ continue;
1082
+ }
1083
+ }
1084
+ if ((tag & 7) === 4 || tag === 0) {
1085
+ break;
1086
+ }
1087
+ reader.skip(tag & 7);
1088
+ }
1089
+ return message;
1090
+ },
1091
+
1092
+ fromJSON(object: any): EventUpdateStatus {
1093
+ return {
1094
+ $type: EventUpdateStatus.$type,
1095
+ subscriptionId: isSet(object.subscriptionId)
1096
+ ? globalThis.Number(object.subscriptionId)
1097
+ : isSet(object.subscription_id)
1098
+ ? globalThis.Number(object.subscription_id)
1099
+ : 0,
1100
+ planId: isSet(object.planId)
1101
+ ? globalThis.Number(object.planId)
1102
+ : isSet(object.plan_id)
1103
+ ? globalThis.Number(object.plan_id)
1104
+ : 0,
1105
+ accAddress: isSet(object.accAddress)
1106
+ ? globalThis.String(object.accAddress)
1107
+ : isSet(object.acc_address)
1108
+ ? globalThis.String(object.acc_address)
1109
+ : "",
1110
+ status: isSet(object.status) ? globalThis.String(object.status) : "",
1111
+ };
1112
+ },
1113
+
1114
+ toJSON(message: EventUpdateStatus): unknown {
1115
+ const obj: any = {};
1116
+ if (message.subscriptionId !== 0) {
1117
+ obj.subscriptionId = Math.round(message.subscriptionId);
1118
+ }
1119
+ if (message.planId !== 0) {
1120
+ obj.planId = Math.round(message.planId);
1121
+ }
1122
+ if (message.accAddress !== "") {
1123
+ obj.accAddress = message.accAddress;
1124
+ }
1125
+ if (message.status !== "") {
1126
+ obj.status = message.status;
1127
+ }
1128
+ return obj;
1129
+ },
1130
+
1131
+ create<I extends Exact<DeepPartial<EventUpdateStatus>, I>>(base?: I): EventUpdateStatus {
1132
+ return EventUpdateStatus.fromPartial(base ?? ({} as any));
1133
+ },
1134
+ fromPartial<I extends Exact<DeepPartial<EventUpdateStatus>, I>>(object: I): EventUpdateStatus {
1135
+ const message = createBaseEventUpdateStatus();
1136
+ message.subscriptionId = object.subscriptionId ?? 0;
1137
+ message.planId = object.planId ?? 0;
1138
+ message.accAddress = object.accAddress ?? "";
1139
+ message.status = object.status ?? "";
1140
+ return message;
1141
+ },
1142
+ };
1143
+
1144
+ messageTypeRegistry.set(EventUpdateStatus.$type, EventUpdateStatus);
1145
+
1146
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1147
+
1148
+ export type DeepPartial<T> = T extends Builtin ? T
1149
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
1150
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
1151
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
1152
+ : Partial<T>;
1153
+
1154
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
1155
+ export type Exact<P, I extends P> = P extends Builtin ? P
1156
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
1157
+
1158
+ function longToNumber(int64: { toString(): string }): number {
1159
+ const num = globalThis.Number(int64.toString());
1160
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
1161
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
1162
+ }
1163
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
1164
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
1165
+ }
1166
+ return num;
1167
+ }
1168
+
1169
+ function isSet(value: any): boolean {
1170
+ return value !== null && value !== undefined;
1171
+ }
1172
+
1173
+ export interface MessageFns<T, V extends string> {
1174
+ readonly $type: V;
1175
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
1176
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
1177
+ fromJSON(object: any): T;
1178
+ toJSON(message: T): unknown;
1179
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
1180
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
1181
+ }