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,1002 @@
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/node/v3/msg.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import { messageTypeRegistry } from "../../../typeRegistry";
10
+ import { Price } from "../../types/v1/price";
11
+ import { Status, statusFromJSON, statusToJSON } from "../../types/v1/status";
12
+ import { Params } from "./params";
13
+
14
+ export const protobufPackage = "sentinel.node.v3";
15
+
16
+ export interface MsgRegisterNodeRequest {
17
+ $type: "sentinel.node.v3.MsgRegisterNodeRequest";
18
+ from: string;
19
+ gigabytePrices: Price[];
20
+ hourlyPrices: Price[];
21
+ remoteAddrs: string[];
22
+ }
23
+
24
+ export interface MsgUpdateNodeDetailsRequest {
25
+ $type: "sentinel.node.v3.MsgUpdateNodeDetailsRequest";
26
+ from: string;
27
+ gigabytePrices: Price[];
28
+ hourlyPrices: Price[];
29
+ remoteAddrs: string[];
30
+ }
31
+
32
+ export interface MsgUpdateNodeStatusRequest {
33
+ $type: "sentinel.node.v3.MsgUpdateNodeStatusRequest";
34
+ from: string;
35
+ status: Status;
36
+ }
37
+
38
+ export interface MsgStartSessionRequest {
39
+ $type: "sentinel.node.v3.MsgStartSessionRequest";
40
+ from: string;
41
+ nodeAddress: string;
42
+ gigabytes: number;
43
+ hours: number;
44
+ maxPrice: Price | undefined;
45
+ }
46
+
47
+ export interface MsgUpdateParamsRequest {
48
+ $type: "sentinel.node.v3.MsgUpdateParamsRequest";
49
+ from: string;
50
+ params: Params | undefined;
51
+ }
52
+
53
+ export interface MsgRegisterNodeResponse {
54
+ $type: "sentinel.node.v3.MsgRegisterNodeResponse";
55
+ }
56
+
57
+ export interface MsgUpdateNodeDetailsResponse {
58
+ $type: "sentinel.node.v3.MsgUpdateNodeDetailsResponse";
59
+ }
60
+
61
+ export interface MsgUpdateNodeStatusResponse {
62
+ $type: "sentinel.node.v3.MsgUpdateNodeStatusResponse";
63
+ }
64
+
65
+ export interface MsgStartSessionResponse {
66
+ $type: "sentinel.node.v3.MsgStartSessionResponse";
67
+ id: number;
68
+ }
69
+
70
+ export interface MsgUpdateParamsResponse {
71
+ $type: "sentinel.node.v3.MsgUpdateParamsResponse";
72
+ }
73
+
74
+ function createBaseMsgRegisterNodeRequest(): MsgRegisterNodeRequest {
75
+ return {
76
+ $type: "sentinel.node.v3.MsgRegisterNodeRequest",
77
+ from: "",
78
+ gigabytePrices: [],
79
+ hourlyPrices: [],
80
+ remoteAddrs: [],
81
+ };
82
+ }
83
+
84
+ export const MsgRegisterNodeRequest: MessageFns<MsgRegisterNodeRequest, "sentinel.node.v3.MsgRegisterNodeRequest"> = {
85
+ $type: "sentinel.node.v3.MsgRegisterNodeRequest" as const,
86
+
87
+ encode(message: MsgRegisterNodeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
88
+ if (message.from !== "") {
89
+ writer.uint32(10).string(message.from);
90
+ }
91
+ for (const v of message.gigabytePrices) {
92
+ Price.encode(v!, writer.uint32(18).fork()).join();
93
+ }
94
+ for (const v of message.hourlyPrices) {
95
+ Price.encode(v!, writer.uint32(26).fork()).join();
96
+ }
97
+ for (const v of message.remoteAddrs) {
98
+ writer.uint32(34).string(v!);
99
+ }
100
+ return writer;
101
+ },
102
+
103
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterNodeRequest {
104
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
105
+ const end = length === undefined ? reader.len : reader.pos + length;
106
+ const message = createBaseMsgRegisterNodeRequest();
107
+ while (reader.pos < end) {
108
+ const tag = reader.uint32();
109
+ switch (tag >>> 3) {
110
+ case 1: {
111
+ if (tag !== 10) {
112
+ break;
113
+ }
114
+
115
+ message.from = reader.string();
116
+ continue;
117
+ }
118
+ case 2: {
119
+ if (tag !== 18) {
120
+ break;
121
+ }
122
+
123
+ message.gigabytePrices.push(Price.decode(reader, reader.uint32()));
124
+ continue;
125
+ }
126
+ case 3: {
127
+ if (tag !== 26) {
128
+ break;
129
+ }
130
+
131
+ message.hourlyPrices.push(Price.decode(reader, reader.uint32()));
132
+ continue;
133
+ }
134
+ case 4: {
135
+ if (tag !== 34) {
136
+ break;
137
+ }
138
+
139
+ message.remoteAddrs.push(reader.string());
140
+ continue;
141
+ }
142
+ }
143
+ if ((tag & 7) === 4 || tag === 0) {
144
+ break;
145
+ }
146
+ reader.skip(tag & 7);
147
+ }
148
+ return message;
149
+ },
150
+
151
+ fromJSON(object: any): MsgRegisterNodeRequest {
152
+ return {
153
+ $type: MsgRegisterNodeRequest.$type,
154
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
155
+ gigabytePrices: globalThis.Array.isArray(object?.gigabytePrices)
156
+ ? object.gigabytePrices.map((e: any) => Price.fromJSON(e))
157
+ : globalThis.Array.isArray(object?.gigabyte_prices)
158
+ ? object.gigabyte_prices.map((e: any) => Price.fromJSON(e))
159
+ : [],
160
+ hourlyPrices: globalThis.Array.isArray(object?.hourlyPrices)
161
+ ? object.hourlyPrices.map((e: any) => Price.fromJSON(e))
162
+ : globalThis.Array.isArray(object?.hourly_prices)
163
+ ? object.hourly_prices.map((e: any) => Price.fromJSON(e))
164
+ : [],
165
+ remoteAddrs: globalThis.Array.isArray(object?.remoteAddrs)
166
+ ? object.remoteAddrs.map((e: any) => globalThis.String(e))
167
+ : globalThis.Array.isArray(object?.remote_addrs)
168
+ ? object.remote_addrs.map((e: any) => globalThis.String(e))
169
+ : [],
170
+ };
171
+ },
172
+
173
+ toJSON(message: MsgRegisterNodeRequest): unknown {
174
+ const obj: any = {};
175
+ if (message.from !== "") {
176
+ obj.from = message.from;
177
+ }
178
+ if (message.gigabytePrices?.length) {
179
+ obj.gigabytePrices = message.gigabytePrices.map((e) => Price.toJSON(e));
180
+ }
181
+ if (message.hourlyPrices?.length) {
182
+ obj.hourlyPrices = message.hourlyPrices.map((e) => Price.toJSON(e));
183
+ }
184
+ if (message.remoteAddrs?.length) {
185
+ obj.remoteAddrs = message.remoteAddrs;
186
+ }
187
+ return obj;
188
+ },
189
+
190
+ create<I extends Exact<DeepPartial<MsgRegisterNodeRequest>, I>>(base?: I): MsgRegisterNodeRequest {
191
+ return MsgRegisterNodeRequest.fromPartial(base ?? ({} as any));
192
+ },
193
+ fromPartial<I extends Exact<DeepPartial<MsgRegisterNodeRequest>, I>>(object: I): MsgRegisterNodeRequest {
194
+ const message = createBaseMsgRegisterNodeRequest();
195
+ message.from = object.from ?? "";
196
+ message.gigabytePrices = object.gigabytePrices?.map((e) => Price.fromPartial(e)) || [];
197
+ message.hourlyPrices = object.hourlyPrices?.map((e) => Price.fromPartial(e)) || [];
198
+ message.remoteAddrs = object.remoteAddrs?.map((e) => e) || [];
199
+ return message;
200
+ },
201
+ };
202
+
203
+ messageTypeRegistry.set(MsgRegisterNodeRequest.$type, MsgRegisterNodeRequest);
204
+
205
+ function createBaseMsgUpdateNodeDetailsRequest(): MsgUpdateNodeDetailsRequest {
206
+ return {
207
+ $type: "sentinel.node.v3.MsgUpdateNodeDetailsRequest",
208
+ from: "",
209
+ gigabytePrices: [],
210
+ hourlyPrices: [],
211
+ remoteAddrs: [],
212
+ };
213
+ }
214
+
215
+ export const MsgUpdateNodeDetailsRequest: MessageFns<
216
+ MsgUpdateNodeDetailsRequest,
217
+ "sentinel.node.v3.MsgUpdateNodeDetailsRequest"
218
+ > = {
219
+ $type: "sentinel.node.v3.MsgUpdateNodeDetailsRequest" as const,
220
+
221
+ encode(message: MsgUpdateNodeDetailsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
222
+ if (message.from !== "") {
223
+ writer.uint32(10).string(message.from);
224
+ }
225
+ for (const v of message.gigabytePrices) {
226
+ Price.encode(v!, writer.uint32(18).fork()).join();
227
+ }
228
+ for (const v of message.hourlyPrices) {
229
+ Price.encode(v!, writer.uint32(26).fork()).join();
230
+ }
231
+ for (const v of message.remoteAddrs) {
232
+ writer.uint32(34).string(v!);
233
+ }
234
+ return writer;
235
+ },
236
+
237
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNodeDetailsRequest {
238
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
239
+ const end = length === undefined ? reader.len : reader.pos + length;
240
+ const message = createBaseMsgUpdateNodeDetailsRequest();
241
+ while (reader.pos < end) {
242
+ const tag = reader.uint32();
243
+ switch (tag >>> 3) {
244
+ case 1: {
245
+ if (tag !== 10) {
246
+ break;
247
+ }
248
+
249
+ message.from = reader.string();
250
+ continue;
251
+ }
252
+ case 2: {
253
+ if (tag !== 18) {
254
+ break;
255
+ }
256
+
257
+ message.gigabytePrices.push(Price.decode(reader, reader.uint32()));
258
+ continue;
259
+ }
260
+ case 3: {
261
+ if (tag !== 26) {
262
+ break;
263
+ }
264
+
265
+ message.hourlyPrices.push(Price.decode(reader, reader.uint32()));
266
+ continue;
267
+ }
268
+ case 4: {
269
+ if (tag !== 34) {
270
+ break;
271
+ }
272
+
273
+ message.remoteAddrs.push(reader.string());
274
+ continue;
275
+ }
276
+ }
277
+ if ((tag & 7) === 4 || tag === 0) {
278
+ break;
279
+ }
280
+ reader.skip(tag & 7);
281
+ }
282
+ return message;
283
+ },
284
+
285
+ fromJSON(object: any): MsgUpdateNodeDetailsRequest {
286
+ return {
287
+ $type: MsgUpdateNodeDetailsRequest.$type,
288
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
289
+ gigabytePrices: globalThis.Array.isArray(object?.gigabytePrices)
290
+ ? object.gigabytePrices.map((e: any) => Price.fromJSON(e))
291
+ : globalThis.Array.isArray(object?.gigabyte_prices)
292
+ ? object.gigabyte_prices.map((e: any) => Price.fromJSON(e))
293
+ : [],
294
+ hourlyPrices: globalThis.Array.isArray(object?.hourlyPrices)
295
+ ? object.hourlyPrices.map((e: any) => Price.fromJSON(e))
296
+ : globalThis.Array.isArray(object?.hourly_prices)
297
+ ? object.hourly_prices.map((e: any) => Price.fromJSON(e))
298
+ : [],
299
+ remoteAddrs: globalThis.Array.isArray(object?.remoteAddrs)
300
+ ? object.remoteAddrs.map((e: any) => globalThis.String(e))
301
+ : globalThis.Array.isArray(object?.remote_addrs)
302
+ ? object.remote_addrs.map((e: any) => globalThis.String(e))
303
+ : [],
304
+ };
305
+ },
306
+
307
+ toJSON(message: MsgUpdateNodeDetailsRequest): unknown {
308
+ const obj: any = {};
309
+ if (message.from !== "") {
310
+ obj.from = message.from;
311
+ }
312
+ if (message.gigabytePrices?.length) {
313
+ obj.gigabytePrices = message.gigabytePrices.map((e) => Price.toJSON(e));
314
+ }
315
+ if (message.hourlyPrices?.length) {
316
+ obj.hourlyPrices = message.hourlyPrices.map((e) => Price.toJSON(e));
317
+ }
318
+ if (message.remoteAddrs?.length) {
319
+ obj.remoteAddrs = message.remoteAddrs;
320
+ }
321
+ return obj;
322
+ },
323
+
324
+ create<I extends Exact<DeepPartial<MsgUpdateNodeDetailsRequest>, I>>(base?: I): MsgUpdateNodeDetailsRequest {
325
+ return MsgUpdateNodeDetailsRequest.fromPartial(base ?? ({} as any));
326
+ },
327
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateNodeDetailsRequest>, I>>(object: I): MsgUpdateNodeDetailsRequest {
328
+ const message = createBaseMsgUpdateNodeDetailsRequest();
329
+ message.from = object.from ?? "";
330
+ message.gigabytePrices = object.gigabytePrices?.map((e) => Price.fromPartial(e)) || [];
331
+ message.hourlyPrices = object.hourlyPrices?.map((e) => Price.fromPartial(e)) || [];
332
+ message.remoteAddrs = object.remoteAddrs?.map((e) => e) || [];
333
+ return message;
334
+ },
335
+ };
336
+
337
+ messageTypeRegistry.set(MsgUpdateNodeDetailsRequest.$type, MsgUpdateNodeDetailsRequest);
338
+
339
+ function createBaseMsgUpdateNodeStatusRequest(): MsgUpdateNodeStatusRequest {
340
+ return { $type: "sentinel.node.v3.MsgUpdateNodeStatusRequest", from: "", status: 0 };
341
+ }
342
+
343
+ export const MsgUpdateNodeStatusRequest: MessageFns<
344
+ MsgUpdateNodeStatusRequest,
345
+ "sentinel.node.v3.MsgUpdateNodeStatusRequest"
346
+ > = {
347
+ $type: "sentinel.node.v3.MsgUpdateNodeStatusRequest" as const,
348
+
349
+ encode(message: MsgUpdateNodeStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
350
+ if (message.from !== "") {
351
+ writer.uint32(10).string(message.from);
352
+ }
353
+ if (message.status !== 0) {
354
+ writer.uint32(16).int32(message.status);
355
+ }
356
+ return writer;
357
+ },
358
+
359
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNodeStatusRequest {
360
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
361
+ const end = length === undefined ? reader.len : reader.pos + length;
362
+ const message = createBaseMsgUpdateNodeStatusRequest();
363
+ while (reader.pos < end) {
364
+ const tag = reader.uint32();
365
+ switch (tag >>> 3) {
366
+ case 1: {
367
+ if (tag !== 10) {
368
+ break;
369
+ }
370
+
371
+ message.from = reader.string();
372
+ continue;
373
+ }
374
+ case 2: {
375
+ if (tag !== 16) {
376
+ break;
377
+ }
378
+
379
+ message.status = reader.int32() as any;
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): MsgUpdateNodeStatusRequest {
392
+ return {
393
+ $type: MsgUpdateNodeStatusRequest.$type,
394
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
395
+ status: isSet(object.status) ? statusFromJSON(object.status) : 0,
396
+ };
397
+ },
398
+
399
+ toJSON(message: MsgUpdateNodeStatusRequest): unknown {
400
+ const obj: any = {};
401
+ if (message.from !== "") {
402
+ obj.from = message.from;
403
+ }
404
+ if (message.status !== 0) {
405
+ obj.status = statusToJSON(message.status);
406
+ }
407
+ return obj;
408
+ },
409
+
410
+ create<I extends Exact<DeepPartial<MsgUpdateNodeStatusRequest>, I>>(base?: I): MsgUpdateNodeStatusRequest {
411
+ return MsgUpdateNodeStatusRequest.fromPartial(base ?? ({} as any));
412
+ },
413
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateNodeStatusRequest>, I>>(object: I): MsgUpdateNodeStatusRequest {
414
+ const message = createBaseMsgUpdateNodeStatusRequest();
415
+ message.from = object.from ?? "";
416
+ message.status = object.status ?? 0;
417
+ return message;
418
+ },
419
+ };
420
+
421
+ messageTypeRegistry.set(MsgUpdateNodeStatusRequest.$type, MsgUpdateNodeStatusRequest);
422
+
423
+ function createBaseMsgStartSessionRequest(): MsgStartSessionRequest {
424
+ return {
425
+ $type: "sentinel.node.v3.MsgStartSessionRequest",
426
+ from: "",
427
+ nodeAddress: "",
428
+ gigabytes: 0,
429
+ hours: 0,
430
+ maxPrice: undefined,
431
+ };
432
+ }
433
+
434
+ export const MsgStartSessionRequest: MessageFns<MsgStartSessionRequest, "sentinel.node.v3.MsgStartSessionRequest"> = {
435
+ $type: "sentinel.node.v3.MsgStartSessionRequest" as const,
436
+
437
+ encode(message: MsgStartSessionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
438
+ if (message.from !== "") {
439
+ writer.uint32(10).string(message.from);
440
+ }
441
+ if (message.nodeAddress !== "") {
442
+ writer.uint32(18).string(message.nodeAddress);
443
+ }
444
+ if (message.gigabytes !== 0) {
445
+ writer.uint32(24).int64(message.gigabytes);
446
+ }
447
+ if (message.hours !== 0) {
448
+ writer.uint32(32).int64(message.hours);
449
+ }
450
+ if (message.maxPrice !== undefined) {
451
+ Price.encode(message.maxPrice, writer.uint32(42).fork()).join();
452
+ }
453
+ return writer;
454
+ },
455
+
456
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgStartSessionRequest {
457
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
458
+ const end = length === undefined ? reader.len : reader.pos + length;
459
+ const message = createBaseMsgStartSessionRequest();
460
+ while (reader.pos < end) {
461
+ const tag = reader.uint32();
462
+ switch (tag >>> 3) {
463
+ case 1: {
464
+ if (tag !== 10) {
465
+ break;
466
+ }
467
+
468
+ message.from = reader.string();
469
+ continue;
470
+ }
471
+ case 2: {
472
+ if (tag !== 18) {
473
+ break;
474
+ }
475
+
476
+ message.nodeAddress = reader.string();
477
+ continue;
478
+ }
479
+ case 3: {
480
+ if (tag !== 24) {
481
+ break;
482
+ }
483
+
484
+ message.gigabytes = longToNumber(reader.int64());
485
+ continue;
486
+ }
487
+ case 4: {
488
+ if (tag !== 32) {
489
+ break;
490
+ }
491
+
492
+ message.hours = longToNumber(reader.int64());
493
+ continue;
494
+ }
495
+ case 5: {
496
+ if (tag !== 42) {
497
+ break;
498
+ }
499
+
500
+ message.maxPrice = Price.decode(reader, reader.uint32());
501
+ continue;
502
+ }
503
+ }
504
+ if ((tag & 7) === 4 || tag === 0) {
505
+ break;
506
+ }
507
+ reader.skip(tag & 7);
508
+ }
509
+ return message;
510
+ },
511
+
512
+ fromJSON(object: any): MsgStartSessionRequest {
513
+ return {
514
+ $type: MsgStartSessionRequest.$type,
515
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
516
+ nodeAddress: isSet(object.nodeAddress)
517
+ ? globalThis.String(object.nodeAddress)
518
+ : isSet(object.node_address)
519
+ ? globalThis.String(object.node_address)
520
+ : "",
521
+ gigabytes: isSet(object.gigabytes) ? globalThis.Number(object.gigabytes) : 0,
522
+ hours: isSet(object.hours) ? globalThis.Number(object.hours) : 0,
523
+ maxPrice: isSet(object.maxPrice)
524
+ ? Price.fromJSON(object.maxPrice)
525
+ : isSet(object.max_price)
526
+ ? Price.fromJSON(object.max_price)
527
+ : undefined,
528
+ };
529
+ },
530
+
531
+ toJSON(message: MsgStartSessionRequest): unknown {
532
+ const obj: any = {};
533
+ if (message.from !== "") {
534
+ obj.from = message.from;
535
+ }
536
+ if (message.nodeAddress !== "") {
537
+ obj.nodeAddress = message.nodeAddress;
538
+ }
539
+ if (message.gigabytes !== 0) {
540
+ obj.gigabytes = Math.round(message.gigabytes);
541
+ }
542
+ if (message.hours !== 0) {
543
+ obj.hours = Math.round(message.hours);
544
+ }
545
+ if (message.maxPrice !== undefined) {
546
+ obj.maxPrice = Price.toJSON(message.maxPrice);
547
+ }
548
+ return obj;
549
+ },
550
+
551
+ create<I extends Exact<DeepPartial<MsgStartSessionRequest>, I>>(base?: I): MsgStartSessionRequest {
552
+ return MsgStartSessionRequest.fromPartial(base ?? ({} as any));
553
+ },
554
+ fromPartial<I extends Exact<DeepPartial<MsgStartSessionRequest>, I>>(object: I): MsgStartSessionRequest {
555
+ const message = createBaseMsgStartSessionRequest();
556
+ message.from = object.from ?? "";
557
+ message.nodeAddress = object.nodeAddress ?? "";
558
+ message.gigabytes = object.gigabytes ?? 0;
559
+ message.hours = object.hours ?? 0;
560
+ message.maxPrice = (object.maxPrice !== undefined && object.maxPrice !== null)
561
+ ? Price.fromPartial(object.maxPrice)
562
+ : undefined;
563
+ return message;
564
+ },
565
+ };
566
+
567
+ messageTypeRegistry.set(MsgStartSessionRequest.$type, MsgStartSessionRequest);
568
+
569
+ function createBaseMsgUpdateParamsRequest(): MsgUpdateParamsRequest {
570
+ return { $type: "sentinel.node.v3.MsgUpdateParamsRequest", from: "", params: undefined };
571
+ }
572
+
573
+ export const MsgUpdateParamsRequest: MessageFns<MsgUpdateParamsRequest, "sentinel.node.v3.MsgUpdateParamsRequest"> = {
574
+ $type: "sentinel.node.v3.MsgUpdateParamsRequest" as const,
575
+
576
+ encode(message: MsgUpdateParamsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
577
+ if (message.from !== "") {
578
+ writer.uint32(10).string(message.from);
579
+ }
580
+ if (message.params !== undefined) {
581
+ Params.encode(message.params, writer.uint32(18).fork()).join();
582
+ }
583
+ return writer;
584
+ },
585
+
586
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsRequest {
587
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
588
+ const end = length === undefined ? reader.len : reader.pos + length;
589
+ const message = createBaseMsgUpdateParamsRequest();
590
+ while (reader.pos < end) {
591
+ const tag = reader.uint32();
592
+ switch (tag >>> 3) {
593
+ case 1: {
594
+ if (tag !== 10) {
595
+ break;
596
+ }
597
+
598
+ message.from = reader.string();
599
+ continue;
600
+ }
601
+ case 2: {
602
+ if (tag !== 18) {
603
+ break;
604
+ }
605
+
606
+ message.params = Params.decode(reader, reader.uint32());
607
+ continue;
608
+ }
609
+ }
610
+ if ((tag & 7) === 4 || tag === 0) {
611
+ break;
612
+ }
613
+ reader.skip(tag & 7);
614
+ }
615
+ return message;
616
+ },
617
+
618
+ fromJSON(object: any): MsgUpdateParamsRequest {
619
+ return {
620
+ $type: MsgUpdateParamsRequest.$type,
621
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
622
+ params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
623
+ };
624
+ },
625
+
626
+ toJSON(message: MsgUpdateParamsRequest): unknown {
627
+ const obj: any = {};
628
+ if (message.from !== "") {
629
+ obj.from = message.from;
630
+ }
631
+ if (message.params !== undefined) {
632
+ obj.params = Params.toJSON(message.params);
633
+ }
634
+ return obj;
635
+ },
636
+
637
+ create<I extends Exact<DeepPartial<MsgUpdateParamsRequest>, I>>(base?: I): MsgUpdateParamsRequest {
638
+ return MsgUpdateParamsRequest.fromPartial(base ?? ({} as any));
639
+ },
640
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsRequest>, I>>(object: I): MsgUpdateParamsRequest {
641
+ const message = createBaseMsgUpdateParamsRequest();
642
+ message.from = object.from ?? "";
643
+ message.params = (object.params !== undefined && object.params !== null)
644
+ ? Params.fromPartial(object.params)
645
+ : undefined;
646
+ return message;
647
+ },
648
+ };
649
+
650
+ messageTypeRegistry.set(MsgUpdateParamsRequest.$type, MsgUpdateParamsRequest);
651
+
652
+ function createBaseMsgRegisterNodeResponse(): MsgRegisterNodeResponse {
653
+ return { $type: "sentinel.node.v3.MsgRegisterNodeResponse" };
654
+ }
655
+
656
+ export const MsgRegisterNodeResponse: MessageFns<MsgRegisterNodeResponse, "sentinel.node.v3.MsgRegisterNodeResponse"> =
657
+ {
658
+ $type: "sentinel.node.v3.MsgRegisterNodeResponse" as const,
659
+
660
+ encode(_: MsgRegisterNodeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
661
+ return writer;
662
+ },
663
+
664
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterNodeResponse {
665
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
666
+ const end = length === undefined ? reader.len : reader.pos + length;
667
+ const message = createBaseMsgRegisterNodeResponse();
668
+ while (reader.pos < end) {
669
+ const tag = reader.uint32();
670
+ switch (tag >>> 3) {
671
+ }
672
+ if ((tag & 7) === 4 || tag === 0) {
673
+ break;
674
+ }
675
+ reader.skip(tag & 7);
676
+ }
677
+ return message;
678
+ },
679
+
680
+ fromJSON(_: any): MsgRegisterNodeResponse {
681
+ return { $type: MsgRegisterNodeResponse.$type };
682
+ },
683
+
684
+ toJSON(_: MsgRegisterNodeResponse): unknown {
685
+ const obj: any = {};
686
+ return obj;
687
+ },
688
+
689
+ create<I extends Exact<DeepPartial<MsgRegisterNodeResponse>, I>>(base?: I): MsgRegisterNodeResponse {
690
+ return MsgRegisterNodeResponse.fromPartial(base ?? ({} as any));
691
+ },
692
+ fromPartial<I extends Exact<DeepPartial<MsgRegisterNodeResponse>, I>>(_: I): MsgRegisterNodeResponse {
693
+ const message = createBaseMsgRegisterNodeResponse();
694
+ return message;
695
+ },
696
+ };
697
+
698
+ messageTypeRegistry.set(MsgRegisterNodeResponse.$type, MsgRegisterNodeResponse);
699
+
700
+ function createBaseMsgUpdateNodeDetailsResponse(): MsgUpdateNodeDetailsResponse {
701
+ return { $type: "sentinel.node.v3.MsgUpdateNodeDetailsResponse" };
702
+ }
703
+
704
+ export const MsgUpdateNodeDetailsResponse: MessageFns<
705
+ MsgUpdateNodeDetailsResponse,
706
+ "sentinel.node.v3.MsgUpdateNodeDetailsResponse"
707
+ > = {
708
+ $type: "sentinel.node.v3.MsgUpdateNodeDetailsResponse" as const,
709
+
710
+ encode(_: MsgUpdateNodeDetailsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
711
+ return writer;
712
+ },
713
+
714
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNodeDetailsResponse {
715
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
716
+ const end = length === undefined ? reader.len : reader.pos + length;
717
+ const message = createBaseMsgUpdateNodeDetailsResponse();
718
+ while (reader.pos < end) {
719
+ const tag = reader.uint32();
720
+ switch (tag >>> 3) {
721
+ }
722
+ if ((tag & 7) === 4 || tag === 0) {
723
+ break;
724
+ }
725
+ reader.skip(tag & 7);
726
+ }
727
+ return message;
728
+ },
729
+
730
+ fromJSON(_: any): MsgUpdateNodeDetailsResponse {
731
+ return { $type: MsgUpdateNodeDetailsResponse.$type };
732
+ },
733
+
734
+ toJSON(_: MsgUpdateNodeDetailsResponse): unknown {
735
+ const obj: any = {};
736
+ return obj;
737
+ },
738
+
739
+ create<I extends Exact<DeepPartial<MsgUpdateNodeDetailsResponse>, I>>(base?: I): MsgUpdateNodeDetailsResponse {
740
+ return MsgUpdateNodeDetailsResponse.fromPartial(base ?? ({} as any));
741
+ },
742
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateNodeDetailsResponse>, I>>(_: I): MsgUpdateNodeDetailsResponse {
743
+ const message = createBaseMsgUpdateNodeDetailsResponse();
744
+ return message;
745
+ },
746
+ };
747
+
748
+ messageTypeRegistry.set(MsgUpdateNodeDetailsResponse.$type, MsgUpdateNodeDetailsResponse);
749
+
750
+ function createBaseMsgUpdateNodeStatusResponse(): MsgUpdateNodeStatusResponse {
751
+ return { $type: "sentinel.node.v3.MsgUpdateNodeStatusResponse" };
752
+ }
753
+
754
+ export const MsgUpdateNodeStatusResponse: MessageFns<
755
+ MsgUpdateNodeStatusResponse,
756
+ "sentinel.node.v3.MsgUpdateNodeStatusResponse"
757
+ > = {
758
+ $type: "sentinel.node.v3.MsgUpdateNodeStatusResponse" as const,
759
+
760
+ encode(_: MsgUpdateNodeStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
761
+ return writer;
762
+ },
763
+
764
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateNodeStatusResponse {
765
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
766
+ const end = length === undefined ? reader.len : reader.pos + length;
767
+ const message = createBaseMsgUpdateNodeStatusResponse();
768
+ while (reader.pos < end) {
769
+ const tag = reader.uint32();
770
+ switch (tag >>> 3) {
771
+ }
772
+ if ((tag & 7) === 4 || tag === 0) {
773
+ break;
774
+ }
775
+ reader.skip(tag & 7);
776
+ }
777
+ return message;
778
+ },
779
+
780
+ fromJSON(_: any): MsgUpdateNodeStatusResponse {
781
+ return { $type: MsgUpdateNodeStatusResponse.$type };
782
+ },
783
+
784
+ toJSON(_: MsgUpdateNodeStatusResponse): unknown {
785
+ const obj: any = {};
786
+ return obj;
787
+ },
788
+
789
+ create<I extends Exact<DeepPartial<MsgUpdateNodeStatusResponse>, I>>(base?: I): MsgUpdateNodeStatusResponse {
790
+ return MsgUpdateNodeStatusResponse.fromPartial(base ?? ({} as any));
791
+ },
792
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateNodeStatusResponse>, I>>(_: I): MsgUpdateNodeStatusResponse {
793
+ const message = createBaseMsgUpdateNodeStatusResponse();
794
+ return message;
795
+ },
796
+ };
797
+
798
+ messageTypeRegistry.set(MsgUpdateNodeStatusResponse.$type, MsgUpdateNodeStatusResponse);
799
+
800
+ function createBaseMsgStartSessionResponse(): MsgStartSessionResponse {
801
+ return { $type: "sentinel.node.v3.MsgStartSessionResponse", id: 0 };
802
+ }
803
+
804
+ export const MsgStartSessionResponse: MessageFns<MsgStartSessionResponse, "sentinel.node.v3.MsgStartSessionResponse"> =
805
+ {
806
+ $type: "sentinel.node.v3.MsgStartSessionResponse" as const,
807
+
808
+ encode(message: MsgStartSessionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
809
+ if (message.id !== 0) {
810
+ writer.uint32(8).uint64(message.id);
811
+ }
812
+ return writer;
813
+ },
814
+
815
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgStartSessionResponse {
816
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
817
+ const end = length === undefined ? reader.len : reader.pos + length;
818
+ const message = createBaseMsgStartSessionResponse();
819
+ while (reader.pos < end) {
820
+ const tag = reader.uint32();
821
+ switch (tag >>> 3) {
822
+ case 1: {
823
+ if (tag !== 8) {
824
+ break;
825
+ }
826
+
827
+ message.id = longToNumber(reader.uint64());
828
+ continue;
829
+ }
830
+ }
831
+ if ((tag & 7) === 4 || tag === 0) {
832
+ break;
833
+ }
834
+ reader.skip(tag & 7);
835
+ }
836
+ return message;
837
+ },
838
+
839
+ fromJSON(object: any): MsgStartSessionResponse {
840
+ return { $type: MsgStartSessionResponse.$type, id: isSet(object.id) ? globalThis.Number(object.id) : 0 };
841
+ },
842
+
843
+ toJSON(message: MsgStartSessionResponse): unknown {
844
+ const obj: any = {};
845
+ if (message.id !== 0) {
846
+ obj.id = Math.round(message.id);
847
+ }
848
+ return obj;
849
+ },
850
+
851
+ create<I extends Exact<DeepPartial<MsgStartSessionResponse>, I>>(base?: I): MsgStartSessionResponse {
852
+ return MsgStartSessionResponse.fromPartial(base ?? ({} as any));
853
+ },
854
+ fromPartial<I extends Exact<DeepPartial<MsgStartSessionResponse>, I>>(object: I): MsgStartSessionResponse {
855
+ const message = createBaseMsgStartSessionResponse();
856
+ message.id = object.id ?? 0;
857
+ return message;
858
+ },
859
+ };
860
+
861
+ messageTypeRegistry.set(MsgStartSessionResponse.$type, MsgStartSessionResponse);
862
+
863
+ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
864
+ return { $type: "sentinel.node.v3.MsgUpdateParamsResponse" };
865
+ }
866
+
867
+ export const MsgUpdateParamsResponse: MessageFns<MsgUpdateParamsResponse, "sentinel.node.v3.MsgUpdateParamsResponse"> =
868
+ {
869
+ $type: "sentinel.node.v3.MsgUpdateParamsResponse" as const,
870
+
871
+ encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
872
+ return writer;
873
+ },
874
+
875
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse {
876
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
877
+ const end = length === undefined ? reader.len : reader.pos + length;
878
+ const message = createBaseMsgUpdateParamsResponse();
879
+ while (reader.pos < end) {
880
+ const tag = reader.uint32();
881
+ switch (tag >>> 3) {
882
+ }
883
+ if ((tag & 7) === 4 || tag === 0) {
884
+ break;
885
+ }
886
+ reader.skip(tag & 7);
887
+ }
888
+ return message;
889
+ },
890
+
891
+ fromJSON(_: any): MsgUpdateParamsResponse {
892
+ return { $type: MsgUpdateParamsResponse.$type };
893
+ },
894
+
895
+ toJSON(_: MsgUpdateParamsResponse): unknown {
896
+ const obj: any = {};
897
+ return obj;
898
+ },
899
+
900
+ create<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(base?: I): MsgUpdateParamsResponse {
901
+ return MsgUpdateParamsResponse.fromPartial(base ?? ({} as any));
902
+ },
903
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(_: I): MsgUpdateParamsResponse {
904
+ const message = createBaseMsgUpdateParamsResponse();
905
+ return message;
906
+ },
907
+ };
908
+
909
+ messageTypeRegistry.set(MsgUpdateParamsResponse.$type, MsgUpdateParamsResponse);
910
+
911
+ export interface MsgService {
912
+ MsgRegisterNode(request: MsgRegisterNodeRequest): Promise<MsgRegisterNodeResponse>;
913
+ MsgUpdateNodeDetails(request: MsgUpdateNodeDetailsRequest): Promise<MsgUpdateNodeDetailsResponse>;
914
+ MsgUpdateNodeStatus(request: MsgUpdateNodeStatusRequest): Promise<MsgUpdateNodeStatusResponse>;
915
+ MsgStartSession(request: MsgStartSessionRequest): Promise<MsgStartSessionResponse>;
916
+ MsgUpdateParams(request: MsgUpdateParamsRequest): Promise<MsgUpdateParamsResponse>;
917
+ }
918
+
919
+ export const MsgServiceServiceName = "sentinel.node.v3.MsgService";
920
+ export class MsgServiceClientImpl implements MsgService {
921
+ private readonly rpc: Rpc;
922
+ private readonly service: string;
923
+ constructor(rpc: Rpc, opts?: { service?: string }) {
924
+ this.service = opts?.service || MsgServiceServiceName;
925
+ this.rpc = rpc;
926
+ this.MsgRegisterNode = this.MsgRegisterNode.bind(this);
927
+ this.MsgUpdateNodeDetails = this.MsgUpdateNodeDetails.bind(this);
928
+ this.MsgUpdateNodeStatus = this.MsgUpdateNodeStatus.bind(this);
929
+ this.MsgStartSession = this.MsgStartSession.bind(this);
930
+ this.MsgUpdateParams = this.MsgUpdateParams.bind(this);
931
+ }
932
+ MsgRegisterNode(request: MsgRegisterNodeRequest): Promise<MsgRegisterNodeResponse> {
933
+ const data = MsgRegisterNodeRequest.encode(request).finish();
934
+ const promise = this.rpc.request(this.service, "MsgRegisterNode", data);
935
+ return promise.then((data) => MsgRegisterNodeResponse.decode(new BinaryReader(data)));
936
+ }
937
+
938
+ MsgUpdateNodeDetails(request: MsgUpdateNodeDetailsRequest): Promise<MsgUpdateNodeDetailsResponse> {
939
+ const data = MsgUpdateNodeDetailsRequest.encode(request).finish();
940
+ const promise = this.rpc.request(this.service, "MsgUpdateNodeDetails", data);
941
+ return promise.then((data) => MsgUpdateNodeDetailsResponse.decode(new BinaryReader(data)));
942
+ }
943
+
944
+ MsgUpdateNodeStatus(request: MsgUpdateNodeStatusRequest): Promise<MsgUpdateNodeStatusResponse> {
945
+ const data = MsgUpdateNodeStatusRequest.encode(request).finish();
946
+ const promise = this.rpc.request(this.service, "MsgUpdateNodeStatus", data);
947
+ return promise.then((data) => MsgUpdateNodeStatusResponse.decode(new BinaryReader(data)));
948
+ }
949
+
950
+ MsgStartSession(request: MsgStartSessionRequest): Promise<MsgStartSessionResponse> {
951
+ const data = MsgStartSessionRequest.encode(request).finish();
952
+ const promise = this.rpc.request(this.service, "MsgStartSession", data);
953
+ return promise.then((data) => MsgStartSessionResponse.decode(new BinaryReader(data)));
954
+ }
955
+
956
+ MsgUpdateParams(request: MsgUpdateParamsRequest): Promise<MsgUpdateParamsResponse> {
957
+ const data = MsgUpdateParamsRequest.encode(request).finish();
958
+ const promise = this.rpc.request(this.service, "MsgUpdateParams", data);
959
+ return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data)));
960
+ }
961
+ }
962
+
963
+ interface Rpc {
964
+ request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
965
+ }
966
+
967
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
968
+
969
+ export type DeepPartial<T> = T extends Builtin ? T
970
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
971
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
972
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
973
+ : Partial<T>;
974
+
975
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
976
+ export type Exact<P, I extends P> = P extends Builtin ? P
977
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
978
+
979
+ function longToNumber(int64: { toString(): string }): number {
980
+ const num = globalThis.Number(int64.toString());
981
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
982
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
983
+ }
984
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
985
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
986
+ }
987
+ return num;
988
+ }
989
+
990
+ function isSet(value: any): boolean {
991
+ return value !== null && value !== undefined;
992
+ }
993
+
994
+ export interface MessageFns<T, V extends string> {
995
+ readonly $type: V;
996
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
997
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
998
+ fromJSON(object: any): T;
999
+ toJSON(message: T): unknown;
1000
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
1001
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
1002
+ }