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,616 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v7.34.0
5
+ // source: sentinel/session/v3/msg.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import { Duration } from "../../../google/protobuf/duration";
10
+ import { messageTypeRegistry } from "../../../typeRegistry";
11
+ import { Params } from "./params";
12
+
13
+ export const protobufPackage = "sentinel.session.v3";
14
+
15
+ export interface MsgCancelSessionRequest {
16
+ $type: "sentinel.session.v3.MsgCancelSessionRequest";
17
+ from: string;
18
+ id: number;
19
+ }
20
+
21
+ export interface MsgUpdateSessionRequest {
22
+ $type: "sentinel.session.v3.MsgUpdateSessionRequest";
23
+ from: string;
24
+ id: number;
25
+ downloadBytes: string;
26
+ uploadBytes: string;
27
+ duration: Duration | undefined;
28
+ signature: Buffer;
29
+ }
30
+
31
+ export interface MsgUpdateParamsRequest {
32
+ $type: "sentinel.session.v3.MsgUpdateParamsRequest";
33
+ from: string;
34
+ params: Params | undefined;
35
+ }
36
+
37
+ export interface MsgCancelSessionResponse {
38
+ $type: "sentinel.session.v3.MsgCancelSessionResponse";
39
+ }
40
+
41
+ export interface MsgUpdateSessionResponse {
42
+ $type: "sentinel.session.v3.MsgUpdateSessionResponse";
43
+ }
44
+
45
+ export interface MsgUpdateParamsResponse {
46
+ $type: "sentinel.session.v3.MsgUpdateParamsResponse";
47
+ }
48
+
49
+ function createBaseMsgCancelSessionRequest(): MsgCancelSessionRequest {
50
+ return { $type: "sentinel.session.v3.MsgCancelSessionRequest", from: "", id: 0 };
51
+ }
52
+
53
+ export const MsgCancelSessionRequest: MessageFns<
54
+ MsgCancelSessionRequest,
55
+ "sentinel.session.v3.MsgCancelSessionRequest"
56
+ > = {
57
+ $type: "sentinel.session.v3.MsgCancelSessionRequest" as const,
58
+
59
+ encode(message: MsgCancelSessionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
60
+ if (message.from !== "") {
61
+ writer.uint32(10).string(message.from);
62
+ }
63
+ if (message.id !== 0) {
64
+ writer.uint32(16).uint64(message.id);
65
+ }
66
+ return writer;
67
+ },
68
+
69
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSessionRequest {
70
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
71
+ const end = length === undefined ? reader.len : reader.pos + length;
72
+ const message = createBaseMsgCancelSessionRequest();
73
+ while (reader.pos < end) {
74
+ const tag = reader.uint32();
75
+ switch (tag >>> 3) {
76
+ case 1: {
77
+ if (tag !== 10) {
78
+ break;
79
+ }
80
+
81
+ message.from = reader.string();
82
+ continue;
83
+ }
84
+ case 2: {
85
+ if (tag !== 16) {
86
+ break;
87
+ }
88
+
89
+ message.id = longToNumber(reader.uint64());
90
+ continue;
91
+ }
92
+ }
93
+ if ((tag & 7) === 4 || tag === 0) {
94
+ break;
95
+ }
96
+ reader.skip(tag & 7);
97
+ }
98
+ return message;
99
+ },
100
+
101
+ fromJSON(object: any): MsgCancelSessionRequest {
102
+ return {
103
+ $type: MsgCancelSessionRequest.$type,
104
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
105
+ id: isSet(object.id) ? globalThis.Number(object.id) : 0,
106
+ };
107
+ },
108
+
109
+ toJSON(message: MsgCancelSessionRequest): unknown {
110
+ const obj: any = {};
111
+ if (message.from !== "") {
112
+ obj.from = message.from;
113
+ }
114
+ if (message.id !== 0) {
115
+ obj.id = Math.round(message.id);
116
+ }
117
+ return obj;
118
+ },
119
+
120
+ create<I extends Exact<DeepPartial<MsgCancelSessionRequest>, I>>(base?: I): MsgCancelSessionRequest {
121
+ return MsgCancelSessionRequest.fromPartial(base ?? ({} as any));
122
+ },
123
+ fromPartial<I extends Exact<DeepPartial<MsgCancelSessionRequest>, I>>(object: I): MsgCancelSessionRequest {
124
+ const message = createBaseMsgCancelSessionRequest();
125
+ message.from = object.from ?? "";
126
+ message.id = object.id ?? 0;
127
+ return message;
128
+ },
129
+ };
130
+
131
+ messageTypeRegistry.set(MsgCancelSessionRequest.$type, MsgCancelSessionRequest);
132
+
133
+ function createBaseMsgUpdateSessionRequest(): MsgUpdateSessionRequest {
134
+ return {
135
+ $type: "sentinel.session.v3.MsgUpdateSessionRequest",
136
+ from: "",
137
+ id: 0,
138
+ downloadBytes: "",
139
+ uploadBytes: "",
140
+ duration: undefined,
141
+ signature: Buffer.alloc(0),
142
+ };
143
+ }
144
+
145
+ export const MsgUpdateSessionRequest: MessageFns<
146
+ MsgUpdateSessionRequest,
147
+ "sentinel.session.v3.MsgUpdateSessionRequest"
148
+ > = {
149
+ $type: "sentinel.session.v3.MsgUpdateSessionRequest" as const,
150
+
151
+ encode(message: MsgUpdateSessionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
152
+ if (message.from !== "") {
153
+ writer.uint32(10).string(message.from);
154
+ }
155
+ if (message.id !== 0) {
156
+ writer.uint32(16).uint64(message.id);
157
+ }
158
+ if (message.downloadBytes !== "") {
159
+ writer.uint32(26).string(message.downloadBytes);
160
+ }
161
+ if (message.uploadBytes !== "") {
162
+ writer.uint32(34).string(message.uploadBytes);
163
+ }
164
+ if (message.duration !== undefined) {
165
+ Duration.encode(message.duration, writer.uint32(42).fork()).join();
166
+ }
167
+ if (message.signature.length !== 0) {
168
+ writer.uint32(50).bytes(message.signature);
169
+ }
170
+ return writer;
171
+ },
172
+
173
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSessionRequest {
174
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
175
+ const end = length === undefined ? reader.len : reader.pos + length;
176
+ const message = createBaseMsgUpdateSessionRequest();
177
+ while (reader.pos < end) {
178
+ const tag = reader.uint32();
179
+ switch (tag >>> 3) {
180
+ case 1: {
181
+ if (tag !== 10) {
182
+ break;
183
+ }
184
+
185
+ message.from = reader.string();
186
+ continue;
187
+ }
188
+ case 2: {
189
+ if (tag !== 16) {
190
+ break;
191
+ }
192
+
193
+ message.id = longToNumber(reader.uint64());
194
+ continue;
195
+ }
196
+ case 3: {
197
+ if (tag !== 26) {
198
+ break;
199
+ }
200
+
201
+ message.downloadBytes = reader.string();
202
+ continue;
203
+ }
204
+ case 4: {
205
+ if (tag !== 34) {
206
+ break;
207
+ }
208
+
209
+ message.uploadBytes = reader.string();
210
+ continue;
211
+ }
212
+ case 5: {
213
+ if (tag !== 42) {
214
+ break;
215
+ }
216
+
217
+ message.duration = Duration.decode(reader, reader.uint32());
218
+ continue;
219
+ }
220
+ case 6: {
221
+ if (tag !== 50) {
222
+ break;
223
+ }
224
+
225
+ message.signature = Buffer.from(reader.bytes());
226
+ continue;
227
+ }
228
+ }
229
+ if ((tag & 7) === 4 || tag === 0) {
230
+ break;
231
+ }
232
+ reader.skip(tag & 7);
233
+ }
234
+ return message;
235
+ },
236
+
237
+ fromJSON(object: any): MsgUpdateSessionRequest {
238
+ return {
239
+ $type: MsgUpdateSessionRequest.$type,
240
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
241
+ id: isSet(object.id) ? globalThis.Number(object.id) : 0,
242
+ downloadBytes: isSet(object.downloadBytes)
243
+ ? globalThis.String(object.downloadBytes)
244
+ : isSet(object.download_bytes)
245
+ ? globalThis.String(object.download_bytes)
246
+ : "",
247
+ uploadBytes: isSet(object.uploadBytes)
248
+ ? globalThis.String(object.uploadBytes)
249
+ : isSet(object.upload_bytes)
250
+ ? globalThis.String(object.upload_bytes)
251
+ : "",
252
+ duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined,
253
+ signature: isSet(object.signature) ? Buffer.from(bytesFromBase64(object.signature)) : Buffer.alloc(0),
254
+ };
255
+ },
256
+
257
+ toJSON(message: MsgUpdateSessionRequest): unknown {
258
+ const obj: any = {};
259
+ if (message.from !== "") {
260
+ obj.from = message.from;
261
+ }
262
+ if (message.id !== 0) {
263
+ obj.id = Math.round(message.id);
264
+ }
265
+ if (message.downloadBytes !== "") {
266
+ obj.downloadBytes = message.downloadBytes;
267
+ }
268
+ if (message.uploadBytes !== "") {
269
+ obj.uploadBytes = message.uploadBytes;
270
+ }
271
+ if (message.duration !== undefined) {
272
+ obj.duration = Duration.toJSON(message.duration);
273
+ }
274
+ if (message.signature.length !== 0) {
275
+ obj.signature = base64FromBytes(message.signature);
276
+ }
277
+ return obj;
278
+ },
279
+
280
+ create<I extends Exact<DeepPartial<MsgUpdateSessionRequest>, I>>(base?: I): MsgUpdateSessionRequest {
281
+ return MsgUpdateSessionRequest.fromPartial(base ?? ({} as any));
282
+ },
283
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateSessionRequest>, I>>(object: I): MsgUpdateSessionRequest {
284
+ const message = createBaseMsgUpdateSessionRequest();
285
+ message.from = object.from ?? "";
286
+ message.id = object.id ?? 0;
287
+ message.downloadBytes = object.downloadBytes ?? "";
288
+ message.uploadBytes = object.uploadBytes ?? "";
289
+ message.duration = (object.duration !== undefined && object.duration !== null)
290
+ ? Duration.fromPartial(object.duration)
291
+ : undefined;
292
+ message.signature = object.signature ?? Buffer.alloc(0);
293
+ return message;
294
+ },
295
+ };
296
+
297
+ messageTypeRegistry.set(MsgUpdateSessionRequest.$type, MsgUpdateSessionRequest);
298
+
299
+ function createBaseMsgUpdateParamsRequest(): MsgUpdateParamsRequest {
300
+ return { $type: "sentinel.session.v3.MsgUpdateParamsRequest", from: "", params: undefined };
301
+ }
302
+
303
+ export const MsgUpdateParamsRequest: MessageFns<MsgUpdateParamsRequest, "sentinel.session.v3.MsgUpdateParamsRequest"> =
304
+ {
305
+ $type: "sentinel.session.v3.MsgUpdateParamsRequest" as const,
306
+
307
+ encode(message: MsgUpdateParamsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
308
+ if (message.from !== "") {
309
+ writer.uint32(10).string(message.from);
310
+ }
311
+ if (message.params !== undefined) {
312
+ Params.encode(message.params, writer.uint32(18).fork()).join();
313
+ }
314
+ return writer;
315
+ },
316
+
317
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsRequest {
318
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
319
+ const end = length === undefined ? reader.len : reader.pos + length;
320
+ const message = createBaseMsgUpdateParamsRequest();
321
+ while (reader.pos < end) {
322
+ const tag = reader.uint32();
323
+ switch (tag >>> 3) {
324
+ case 1: {
325
+ if (tag !== 10) {
326
+ break;
327
+ }
328
+
329
+ message.from = reader.string();
330
+ continue;
331
+ }
332
+ case 2: {
333
+ if (tag !== 18) {
334
+ break;
335
+ }
336
+
337
+ message.params = Params.decode(reader, reader.uint32());
338
+ continue;
339
+ }
340
+ }
341
+ if ((tag & 7) === 4 || tag === 0) {
342
+ break;
343
+ }
344
+ reader.skip(tag & 7);
345
+ }
346
+ return message;
347
+ },
348
+
349
+ fromJSON(object: any): MsgUpdateParamsRequest {
350
+ return {
351
+ $type: MsgUpdateParamsRequest.$type,
352
+ from: isSet(object.from) ? globalThis.String(object.from) : "",
353
+ params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
354
+ };
355
+ },
356
+
357
+ toJSON(message: MsgUpdateParamsRequest): unknown {
358
+ const obj: any = {};
359
+ if (message.from !== "") {
360
+ obj.from = message.from;
361
+ }
362
+ if (message.params !== undefined) {
363
+ obj.params = Params.toJSON(message.params);
364
+ }
365
+ return obj;
366
+ },
367
+
368
+ create<I extends Exact<DeepPartial<MsgUpdateParamsRequest>, I>>(base?: I): MsgUpdateParamsRequest {
369
+ return MsgUpdateParamsRequest.fromPartial(base ?? ({} as any));
370
+ },
371
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsRequest>, I>>(object: I): MsgUpdateParamsRequest {
372
+ const message = createBaseMsgUpdateParamsRequest();
373
+ message.from = object.from ?? "";
374
+ message.params = (object.params !== undefined && object.params !== null)
375
+ ? Params.fromPartial(object.params)
376
+ : undefined;
377
+ return message;
378
+ },
379
+ };
380
+
381
+ messageTypeRegistry.set(MsgUpdateParamsRequest.$type, MsgUpdateParamsRequest);
382
+
383
+ function createBaseMsgCancelSessionResponse(): MsgCancelSessionResponse {
384
+ return { $type: "sentinel.session.v3.MsgCancelSessionResponse" };
385
+ }
386
+
387
+ export const MsgCancelSessionResponse: MessageFns<
388
+ MsgCancelSessionResponse,
389
+ "sentinel.session.v3.MsgCancelSessionResponse"
390
+ > = {
391
+ $type: "sentinel.session.v3.MsgCancelSessionResponse" as const,
392
+
393
+ encode(_: MsgCancelSessionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
394
+ return writer;
395
+ },
396
+
397
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelSessionResponse {
398
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
399
+ const end = length === undefined ? reader.len : reader.pos + length;
400
+ const message = createBaseMsgCancelSessionResponse();
401
+ while (reader.pos < end) {
402
+ const tag = reader.uint32();
403
+ switch (tag >>> 3) {
404
+ }
405
+ if ((tag & 7) === 4 || tag === 0) {
406
+ break;
407
+ }
408
+ reader.skip(tag & 7);
409
+ }
410
+ return message;
411
+ },
412
+
413
+ fromJSON(_: any): MsgCancelSessionResponse {
414
+ return { $type: MsgCancelSessionResponse.$type };
415
+ },
416
+
417
+ toJSON(_: MsgCancelSessionResponse): unknown {
418
+ const obj: any = {};
419
+ return obj;
420
+ },
421
+
422
+ create<I extends Exact<DeepPartial<MsgCancelSessionResponse>, I>>(base?: I): MsgCancelSessionResponse {
423
+ return MsgCancelSessionResponse.fromPartial(base ?? ({} as any));
424
+ },
425
+ fromPartial<I extends Exact<DeepPartial<MsgCancelSessionResponse>, I>>(_: I): MsgCancelSessionResponse {
426
+ const message = createBaseMsgCancelSessionResponse();
427
+ return message;
428
+ },
429
+ };
430
+
431
+ messageTypeRegistry.set(MsgCancelSessionResponse.$type, MsgCancelSessionResponse);
432
+
433
+ function createBaseMsgUpdateSessionResponse(): MsgUpdateSessionResponse {
434
+ return { $type: "sentinel.session.v3.MsgUpdateSessionResponse" };
435
+ }
436
+
437
+ export const MsgUpdateSessionResponse: MessageFns<
438
+ MsgUpdateSessionResponse,
439
+ "sentinel.session.v3.MsgUpdateSessionResponse"
440
+ > = {
441
+ $type: "sentinel.session.v3.MsgUpdateSessionResponse" as const,
442
+
443
+ encode(_: MsgUpdateSessionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
444
+ return writer;
445
+ },
446
+
447
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateSessionResponse {
448
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
449
+ const end = length === undefined ? reader.len : reader.pos + length;
450
+ const message = createBaseMsgUpdateSessionResponse();
451
+ while (reader.pos < end) {
452
+ const tag = reader.uint32();
453
+ switch (tag >>> 3) {
454
+ }
455
+ if ((tag & 7) === 4 || tag === 0) {
456
+ break;
457
+ }
458
+ reader.skip(tag & 7);
459
+ }
460
+ return message;
461
+ },
462
+
463
+ fromJSON(_: any): MsgUpdateSessionResponse {
464
+ return { $type: MsgUpdateSessionResponse.$type };
465
+ },
466
+
467
+ toJSON(_: MsgUpdateSessionResponse): unknown {
468
+ const obj: any = {};
469
+ return obj;
470
+ },
471
+
472
+ create<I extends Exact<DeepPartial<MsgUpdateSessionResponse>, I>>(base?: I): MsgUpdateSessionResponse {
473
+ return MsgUpdateSessionResponse.fromPartial(base ?? ({} as any));
474
+ },
475
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateSessionResponse>, I>>(_: I): MsgUpdateSessionResponse {
476
+ const message = createBaseMsgUpdateSessionResponse();
477
+ return message;
478
+ },
479
+ };
480
+
481
+ messageTypeRegistry.set(MsgUpdateSessionResponse.$type, MsgUpdateSessionResponse);
482
+
483
+ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse {
484
+ return { $type: "sentinel.session.v3.MsgUpdateParamsResponse" };
485
+ }
486
+
487
+ export const MsgUpdateParamsResponse: MessageFns<
488
+ MsgUpdateParamsResponse,
489
+ "sentinel.session.v3.MsgUpdateParamsResponse"
490
+ > = {
491
+ $type: "sentinel.session.v3.MsgUpdateParamsResponse" as const,
492
+
493
+ encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
494
+ return writer;
495
+ },
496
+
497
+ decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse {
498
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
499
+ const end = length === undefined ? reader.len : reader.pos + length;
500
+ const message = createBaseMsgUpdateParamsResponse();
501
+ while (reader.pos < end) {
502
+ const tag = reader.uint32();
503
+ switch (tag >>> 3) {
504
+ }
505
+ if ((tag & 7) === 4 || tag === 0) {
506
+ break;
507
+ }
508
+ reader.skip(tag & 7);
509
+ }
510
+ return message;
511
+ },
512
+
513
+ fromJSON(_: any): MsgUpdateParamsResponse {
514
+ return { $type: MsgUpdateParamsResponse.$type };
515
+ },
516
+
517
+ toJSON(_: MsgUpdateParamsResponse): unknown {
518
+ const obj: any = {};
519
+ return obj;
520
+ },
521
+
522
+ create<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(base?: I): MsgUpdateParamsResponse {
523
+ return MsgUpdateParamsResponse.fromPartial(base ?? ({} as any));
524
+ },
525
+ fromPartial<I extends Exact<DeepPartial<MsgUpdateParamsResponse>, I>>(_: I): MsgUpdateParamsResponse {
526
+ const message = createBaseMsgUpdateParamsResponse();
527
+ return message;
528
+ },
529
+ };
530
+
531
+ messageTypeRegistry.set(MsgUpdateParamsResponse.$type, MsgUpdateParamsResponse);
532
+
533
+ export interface MsgService {
534
+ MsgCancelSession(request: MsgCancelSessionRequest): Promise<MsgCancelSessionResponse>;
535
+ MsgUpdateSession(request: MsgUpdateSessionRequest): Promise<MsgUpdateSessionResponse>;
536
+ MsgUpdateParams(request: MsgUpdateParamsRequest): Promise<MsgUpdateParamsResponse>;
537
+ }
538
+
539
+ export const MsgServiceServiceName = "sentinel.session.v3.MsgService";
540
+ export class MsgServiceClientImpl implements MsgService {
541
+ private readonly rpc: Rpc;
542
+ private readonly service: string;
543
+ constructor(rpc: Rpc, opts?: { service?: string }) {
544
+ this.service = opts?.service || MsgServiceServiceName;
545
+ this.rpc = rpc;
546
+ this.MsgCancelSession = this.MsgCancelSession.bind(this);
547
+ this.MsgUpdateSession = this.MsgUpdateSession.bind(this);
548
+ this.MsgUpdateParams = this.MsgUpdateParams.bind(this);
549
+ }
550
+ MsgCancelSession(request: MsgCancelSessionRequest): Promise<MsgCancelSessionResponse> {
551
+ const data = MsgCancelSessionRequest.encode(request).finish();
552
+ const promise = this.rpc.request(this.service, "MsgCancelSession", data);
553
+ return promise.then((data) => MsgCancelSessionResponse.decode(new BinaryReader(data)));
554
+ }
555
+
556
+ MsgUpdateSession(request: MsgUpdateSessionRequest): Promise<MsgUpdateSessionResponse> {
557
+ const data = MsgUpdateSessionRequest.encode(request).finish();
558
+ const promise = this.rpc.request(this.service, "MsgUpdateSession", data);
559
+ return promise.then((data) => MsgUpdateSessionResponse.decode(new BinaryReader(data)));
560
+ }
561
+
562
+ MsgUpdateParams(request: MsgUpdateParamsRequest): Promise<MsgUpdateParamsResponse> {
563
+ const data = MsgUpdateParamsRequest.encode(request).finish();
564
+ const promise = this.rpc.request(this.service, "MsgUpdateParams", data);
565
+ return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data)));
566
+ }
567
+ }
568
+
569
+ interface Rpc {
570
+ request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
571
+ }
572
+
573
+ function bytesFromBase64(b64: string): Uint8Array {
574
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
575
+ }
576
+
577
+ function base64FromBytes(arr: Uint8Array): string {
578
+ return globalThis.Buffer.from(arr).toString("base64");
579
+ }
580
+
581
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
582
+
583
+ export type DeepPartial<T> = T extends Builtin ? T
584
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
585
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
586
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
587
+ : Partial<T>;
588
+
589
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
590
+ export type Exact<P, I extends P> = P extends Builtin ? P
591
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
592
+
593
+ function longToNumber(int64: { toString(): string }): number {
594
+ const num = globalThis.Number(int64.toString());
595
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
596
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
597
+ }
598
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
599
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
600
+ }
601
+ return num;
602
+ }
603
+
604
+ function isSet(value: any): boolean {
605
+ return value !== null && value !== undefined;
606
+ }
607
+
608
+ export interface MessageFns<T, V extends string> {
609
+ readonly $type: V;
610
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
611
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
612
+ fromJSON(object: any): T;
613
+ toJSON(message: T): unknown;
614
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
615
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
616
+ }