@world-engines/protocol-ts 0.1.0-alpha.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 (74) hide show
  1. package/LICENSE +46 -0
  2. package/dist/entity-prop-envelope.d.ts +36 -0
  3. package/dist/entity-prop-envelope.js +50 -0
  4. package/dist/gen/v1/auth.d.ts +46 -0
  5. package/dist/gen/v1/auth.js +278 -0
  6. package/dist/gen/v1/billing.d.ts +71 -0
  7. package/dist/gen/v1/billing.js +521 -0
  8. package/dist/gen/v1/common.d.ts +65 -0
  9. package/dist/gen/v1/common.js +387 -0
  10. package/dist/gen/v1/llm.d.ts +317 -0
  11. package/dist/gen/v1/llm.js +3557 -0
  12. package/dist/gen/v1/mcp.d.ts +373 -0
  13. package/dist/gen/v1/mcp.js +3190 -0
  14. package/dist/gen/v1/moderation.d.ts +51 -0
  15. package/dist/gen/v1/moderation.js +368 -0
  16. package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
  17. package/dist/gen/v1/neutral_scenario_source.js +569 -0
  18. package/dist/gen/v1/relation_kind.d.ts +105 -0
  19. package/dist/gen/v1/relation_kind.js +562 -0
  20. package/dist/gen/v1/rest/admin.d.ts +432 -0
  21. package/dist/gen/v1/rest/admin.js +4957 -0
  22. package/dist/gen/v1/rest/asset.d.ts +205 -0
  23. package/dist/gen/v1/rest/asset.js +2200 -0
  24. package/dist/gen/v1/rest/auth.d.ts +275 -0
  25. package/dist/gen/v1/rest/auth.js +2896 -0
  26. package/dist/gen/v1/rest/billing.d.ts +101 -0
  27. package/dist/gen/v1/rest/billing.js +866 -0
  28. package/dist/gen/v1/rest/common.d.ts +179 -0
  29. package/dist/gen/v1/rest/common.js +1358 -0
  30. package/dist/gen/v1/rest/creator.d.ts +354 -0
  31. package/dist/gen/v1/rest/creator.js +4169 -0
  32. package/dist/gen/v1/rest/messaging.d.ts +190 -0
  33. package/dist/gen/v1/rest/messaging.js +2017 -0
  34. package/dist/gen/v1/rest/moderation.d.ts +61 -0
  35. package/dist/gen/v1/rest/moderation.js +569 -0
  36. package/dist/gen/v1/rest/pet.d.ts +98 -0
  37. package/dist/gen/v1/rest/pet.js +698 -0
  38. package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
  39. package/dist/gen/v1/rest/project_transfer.js +5266 -0
  40. package/dist/gen/v1/rest/scenario.d.ts +756 -0
  41. package/dist/gen/v1/rest/scenario.js +8768 -0
  42. package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
  43. package/dist/gen/v1/rest/stock_bounty.js +1547 -0
  44. package/dist/gen/v1/rest/stocks.d.ts +465 -0
  45. package/dist/gen/v1/rest/stocks.js +5200 -0
  46. package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
  47. package/dist/gen/v1/rest/support_ticket.js +511 -0
  48. package/dist/gen/v1/rest/users.d.ts +292 -0
  49. package/dist/gen/v1/rest/users.js +2879 -0
  50. package/dist/gen/v1/rest/violations.d.ts +52 -0
  51. package/dist/gen/v1/rest/violations.js +338 -0
  52. package/dist/gen/v1/sav.d.ts +987 -0
  53. package/dist/gen/v1/sav.js +12327 -0
  54. package/dist/gen/v1/save.d.ts +68 -0
  55. package/dist/gen/v1/save.js +595 -0
  56. package/dist/gen/v1/scenario_part_source.d.ts +94 -0
  57. package/dist/gen/v1/scenario_part_source.js +913 -0
  58. package/dist/gen/v1/session.d.ts +49 -0
  59. package/dist/gen/v1/session.js +311 -0
  60. package/dist/gen/v1/view_state.d.ts +267 -0
  61. package/dist/gen/v1/view_state.js +3239 -0
  62. package/dist/gen/v1/world.d.ts +82 -0
  63. package/dist/gen/v1/world.js +707 -0
  64. package/dist/gen/v1/world_memory.d.ts +545 -0
  65. package/dist/gen/v1/world_memory.js +5816 -0
  66. package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
  67. package/dist/gen/v1/world_memory_privacy.js +994 -0
  68. package/dist/gen/v1/ws_frame.d.ts +1626 -0
  69. package/dist/gen/v1/ws_frame.js +18253 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.js +5 -0
  72. package/dist/ladybug-extraction.d.ts +36 -0
  73. package/dist/ladybug-extraction.js +1 -0
  74. package/package.json +65 -0
@@ -0,0 +1,1547 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.0
4
+ // protoc unknown
5
+ // source: v1/rest/stock_bounty.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { ErrorInfo } from "../common.js";
9
+ /** 市场悬赏 wire authority。金额均是平台整数单位,发布时必须明确选择🐔或🐟,不支持🐋/🐺或混合扣款。 */
10
+ export var BountySourceKind;
11
+ (function (BountySourceKind) {
12
+ BountySourceKind[BountySourceKind["BOUNTY_SOURCE_KIND_UNSPECIFIED"] = 0] = "BOUNTY_SOURCE_KIND_UNSPECIFIED";
13
+ BountySourceKind[BountySourceKind["BOUNTY_SOURCE_KIND_CREDIT"] = 1] = "BOUNTY_SOURCE_KIND_CREDIT";
14
+ BountySourceKind[BountySourceKind["BOUNTY_SOURCE_KIND_TOP_UP"] = 2] = "BOUNTY_SOURCE_KIND_TOP_UP";
15
+ BountySourceKind[BountySourceKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
16
+ })(BountySourceKind || (BountySourceKind = {}));
17
+ export function bountySourceKindFromJSON(object) {
18
+ switch (object) {
19
+ case 0:
20
+ case "BOUNTY_SOURCE_KIND_UNSPECIFIED":
21
+ return BountySourceKind.BOUNTY_SOURCE_KIND_UNSPECIFIED;
22
+ case 1:
23
+ case "BOUNTY_SOURCE_KIND_CREDIT":
24
+ return BountySourceKind.BOUNTY_SOURCE_KIND_CREDIT;
25
+ case 2:
26
+ case "BOUNTY_SOURCE_KIND_TOP_UP":
27
+ return BountySourceKind.BOUNTY_SOURCE_KIND_TOP_UP;
28
+ case -1:
29
+ case "UNRECOGNIZED":
30
+ default:
31
+ return BountySourceKind.UNRECOGNIZED;
32
+ }
33
+ }
34
+ export function bountySourceKindToJSON(object) {
35
+ switch (object) {
36
+ case BountySourceKind.BOUNTY_SOURCE_KIND_UNSPECIFIED:
37
+ return "BOUNTY_SOURCE_KIND_UNSPECIFIED";
38
+ case BountySourceKind.BOUNTY_SOURCE_KIND_CREDIT:
39
+ return "BOUNTY_SOURCE_KIND_CREDIT";
40
+ case BountySourceKind.BOUNTY_SOURCE_KIND_TOP_UP:
41
+ return "BOUNTY_SOURCE_KIND_TOP_UP";
42
+ case BountySourceKind.UNRECOGNIZED:
43
+ default:
44
+ return "UNRECOGNIZED";
45
+ }
46
+ }
47
+ export var BountyState;
48
+ (function (BountyState) {
49
+ BountyState[BountyState["BOUNTY_STATE_UNSPECIFIED"] = 0] = "BOUNTY_STATE_UNSPECIFIED";
50
+ BountyState[BountyState["BOUNTY_STATE_OPEN"] = 1] = "BOUNTY_STATE_OPEN";
51
+ BountyState[BountyState["BOUNTY_STATE_CLAIMED"] = 2] = "BOUNTY_STATE_CLAIMED";
52
+ BountyState[BountyState["BOUNTY_STATE_SUBMITTED"] = 3] = "BOUNTY_STATE_SUBMITTED";
53
+ BountyState[BountyState["BOUNTY_STATE_ACCEPTED"] = 4] = "BOUNTY_STATE_ACCEPTED";
54
+ BountyState[BountyState["BOUNTY_STATE_CANCELLED"] = 5] = "BOUNTY_STATE_CANCELLED";
55
+ BountyState[BountyState["BOUNTY_STATE_EXPIRED"] = 6] = "BOUNTY_STATE_EXPIRED";
56
+ BountyState[BountyState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
57
+ })(BountyState || (BountyState = {}));
58
+ export function bountyStateFromJSON(object) {
59
+ switch (object) {
60
+ case 0:
61
+ case "BOUNTY_STATE_UNSPECIFIED":
62
+ return BountyState.BOUNTY_STATE_UNSPECIFIED;
63
+ case 1:
64
+ case "BOUNTY_STATE_OPEN":
65
+ return BountyState.BOUNTY_STATE_OPEN;
66
+ case 2:
67
+ case "BOUNTY_STATE_CLAIMED":
68
+ return BountyState.BOUNTY_STATE_CLAIMED;
69
+ case 3:
70
+ case "BOUNTY_STATE_SUBMITTED":
71
+ return BountyState.BOUNTY_STATE_SUBMITTED;
72
+ case 4:
73
+ case "BOUNTY_STATE_ACCEPTED":
74
+ return BountyState.BOUNTY_STATE_ACCEPTED;
75
+ case 5:
76
+ case "BOUNTY_STATE_CANCELLED":
77
+ return BountyState.BOUNTY_STATE_CANCELLED;
78
+ case 6:
79
+ case "BOUNTY_STATE_EXPIRED":
80
+ return BountyState.BOUNTY_STATE_EXPIRED;
81
+ case -1:
82
+ case "UNRECOGNIZED":
83
+ default:
84
+ return BountyState.UNRECOGNIZED;
85
+ }
86
+ }
87
+ export function bountyStateToJSON(object) {
88
+ switch (object) {
89
+ case BountyState.BOUNTY_STATE_UNSPECIFIED:
90
+ return "BOUNTY_STATE_UNSPECIFIED";
91
+ case BountyState.BOUNTY_STATE_OPEN:
92
+ return "BOUNTY_STATE_OPEN";
93
+ case BountyState.BOUNTY_STATE_CLAIMED:
94
+ return "BOUNTY_STATE_CLAIMED";
95
+ case BountyState.BOUNTY_STATE_SUBMITTED:
96
+ return "BOUNTY_STATE_SUBMITTED";
97
+ case BountyState.BOUNTY_STATE_ACCEPTED:
98
+ return "BOUNTY_STATE_ACCEPTED";
99
+ case BountyState.BOUNTY_STATE_CANCELLED:
100
+ return "BOUNTY_STATE_CANCELLED";
101
+ case BountyState.BOUNTY_STATE_EXPIRED:
102
+ return "BOUNTY_STATE_EXPIRED";
103
+ case BountyState.UNRECOGNIZED:
104
+ default:
105
+ return "UNRECOGNIZED";
106
+ }
107
+ }
108
+ function createBaseBounty() {
109
+ return {
110
+ bounty_id: "",
111
+ publisher_user_id: "",
112
+ claimant_user_id: "",
113
+ body: "",
114
+ delivery_body: "",
115
+ source_kind: 0,
116
+ amount_units: "",
117
+ expires_at_ms: "",
118
+ state: 0,
119
+ revision: "",
120
+ body_redacted: false,
121
+ delivery_redacted: false,
122
+ _unknownFields: {},
123
+ };
124
+ }
125
+ export const Bounty = {
126
+ encode(message, writer = new BinaryWriter()) {
127
+ if (message.bounty_id !== "") {
128
+ writer.uint32(10).string(message.bounty_id);
129
+ }
130
+ if (message.publisher_user_id !== "") {
131
+ writer.uint32(18).string(message.publisher_user_id);
132
+ }
133
+ if (message.claimant_user_id !== "") {
134
+ writer.uint32(26).string(message.claimant_user_id);
135
+ }
136
+ if (message.body !== "") {
137
+ writer.uint32(34).string(message.body);
138
+ }
139
+ if (message.delivery_body !== "") {
140
+ writer.uint32(42).string(message.delivery_body);
141
+ }
142
+ if (message.source_kind !== 0) {
143
+ writer.uint32(48).int32(message.source_kind);
144
+ }
145
+ if (message.amount_units !== "") {
146
+ writer.uint32(58).string(message.amount_units);
147
+ }
148
+ if (message.expires_at_ms !== "") {
149
+ writer.uint32(66).string(message.expires_at_ms);
150
+ }
151
+ if (message.state !== 0) {
152
+ writer.uint32(72).int32(message.state);
153
+ }
154
+ if (message.revision !== "") {
155
+ writer.uint32(82).string(message.revision);
156
+ }
157
+ if (message.body_redacted !== false) {
158
+ writer.uint32(88).bool(message.body_redacted);
159
+ }
160
+ if (message.delivery_redacted !== false) {
161
+ writer.uint32(96).bool(message.delivery_redacted);
162
+ }
163
+ if (message._unknownFields !== undefined) {
164
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
165
+ const tag = parseInt(key, 10);
166
+ for (const value of values) {
167
+ writer.uint32(tag).raw(value);
168
+ }
169
+ }
170
+ }
171
+ return writer;
172
+ },
173
+ decode(input, length) {
174
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
175
+ const end = length === undefined ? reader.len : reader.pos + length;
176
+ const message = createBaseBounty();
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
+ message.bounty_id = reader.string();
185
+ continue;
186
+ }
187
+ case 2: {
188
+ if (tag !== 18) {
189
+ break;
190
+ }
191
+ message.publisher_user_id = reader.string();
192
+ continue;
193
+ }
194
+ case 3: {
195
+ if (tag !== 26) {
196
+ break;
197
+ }
198
+ message.claimant_user_id = reader.string();
199
+ continue;
200
+ }
201
+ case 4: {
202
+ if (tag !== 34) {
203
+ break;
204
+ }
205
+ message.body = reader.string();
206
+ continue;
207
+ }
208
+ case 5: {
209
+ if (tag !== 42) {
210
+ break;
211
+ }
212
+ message.delivery_body = reader.string();
213
+ continue;
214
+ }
215
+ case 6: {
216
+ if (tag !== 48) {
217
+ break;
218
+ }
219
+ message.source_kind = reader.int32();
220
+ continue;
221
+ }
222
+ case 7: {
223
+ if (tag !== 58) {
224
+ break;
225
+ }
226
+ message.amount_units = reader.string();
227
+ continue;
228
+ }
229
+ case 8: {
230
+ if (tag !== 66) {
231
+ break;
232
+ }
233
+ message.expires_at_ms = reader.string();
234
+ continue;
235
+ }
236
+ case 9: {
237
+ if (tag !== 72) {
238
+ break;
239
+ }
240
+ message.state = reader.int32();
241
+ continue;
242
+ }
243
+ case 10: {
244
+ if (tag !== 82) {
245
+ break;
246
+ }
247
+ message.revision = reader.string();
248
+ continue;
249
+ }
250
+ case 11: {
251
+ if (tag !== 88) {
252
+ break;
253
+ }
254
+ message.body_redacted = reader.bool();
255
+ continue;
256
+ }
257
+ case 12: {
258
+ if (tag !== 96) {
259
+ break;
260
+ }
261
+ message.delivery_redacted = reader.bool();
262
+ continue;
263
+ }
264
+ }
265
+ if ((tag & 7) === 4 || tag === 0) {
266
+ break;
267
+ }
268
+ const buf = reader.skip(tag & 7);
269
+ const list = message._unknownFields[tag];
270
+ if (list === undefined) {
271
+ message._unknownFields[tag] = [buf];
272
+ }
273
+ else {
274
+ list.push(buf);
275
+ }
276
+ }
277
+ return message;
278
+ },
279
+ fromJSON(object) {
280
+ return {
281
+ bounty_id: isSet(object.bountyId)
282
+ ? globalThis.String(object.bountyId)
283
+ : isSet(object.bounty_id)
284
+ ? globalThis.String(object.bounty_id)
285
+ : "",
286
+ publisher_user_id: isSet(object.publisherUserId)
287
+ ? globalThis.String(object.publisherUserId)
288
+ : isSet(object.publisher_user_id)
289
+ ? globalThis.String(object.publisher_user_id)
290
+ : "",
291
+ claimant_user_id: isSet(object.claimantUserId)
292
+ ? globalThis.String(object.claimantUserId)
293
+ : isSet(object.claimant_user_id)
294
+ ? globalThis.String(object.claimant_user_id)
295
+ : "",
296
+ body: isSet(object.body) ? globalThis.String(object.body) : "",
297
+ delivery_body: isSet(object.deliveryBody)
298
+ ? globalThis.String(object.deliveryBody)
299
+ : isSet(object.delivery_body)
300
+ ? globalThis.String(object.delivery_body)
301
+ : "",
302
+ source_kind: isSet(object.sourceKind)
303
+ ? bountySourceKindFromJSON(object.sourceKind)
304
+ : isSet(object.source_kind)
305
+ ? bountySourceKindFromJSON(object.source_kind)
306
+ : 0,
307
+ amount_units: isSet(object.amountUnits)
308
+ ? globalThis.String(object.amountUnits)
309
+ : isSet(object.amount_units)
310
+ ? globalThis.String(object.amount_units)
311
+ : "",
312
+ expires_at_ms: isSet(object.expiresAtMs)
313
+ ? globalThis.String(object.expiresAtMs)
314
+ : isSet(object.expires_at_ms)
315
+ ? globalThis.String(object.expires_at_ms)
316
+ : "",
317
+ state: isSet(object.state) ? bountyStateFromJSON(object.state) : 0,
318
+ revision: isSet(object.revision) ? globalThis.String(object.revision) : "",
319
+ body_redacted: isSet(object.bodyRedacted)
320
+ ? globalThis.Boolean(object.bodyRedacted)
321
+ : isSet(object.body_redacted)
322
+ ? globalThis.Boolean(object.body_redacted)
323
+ : false,
324
+ delivery_redacted: isSet(object.deliveryRedacted)
325
+ ? globalThis.Boolean(object.deliveryRedacted)
326
+ : isSet(object.delivery_redacted)
327
+ ? globalThis.Boolean(object.delivery_redacted)
328
+ : false,
329
+ };
330
+ },
331
+ toJSON(message) {
332
+ const obj = {};
333
+ if (message.bounty_id !== "") {
334
+ obj.bountyId = message.bounty_id;
335
+ }
336
+ if (message.publisher_user_id !== "") {
337
+ obj.publisherUserId = message.publisher_user_id;
338
+ }
339
+ if (message.claimant_user_id !== "") {
340
+ obj.claimantUserId = message.claimant_user_id;
341
+ }
342
+ if (message.body !== "") {
343
+ obj.body = message.body;
344
+ }
345
+ if (message.delivery_body !== "") {
346
+ obj.deliveryBody = message.delivery_body;
347
+ }
348
+ if (message.source_kind !== 0) {
349
+ obj.sourceKind = bountySourceKindToJSON(message.source_kind);
350
+ }
351
+ if (message.amount_units !== "") {
352
+ obj.amountUnits = message.amount_units;
353
+ }
354
+ if (message.expires_at_ms !== "") {
355
+ obj.expiresAtMs = message.expires_at_ms;
356
+ }
357
+ if (message.state !== 0) {
358
+ obj.state = bountyStateToJSON(message.state);
359
+ }
360
+ if (message.revision !== "") {
361
+ obj.revision = message.revision;
362
+ }
363
+ if (message.body_redacted !== false) {
364
+ obj.bodyRedacted = message.body_redacted;
365
+ }
366
+ if (message.delivery_redacted !== false) {
367
+ obj.deliveryRedacted = message.delivery_redacted;
368
+ }
369
+ return obj;
370
+ },
371
+ create(base) {
372
+ return Bounty.fromPartial(base ?? {});
373
+ },
374
+ fromPartial(object) {
375
+ const message = createBaseBounty();
376
+ message.bounty_id = object.bounty_id ?? "";
377
+ message.publisher_user_id = object.publisher_user_id ?? "";
378
+ message.claimant_user_id = object.claimant_user_id ?? "";
379
+ message.body = object.body ?? "";
380
+ message.delivery_body = object.delivery_body ?? "";
381
+ message.source_kind = object.source_kind ?? 0;
382
+ message.amount_units = object.amount_units ?? "";
383
+ message.expires_at_ms = object.expires_at_ms ?? "";
384
+ message.state = object.state ?? 0;
385
+ message.revision = object.revision ?? "";
386
+ message.body_redacted = object.body_redacted ?? false;
387
+ message.delivery_redacted = object.delivery_redacted ?? false;
388
+ return message;
389
+ },
390
+ };
391
+ function createBaseBountyReceipt() {
392
+ return {
393
+ operation_id: "",
394
+ intent_key: "",
395
+ bounty_id: "",
396
+ state: 0,
397
+ source_kind: 0,
398
+ amount_units: "",
399
+ _unknownFields: {},
400
+ };
401
+ }
402
+ export const BountyReceipt = {
403
+ encode(message, writer = new BinaryWriter()) {
404
+ if (message.operation_id !== "") {
405
+ writer.uint32(10).string(message.operation_id);
406
+ }
407
+ if (message.intent_key !== "") {
408
+ writer.uint32(18).string(message.intent_key);
409
+ }
410
+ if (message.bounty_id !== "") {
411
+ writer.uint32(26).string(message.bounty_id);
412
+ }
413
+ if (message.state !== 0) {
414
+ writer.uint32(32).int32(message.state);
415
+ }
416
+ if (message.source_kind !== 0) {
417
+ writer.uint32(40).int32(message.source_kind);
418
+ }
419
+ if (message.amount_units !== "") {
420
+ writer.uint32(50).string(message.amount_units);
421
+ }
422
+ if (message._unknownFields !== undefined) {
423
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
424
+ const tag = parseInt(key, 10);
425
+ for (const value of values) {
426
+ writer.uint32(tag).raw(value);
427
+ }
428
+ }
429
+ }
430
+ return writer;
431
+ },
432
+ decode(input, length) {
433
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
434
+ const end = length === undefined ? reader.len : reader.pos + length;
435
+ const message = createBaseBountyReceipt();
436
+ while (reader.pos < end) {
437
+ const tag = reader.uint32();
438
+ switch (tag >>> 3) {
439
+ case 1: {
440
+ if (tag !== 10) {
441
+ break;
442
+ }
443
+ message.operation_id = reader.string();
444
+ continue;
445
+ }
446
+ case 2: {
447
+ if (tag !== 18) {
448
+ break;
449
+ }
450
+ message.intent_key = reader.string();
451
+ continue;
452
+ }
453
+ case 3: {
454
+ if (tag !== 26) {
455
+ break;
456
+ }
457
+ message.bounty_id = reader.string();
458
+ continue;
459
+ }
460
+ case 4: {
461
+ if (tag !== 32) {
462
+ break;
463
+ }
464
+ message.state = reader.int32();
465
+ continue;
466
+ }
467
+ case 5: {
468
+ if (tag !== 40) {
469
+ break;
470
+ }
471
+ message.source_kind = reader.int32();
472
+ continue;
473
+ }
474
+ case 6: {
475
+ if (tag !== 50) {
476
+ break;
477
+ }
478
+ message.amount_units = reader.string();
479
+ continue;
480
+ }
481
+ }
482
+ if ((tag & 7) === 4 || tag === 0) {
483
+ break;
484
+ }
485
+ const buf = reader.skip(tag & 7);
486
+ const list = message._unknownFields[tag];
487
+ if (list === undefined) {
488
+ message._unknownFields[tag] = [buf];
489
+ }
490
+ else {
491
+ list.push(buf);
492
+ }
493
+ }
494
+ return message;
495
+ },
496
+ fromJSON(object) {
497
+ return {
498
+ operation_id: isSet(object.operationId)
499
+ ? globalThis.String(object.operationId)
500
+ : isSet(object.operation_id)
501
+ ? globalThis.String(object.operation_id)
502
+ : "",
503
+ intent_key: isSet(object.intentKey)
504
+ ? globalThis.String(object.intentKey)
505
+ : isSet(object.intent_key)
506
+ ? globalThis.String(object.intent_key)
507
+ : "",
508
+ bounty_id: isSet(object.bountyId)
509
+ ? globalThis.String(object.bountyId)
510
+ : isSet(object.bounty_id)
511
+ ? globalThis.String(object.bounty_id)
512
+ : "",
513
+ state: isSet(object.state) ? bountyStateFromJSON(object.state) : 0,
514
+ source_kind: isSet(object.sourceKind)
515
+ ? bountySourceKindFromJSON(object.sourceKind)
516
+ : isSet(object.source_kind)
517
+ ? bountySourceKindFromJSON(object.source_kind)
518
+ : 0,
519
+ amount_units: isSet(object.amountUnits)
520
+ ? globalThis.String(object.amountUnits)
521
+ : isSet(object.amount_units)
522
+ ? globalThis.String(object.amount_units)
523
+ : "",
524
+ };
525
+ },
526
+ toJSON(message) {
527
+ const obj = {};
528
+ if (message.operation_id !== "") {
529
+ obj.operationId = message.operation_id;
530
+ }
531
+ if (message.intent_key !== "") {
532
+ obj.intentKey = message.intent_key;
533
+ }
534
+ if (message.bounty_id !== "") {
535
+ obj.bountyId = message.bounty_id;
536
+ }
537
+ if (message.state !== 0) {
538
+ obj.state = bountyStateToJSON(message.state);
539
+ }
540
+ if (message.source_kind !== 0) {
541
+ obj.sourceKind = bountySourceKindToJSON(message.source_kind);
542
+ }
543
+ if (message.amount_units !== "") {
544
+ obj.amountUnits = message.amount_units;
545
+ }
546
+ return obj;
547
+ },
548
+ create(base) {
549
+ return BountyReceipt.fromPartial(base ?? {});
550
+ },
551
+ fromPartial(object) {
552
+ const message = createBaseBountyReceipt();
553
+ message.operation_id = object.operation_id ?? "";
554
+ message.intent_key = object.intent_key ?? "";
555
+ message.bounty_id = object.bounty_id ?? "";
556
+ message.state = object.state ?? 0;
557
+ message.source_kind = object.source_kind ?? 0;
558
+ message.amount_units = object.amount_units ?? "";
559
+ return message;
560
+ },
561
+ };
562
+ function createBaseListBountiesRequest() {
563
+ return { cursor: "", state: 0, _unknownFields: {} };
564
+ }
565
+ export const ListBountiesRequest = {
566
+ encode(message, writer = new BinaryWriter()) {
567
+ if (message.cursor !== "") {
568
+ writer.uint32(10).string(message.cursor);
569
+ }
570
+ if (message.state !== 0) {
571
+ writer.uint32(16).int32(message.state);
572
+ }
573
+ if (message._unknownFields !== undefined) {
574
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
575
+ const tag = parseInt(key, 10);
576
+ for (const value of values) {
577
+ writer.uint32(tag).raw(value);
578
+ }
579
+ }
580
+ }
581
+ return writer;
582
+ },
583
+ decode(input, length) {
584
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
585
+ const end = length === undefined ? reader.len : reader.pos + length;
586
+ const message = createBaseListBountiesRequest();
587
+ while (reader.pos < end) {
588
+ const tag = reader.uint32();
589
+ switch (tag >>> 3) {
590
+ case 1: {
591
+ if (tag !== 10) {
592
+ break;
593
+ }
594
+ message.cursor = reader.string();
595
+ continue;
596
+ }
597
+ case 2: {
598
+ if (tag !== 16) {
599
+ break;
600
+ }
601
+ message.state = reader.int32();
602
+ continue;
603
+ }
604
+ }
605
+ if ((tag & 7) === 4 || tag === 0) {
606
+ break;
607
+ }
608
+ const buf = reader.skip(tag & 7);
609
+ const list = message._unknownFields[tag];
610
+ if (list === undefined) {
611
+ message._unknownFields[tag] = [buf];
612
+ }
613
+ else {
614
+ list.push(buf);
615
+ }
616
+ }
617
+ return message;
618
+ },
619
+ fromJSON(object) {
620
+ return {
621
+ cursor: isSet(object.cursor) ? globalThis.String(object.cursor) : "",
622
+ state: isSet(object.state) ? bountyStateFromJSON(object.state) : 0,
623
+ };
624
+ },
625
+ toJSON(message) {
626
+ const obj = {};
627
+ if (message.cursor !== "") {
628
+ obj.cursor = message.cursor;
629
+ }
630
+ if (message.state !== 0) {
631
+ obj.state = bountyStateToJSON(message.state);
632
+ }
633
+ return obj;
634
+ },
635
+ create(base) {
636
+ return ListBountiesRequest.fromPartial(base ?? {});
637
+ },
638
+ fromPartial(object) {
639
+ const message = createBaseListBountiesRequest();
640
+ message.cursor = object.cursor ?? "";
641
+ message.state = object.state ?? 0;
642
+ return message;
643
+ },
644
+ };
645
+ function createBaseListBountiesResponse() {
646
+ return { items: [], next_cursor: "", has_more: false, error: undefined, _unknownFields: {} };
647
+ }
648
+ export const ListBountiesResponse = {
649
+ encode(message, writer = new BinaryWriter()) {
650
+ for (const v of message.items) {
651
+ Bounty.encode(v, writer.uint32(10).fork()).join();
652
+ }
653
+ if (message.next_cursor !== "") {
654
+ writer.uint32(18).string(message.next_cursor);
655
+ }
656
+ if (message.has_more !== false) {
657
+ writer.uint32(24).bool(message.has_more);
658
+ }
659
+ if (message.error !== undefined) {
660
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
661
+ }
662
+ if (message._unknownFields !== undefined) {
663
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
664
+ const tag = parseInt(key, 10);
665
+ for (const value of values) {
666
+ writer.uint32(tag).raw(value);
667
+ }
668
+ }
669
+ }
670
+ return writer;
671
+ },
672
+ decode(input, length) {
673
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
674
+ const end = length === undefined ? reader.len : reader.pos + length;
675
+ const message = createBaseListBountiesResponse();
676
+ while (reader.pos < end) {
677
+ const tag = reader.uint32();
678
+ switch (tag >>> 3) {
679
+ case 1: {
680
+ if (tag !== 10) {
681
+ break;
682
+ }
683
+ message.items.push(Bounty.decode(reader, reader.uint32()));
684
+ continue;
685
+ }
686
+ case 2: {
687
+ if (tag !== 18) {
688
+ break;
689
+ }
690
+ message.next_cursor = reader.string();
691
+ continue;
692
+ }
693
+ case 3: {
694
+ if (tag !== 24) {
695
+ break;
696
+ }
697
+ message.has_more = reader.bool();
698
+ continue;
699
+ }
700
+ case 15: {
701
+ if (tag !== 122) {
702
+ break;
703
+ }
704
+ message.error = ErrorInfo.decode(reader, reader.uint32());
705
+ continue;
706
+ }
707
+ }
708
+ if ((tag & 7) === 4 || tag === 0) {
709
+ break;
710
+ }
711
+ const buf = reader.skip(tag & 7);
712
+ const list = message._unknownFields[tag];
713
+ if (list === undefined) {
714
+ message._unknownFields[tag] = [buf];
715
+ }
716
+ else {
717
+ list.push(buf);
718
+ }
719
+ }
720
+ return message;
721
+ },
722
+ fromJSON(object) {
723
+ return {
724
+ items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => Bounty.fromJSON(e)) : [],
725
+ next_cursor: isSet(object.nextCursor)
726
+ ? globalThis.String(object.nextCursor)
727
+ : isSet(object.next_cursor)
728
+ ? globalThis.String(object.next_cursor)
729
+ : "",
730
+ has_more: isSet(object.hasMore)
731
+ ? globalThis.Boolean(object.hasMore)
732
+ : isSet(object.has_more)
733
+ ? globalThis.Boolean(object.has_more)
734
+ : false,
735
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
736
+ };
737
+ },
738
+ toJSON(message) {
739
+ const obj = {};
740
+ if (message.items?.length) {
741
+ obj.items = message.items.map((e) => Bounty.toJSON(e));
742
+ }
743
+ if (message.next_cursor !== "") {
744
+ obj.nextCursor = message.next_cursor;
745
+ }
746
+ if (message.has_more !== false) {
747
+ obj.hasMore = message.has_more;
748
+ }
749
+ if (message.error !== undefined) {
750
+ obj.error = ErrorInfo.toJSON(message.error);
751
+ }
752
+ return obj;
753
+ },
754
+ create(base) {
755
+ return ListBountiesResponse.fromPartial(base ?? {});
756
+ },
757
+ fromPartial(object) {
758
+ const message = createBaseListBountiesResponse();
759
+ message.items = object.items?.map((e) => Bounty.fromPartial(e)) || [];
760
+ message.next_cursor = object.next_cursor ?? "";
761
+ message.has_more = object.has_more ?? false;
762
+ message.error = (object.error !== undefined && object.error !== null)
763
+ ? ErrorInfo.fromPartial(object.error)
764
+ : undefined;
765
+ return message;
766
+ },
767
+ };
768
+ function createBaseCreateBountyRequest() {
769
+ return { intent_key: "", body: "", source_kind: 0, amount_units: "", expires_at_ms: "", _unknownFields: {} };
770
+ }
771
+ export const CreateBountyRequest = {
772
+ encode(message, writer = new BinaryWriter()) {
773
+ if (message.intent_key !== "") {
774
+ writer.uint32(10).string(message.intent_key);
775
+ }
776
+ if (message.body !== "") {
777
+ writer.uint32(18).string(message.body);
778
+ }
779
+ if (message.source_kind !== 0) {
780
+ writer.uint32(24).int32(message.source_kind);
781
+ }
782
+ if (message.amount_units !== "") {
783
+ writer.uint32(34).string(message.amount_units);
784
+ }
785
+ if (message.expires_at_ms !== "") {
786
+ writer.uint32(42).string(message.expires_at_ms);
787
+ }
788
+ if (message._unknownFields !== undefined) {
789
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
790
+ const tag = parseInt(key, 10);
791
+ for (const value of values) {
792
+ writer.uint32(tag).raw(value);
793
+ }
794
+ }
795
+ }
796
+ return writer;
797
+ },
798
+ decode(input, length) {
799
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
800
+ const end = length === undefined ? reader.len : reader.pos + length;
801
+ const message = createBaseCreateBountyRequest();
802
+ while (reader.pos < end) {
803
+ const tag = reader.uint32();
804
+ switch (tag >>> 3) {
805
+ case 1: {
806
+ if (tag !== 10) {
807
+ break;
808
+ }
809
+ message.intent_key = reader.string();
810
+ continue;
811
+ }
812
+ case 2: {
813
+ if (tag !== 18) {
814
+ break;
815
+ }
816
+ message.body = reader.string();
817
+ continue;
818
+ }
819
+ case 3: {
820
+ if (tag !== 24) {
821
+ break;
822
+ }
823
+ message.source_kind = reader.int32();
824
+ continue;
825
+ }
826
+ case 4: {
827
+ if (tag !== 34) {
828
+ break;
829
+ }
830
+ message.amount_units = reader.string();
831
+ continue;
832
+ }
833
+ case 5: {
834
+ if (tag !== 42) {
835
+ break;
836
+ }
837
+ message.expires_at_ms = reader.string();
838
+ continue;
839
+ }
840
+ }
841
+ if ((tag & 7) === 4 || tag === 0) {
842
+ break;
843
+ }
844
+ const buf = reader.skip(tag & 7);
845
+ const list = message._unknownFields[tag];
846
+ if (list === undefined) {
847
+ message._unknownFields[tag] = [buf];
848
+ }
849
+ else {
850
+ list.push(buf);
851
+ }
852
+ }
853
+ return message;
854
+ },
855
+ fromJSON(object) {
856
+ return {
857
+ intent_key: isSet(object.intentKey)
858
+ ? globalThis.String(object.intentKey)
859
+ : isSet(object.intent_key)
860
+ ? globalThis.String(object.intent_key)
861
+ : "",
862
+ body: isSet(object.body) ? globalThis.String(object.body) : "",
863
+ source_kind: isSet(object.sourceKind)
864
+ ? bountySourceKindFromJSON(object.sourceKind)
865
+ : isSet(object.source_kind)
866
+ ? bountySourceKindFromJSON(object.source_kind)
867
+ : 0,
868
+ amount_units: isSet(object.amountUnits)
869
+ ? globalThis.String(object.amountUnits)
870
+ : isSet(object.amount_units)
871
+ ? globalThis.String(object.amount_units)
872
+ : "",
873
+ expires_at_ms: isSet(object.expiresAtMs)
874
+ ? globalThis.String(object.expiresAtMs)
875
+ : isSet(object.expires_at_ms)
876
+ ? globalThis.String(object.expires_at_ms)
877
+ : "",
878
+ };
879
+ },
880
+ toJSON(message) {
881
+ const obj = {};
882
+ if (message.intent_key !== "") {
883
+ obj.intentKey = message.intent_key;
884
+ }
885
+ if (message.body !== "") {
886
+ obj.body = message.body;
887
+ }
888
+ if (message.source_kind !== 0) {
889
+ obj.sourceKind = bountySourceKindToJSON(message.source_kind);
890
+ }
891
+ if (message.amount_units !== "") {
892
+ obj.amountUnits = message.amount_units;
893
+ }
894
+ if (message.expires_at_ms !== "") {
895
+ obj.expiresAtMs = message.expires_at_ms;
896
+ }
897
+ return obj;
898
+ },
899
+ create(base) {
900
+ return CreateBountyRequest.fromPartial(base ?? {});
901
+ },
902
+ fromPartial(object) {
903
+ const message = createBaseCreateBountyRequest();
904
+ message.intent_key = object.intent_key ?? "";
905
+ message.body = object.body ?? "";
906
+ message.source_kind = object.source_kind ?? 0;
907
+ message.amount_units = object.amount_units ?? "";
908
+ message.expires_at_ms = object.expires_at_ms ?? "";
909
+ return message;
910
+ },
911
+ };
912
+ function createBaseCreateBountyResponse() {
913
+ return { receipt: undefined, error: undefined, _unknownFields: {} };
914
+ }
915
+ export const CreateBountyResponse = {
916
+ encode(message, writer = new BinaryWriter()) {
917
+ if (message.receipt !== undefined) {
918
+ BountyReceipt.encode(message.receipt, writer.uint32(10).fork()).join();
919
+ }
920
+ if (message.error !== undefined) {
921
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
922
+ }
923
+ if (message._unknownFields !== undefined) {
924
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
925
+ const tag = parseInt(key, 10);
926
+ for (const value of values) {
927
+ writer.uint32(tag).raw(value);
928
+ }
929
+ }
930
+ }
931
+ return writer;
932
+ },
933
+ decode(input, length) {
934
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
935
+ const end = length === undefined ? reader.len : reader.pos + length;
936
+ const message = createBaseCreateBountyResponse();
937
+ while (reader.pos < end) {
938
+ const tag = reader.uint32();
939
+ switch (tag >>> 3) {
940
+ case 1: {
941
+ if (tag !== 10) {
942
+ break;
943
+ }
944
+ message.receipt = BountyReceipt.decode(reader, reader.uint32());
945
+ continue;
946
+ }
947
+ case 15: {
948
+ if (tag !== 122) {
949
+ break;
950
+ }
951
+ message.error = ErrorInfo.decode(reader, reader.uint32());
952
+ continue;
953
+ }
954
+ }
955
+ if ((tag & 7) === 4 || tag === 0) {
956
+ break;
957
+ }
958
+ const buf = reader.skip(tag & 7);
959
+ const list = message._unknownFields[tag];
960
+ if (list === undefined) {
961
+ message._unknownFields[tag] = [buf];
962
+ }
963
+ else {
964
+ list.push(buf);
965
+ }
966
+ }
967
+ return message;
968
+ },
969
+ fromJSON(object) {
970
+ return {
971
+ receipt: isSet(object.receipt) ? BountyReceipt.fromJSON(object.receipt) : undefined,
972
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
973
+ };
974
+ },
975
+ toJSON(message) {
976
+ const obj = {};
977
+ if (message.receipt !== undefined) {
978
+ obj.receipt = BountyReceipt.toJSON(message.receipt);
979
+ }
980
+ if (message.error !== undefined) {
981
+ obj.error = ErrorInfo.toJSON(message.error);
982
+ }
983
+ return obj;
984
+ },
985
+ create(base) {
986
+ return CreateBountyResponse.fromPartial(base ?? {});
987
+ },
988
+ fromPartial(object) {
989
+ const message = createBaseCreateBountyResponse();
990
+ message.receipt = (object.receipt !== undefined && object.receipt !== null)
991
+ ? BountyReceipt.fromPartial(object.receipt)
992
+ : undefined;
993
+ message.error = (object.error !== undefined && object.error !== null)
994
+ ? ErrorInfo.fromPartial(object.error)
995
+ : undefined;
996
+ return message;
997
+ },
998
+ };
999
+ function createBaseClaimBountyRequest() {
1000
+ return { intent_key: "", bounty_id: "", expected_revision: "", _unknownFields: {} };
1001
+ }
1002
+ export const ClaimBountyRequest = {
1003
+ encode(message, writer = new BinaryWriter()) {
1004
+ if (message.intent_key !== "") {
1005
+ writer.uint32(10).string(message.intent_key);
1006
+ }
1007
+ if (message.bounty_id !== "") {
1008
+ writer.uint32(18).string(message.bounty_id);
1009
+ }
1010
+ if (message.expected_revision !== "") {
1011
+ writer.uint32(26).string(message.expected_revision);
1012
+ }
1013
+ if (message._unknownFields !== undefined) {
1014
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1015
+ const tag = parseInt(key, 10);
1016
+ for (const value of values) {
1017
+ writer.uint32(tag).raw(value);
1018
+ }
1019
+ }
1020
+ }
1021
+ return writer;
1022
+ },
1023
+ decode(input, length) {
1024
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1025
+ const end = length === undefined ? reader.len : reader.pos + length;
1026
+ const message = createBaseClaimBountyRequest();
1027
+ while (reader.pos < end) {
1028
+ const tag = reader.uint32();
1029
+ switch (tag >>> 3) {
1030
+ case 1: {
1031
+ if (tag !== 10) {
1032
+ break;
1033
+ }
1034
+ message.intent_key = reader.string();
1035
+ continue;
1036
+ }
1037
+ case 2: {
1038
+ if (tag !== 18) {
1039
+ break;
1040
+ }
1041
+ message.bounty_id = reader.string();
1042
+ continue;
1043
+ }
1044
+ case 3: {
1045
+ if (tag !== 26) {
1046
+ break;
1047
+ }
1048
+ message.expected_revision = reader.string();
1049
+ continue;
1050
+ }
1051
+ }
1052
+ if ((tag & 7) === 4 || tag === 0) {
1053
+ break;
1054
+ }
1055
+ const buf = reader.skip(tag & 7);
1056
+ const list = message._unknownFields[tag];
1057
+ if (list === undefined) {
1058
+ message._unknownFields[tag] = [buf];
1059
+ }
1060
+ else {
1061
+ list.push(buf);
1062
+ }
1063
+ }
1064
+ return message;
1065
+ },
1066
+ fromJSON(object) {
1067
+ return {
1068
+ intent_key: isSet(object.intentKey)
1069
+ ? globalThis.String(object.intentKey)
1070
+ : isSet(object.intent_key)
1071
+ ? globalThis.String(object.intent_key)
1072
+ : "",
1073
+ bounty_id: isSet(object.bountyId)
1074
+ ? globalThis.String(object.bountyId)
1075
+ : isSet(object.bounty_id)
1076
+ ? globalThis.String(object.bounty_id)
1077
+ : "",
1078
+ expected_revision: isSet(object.expectedRevision)
1079
+ ? globalThis.String(object.expectedRevision)
1080
+ : isSet(object.expected_revision)
1081
+ ? globalThis.String(object.expected_revision)
1082
+ : "",
1083
+ };
1084
+ },
1085
+ toJSON(message) {
1086
+ const obj = {};
1087
+ if (message.intent_key !== "") {
1088
+ obj.intentKey = message.intent_key;
1089
+ }
1090
+ if (message.bounty_id !== "") {
1091
+ obj.bountyId = message.bounty_id;
1092
+ }
1093
+ if (message.expected_revision !== "") {
1094
+ obj.expectedRevision = message.expected_revision;
1095
+ }
1096
+ return obj;
1097
+ },
1098
+ create(base) {
1099
+ return ClaimBountyRequest.fromPartial(base ?? {});
1100
+ },
1101
+ fromPartial(object) {
1102
+ const message = createBaseClaimBountyRequest();
1103
+ message.intent_key = object.intent_key ?? "";
1104
+ message.bounty_id = object.bounty_id ?? "";
1105
+ message.expected_revision = object.expected_revision ?? "";
1106
+ return message;
1107
+ },
1108
+ };
1109
+ function createBaseSubmitBountyRequest() {
1110
+ return { intent_key: "", bounty_id: "", expected_revision: "", delivery_body: "", _unknownFields: {} };
1111
+ }
1112
+ export const SubmitBountyRequest = {
1113
+ encode(message, writer = new BinaryWriter()) {
1114
+ if (message.intent_key !== "") {
1115
+ writer.uint32(10).string(message.intent_key);
1116
+ }
1117
+ if (message.bounty_id !== "") {
1118
+ writer.uint32(18).string(message.bounty_id);
1119
+ }
1120
+ if (message.expected_revision !== "") {
1121
+ writer.uint32(26).string(message.expected_revision);
1122
+ }
1123
+ if (message.delivery_body !== "") {
1124
+ writer.uint32(34).string(message.delivery_body);
1125
+ }
1126
+ if (message._unknownFields !== undefined) {
1127
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1128
+ const tag = parseInt(key, 10);
1129
+ for (const value of values) {
1130
+ writer.uint32(tag).raw(value);
1131
+ }
1132
+ }
1133
+ }
1134
+ return writer;
1135
+ },
1136
+ decode(input, length) {
1137
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1138
+ const end = length === undefined ? reader.len : reader.pos + length;
1139
+ const message = createBaseSubmitBountyRequest();
1140
+ while (reader.pos < end) {
1141
+ const tag = reader.uint32();
1142
+ switch (tag >>> 3) {
1143
+ case 1: {
1144
+ if (tag !== 10) {
1145
+ break;
1146
+ }
1147
+ message.intent_key = reader.string();
1148
+ continue;
1149
+ }
1150
+ case 2: {
1151
+ if (tag !== 18) {
1152
+ break;
1153
+ }
1154
+ message.bounty_id = reader.string();
1155
+ continue;
1156
+ }
1157
+ case 3: {
1158
+ if (tag !== 26) {
1159
+ break;
1160
+ }
1161
+ message.expected_revision = reader.string();
1162
+ continue;
1163
+ }
1164
+ case 4: {
1165
+ if (tag !== 34) {
1166
+ break;
1167
+ }
1168
+ message.delivery_body = reader.string();
1169
+ continue;
1170
+ }
1171
+ }
1172
+ if ((tag & 7) === 4 || tag === 0) {
1173
+ break;
1174
+ }
1175
+ const buf = reader.skip(tag & 7);
1176
+ const list = message._unknownFields[tag];
1177
+ if (list === undefined) {
1178
+ message._unknownFields[tag] = [buf];
1179
+ }
1180
+ else {
1181
+ list.push(buf);
1182
+ }
1183
+ }
1184
+ return message;
1185
+ },
1186
+ fromJSON(object) {
1187
+ return {
1188
+ intent_key: isSet(object.intentKey)
1189
+ ? globalThis.String(object.intentKey)
1190
+ : isSet(object.intent_key)
1191
+ ? globalThis.String(object.intent_key)
1192
+ : "",
1193
+ bounty_id: isSet(object.bountyId)
1194
+ ? globalThis.String(object.bountyId)
1195
+ : isSet(object.bounty_id)
1196
+ ? globalThis.String(object.bounty_id)
1197
+ : "",
1198
+ expected_revision: isSet(object.expectedRevision)
1199
+ ? globalThis.String(object.expectedRevision)
1200
+ : isSet(object.expected_revision)
1201
+ ? globalThis.String(object.expected_revision)
1202
+ : "",
1203
+ delivery_body: isSet(object.deliveryBody)
1204
+ ? globalThis.String(object.deliveryBody)
1205
+ : isSet(object.delivery_body)
1206
+ ? globalThis.String(object.delivery_body)
1207
+ : "",
1208
+ };
1209
+ },
1210
+ toJSON(message) {
1211
+ const obj = {};
1212
+ if (message.intent_key !== "") {
1213
+ obj.intentKey = message.intent_key;
1214
+ }
1215
+ if (message.bounty_id !== "") {
1216
+ obj.bountyId = message.bounty_id;
1217
+ }
1218
+ if (message.expected_revision !== "") {
1219
+ obj.expectedRevision = message.expected_revision;
1220
+ }
1221
+ if (message.delivery_body !== "") {
1222
+ obj.deliveryBody = message.delivery_body;
1223
+ }
1224
+ return obj;
1225
+ },
1226
+ create(base) {
1227
+ return SubmitBountyRequest.fromPartial(base ?? {});
1228
+ },
1229
+ fromPartial(object) {
1230
+ const message = createBaseSubmitBountyRequest();
1231
+ message.intent_key = object.intent_key ?? "";
1232
+ message.bounty_id = object.bounty_id ?? "";
1233
+ message.expected_revision = object.expected_revision ?? "";
1234
+ message.delivery_body = object.delivery_body ?? "";
1235
+ return message;
1236
+ },
1237
+ };
1238
+ function createBaseAcceptBountyRequest() {
1239
+ return { intent_key: "", bounty_id: "", expected_revision: "", _unknownFields: {} };
1240
+ }
1241
+ export const AcceptBountyRequest = {
1242
+ encode(message, writer = new BinaryWriter()) {
1243
+ if (message.intent_key !== "") {
1244
+ writer.uint32(10).string(message.intent_key);
1245
+ }
1246
+ if (message.bounty_id !== "") {
1247
+ writer.uint32(18).string(message.bounty_id);
1248
+ }
1249
+ if (message.expected_revision !== "") {
1250
+ writer.uint32(26).string(message.expected_revision);
1251
+ }
1252
+ if (message._unknownFields !== undefined) {
1253
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1254
+ const tag = parseInt(key, 10);
1255
+ for (const value of values) {
1256
+ writer.uint32(tag).raw(value);
1257
+ }
1258
+ }
1259
+ }
1260
+ return writer;
1261
+ },
1262
+ decode(input, length) {
1263
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1264
+ const end = length === undefined ? reader.len : reader.pos + length;
1265
+ const message = createBaseAcceptBountyRequest();
1266
+ while (reader.pos < end) {
1267
+ const tag = reader.uint32();
1268
+ switch (tag >>> 3) {
1269
+ case 1: {
1270
+ if (tag !== 10) {
1271
+ break;
1272
+ }
1273
+ message.intent_key = reader.string();
1274
+ continue;
1275
+ }
1276
+ case 2: {
1277
+ if (tag !== 18) {
1278
+ break;
1279
+ }
1280
+ message.bounty_id = reader.string();
1281
+ continue;
1282
+ }
1283
+ case 3: {
1284
+ if (tag !== 26) {
1285
+ break;
1286
+ }
1287
+ message.expected_revision = reader.string();
1288
+ continue;
1289
+ }
1290
+ }
1291
+ if ((tag & 7) === 4 || tag === 0) {
1292
+ break;
1293
+ }
1294
+ const buf = reader.skip(tag & 7);
1295
+ const list = message._unknownFields[tag];
1296
+ if (list === undefined) {
1297
+ message._unknownFields[tag] = [buf];
1298
+ }
1299
+ else {
1300
+ list.push(buf);
1301
+ }
1302
+ }
1303
+ return message;
1304
+ },
1305
+ fromJSON(object) {
1306
+ return {
1307
+ intent_key: isSet(object.intentKey)
1308
+ ? globalThis.String(object.intentKey)
1309
+ : isSet(object.intent_key)
1310
+ ? globalThis.String(object.intent_key)
1311
+ : "",
1312
+ bounty_id: isSet(object.bountyId)
1313
+ ? globalThis.String(object.bountyId)
1314
+ : isSet(object.bounty_id)
1315
+ ? globalThis.String(object.bounty_id)
1316
+ : "",
1317
+ expected_revision: isSet(object.expectedRevision)
1318
+ ? globalThis.String(object.expectedRevision)
1319
+ : isSet(object.expected_revision)
1320
+ ? globalThis.String(object.expected_revision)
1321
+ : "",
1322
+ };
1323
+ },
1324
+ toJSON(message) {
1325
+ const obj = {};
1326
+ if (message.intent_key !== "") {
1327
+ obj.intentKey = message.intent_key;
1328
+ }
1329
+ if (message.bounty_id !== "") {
1330
+ obj.bountyId = message.bounty_id;
1331
+ }
1332
+ if (message.expected_revision !== "") {
1333
+ obj.expectedRevision = message.expected_revision;
1334
+ }
1335
+ return obj;
1336
+ },
1337
+ create(base) {
1338
+ return AcceptBountyRequest.fromPartial(base ?? {});
1339
+ },
1340
+ fromPartial(object) {
1341
+ const message = createBaseAcceptBountyRequest();
1342
+ message.intent_key = object.intent_key ?? "";
1343
+ message.bounty_id = object.bounty_id ?? "";
1344
+ message.expected_revision = object.expected_revision ?? "";
1345
+ return message;
1346
+ },
1347
+ };
1348
+ function createBaseCancelBountyRequest() {
1349
+ return { intent_key: "", bounty_id: "", expected_revision: "", _unknownFields: {} };
1350
+ }
1351
+ export const CancelBountyRequest = {
1352
+ encode(message, writer = new BinaryWriter()) {
1353
+ if (message.intent_key !== "") {
1354
+ writer.uint32(10).string(message.intent_key);
1355
+ }
1356
+ if (message.bounty_id !== "") {
1357
+ writer.uint32(18).string(message.bounty_id);
1358
+ }
1359
+ if (message.expected_revision !== "") {
1360
+ writer.uint32(26).string(message.expected_revision);
1361
+ }
1362
+ if (message._unknownFields !== undefined) {
1363
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1364
+ const tag = parseInt(key, 10);
1365
+ for (const value of values) {
1366
+ writer.uint32(tag).raw(value);
1367
+ }
1368
+ }
1369
+ }
1370
+ return writer;
1371
+ },
1372
+ decode(input, length) {
1373
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1374
+ const end = length === undefined ? reader.len : reader.pos + length;
1375
+ const message = createBaseCancelBountyRequest();
1376
+ while (reader.pos < end) {
1377
+ const tag = reader.uint32();
1378
+ switch (tag >>> 3) {
1379
+ case 1: {
1380
+ if (tag !== 10) {
1381
+ break;
1382
+ }
1383
+ message.intent_key = reader.string();
1384
+ continue;
1385
+ }
1386
+ case 2: {
1387
+ if (tag !== 18) {
1388
+ break;
1389
+ }
1390
+ message.bounty_id = reader.string();
1391
+ continue;
1392
+ }
1393
+ case 3: {
1394
+ if (tag !== 26) {
1395
+ break;
1396
+ }
1397
+ message.expected_revision = reader.string();
1398
+ continue;
1399
+ }
1400
+ }
1401
+ if ((tag & 7) === 4 || tag === 0) {
1402
+ break;
1403
+ }
1404
+ const buf = reader.skip(tag & 7);
1405
+ const list = message._unknownFields[tag];
1406
+ if (list === undefined) {
1407
+ message._unknownFields[tag] = [buf];
1408
+ }
1409
+ else {
1410
+ list.push(buf);
1411
+ }
1412
+ }
1413
+ return message;
1414
+ },
1415
+ fromJSON(object) {
1416
+ return {
1417
+ intent_key: isSet(object.intentKey)
1418
+ ? globalThis.String(object.intentKey)
1419
+ : isSet(object.intent_key)
1420
+ ? globalThis.String(object.intent_key)
1421
+ : "",
1422
+ bounty_id: isSet(object.bountyId)
1423
+ ? globalThis.String(object.bountyId)
1424
+ : isSet(object.bounty_id)
1425
+ ? globalThis.String(object.bounty_id)
1426
+ : "",
1427
+ expected_revision: isSet(object.expectedRevision)
1428
+ ? globalThis.String(object.expectedRevision)
1429
+ : isSet(object.expected_revision)
1430
+ ? globalThis.String(object.expected_revision)
1431
+ : "",
1432
+ };
1433
+ },
1434
+ toJSON(message) {
1435
+ const obj = {};
1436
+ if (message.intent_key !== "") {
1437
+ obj.intentKey = message.intent_key;
1438
+ }
1439
+ if (message.bounty_id !== "") {
1440
+ obj.bountyId = message.bounty_id;
1441
+ }
1442
+ if (message.expected_revision !== "") {
1443
+ obj.expectedRevision = message.expected_revision;
1444
+ }
1445
+ return obj;
1446
+ },
1447
+ create(base) {
1448
+ return CancelBountyRequest.fromPartial(base ?? {});
1449
+ },
1450
+ fromPartial(object) {
1451
+ const message = createBaseCancelBountyRequest();
1452
+ message.intent_key = object.intent_key ?? "";
1453
+ message.bounty_id = object.bounty_id ?? "";
1454
+ message.expected_revision = object.expected_revision ?? "";
1455
+ return message;
1456
+ },
1457
+ };
1458
+ function createBaseBountyMutationResponse() {
1459
+ return { receipt: undefined, error: undefined, _unknownFields: {} };
1460
+ }
1461
+ export const BountyMutationResponse = {
1462
+ encode(message, writer = new BinaryWriter()) {
1463
+ if (message.receipt !== undefined) {
1464
+ BountyReceipt.encode(message.receipt, writer.uint32(10).fork()).join();
1465
+ }
1466
+ if (message.error !== undefined) {
1467
+ ErrorInfo.encode(message.error, writer.uint32(122).fork()).join();
1468
+ }
1469
+ if (message._unknownFields !== undefined) {
1470
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
1471
+ const tag = parseInt(key, 10);
1472
+ for (const value of values) {
1473
+ writer.uint32(tag).raw(value);
1474
+ }
1475
+ }
1476
+ }
1477
+ return writer;
1478
+ },
1479
+ decode(input, length) {
1480
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1481
+ const end = length === undefined ? reader.len : reader.pos + length;
1482
+ const message = createBaseBountyMutationResponse();
1483
+ while (reader.pos < end) {
1484
+ const tag = reader.uint32();
1485
+ switch (tag >>> 3) {
1486
+ case 1: {
1487
+ if (tag !== 10) {
1488
+ break;
1489
+ }
1490
+ message.receipt = BountyReceipt.decode(reader, reader.uint32());
1491
+ continue;
1492
+ }
1493
+ case 15: {
1494
+ if (tag !== 122) {
1495
+ break;
1496
+ }
1497
+ message.error = ErrorInfo.decode(reader, reader.uint32());
1498
+ continue;
1499
+ }
1500
+ }
1501
+ if ((tag & 7) === 4 || tag === 0) {
1502
+ break;
1503
+ }
1504
+ const buf = reader.skip(tag & 7);
1505
+ const list = message._unknownFields[tag];
1506
+ if (list === undefined) {
1507
+ message._unknownFields[tag] = [buf];
1508
+ }
1509
+ else {
1510
+ list.push(buf);
1511
+ }
1512
+ }
1513
+ return message;
1514
+ },
1515
+ fromJSON(object) {
1516
+ return {
1517
+ receipt: isSet(object.receipt) ? BountyReceipt.fromJSON(object.receipt) : undefined,
1518
+ error: isSet(object.error) ? ErrorInfo.fromJSON(object.error) : undefined,
1519
+ };
1520
+ },
1521
+ toJSON(message) {
1522
+ const obj = {};
1523
+ if (message.receipt !== undefined) {
1524
+ obj.receipt = BountyReceipt.toJSON(message.receipt);
1525
+ }
1526
+ if (message.error !== undefined) {
1527
+ obj.error = ErrorInfo.toJSON(message.error);
1528
+ }
1529
+ return obj;
1530
+ },
1531
+ create(base) {
1532
+ return BountyMutationResponse.fromPartial(base ?? {});
1533
+ },
1534
+ fromPartial(object) {
1535
+ const message = createBaseBountyMutationResponse();
1536
+ message.receipt = (object.receipt !== undefined && object.receipt !== null)
1537
+ ? BountyReceipt.fromPartial(object.receipt)
1538
+ : undefined;
1539
+ message.error = (object.error !== undefined && object.error !== null)
1540
+ ? ErrorInfo.fromPartial(object.error)
1541
+ : undefined;
1542
+ return message;
1543
+ },
1544
+ };
1545
+ function isSet(value) {
1546
+ return value !== null && value !== undefined;
1547
+ }