@ottochain/sdk 1.4.1 → 1.4.2

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 (35) hide show
  1. package/dist/esm/apps/contracts/index.js +10 -28
  2. package/dist/esm/apps/corporate/index.js +24 -79
  3. package/dist/esm/apps/governance/index.js +36 -85
  4. package/dist/esm/apps/identity/constants.js +22 -27
  5. package/dist/esm/apps/identity/index.js +7 -35
  6. package/dist/esm/apps/index.js +6 -32
  7. package/dist/esm/apps/markets/index.js +6 -27
  8. package/dist/esm/apps/oracles/index.js +7 -27
  9. package/dist/esm/errors.js +9 -19
  10. package/dist/esm/generated/google/protobuf/struct.js +33 -39
  11. package/dist/esm/generated/google/protobuf/timestamp.js +6 -9
  12. package/dist/esm/generated/index.js +10 -134
  13. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +48 -54
  14. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +335 -357
  15. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +284 -299
  16. package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +38 -47
  17. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +44 -50
  18. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +77 -86
  19. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +66 -72
  20. package/dist/esm/generated/ottochain/v1/common.js +1 -4
  21. package/dist/esm/generated/ottochain/v1/fiber.js +90 -96
  22. package/dist/esm/generated/ottochain/v1/messages.js +79 -82
  23. package/dist/esm/generated/ottochain/v1/records.js +137 -140
  24. package/dist/esm/index.js +13 -70
  25. package/dist/esm/ottochain/drop-nulls.js +1 -5
  26. package/dist/esm/ottochain/index.js +6 -54
  27. package/dist/esm/ottochain/metagraph-client.js +12 -16
  28. package/dist/esm/ottochain/normalize.js +4 -11
  29. package/dist/esm/ottochain/snapshot.js +10 -20
  30. package/dist/esm/ottochain/transaction.js +13 -25
  31. package/dist/esm/ottochain/types.js +1 -2
  32. package/dist/esm/types.js +2 -7
  33. package/dist/esm/validation.js +65 -76
  34. package/dist/esm/verify.js +3 -7
  35. package/package.json +1 -1
@@ -1,17 +1,14 @@
1
- "use strict";
2
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
2
  // versions:
4
3
  // protoc-gen-ts_proto v2.11.2
5
4
  // protoc unknown
6
5
  // source: ottochain/apps/identity/v1/agent.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AgentIdentityDefinition = exports.AgentIdentity = exports.PlatformLink = exports.platformToNumber = exports.platformToJSON = exports.platformFromJSON = exports.Platform = exports.agentStateToNumber = exports.agentStateToJSON = exports.agentStateFromJSON = exports.AgentState = exports.protobufPackage = void 0;
9
6
  /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const timestamp_js_1 = require("../../../../google/protobuf/timestamp.js");
12
- exports.protobufPackage = "ottochain.apps.identity.v1";
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { Timestamp } from "../../../../google/protobuf/timestamp.js";
9
+ export const protobufPackage = "ottochain.apps.identity.v1";
13
10
  /** Agent lifecycle states in the identity state machine */
14
- var AgentState;
11
+ export var AgentState;
15
12
  (function (AgentState) {
16
13
  AgentState["AGENT_STATE_UNSPECIFIED"] = "AGENT_STATE_UNSPECIFIED";
17
14
  /** AGENT_STATE_REGISTERED - Initial state after registration */
@@ -27,8 +24,8 @@ var AgentState;
27
24
  /** AGENT_STATE_WITHDRAWN - Voluntarily exited (terminal) */
28
25
  AgentState["AGENT_STATE_WITHDRAWN"] = "AGENT_STATE_WITHDRAWN";
29
26
  AgentState["UNRECOGNIZED"] = "UNRECOGNIZED";
30
- })(AgentState || (exports.AgentState = AgentState = {}));
31
- function agentStateFromJSON(object) {
27
+ })(AgentState || (AgentState = {}));
28
+ export function agentStateFromJSON(object) {
32
29
  switch (object) {
33
30
  case 0:
34
31
  case "AGENT_STATE_UNSPECIFIED":
@@ -57,8 +54,7 @@ function agentStateFromJSON(object) {
57
54
  return AgentState.UNRECOGNIZED;
58
55
  }
59
56
  }
60
- exports.agentStateFromJSON = agentStateFromJSON;
61
- function agentStateToJSON(object) {
57
+ export function agentStateToJSON(object) {
62
58
  switch (object) {
63
59
  case AgentState.AGENT_STATE_UNSPECIFIED:
64
60
  return "AGENT_STATE_UNSPECIFIED";
@@ -79,8 +75,7 @@ function agentStateToJSON(object) {
79
75
  return "UNRECOGNIZED";
80
76
  }
81
77
  }
82
- exports.agentStateToJSON = agentStateToJSON;
83
- function agentStateToNumber(object) {
78
+ export function agentStateToNumber(object) {
84
79
  switch (object) {
85
80
  case AgentState.AGENT_STATE_UNSPECIFIED:
86
81
  return 0;
@@ -101,9 +96,8 @@ function agentStateToNumber(object) {
101
96
  return -1;
102
97
  }
103
98
  }
104
- exports.agentStateToNumber = agentStateToNumber;
105
99
  /** Platform where agent identity is linked */
106
- var Platform;
100
+ export var Platform;
107
101
  (function (Platform) {
108
102
  Platform["PLATFORM_UNSPECIFIED"] = "PLATFORM_UNSPECIFIED";
109
103
  Platform["PLATFORM_DISCORD"] = "PLATFORM_DISCORD";
@@ -112,8 +106,8 @@ var Platform;
112
106
  Platform["PLATFORM_GITHUB"] = "PLATFORM_GITHUB";
113
107
  Platform["PLATFORM_CUSTOM"] = "PLATFORM_CUSTOM";
114
108
  Platform["UNRECOGNIZED"] = "UNRECOGNIZED";
115
- })(Platform || (exports.Platform = Platform = {}));
116
- function platformFromJSON(object) {
109
+ })(Platform || (Platform = {}));
110
+ export function platformFromJSON(object) {
117
111
  switch (object) {
118
112
  case 0:
119
113
  case "PLATFORM_UNSPECIFIED":
@@ -139,8 +133,7 @@ function platformFromJSON(object) {
139
133
  return Platform.UNRECOGNIZED;
140
134
  }
141
135
  }
142
- exports.platformFromJSON = platformFromJSON;
143
- function platformToJSON(object) {
136
+ export function platformToJSON(object) {
144
137
  switch (object) {
145
138
  case Platform.PLATFORM_UNSPECIFIED:
146
139
  return "PLATFORM_UNSPECIFIED";
@@ -159,8 +152,7 @@ function platformToJSON(object) {
159
152
  return "UNRECOGNIZED";
160
153
  }
161
154
  }
162
- exports.platformToJSON = platformToJSON;
163
- function platformToNumber(object) {
155
+ export function platformToNumber(object) {
164
156
  switch (object) {
165
157
  case Platform.PLATFORM_UNSPECIFIED:
166
158
  return 0;
@@ -179,7 +171,6 @@ function platformToNumber(object) {
179
171
  return -1;
180
172
  }
181
173
  }
182
- exports.platformToNumber = platformToNumber;
183
174
  function createBasePlatformLink() {
184
175
  return {
185
176
  platform: Platform.PLATFORM_UNSPECIFIED,
@@ -189,8 +180,8 @@ function createBasePlatformLink() {
189
180
  verified: false,
190
181
  };
191
182
  }
192
- exports.PlatformLink = {
193
- encode(message, writer = new wire_1.BinaryWriter()) {
183
+ export const PlatformLink = {
184
+ encode(message, writer = new BinaryWriter()) {
194
185
  if (message.platform !== Platform.PLATFORM_UNSPECIFIED) {
195
186
  writer.uint32(8).int32(platformToNumber(message.platform));
196
187
  }
@@ -201,7 +192,7 @@ exports.PlatformLink = {
201
192
  writer.uint32(26).string(message.platformUsername);
202
193
  }
203
194
  if (message.linkedAt !== undefined) {
204
- timestamp_js_1.Timestamp.encode(toTimestamp(message.linkedAt), writer.uint32(34).fork()).join();
195
+ Timestamp.encode(toTimestamp(message.linkedAt), writer.uint32(34).fork()).join();
205
196
  }
206
197
  if (message.verified !== false) {
207
198
  writer.uint32(40).bool(message.verified);
@@ -209,7 +200,7 @@ exports.PlatformLink = {
209
200
  return writer;
210
201
  },
211
202
  decode(input, length) {
212
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
203
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
213
204
  const end = length === undefined ? reader.len : reader.pos + length;
214
205
  const message = createBasePlatformLink();
215
206
  while (reader.pos < end) {
@@ -240,7 +231,7 @@ exports.PlatformLink = {
240
231
  if (tag !== 34) {
241
232
  break;
242
233
  }
243
- message.linkedAt = fromTimestamp(timestamp_js_1.Timestamp.decode(reader, reader.uint32()));
234
+ message.linkedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
244
235
  continue;
245
236
  }
246
237
  case 5: {
@@ -299,7 +290,7 @@ exports.PlatformLink = {
299
290
  return obj;
300
291
  },
301
292
  create(base) {
302
- return exports.PlatformLink.fromPartial(base ?? {});
293
+ return PlatformLink.fromPartial(base ?? {});
303
294
  },
304
295
  fromPartial(object) {
305
296
  const message = createBasePlatformLink();
@@ -323,8 +314,8 @@ function createBaseAgentIdentity() {
323
314
  updatedAt: undefined,
324
315
  };
325
316
  }
326
- exports.AgentIdentity = {
327
- encode(message, writer = new wire_1.BinaryWriter()) {
317
+ export const AgentIdentity = {
318
+ encode(message, writer = new BinaryWriter()) {
328
319
  if (message.address !== "") {
329
320
  writer.uint32(10).string(message.address);
330
321
  }
@@ -341,18 +332,18 @@ exports.AgentIdentity = {
341
332
  writer.uint32(40).int32(agentStateToNumber(message.state));
342
333
  }
343
334
  for (const v of message.platformLinks) {
344
- exports.PlatformLink.encode(v, writer.uint32(50).fork()).join();
335
+ PlatformLink.encode(v, writer.uint32(50).fork()).join();
345
336
  }
346
337
  if (message.createdAt !== undefined) {
347
- timestamp_js_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
338
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
348
339
  }
349
340
  if (message.updatedAt !== undefined) {
350
- timestamp_js_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(66).fork()).join();
341
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(66).fork()).join();
351
342
  }
352
343
  return writer;
353
344
  },
354
345
  decode(input, length) {
355
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
346
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
356
347
  const end = length === undefined ? reader.len : reader.pos + length;
357
348
  const message = createBaseAgentIdentity();
358
349
  while (reader.pos < end) {
@@ -397,21 +388,21 @@ exports.AgentIdentity = {
397
388
  if (tag !== 50) {
398
389
  break;
399
390
  }
400
- message.platformLinks.push(exports.PlatformLink.decode(reader, reader.uint32()));
391
+ message.platformLinks.push(PlatformLink.decode(reader, reader.uint32()));
401
392
  continue;
402
393
  }
403
394
  case 7: {
404
395
  if (tag !== 58) {
405
396
  break;
406
397
  }
407
- message.createdAt = fromTimestamp(timestamp_js_1.Timestamp.decode(reader, reader.uint32()));
398
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
408
399
  continue;
409
400
  }
410
401
  case 8: {
411
402
  if (tag !== 66) {
412
403
  break;
413
404
  }
414
- message.updatedAt = fromTimestamp(timestamp_js_1.Timestamp.decode(reader, reader.uint32()));
405
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
415
406
  continue;
416
407
  }
417
408
  }
@@ -438,9 +429,9 @@ exports.AgentIdentity = {
438
429
  reputation: isSet(object.reputation) ? globalThis.Number(object.reputation) : 0,
439
430
  state: isSet(object.state) ? agentStateFromJSON(object.state) : AgentState.AGENT_STATE_UNSPECIFIED,
440
431
  platformLinks: globalThis.Array.isArray(object?.platformLinks)
441
- ? object.platformLinks.map((e) => exports.PlatformLink.fromJSON(e))
432
+ ? object.platformLinks.map((e) => PlatformLink.fromJSON(e))
442
433
  : globalThis.Array.isArray(object?.platform_links)
443
- ? object.platform_links.map((e) => exports.PlatformLink.fromJSON(e))
434
+ ? object.platform_links.map((e) => PlatformLink.fromJSON(e))
444
435
  : [],
445
436
  createdAt: isSet(object.createdAt)
446
437
  ? fromJsonTimestamp(object.createdAt)
@@ -472,7 +463,7 @@ exports.AgentIdentity = {
472
463
  obj.state = agentStateToJSON(message.state);
473
464
  }
474
465
  if (message.platformLinks?.length) {
475
- obj.platformLinks = message.platformLinks.map((e) => exports.PlatformLink.toJSON(e));
466
+ obj.platformLinks = message.platformLinks.map((e) => PlatformLink.toJSON(e));
476
467
  }
477
468
  if (message.createdAt !== undefined) {
478
469
  obj.createdAt = message.createdAt.toISOString();
@@ -483,7 +474,7 @@ exports.AgentIdentity = {
483
474
  return obj;
484
475
  },
485
476
  create(base) {
486
- return exports.AgentIdentity.fromPartial(base ?? {});
477
+ return AgentIdentity.fromPartial(base ?? {});
487
478
  },
488
479
  fromPartial(object) {
489
480
  const message = createBaseAgentIdentity();
@@ -492,7 +483,7 @@ exports.AgentIdentity = {
492
483
  message.displayName = object.displayName ?? "";
493
484
  message.reputation = object.reputation ?? 0;
494
485
  message.state = object.state ?? AgentState.AGENT_STATE_UNSPECIFIED;
495
- message.platformLinks = object.platformLinks?.map((e) => exports.PlatformLink.fromPartial(e)) || [];
486
+ message.platformLinks = object.platformLinks?.map((e) => PlatformLink.fromPartial(e)) || [];
496
487
  message.createdAt = object.createdAt ?? undefined;
497
488
  message.updatedAt = object.updatedAt ?? undefined;
498
489
  return message;
@@ -501,8 +492,8 @@ exports.AgentIdentity = {
501
492
  function createBaseAgentIdentityDefinition() {
502
493
  return { initialReputation: 0, activationThreshold: 0, suspensionDurationEpochs: 0 };
503
494
  }
504
- exports.AgentIdentityDefinition = {
505
- encode(message, writer = new wire_1.BinaryWriter()) {
495
+ export const AgentIdentityDefinition = {
496
+ encode(message, writer = new BinaryWriter()) {
506
497
  if (message.initialReputation !== 0) {
507
498
  writer.uint32(8).int32(message.initialReputation);
508
499
  }
@@ -515,7 +506,7 @@ exports.AgentIdentityDefinition = {
515
506
  return writer;
516
507
  },
517
508
  decode(input, length) {
518
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
509
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
519
510
  const end = length === undefined ? reader.len : reader.pos + length;
520
511
  const message = createBaseAgentIdentityDefinition();
521
512
  while (reader.pos < end) {
@@ -583,7 +574,7 @@ exports.AgentIdentityDefinition = {
583
574
  return obj;
584
575
  },
585
576
  create(base) {
586
- return exports.AgentIdentityDefinition.fromPartial(base ?? {});
577
+ return AgentIdentityDefinition.fromPartial(base ?? {});
587
578
  },
588
579
  fromPartial(object) {
589
580
  const message = createBaseAgentIdentityDefinition();
@@ -611,7 +602,7 @@ function fromJsonTimestamp(o) {
611
602
  return new globalThis.Date(o);
612
603
  }
613
604
  else {
614
- return fromTimestamp(timestamp_js_1.Timestamp.fromJSON(o));
605
+ return fromTimestamp(Timestamp.fromJSON(o));
615
606
  }
616
607
  }
617
608
  function isSet(value) {
@@ -1,18 +1,15 @@
1
- "use strict";
2
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
2
  // versions:
4
3
  // protoc-gen-ts_proto v2.11.2
5
4
  // protoc unknown
6
5
  // source: ottochain/apps/identity/v1/attestation.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ReputationConfig = exports.ChallengeRequest = exports.VouchRequest = exports.Attestation = exports.ReputationDelta = exports.attestationTypeToNumber = exports.attestationTypeToJSON = exports.attestationTypeFromJSON = exports.AttestationType = exports.protobufPackage = void 0;
9
6
  /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const timestamp_js_1 = require("../../../../google/protobuf/timestamp.js");
12
- const agent_js_1 = require("./agent.js");
13
- exports.protobufPackage = "ottochain.apps.identity.v1";
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { Timestamp } from "../../../../google/protobuf/timestamp.js";
9
+ import { Platform, platformFromJSON, platformToJSON, platformToNumber } from "./agent.js";
10
+ export const protobufPackage = "ottochain.apps.identity.v1";
14
11
  /** Types of attestations that affect reputation */
15
- var AttestationType;
12
+ export var AttestationType;
16
13
  (function (AttestationType) {
17
14
  AttestationType["ATTESTATION_TYPE_UNSPECIFIED"] = "ATTESTATION_TYPE_UNSPECIFIED";
18
15
  /** ATTESTATION_TYPE_COMPLETION - Contract completed successfully (+5) */
@@ -24,8 +21,8 @@ var AttestationType;
24
21
  /** ATTESTATION_TYPE_BEHAVIORAL - Positive behavioral signal (+3) */
25
22
  AttestationType["ATTESTATION_TYPE_BEHAVIORAL"] = "ATTESTATION_TYPE_BEHAVIORAL";
26
23
  AttestationType["UNRECOGNIZED"] = "UNRECOGNIZED";
27
- })(AttestationType || (exports.AttestationType = AttestationType = {}));
28
- function attestationTypeFromJSON(object) {
24
+ })(AttestationType || (AttestationType = {}));
25
+ export function attestationTypeFromJSON(object) {
29
26
  switch (object) {
30
27
  case 0:
31
28
  case "ATTESTATION_TYPE_UNSPECIFIED":
@@ -48,8 +45,7 @@ function attestationTypeFromJSON(object) {
48
45
  return AttestationType.UNRECOGNIZED;
49
46
  }
50
47
  }
51
- exports.attestationTypeFromJSON = attestationTypeFromJSON;
52
- function attestationTypeToJSON(object) {
48
+ export function attestationTypeToJSON(object) {
53
49
  switch (object) {
54
50
  case AttestationType.ATTESTATION_TYPE_UNSPECIFIED:
55
51
  return "ATTESTATION_TYPE_UNSPECIFIED";
@@ -66,8 +62,7 @@ function attestationTypeToJSON(object) {
66
62
  return "UNRECOGNIZED";
67
63
  }
68
64
  }
69
- exports.attestationTypeToJSON = attestationTypeToJSON;
70
- function attestationTypeToNumber(object) {
65
+ export function attestationTypeToNumber(object) {
71
66
  switch (object) {
72
67
  case AttestationType.ATTESTATION_TYPE_UNSPECIFIED:
73
68
  return 0;
@@ -84,12 +79,11 @@ function attestationTypeToNumber(object) {
84
79
  return -1;
85
80
  }
86
81
  }
87
- exports.attestationTypeToNumber = attestationTypeToNumber;
88
82
  function createBaseReputationDelta() {
89
83
  return { attestationType: AttestationType.ATTESTATION_TYPE_UNSPECIFIED, delta: 0, reason: "", recordedAt: undefined };
90
84
  }
91
- exports.ReputationDelta = {
92
- encode(message, writer = new wire_1.BinaryWriter()) {
85
+ export const ReputationDelta = {
86
+ encode(message, writer = new BinaryWriter()) {
93
87
  if (message.attestationType !== AttestationType.ATTESTATION_TYPE_UNSPECIFIED) {
94
88
  writer.uint32(8).int32(attestationTypeToNumber(message.attestationType));
95
89
  }
@@ -100,12 +94,12 @@ exports.ReputationDelta = {
100
94
  writer.uint32(26).string(message.reason);
101
95
  }
102
96
  if (message.recordedAt !== undefined) {
103
- timestamp_js_1.Timestamp.encode(toTimestamp(message.recordedAt), writer.uint32(34).fork()).join();
97
+ Timestamp.encode(toTimestamp(message.recordedAt), writer.uint32(34).fork()).join();
104
98
  }
105
99
  return writer;
106
100
  },
107
101
  decode(input, length) {
108
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
102
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
109
103
  const end = length === undefined ? reader.len : reader.pos + length;
110
104
  const message = createBaseReputationDelta();
111
105
  while (reader.pos < end) {
@@ -136,7 +130,7 @@ exports.ReputationDelta = {
136
130
  if (tag !== 34) {
137
131
  break;
138
132
  }
139
- message.recordedAt = fromTimestamp(timestamp_js_1.Timestamp.decode(reader, reader.uint32()));
133
+ message.recordedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
140
134
  continue;
141
135
  }
142
136
  }
@@ -180,7 +174,7 @@ exports.ReputationDelta = {
180
174
  return obj;
181
175
  },
182
176
  create(base) {
183
- return exports.ReputationDelta.fromPartial(base ?? {});
177
+ return ReputationDelta.fromPartial(base ?? {});
184
178
  },
185
179
  fromPartial(object) {
186
180
  const message = createBaseReputationDelta();
@@ -197,15 +191,15 @@ function createBaseAttestation() {
197
191
  type: AttestationType.ATTESTATION_TYPE_UNSPECIFIED,
198
192
  subject: "",
199
193
  issuer: "",
200
- issuerPlatform: agent_js_1.Platform.PLATFORM_UNSPECIFIED,
194
+ issuerPlatform: Platform.PLATFORM_UNSPECIFIED,
201
195
  delta: 0,
202
196
  reason: "",
203
197
  txHash: "",
204
198
  createdAt: undefined,
205
199
  };
206
200
  }
207
- exports.Attestation = {
208
- encode(message, writer = new wire_1.BinaryWriter()) {
201
+ export const Attestation = {
202
+ encode(message, writer = new BinaryWriter()) {
209
203
  if (message.id !== "") {
210
204
  writer.uint32(10).string(message.id);
211
205
  }
@@ -218,8 +212,8 @@ exports.Attestation = {
218
212
  if (message.issuer !== "") {
219
213
  writer.uint32(34).string(message.issuer);
220
214
  }
221
- if (message.issuerPlatform !== agent_js_1.Platform.PLATFORM_UNSPECIFIED) {
222
- writer.uint32(40).int32((0, agent_js_1.platformToNumber)(message.issuerPlatform));
215
+ if (message.issuerPlatform !== Platform.PLATFORM_UNSPECIFIED) {
216
+ writer.uint32(40).int32(platformToNumber(message.issuerPlatform));
223
217
  }
224
218
  if (message.delta !== 0) {
225
219
  writer.uint32(48).int32(message.delta);
@@ -231,12 +225,12 @@ exports.Attestation = {
231
225
  writer.uint32(66).string(message.txHash);
232
226
  }
233
227
  if (message.createdAt !== undefined) {
234
- timestamp_js_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
228
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
235
229
  }
236
230
  return writer;
237
231
  },
238
232
  decode(input, length) {
239
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
233
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
240
234
  const end = length === undefined ? reader.len : reader.pos + length;
241
235
  const message = createBaseAttestation();
242
236
  while (reader.pos < end) {
@@ -274,7 +268,7 @@ exports.Attestation = {
274
268
  if (tag !== 40) {
275
269
  break;
276
270
  }
277
- message.issuerPlatform = (0, agent_js_1.platformFromJSON)(reader.int32());
271
+ message.issuerPlatform = platformFromJSON(reader.int32());
278
272
  continue;
279
273
  }
280
274
  case 6: {
@@ -302,7 +296,7 @@ exports.Attestation = {
302
296
  if (tag !== 74) {
303
297
  break;
304
298
  }
305
- message.createdAt = fromTimestamp(timestamp_js_1.Timestamp.decode(reader, reader.uint32()));
299
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
306
300
  continue;
307
301
  }
308
302
  }
@@ -320,10 +314,10 @@ exports.Attestation = {
320
314
  subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
321
315
  issuer: isSet(object.issuer) ? globalThis.String(object.issuer) : "",
322
316
  issuerPlatform: isSet(object.issuerPlatform)
323
- ? (0, agent_js_1.platformFromJSON)(object.issuerPlatform)
317
+ ? platformFromJSON(object.issuerPlatform)
324
318
  : isSet(object.issuer_platform)
325
- ? (0, agent_js_1.platformFromJSON)(object.issuer_platform)
326
- : agent_js_1.Platform.PLATFORM_UNSPECIFIED,
319
+ ? platformFromJSON(object.issuer_platform)
320
+ : Platform.PLATFORM_UNSPECIFIED,
327
321
  delta: isSet(object.delta) ? globalThis.Number(object.delta) : 0,
328
322
  reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
329
323
  txHash: isSet(object.txHash)
@@ -352,8 +346,8 @@ exports.Attestation = {
352
346
  if (message.issuer !== "") {
353
347
  obj.issuer = message.issuer;
354
348
  }
355
- if (message.issuerPlatform !== agent_js_1.Platform.PLATFORM_UNSPECIFIED) {
356
- obj.issuerPlatform = (0, agent_js_1.platformToJSON)(message.issuerPlatform);
349
+ if (message.issuerPlatform !== Platform.PLATFORM_UNSPECIFIED) {
350
+ obj.issuerPlatform = platformToJSON(message.issuerPlatform);
357
351
  }
358
352
  if (message.delta !== 0) {
359
353
  obj.delta = Math.round(message.delta);
@@ -370,7 +364,7 @@ exports.Attestation = {
370
364
  return obj;
371
365
  },
372
366
  create(base) {
373
- return exports.Attestation.fromPartial(base ?? {});
367
+ return Attestation.fromPartial(base ?? {});
374
368
  },
375
369
  fromPartial(object) {
376
370
  const message = createBaseAttestation();
@@ -378,7 +372,7 @@ exports.Attestation = {
378
372
  message.type = object.type ?? AttestationType.ATTESTATION_TYPE_UNSPECIFIED;
379
373
  message.subject = object.subject ?? "";
380
374
  message.issuer = object.issuer ?? "";
381
- message.issuerPlatform = object.issuerPlatform ?? agent_js_1.Platform.PLATFORM_UNSPECIFIED;
375
+ message.issuerPlatform = object.issuerPlatform ?? Platform.PLATFORM_UNSPECIFIED;
382
376
  message.delta = object.delta ?? 0;
383
377
  message.reason = object.reason ?? "";
384
378
  message.txHash = object.txHash ?? "";
@@ -389,8 +383,8 @@ exports.Attestation = {
389
383
  function createBaseVouchRequest() {
390
384
  return { fromAddress: "", toAddress: "", reason: "" };
391
385
  }
392
- exports.VouchRequest = {
393
- encode(message, writer = new wire_1.BinaryWriter()) {
386
+ export const VouchRequest = {
387
+ encode(message, writer = new BinaryWriter()) {
394
388
  if (message.fromAddress !== "") {
395
389
  writer.uint32(10).string(message.fromAddress);
396
390
  }
@@ -403,7 +397,7 @@ exports.VouchRequest = {
403
397
  return writer;
404
398
  },
405
399
  decode(input, length) {
406
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
400
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
407
401
  const end = length === undefined ? reader.len : reader.pos + length;
408
402
  const message = createBaseVouchRequest();
409
403
  while (reader.pos < end) {
@@ -467,7 +461,7 @@ exports.VouchRequest = {
467
461
  return obj;
468
462
  },
469
463
  create(base) {
470
- return exports.VouchRequest.fromPartial(base ?? {});
464
+ return VouchRequest.fromPartial(base ?? {});
471
465
  },
472
466
  fromPartial(object) {
473
467
  const message = createBaseVouchRequest();
@@ -480,8 +474,8 @@ exports.VouchRequest = {
480
474
  function createBaseChallengeRequest() {
481
475
  return { challenger: "", challenged: "", evidence: "", reason: "" };
482
476
  }
483
- exports.ChallengeRequest = {
484
- encode(message, writer = new wire_1.BinaryWriter()) {
477
+ export const ChallengeRequest = {
478
+ encode(message, writer = new BinaryWriter()) {
485
479
  if (message.challenger !== "") {
486
480
  writer.uint32(10).string(message.challenger);
487
481
  }
@@ -497,7 +491,7 @@ exports.ChallengeRequest = {
497
491
  return writer;
498
492
  },
499
493
  decode(input, length) {
500
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
494
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
501
495
  const end = length === undefined ? reader.len : reader.pos + length;
502
496
  const message = createBaseChallengeRequest();
503
497
  while (reader.pos < end) {
@@ -564,7 +558,7 @@ exports.ChallengeRequest = {
564
558
  return obj;
565
559
  },
566
560
  create(base) {
567
- return exports.ChallengeRequest.fromPartial(base ?? {});
561
+ return ChallengeRequest.fromPartial(base ?? {});
568
562
  },
569
563
  fromPartial(object) {
570
564
  const message = createBaseChallengeRequest();
@@ -586,8 +580,8 @@ function createBaseReputationConfig() {
586
580
  challengeThreshold: 0,
587
581
  };
588
582
  }
589
- exports.ReputationConfig = {
590
- encode(message, writer = new wire_1.BinaryWriter()) {
583
+ export const ReputationConfig = {
584
+ encode(message, writer = new BinaryWriter()) {
591
585
  if (message.baseReputation !== 0) {
592
586
  writer.uint32(8).int32(message.baseReputation);
593
587
  }
@@ -612,7 +606,7 @@ exports.ReputationConfig = {
612
606
  return writer;
613
607
  },
614
608
  decode(input, length) {
615
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
609
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
616
610
  const end = length === undefined ? reader.len : reader.pos + length;
617
611
  const message = createBaseReputationConfig();
618
612
  while (reader.pos < end) {
@@ -740,7 +734,7 @@ exports.ReputationConfig = {
740
734
  return obj;
741
735
  },
742
736
  create(base) {
743
- return exports.ReputationConfig.fromPartial(base ?? {});
737
+ return ReputationConfig.fromPartial(base ?? {});
744
738
  },
745
739
  fromPartial(object) {
746
740
  const message = createBaseReputationConfig();
@@ -772,7 +766,7 @@ function fromJsonTimestamp(o) {
772
766
  return new globalThis.Date(o);
773
767
  }
774
768
  else {
775
- return fromTimestamp(timestamp_js_1.Timestamp.fromJSON(o));
769
+ return fromTimestamp(Timestamp.fromJSON(o));
776
770
  }
777
771
  }
778
772
  function isSet(value) {