@ottochain/sdk 1.7.0-beta.2 → 2.1.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.
- package/dist/cjs/apps/contracts/index.js +1 -1
- package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +272 -0
- package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +284 -0
- package/dist/cjs/apps/contracts/state-machines/contract-universal.js +93 -0
- package/dist/cjs/apps/contracts/state-machines/index.js +177 -1
- package/dist/cjs/apps/corporate/state-machines/corp-board.js +1022 -0
- package/dist/cjs/apps/corporate/state-machines/corp-entity.js +671 -0
- package/dist/cjs/apps/corporate/state-machines/corp-securities.js +998 -0
- package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +1102 -0
- package/dist/cjs/apps/corporate/state-machines/index.js +20 -4440
- package/dist/cjs/apps/governance/index.js +7 -7
- package/dist/cjs/apps/governance/state-machines/dao-multisig.js +467 -0
- package/dist/cjs/apps/governance/state-machines/dao-reputation.js +458 -0
- package/dist/cjs/apps/governance/state-machines/dao-single.js +199 -0
- package/dist/cjs/apps/governance/state-machines/dao-token.js +503 -0
- package/dist/cjs/apps/governance/state-machines/governance-simple.js +482 -0
- package/dist/cjs/apps/governance/state-machines/governance-universal.js +138 -0
- package/dist/cjs/apps/governance/state-machines/index.js +16 -2934
- package/dist/cjs/apps/identity/constants.js +20 -20
- package/dist/cjs/apps/identity/index.js +13 -21
- package/dist/cjs/apps/identity/state-machines/identity-agent.js +256 -0
- package/dist/cjs/apps/identity/state-machines/identity-oracle.js +321 -0
- package/dist/cjs/apps/identity/state-machines/identity-universal.js +106 -0
- package/dist/cjs/apps/identity/state-machines/index.js +15 -784
- package/dist/cjs/apps/markets/index.js +1 -1
- package/dist/cjs/apps/markets/state-machines/index.js +14 -2298
- package/dist/cjs/apps/markets/state-machines/market-auction.js +283 -0
- package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +312 -0
- package/dist/cjs/apps/markets/state-machines/market-group-buy.js +407 -0
- package/dist/cjs/apps/markets/state-machines/market-prediction.js +485 -0
- package/dist/cjs/apps/markets/state-machines/market-universal.js +129 -0
- package/dist/cjs/apps/oracles/index.js +36 -0
- package/dist/cjs/generated/index.js +14 -7
- package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +197 -198
- package/dist/cjs/schema/fiber-app.js +55 -0
- package/dist/cjs/schema/index.js +20 -0
- package/dist/esm/apps/contracts/index.js +3 -3
- package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
- package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
- package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
- package/dist/esm/apps/contracts/state-machines/index.js +177 -1
- package/dist/esm/apps/corporate/index.js +3 -3
- package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
- package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
- package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
- package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
- package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
- package/dist/esm/apps/governance/index.js +9 -9
- package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
- package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
- package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
- package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
- package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
- package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
- package/dist/esm/apps/governance/state-machines/index.js +9 -2933
- package/dist/esm/apps/identity/constants.js +21 -21
- package/dist/esm/apps/identity/index.js +13 -22
- package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
- package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
- package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
- package/dist/esm/apps/identity/state-machines/index.js +11 -783
- package/dist/esm/apps/index.js +5 -5
- package/dist/esm/apps/markets/index.js +3 -3
- package/dist/esm/apps/markets/state-machines/index.js +8 -2297
- package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
- package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
- package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
- package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
- package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
- package/dist/esm/apps/oracles/index.js +21 -0
- package/dist/esm/generated/index.js +8 -3
- package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +196 -197
- package/dist/esm/schema/fiber-app.js +47 -0
- package/dist/esm/schema/index.js +4 -0
- package/dist/types/apps/contracts/index.d.ts +151 -2
- package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
- package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
- package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
- package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
- package/dist/types/apps/corporate/index.d.ts +5263 -3825
- package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
- package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
- package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
- package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
- package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
- package/dist/types/apps/governance/index.d.ts +875 -37
- package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
- package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
- package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
- package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
- package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
- package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
- package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
- package/dist/types/apps/identity/constants.d.ts +4 -7
- package/dist/types/apps/identity/index.d.ts +1082 -592
- package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
- package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
- package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
- package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
- package/dist/types/apps/index.d.ts +5 -5
- package/dist/types/apps/markets/index.d.ts +535 -7
- package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
- package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
- package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
- package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
- package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
- package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
- package/dist/types/apps/oracles/index.d.ts +18 -0
- package/dist/types/generated/index.d.ts +3 -1
- package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +43 -64
- package/dist/types/schema/fiber-app.d.ts +139 -0
- package/dist/types/schema/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
8
|
import { Timestamp } from "../../../../google/protobuf/timestamp.js";
|
|
9
9
|
export const protobufPackage = "ottochain.apps.identity.v1";
|
|
10
|
-
/**
|
|
10
|
+
/** Identity type - determines which state machine variant applies */
|
|
11
11
|
export var IdentityType;
|
|
12
12
|
(function (IdentityType) {
|
|
13
13
|
IdentityType["IDENTITY_TYPE_UNSPECIFIED"] = "IDENTITY_TYPE_UNSPECIFIED";
|
|
14
|
-
/** IDENTITY_TYPE_AGENT -
|
|
14
|
+
/** IDENTITY_TYPE_AGENT - AI agent identity */
|
|
15
15
|
IdentityType["IDENTITY_TYPE_AGENT"] = "IDENTITY_TYPE_AGENT";
|
|
16
|
-
/** IDENTITY_TYPE_ORACLE - Oracle service
|
|
16
|
+
/** IDENTITY_TYPE_ORACLE - Oracle service identity */
|
|
17
17
|
IdentityType["IDENTITY_TYPE_ORACLE"] = "IDENTITY_TYPE_ORACLE";
|
|
18
|
-
/** IDENTITY_TYPE_SERVICE -
|
|
18
|
+
/** IDENTITY_TYPE_SERVICE - Generic service identity */
|
|
19
19
|
IdentityType["IDENTITY_TYPE_SERVICE"] = "IDENTITY_TYPE_SERVICE";
|
|
20
20
|
IdentityType["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
21
21
|
})(IdentityType || (IdentityType = {}));
|
|
@@ -69,25 +69,30 @@ export function identityTypeToNumber(object) {
|
|
|
69
69
|
return -1;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Unified identity lifecycle states
|
|
74
|
+
* Shared across all identity types with type-specific transitions
|
|
75
|
+
*/
|
|
73
76
|
export var IdentityState;
|
|
74
77
|
(function (IdentityState) {
|
|
75
78
|
IdentityState["IDENTITY_STATE_UNSPECIFIED"] = "IDENTITY_STATE_UNSPECIFIED";
|
|
76
79
|
/** IDENTITY_STATE_UNREGISTERED - Not yet registered (oracle initial) */
|
|
77
80
|
IdentityState["IDENTITY_STATE_UNREGISTERED"] = "IDENTITY_STATE_UNREGISTERED";
|
|
78
|
-
/** IDENTITY_STATE_REGISTERED - Registered,
|
|
81
|
+
/** IDENTITY_STATE_REGISTERED - Registered, pending activation */
|
|
79
82
|
IdentityState["IDENTITY_STATE_REGISTERED"] = "IDENTITY_STATE_REGISTERED";
|
|
80
83
|
/** IDENTITY_STATE_ACTIVE - Active and participating */
|
|
81
84
|
IdentityState["IDENTITY_STATE_ACTIVE"] = "IDENTITY_STATE_ACTIVE";
|
|
82
|
-
/**
|
|
83
|
-
IdentityState["IDENTITY_STATE_INACTIVE"] = "IDENTITY_STATE_INACTIVE";
|
|
84
|
-
/** IDENTITY_STATE_CHALLENGED - Under dispute/challenge */
|
|
85
|
+
/** IDENTITY_STATE_CHALLENGED - Under dispute (agent-specific) */
|
|
85
86
|
IdentityState["IDENTITY_STATE_CHALLENGED"] = "IDENTITY_STATE_CHALLENGED";
|
|
86
|
-
/** IDENTITY_STATE_SUSPENDED -
|
|
87
|
+
/** IDENTITY_STATE_SUSPENDED - Temporarily suspended */
|
|
87
88
|
IdentityState["IDENTITY_STATE_SUSPENDED"] = "IDENTITY_STATE_SUSPENDED";
|
|
88
89
|
/** IDENTITY_STATE_PROBATION - Recovering from suspension */
|
|
89
90
|
IdentityState["IDENTITY_STATE_PROBATION"] = "IDENTITY_STATE_PROBATION";
|
|
90
|
-
/**
|
|
91
|
+
/** IDENTITY_STATE_SLASHED - Penalized (oracle-specific) */
|
|
92
|
+
IdentityState["IDENTITY_STATE_SLASHED"] = "IDENTITY_STATE_SLASHED";
|
|
93
|
+
/** IDENTITY_STATE_INACTIVE - Voluntarily inactive but can reactivate */
|
|
94
|
+
IdentityState["IDENTITY_STATE_INACTIVE"] = "IDENTITY_STATE_INACTIVE";
|
|
95
|
+
/** IDENTITY_STATE_WITHDRAWN - Terminal - exited permanently */
|
|
91
96
|
IdentityState["IDENTITY_STATE_WITHDRAWN"] = "IDENTITY_STATE_WITHDRAWN";
|
|
92
97
|
IdentityState["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
93
98
|
})(IdentityState || (IdentityState = {}));
|
|
@@ -106,18 +111,21 @@ export function identityStateFromJSON(object) {
|
|
|
106
111
|
case "IDENTITY_STATE_ACTIVE":
|
|
107
112
|
return IdentityState.IDENTITY_STATE_ACTIVE;
|
|
108
113
|
case 4:
|
|
109
|
-
case "IDENTITY_STATE_INACTIVE":
|
|
110
|
-
return IdentityState.IDENTITY_STATE_INACTIVE;
|
|
111
|
-
case 5:
|
|
112
114
|
case "IDENTITY_STATE_CHALLENGED":
|
|
113
115
|
return IdentityState.IDENTITY_STATE_CHALLENGED;
|
|
114
|
-
case
|
|
116
|
+
case 5:
|
|
115
117
|
case "IDENTITY_STATE_SUSPENDED":
|
|
116
118
|
return IdentityState.IDENTITY_STATE_SUSPENDED;
|
|
117
|
-
case
|
|
119
|
+
case 6:
|
|
118
120
|
case "IDENTITY_STATE_PROBATION":
|
|
119
121
|
return IdentityState.IDENTITY_STATE_PROBATION;
|
|
122
|
+
case 7:
|
|
123
|
+
case "IDENTITY_STATE_SLASHED":
|
|
124
|
+
return IdentityState.IDENTITY_STATE_SLASHED;
|
|
120
125
|
case 8:
|
|
126
|
+
case "IDENTITY_STATE_INACTIVE":
|
|
127
|
+
return IdentityState.IDENTITY_STATE_INACTIVE;
|
|
128
|
+
case 9:
|
|
121
129
|
case "IDENTITY_STATE_WITHDRAWN":
|
|
122
130
|
return IdentityState.IDENTITY_STATE_WITHDRAWN;
|
|
123
131
|
case -1:
|
|
@@ -136,14 +144,16 @@ export function identityStateToJSON(object) {
|
|
|
136
144
|
return "IDENTITY_STATE_REGISTERED";
|
|
137
145
|
case IdentityState.IDENTITY_STATE_ACTIVE:
|
|
138
146
|
return "IDENTITY_STATE_ACTIVE";
|
|
139
|
-
case IdentityState.IDENTITY_STATE_INACTIVE:
|
|
140
|
-
return "IDENTITY_STATE_INACTIVE";
|
|
141
147
|
case IdentityState.IDENTITY_STATE_CHALLENGED:
|
|
142
148
|
return "IDENTITY_STATE_CHALLENGED";
|
|
143
149
|
case IdentityState.IDENTITY_STATE_SUSPENDED:
|
|
144
150
|
return "IDENTITY_STATE_SUSPENDED";
|
|
145
151
|
case IdentityState.IDENTITY_STATE_PROBATION:
|
|
146
152
|
return "IDENTITY_STATE_PROBATION";
|
|
153
|
+
case IdentityState.IDENTITY_STATE_SLASHED:
|
|
154
|
+
return "IDENTITY_STATE_SLASHED";
|
|
155
|
+
case IdentityState.IDENTITY_STATE_INACTIVE:
|
|
156
|
+
return "IDENTITY_STATE_INACTIVE";
|
|
147
157
|
case IdentityState.IDENTITY_STATE_WITHDRAWN:
|
|
148
158
|
return "IDENTITY_STATE_WITHDRAWN";
|
|
149
159
|
case IdentityState.UNRECOGNIZED:
|
|
@@ -161,16 +171,18 @@ export function identityStateToNumber(object) {
|
|
|
161
171
|
return 2;
|
|
162
172
|
case IdentityState.IDENTITY_STATE_ACTIVE:
|
|
163
173
|
return 3;
|
|
164
|
-
case IdentityState.IDENTITY_STATE_INACTIVE:
|
|
165
|
-
return 4;
|
|
166
174
|
case IdentityState.IDENTITY_STATE_CHALLENGED:
|
|
167
|
-
return
|
|
175
|
+
return 4;
|
|
168
176
|
case IdentityState.IDENTITY_STATE_SUSPENDED:
|
|
169
|
-
return
|
|
177
|
+
return 5;
|
|
170
178
|
case IdentityState.IDENTITY_STATE_PROBATION:
|
|
179
|
+
return 6;
|
|
180
|
+
case IdentityState.IDENTITY_STATE_SLASHED:
|
|
171
181
|
return 7;
|
|
172
|
-
case IdentityState.
|
|
182
|
+
case IdentityState.IDENTITY_STATE_INACTIVE:
|
|
173
183
|
return 8;
|
|
184
|
+
case IdentityState.IDENTITY_STATE_WITHDRAWN:
|
|
185
|
+
return 9;
|
|
174
186
|
case IdentityState.UNRECOGNIZED:
|
|
175
187
|
default:
|
|
176
188
|
return -1;
|
|
@@ -383,18 +395,18 @@ export const PlatformLink = {
|
|
|
383
395
|
},
|
|
384
396
|
};
|
|
385
397
|
function createBaseReputation() {
|
|
386
|
-
return { score: 0,
|
|
398
|
+
return { score: 0, accuracy: 0, totalActions: 0, disputesWon: 0, disputesLost: 0 };
|
|
387
399
|
}
|
|
388
400
|
export const Reputation = {
|
|
389
401
|
encode(message, writer = new BinaryWriter()) {
|
|
390
402
|
if (message.score !== 0) {
|
|
391
403
|
writer.uint32(8).int32(message.score);
|
|
392
404
|
}
|
|
393
|
-
if (message.
|
|
394
|
-
writer.uint32(16).int32(message.
|
|
405
|
+
if (message.accuracy !== 0) {
|
|
406
|
+
writer.uint32(16).int32(message.accuracy);
|
|
395
407
|
}
|
|
396
|
-
if (message.
|
|
397
|
-
writer.uint32(24).int32(message.
|
|
408
|
+
if (message.totalActions !== 0) {
|
|
409
|
+
writer.uint32(24).int32(message.totalActions);
|
|
398
410
|
}
|
|
399
411
|
if (message.disputesWon !== 0) {
|
|
400
412
|
writer.uint32(32).int32(message.disputesWon);
|
|
@@ -422,14 +434,14 @@ export const Reputation = {
|
|
|
422
434
|
if (tag !== 16) {
|
|
423
435
|
break;
|
|
424
436
|
}
|
|
425
|
-
message.
|
|
437
|
+
message.accuracy = reader.int32();
|
|
426
438
|
continue;
|
|
427
439
|
}
|
|
428
440
|
case 3: {
|
|
429
441
|
if (tag !== 24) {
|
|
430
442
|
break;
|
|
431
443
|
}
|
|
432
|
-
message.
|
|
444
|
+
message.totalActions = reader.int32();
|
|
433
445
|
continue;
|
|
434
446
|
}
|
|
435
447
|
case 4: {
|
|
@@ -457,15 +469,11 @@ export const Reputation = {
|
|
|
457
469
|
fromJSON(object) {
|
|
458
470
|
return {
|
|
459
471
|
score: isSet(object.score) ? globalThis.Number(object.score) : 0,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
totalInteractions: isSet(object.totalInteractions)
|
|
466
|
-
? globalThis.Number(object.totalInteractions)
|
|
467
|
-
: isSet(object.total_interactions)
|
|
468
|
-
? globalThis.Number(object.total_interactions)
|
|
472
|
+
accuracy: isSet(object.accuracy) ? globalThis.Number(object.accuracy) : 0,
|
|
473
|
+
totalActions: isSet(object.totalActions)
|
|
474
|
+
? globalThis.Number(object.totalActions)
|
|
475
|
+
: isSet(object.total_actions)
|
|
476
|
+
? globalThis.Number(object.total_actions)
|
|
469
477
|
: 0,
|
|
470
478
|
disputesWon: isSet(object.disputesWon)
|
|
471
479
|
? globalThis.Number(object.disputesWon)
|
|
@@ -484,11 +492,11 @@ export const Reputation = {
|
|
|
484
492
|
if (message.score !== 0) {
|
|
485
493
|
obj.score = Math.round(message.score);
|
|
486
494
|
}
|
|
487
|
-
if (message.
|
|
488
|
-
obj.
|
|
495
|
+
if (message.accuracy !== 0) {
|
|
496
|
+
obj.accuracy = Math.round(message.accuracy);
|
|
489
497
|
}
|
|
490
|
-
if (message.
|
|
491
|
-
obj.
|
|
498
|
+
if (message.totalActions !== 0) {
|
|
499
|
+
obj.totalActions = Math.round(message.totalActions);
|
|
492
500
|
}
|
|
493
501
|
if (message.disputesWon !== 0) {
|
|
494
502
|
obj.disputesWon = Math.round(message.disputesWon);
|
|
@@ -504,8 +512,8 @@ export const Reputation = {
|
|
|
504
512
|
fromPartial(object) {
|
|
505
513
|
const message = createBaseReputation();
|
|
506
514
|
message.score = object.score ?? 0;
|
|
507
|
-
message.
|
|
508
|
-
message.
|
|
515
|
+
message.accuracy = object.accuracy ?? 0;
|
|
516
|
+
message.totalActions = object.totalActions ?? 0;
|
|
509
517
|
message.disputesWon = object.disputesWon ?? 0;
|
|
510
518
|
message.disputesLost = object.disputesLost ?? 0;
|
|
511
519
|
return message;
|
|
@@ -616,15 +624,15 @@ export const PenaltyEvent = {
|
|
|
616
624
|
function createBaseIdentity() {
|
|
617
625
|
return {
|
|
618
626
|
id: "",
|
|
619
|
-
identityType: IdentityType.IDENTITY_TYPE_UNSPECIFIED,
|
|
620
627
|
address: "",
|
|
621
628
|
publicKey: "",
|
|
622
629
|
displayName: "",
|
|
630
|
+
identityType: IdentityType.IDENTITY_TYPE_UNSPECIFIED,
|
|
623
631
|
state: IdentityState.IDENTITY_STATE_UNSPECIFIED,
|
|
624
632
|
reputation: undefined,
|
|
625
|
-
platformLinks: [],
|
|
626
633
|
stake: 0,
|
|
627
634
|
domains: [],
|
|
635
|
+
platformLinks: [],
|
|
628
636
|
penaltyHistory: [],
|
|
629
637
|
createdAt: undefined,
|
|
630
638
|
updatedAt: undefined,
|
|
@@ -635,17 +643,17 @@ export const Identity = {
|
|
|
635
643
|
if (message.id !== "") {
|
|
636
644
|
writer.uint32(10).string(message.id);
|
|
637
645
|
}
|
|
638
|
-
if (message.identityType !== IdentityType.IDENTITY_TYPE_UNSPECIFIED) {
|
|
639
|
-
writer.uint32(16).int32(identityTypeToNumber(message.identityType));
|
|
640
|
-
}
|
|
641
646
|
if (message.address !== "") {
|
|
642
|
-
writer.uint32(
|
|
647
|
+
writer.uint32(18).string(message.address);
|
|
643
648
|
}
|
|
644
649
|
if (message.publicKey !== "") {
|
|
645
|
-
writer.uint32(
|
|
650
|
+
writer.uint32(26).string(message.publicKey);
|
|
646
651
|
}
|
|
647
652
|
if (message.displayName !== "") {
|
|
648
|
-
writer.uint32(
|
|
653
|
+
writer.uint32(34).string(message.displayName);
|
|
654
|
+
}
|
|
655
|
+
if (message.identityType !== IdentityType.IDENTITY_TYPE_UNSPECIFIED) {
|
|
656
|
+
writer.uint32(40).int32(identityTypeToNumber(message.identityType));
|
|
649
657
|
}
|
|
650
658
|
if (message.state !== IdentityState.IDENTITY_STATE_UNSPECIFIED) {
|
|
651
659
|
writer.uint32(48).int32(identityStateToNumber(message.state));
|
|
@@ -653,14 +661,14 @@ export const Identity = {
|
|
|
653
661
|
if (message.reputation !== undefined) {
|
|
654
662
|
Reputation.encode(message.reputation, writer.uint32(58).fork()).join();
|
|
655
663
|
}
|
|
656
|
-
for (const v of message.platformLinks) {
|
|
657
|
-
PlatformLink.encode(v, writer.uint32(66).fork()).join();
|
|
658
|
-
}
|
|
659
664
|
if (message.stake !== 0) {
|
|
660
|
-
writer.uint32(
|
|
665
|
+
writer.uint32(64).int64(message.stake);
|
|
661
666
|
}
|
|
662
667
|
for (const v of message.domains) {
|
|
663
|
-
writer.uint32(
|
|
668
|
+
writer.uint32(74).string(v);
|
|
669
|
+
}
|
|
670
|
+
for (const v of message.platformLinks) {
|
|
671
|
+
PlatformLink.encode(v, writer.uint32(82).fork()).join();
|
|
664
672
|
}
|
|
665
673
|
for (const v of message.penaltyHistory) {
|
|
666
674
|
PenaltyEvent.encode(v, writer.uint32(90).fork()).join();
|
|
@@ -688,31 +696,31 @@ export const Identity = {
|
|
|
688
696
|
continue;
|
|
689
697
|
}
|
|
690
698
|
case 2: {
|
|
691
|
-
if (tag !==
|
|
699
|
+
if (tag !== 18) {
|
|
692
700
|
break;
|
|
693
701
|
}
|
|
694
|
-
message.
|
|
702
|
+
message.address = reader.string();
|
|
695
703
|
continue;
|
|
696
704
|
}
|
|
697
705
|
case 3: {
|
|
698
706
|
if (tag !== 26) {
|
|
699
707
|
break;
|
|
700
708
|
}
|
|
701
|
-
message.
|
|
709
|
+
message.publicKey = reader.string();
|
|
702
710
|
continue;
|
|
703
711
|
}
|
|
704
712
|
case 4: {
|
|
705
713
|
if (tag !== 34) {
|
|
706
714
|
break;
|
|
707
715
|
}
|
|
708
|
-
message.
|
|
716
|
+
message.displayName = reader.string();
|
|
709
717
|
continue;
|
|
710
718
|
}
|
|
711
719
|
case 5: {
|
|
712
|
-
if (tag !==
|
|
720
|
+
if (tag !== 40) {
|
|
713
721
|
break;
|
|
714
722
|
}
|
|
715
|
-
message.
|
|
723
|
+
message.identityType = identityTypeFromJSON(reader.int32());
|
|
716
724
|
continue;
|
|
717
725
|
}
|
|
718
726
|
case 6: {
|
|
@@ -730,24 +738,24 @@ export const Identity = {
|
|
|
730
738
|
continue;
|
|
731
739
|
}
|
|
732
740
|
case 8: {
|
|
733
|
-
if (tag !==
|
|
741
|
+
if (tag !== 64) {
|
|
734
742
|
break;
|
|
735
743
|
}
|
|
736
|
-
message.
|
|
744
|
+
message.stake = longToNumber(reader.int64());
|
|
737
745
|
continue;
|
|
738
746
|
}
|
|
739
747
|
case 9: {
|
|
740
|
-
if (tag !==
|
|
748
|
+
if (tag !== 74) {
|
|
741
749
|
break;
|
|
742
750
|
}
|
|
743
|
-
message.
|
|
751
|
+
message.domains.push(reader.string());
|
|
744
752
|
continue;
|
|
745
753
|
}
|
|
746
754
|
case 10: {
|
|
747
755
|
if (tag !== 82) {
|
|
748
756
|
break;
|
|
749
757
|
}
|
|
750
|
-
message.
|
|
758
|
+
message.platformLinks.push(PlatformLink.decode(reader, reader.uint32()));
|
|
751
759
|
continue;
|
|
752
760
|
}
|
|
753
761
|
case 11: {
|
|
@@ -782,11 +790,6 @@ export const Identity = {
|
|
|
782
790
|
fromJSON(object) {
|
|
783
791
|
return {
|
|
784
792
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
785
|
-
identityType: isSet(object.identityType)
|
|
786
|
-
? identityTypeFromJSON(object.identityType)
|
|
787
|
-
: isSet(object.identity_type)
|
|
788
|
-
? identityTypeFromJSON(object.identity_type)
|
|
789
|
-
: IdentityType.IDENTITY_TYPE_UNSPECIFIED,
|
|
790
793
|
address: isSet(object.address) ? globalThis.String(object.address) : "",
|
|
791
794
|
publicKey: isSet(object.publicKey)
|
|
792
795
|
? globalThis.String(object.publicKey)
|
|
@@ -798,17 +801,20 @@ export const Identity = {
|
|
|
798
801
|
: isSet(object.display_name)
|
|
799
802
|
? globalThis.String(object.display_name)
|
|
800
803
|
: "",
|
|
804
|
+
identityType: isSet(object.identityType)
|
|
805
|
+
? identityTypeFromJSON(object.identityType)
|
|
806
|
+
: isSet(object.identity_type)
|
|
807
|
+
? identityTypeFromJSON(object.identity_type)
|
|
808
|
+
: IdentityType.IDENTITY_TYPE_UNSPECIFIED,
|
|
801
809
|
state: isSet(object.state) ? identityStateFromJSON(object.state) : IdentityState.IDENTITY_STATE_UNSPECIFIED,
|
|
802
810
|
reputation: isSet(object.reputation) ? Reputation.fromJSON(object.reputation) : undefined,
|
|
811
|
+
stake: isSet(object.stake) ? globalThis.Number(object.stake) : 0,
|
|
812
|
+
domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e) => globalThis.String(e)) : [],
|
|
803
813
|
platformLinks: globalThis.Array.isArray(object?.platformLinks)
|
|
804
814
|
? object.platformLinks.map((e) => PlatformLink.fromJSON(e))
|
|
805
815
|
: globalThis.Array.isArray(object?.platform_links)
|
|
806
816
|
? object.platform_links.map((e) => PlatformLink.fromJSON(e))
|
|
807
817
|
: [],
|
|
808
|
-
stake: isSet(object.stake) ? globalThis.Number(object.stake) : 0,
|
|
809
|
-
domains: globalThis.Array.isArray(object?.domains)
|
|
810
|
-
? object.domains.map((e) => globalThis.String(e))
|
|
811
|
-
: [],
|
|
812
818
|
penaltyHistory: globalThis.Array.isArray(object?.penaltyHistory)
|
|
813
819
|
? object.penaltyHistory.map((e) => PenaltyEvent.fromJSON(e))
|
|
814
820
|
: globalThis.Array.isArray(object?.penalty_history)
|
|
@@ -831,9 +837,6 @@ export const Identity = {
|
|
|
831
837
|
if (message.id !== "") {
|
|
832
838
|
obj.id = message.id;
|
|
833
839
|
}
|
|
834
|
-
if (message.identityType !== IdentityType.IDENTITY_TYPE_UNSPECIFIED) {
|
|
835
|
-
obj.identityType = identityTypeToJSON(message.identityType);
|
|
836
|
-
}
|
|
837
840
|
if (message.address !== "") {
|
|
838
841
|
obj.address = message.address;
|
|
839
842
|
}
|
|
@@ -843,21 +846,24 @@ export const Identity = {
|
|
|
843
846
|
if (message.displayName !== "") {
|
|
844
847
|
obj.displayName = message.displayName;
|
|
845
848
|
}
|
|
849
|
+
if (message.identityType !== IdentityType.IDENTITY_TYPE_UNSPECIFIED) {
|
|
850
|
+
obj.identityType = identityTypeToJSON(message.identityType);
|
|
851
|
+
}
|
|
846
852
|
if (message.state !== IdentityState.IDENTITY_STATE_UNSPECIFIED) {
|
|
847
853
|
obj.state = identityStateToJSON(message.state);
|
|
848
854
|
}
|
|
849
855
|
if (message.reputation !== undefined) {
|
|
850
856
|
obj.reputation = Reputation.toJSON(message.reputation);
|
|
851
857
|
}
|
|
852
|
-
if (message.platformLinks?.length) {
|
|
853
|
-
obj.platformLinks = message.platformLinks.map((e) => PlatformLink.toJSON(e));
|
|
854
|
-
}
|
|
855
858
|
if (message.stake !== 0) {
|
|
856
859
|
obj.stake = Math.round(message.stake);
|
|
857
860
|
}
|
|
858
861
|
if (message.domains?.length) {
|
|
859
862
|
obj.domains = message.domains;
|
|
860
863
|
}
|
|
864
|
+
if (message.platformLinks?.length) {
|
|
865
|
+
obj.platformLinks = message.platformLinks.map((e) => PlatformLink.toJSON(e));
|
|
866
|
+
}
|
|
861
867
|
if (message.penaltyHistory?.length) {
|
|
862
868
|
obj.penaltyHistory = message.penaltyHistory.map((e) => PenaltyEvent.toJSON(e));
|
|
863
869
|
}
|
|
@@ -875,17 +881,17 @@ export const Identity = {
|
|
|
875
881
|
fromPartial(object) {
|
|
876
882
|
const message = createBaseIdentity();
|
|
877
883
|
message.id = object.id ?? "";
|
|
878
|
-
message.identityType = object.identityType ?? IdentityType.IDENTITY_TYPE_UNSPECIFIED;
|
|
879
884
|
message.address = object.address ?? "";
|
|
880
885
|
message.publicKey = object.publicKey ?? "";
|
|
881
886
|
message.displayName = object.displayName ?? "";
|
|
887
|
+
message.identityType = object.identityType ?? IdentityType.IDENTITY_TYPE_UNSPECIFIED;
|
|
882
888
|
message.state = object.state ?? IdentityState.IDENTITY_STATE_UNSPECIFIED;
|
|
883
889
|
message.reputation = (object.reputation !== undefined && object.reputation !== null)
|
|
884
890
|
? Reputation.fromPartial(object.reputation)
|
|
885
891
|
: undefined;
|
|
886
|
-
message.platformLinks = object.platformLinks?.map((e) => PlatformLink.fromPartial(e)) || [];
|
|
887
892
|
message.stake = object.stake ?? 0;
|
|
888
893
|
message.domains = object.domains?.map((e) => e) || [];
|
|
894
|
+
message.platformLinks = object.platformLinks?.map((e) => PlatformLink.fromPartial(e)) || [];
|
|
889
895
|
message.penaltyHistory = object.penaltyHistory?.map((e) => PenaltyEvent.fromPartial(e)) || [];
|
|
890
896
|
message.createdAt = object.createdAt ?? undefined;
|
|
891
897
|
message.updatedAt = object.updatedAt ?? undefined;
|
|
@@ -1095,26 +1101,29 @@ export const ActivateIdentityRequest = {
|
|
|
1095
1101
|
return message;
|
|
1096
1102
|
},
|
|
1097
1103
|
};
|
|
1098
|
-
function
|
|
1099
|
-
return { identityId: "",
|
|
1104
|
+
function createBaseLinkPlatformRequest() {
|
|
1105
|
+
return { identityId: "", platform: Platform.PLATFORM_UNSPECIFIED, platformUserId: "", platformUsername: "" };
|
|
1100
1106
|
}
|
|
1101
|
-
export const
|
|
1107
|
+
export const LinkPlatformRequest = {
|
|
1102
1108
|
encode(message, writer = new BinaryWriter()) {
|
|
1103
1109
|
if (message.identityId !== "") {
|
|
1104
1110
|
writer.uint32(10).string(message.identityId);
|
|
1105
1111
|
}
|
|
1106
|
-
if (message.
|
|
1107
|
-
writer.uint32(
|
|
1112
|
+
if (message.platform !== Platform.PLATFORM_UNSPECIFIED) {
|
|
1113
|
+
writer.uint32(16).int32(platformToNumber(message.platform));
|
|
1108
1114
|
}
|
|
1109
|
-
if (message.
|
|
1110
|
-
writer.uint32(
|
|
1115
|
+
if (message.platformUserId !== "") {
|
|
1116
|
+
writer.uint32(26).string(message.platformUserId);
|
|
1117
|
+
}
|
|
1118
|
+
if (message.platformUsername !== "") {
|
|
1119
|
+
writer.uint32(34).string(message.platformUsername);
|
|
1111
1120
|
}
|
|
1112
1121
|
return writer;
|
|
1113
1122
|
},
|
|
1114
1123
|
decode(input, length) {
|
|
1115
1124
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1116
1125
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1117
|
-
const message =
|
|
1126
|
+
const message = createBaseLinkPlatformRequest();
|
|
1118
1127
|
while (reader.pos < end) {
|
|
1119
1128
|
const tag = reader.uint32();
|
|
1120
1129
|
switch (tag >>> 3) {
|
|
@@ -1126,17 +1135,24 @@ export const UpdateStakeRequest = {
|
|
|
1126
1135
|
continue;
|
|
1127
1136
|
}
|
|
1128
1137
|
case 2: {
|
|
1129
|
-
if (tag !==
|
|
1138
|
+
if (tag !== 16) {
|
|
1130
1139
|
break;
|
|
1131
1140
|
}
|
|
1132
|
-
message.
|
|
1141
|
+
message.platform = platformFromJSON(reader.int32());
|
|
1133
1142
|
continue;
|
|
1134
1143
|
}
|
|
1135
1144
|
case 3: {
|
|
1136
|
-
if (tag !==
|
|
1145
|
+
if (tag !== 26) {
|
|
1137
1146
|
break;
|
|
1138
1147
|
}
|
|
1139
|
-
message.
|
|
1148
|
+
message.platformUserId = reader.string();
|
|
1149
|
+
continue;
|
|
1150
|
+
}
|
|
1151
|
+
case 4: {
|
|
1152
|
+
if (tag !== 34) {
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
message.platformUsername = reader.string();
|
|
1140
1156
|
continue;
|
|
1141
1157
|
}
|
|
1142
1158
|
}
|
|
@@ -1154,8 +1170,17 @@ export const UpdateStakeRequest = {
|
|
|
1154
1170
|
: isSet(object.identity_id)
|
|
1155
1171
|
? globalThis.String(object.identity_id)
|
|
1156
1172
|
: "",
|
|
1157
|
-
|
|
1158
|
-
|
|
1173
|
+
platform: isSet(object.platform) ? platformFromJSON(object.platform) : Platform.PLATFORM_UNSPECIFIED,
|
|
1174
|
+
platformUserId: isSet(object.platformUserId)
|
|
1175
|
+
? globalThis.String(object.platformUserId)
|
|
1176
|
+
: isSet(object.platform_user_id)
|
|
1177
|
+
? globalThis.String(object.platform_user_id)
|
|
1178
|
+
: "",
|
|
1179
|
+
platformUsername: isSet(object.platformUsername)
|
|
1180
|
+
? globalThis.String(object.platformUsername)
|
|
1181
|
+
: isSet(object.platform_username)
|
|
1182
|
+
? globalThis.String(object.platform_username)
|
|
1183
|
+
: "",
|
|
1159
1184
|
};
|
|
1160
1185
|
},
|
|
1161
1186
|
toJSON(message) {
|
|
@@ -1163,42 +1188,43 @@ export const UpdateStakeRequest = {
|
|
|
1163
1188
|
if (message.identityId !== "") {
|
|
1164
1189
|
obj.identityId = message.identityId;
|
|
1165
1190
|
}
|
|
1166
|
-
if (message.
|
|
1167
|
-
obj.
|
|
1191
|
+
if (message.platform !== Platform.PLATFORM_UNSPECIFIED) {
|
|
1192
|
+
obj.platform = platformToJSON(message.platform);
|
|
1168
1193
|
}
|
|
1169
|
-
if (message.
|
|
1170
|
-
obj.
|
|
1194
|
+
if (message.platformUserId !== "") {
|
|
1195
|
+
obj.platformUserId = message.platformUserId;
|
|
1196
|
+
}
|
|
1197
|
+
if (message.platformUsername !== "") {
|
|
1198
|
+
obj.platformUsername = message.platformUsername;
|
|
1171
1199
|
}
|
|
1172
1200
|
return obj;
|
|
1173
1201
|
},
|
|
1174
1202
|
create(base) {
|
|
1175
|
-
return
|
|
1203
|
+
return LinkPlatformRequest.fromPartial(base ?? {});
|
|
1176
1204
|
},
|
|
1177
1205
|
fromPartial(object) {
|
|
1178
|
-
const message =
|
|
1206
|
+
const message = createBaseLinkPlatformRequest();
|
|
1179
1207
|
message.identityId = object.identityId ?? "";
|
|
1180
|
-
message.
|
|
1181
|
-
message.
|
|
1208
|
+
message.platform = object.platform ?? Platform.PLATFORM_UNSPECIFIED;
|
|
1209
|
+
message.platformUserId = object.platformUserId ?? "";
|
|
1210
|
+
message.platformUsername = object.platformUsername ?? "";
|
|
1182
1211
|
return message;
|
|
1183
1212
|
},
|
|
1184
1213
|
};
|
|
1185
1214
|
function createBaseChallengeIdentityRequest() {
|
|
1186
|
-
return { identityId: "",
|
|
1215
|
+
return { identityId: "", challengerAddress: "", reason: "" };
|
|
1187
1216
|
}
|
|
1188
1217
|
export const ChallengeIdentityRequest = {
|
|
1189
1218
|
encode(message, writer = new BinaryWriter()) {
|
|
1190
1219
|
if (message.identityId !== "") {
|
|
1191
1220
|
writer.uint32(10).string(message.identityId);
|
|
1192
1221
|
}
|
|
1193
|
-
if (message.
|
|
1194
|
-
writer.uint32(18).string(message.
|
|
1222
|
+
if (message.challengerAddress !== "") {
|
|
1223
|
+
writer.uint32(18).string(message.challengerAddress);
|
|
1195
1224
|
}
|
|
1196
1225
|
if (message.reason !== "") {
|
|
1197
1226
|
writer.uint32(26).string(message.reason);
|
|
1198
1227
|
}
|
|
1199
|
-
if (message.evidence !== "") {
|
|
1200
|
-
writer.uint32(34).string(message.evidence);
|
|
1201
|
-
}
|
|
1202
1228
|
return writer;
|
|
1203
1229
|
},
|
|
1204
1230
|
decode(input, length) {
|
|
@@ -1219,7 +1245,7 @@ export const ChallengeIdentityRequest = {
|
|
|
1219
1245
|
if (tag !== 18) {
|
|
1220
1246
|
break;
|
|
1221
1247
|
}
|
|
1222
|
-
message.
|
|
1248
|
+
message.challengerAddress = reader.string();
|
|
1223
1249
|
continue;
|
|
1224
1250
|
}
|
|
1225
1251
|
case 3: {
|
|
@@ -1229,13 +1255,6 @@ export const ChallengeIdentityRequest = {
|
|
|
1229
1255
|
message.reason = reader.string();
|
|
1230
1256
|
continue;
|
|
1231
1257
|
}
|
|
1232
|
-
case 4: {
|
|
1233
|
-
if (tag !== 34) {
|
|
1234
|
-
break;
|
|
1235
|
-
}
|
|
1236
|
-
message.evidence = reader.string();
|
|
1237
|
-
continue;
|
|
1238
|
-
}
|
|
1239
1258
|
}
|
|
1240
1259
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1241
1260
|
break;
|
|
@@ -1251,9 +1270,12 @@ export const ChallengeIdentityRequest = {
|
|
|
1251
1270
|
: isSet(object.identity_id)
|
|
1252
1271
|
? globalThis.String(object.identity_id)
|
|
1253
1272
|
: "",
|
|
1254
|
-
|
|
1273
|
+
challengerAddress: isSet(object.challengerAddress)
|
|
1274
|
+
? globalThis.String(object.challengerAddress)
|
|
1275
|
+
: isSet(object.challenger_address)
|
|
1276
|
+
? globalThis.String(object.challenger_address)
|
|
1277
|
+
: "",
|
|
1255
1278
|
reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
|
|
1256
|
-
evidence: isSet(object.evidence) ? globalThis.String(object.evidence) : "",
|
|
1257
1279
|
};
|
|
1258
1280
|
},
|
|
1259
1281
|
toJSON(message) {
|
|
@@ -1261,15 +1283,12 @@ export const ChallengeIdentityRequest = {
|
|
|
1261
1283
|
if (message.identityId !== "") {
|
|
1262
1284
|
obj.identityId = message.identityId;
|
|
1263
1285
|
}
|
|
1264
|
-
if (message.
|
|
1265
|
-
obj.
|
|
1286
|
+
if (message.challengerAddress !== "") {
|
|
1287
|
+
obj.challengerAddress = message.challengerAddress;
|
|
1266
1288
|
}
|
|
1267
1289
|
if (message.reason !== "") {
|
|
1268
1290
|
obj.reason = message.reason;
|
|
1269
1291
|
}
|
|
1270
|
-
if (message.evidence !== "") {
|
|
1271
|
-
obj.evidence = message.evidence;
|
|
1272
|
-
}
|
|
1273
1292
|
return obj;
|
|
1274
1293
|
},
|
|
1275
1294
|
create(base) {
|
|
@@ -1278,35 +1297,31 @@ export const ChallengeIdentityRequest = {
|
|
|
1278
1297
|
fromPartial(object) {
|
|
1279
1298
|
const message = createBaseChallengeIdentityRequest();
|
|
1280
1299
|
message.identityId = object.identityId ?? "";
|
|
1281
|
-
message.
|
|
1300
|
+
message.challengerAddress = object.challengerAddress ?? "";
|
|
1282
1301
|
message.reason = object.reason ?? "";
|
|
1283
|
-
message.evidence = object.evidence ?? "";
|
|
1284
1302
|
return message;
|
|
1285
1303
|
},
|
|
1286
1304
|
};
|
|
1287
|
-
function
|
|
1288
|
-
return { identityId: "",
|
|
1305
|
+
function createBaseAddStakeRequest() {
|
|
1306
|
+
return { identityId: "", address: "", amount: 0 };
|
|
1289
1307
|
}
|
|
1290
|
-
export const
|
|
1308
|
+
export const AddStakeRequest = {
|
|
1291
1309
|
encode(message, writer = new BinaryWriter()) {
|
|
1292
1310
|
if (message.identityId !== "") {
|
|
1293
1311
|
writer.uint32(10).string(message.identityId);
|
|
1294
1312
|
}
|
|
1295
|
-
if (message.
|
|
1296
|
-
writer.uint32(18).string(message.
|
|
1297
|
-
}
|
|
1298
|
-
if (message.reason !== "") {
|
|
1299
|
-
writer.uint32(26).string(message.reason);
|
|
1313
|
+
if (message.address !== "") {
|
|
1314
|
+
writer.uint32(18).string(message.address);
|
|
1300
1315
|
}
|
|
1301
1316
|
if (message.amount !== 0) {
|
|
1302
|
-
writer.uint32(
|
|
1317
|
+
writer.uint32(24).int64(message.amount);
|
|
1303
1318
|
}
|
|
1304
1319
|
return writer;
|
|
1305
1320
|
},
|
|
1306
1321
|
decode(input, length) {
|
|
1307
1322
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1308
1323
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1309
|
-
const message =
|
|
1324
|
+
const message = createBaseAddStakeRequest();
|
|
1310
1325
|
while (reader.pos < end) {
|
|
1311
1326
|
const tag = reader.uint32();
|
|
1312
1327
|
switch (tag >>> 3) {
|
|
@@ -1321,18 +1336,11 @@ export const PenalizeIdentityRequest = {
|
|
|
1321
1336
|
if (tag !== 18) {
|
|
1322
1337
|
break;
|
|
1323
1338
|
}
|
|
1324
|
-
message.
|
|
1339
|
+
message.address = reader.string();
|
|
1325
1340
|
continue;
|
|
1326
1341
|
}
|
|
1327
1342
|
case 3: {
|
|
1328
|
-
if (tag !==
|
|
1329
|
-
break;
|
|
1330
|
-
}
|
|
1331
|
-
message.reason = reader.string();
|
|
1332
|
-
continue;
|
|
1333
|
-
}
|
|
1334
|
-
case 4: {
|
|
1335
|
-
if (tag !== 32) {
|
|
1343
|
+
if (tag !== 24) {
|
|
1336
1344
|
break;
|
|
1337
1345
|
}
|
|
1338
1346
|
message.amount = longToNumber(reader.int64());
|
|
@@ -1353,12 +1361,7 @@ export const PenalizeIdentityRequest = {
|
|
|
1353
1361
|
: isSet(object.identity_id)
|
|
1354
1362
|
? globalThis.String(object.identity_id)
|
|
1355
1363
|
: "",
|
|
1356
|
-
|
|
1357
|
-
? globalThis.String(object.contextId)
|
|
1358
|
-
: isSet(object.context_id)
|
|
1359
|
-
? globalThis.String(object.context_id)
|
|
1360
|
-
: "",
|
|
1361
|
-
reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
|
|
1364
|
+
address: isSet(object.address) ? globalThis.String(object.address) : "",
|
|
1362
1365
|
amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
|
|
1363
1366
|
};
|
|
1364
1367
|
},
|
|
@@ -1367,11 +1370,8 @@ export const PenalizeIdentityRequest = {
|
|
|
1367
1370
|
if (message.identityId !== "") {
|
|
1368
1371
|
obj.identityId = message.identityId;
|
|
1369
1372
|
}
|
|
1370
|
-
if (message.
|
|
1371
|
-
obj.
|
|
1372
|
-
}
|
|
1373
|
-
if (message.reason !== "") {
|
|
1374
|
-
obj.reason = message.reason;
|
|
1373
|
+
if (message.address !== "") {
|
|
1374
|
+
obj.address = message.address;
|
|
1375
1375
|
}
|
|
1376
1376
|
if (message.amount !== 0) {
|
|
1377
1377
|
obj.amount = Math.round(message.amount);
|
|
@@ -1379,13 +1379,12 @@ export const PenalizeIdentityRequest = {
|
|
|
1379
1379
|
return obj;
|
|
1380
1380
|
},
|
|
1381
1381
|
create(base) {
|
|
1382
|
-
return
|
|
1382
|
+
return AddStakeRequest.fromPartial(base ?? {});
|
|
1383
1383
|
},
|
|
1384
1384
|
fromPartial(object) {
|
|
1385
|
-
const message =
|
|
1385
|
+
const message = createBaseAddStakeRequest();
|
|
1386
1386
|
message.identityId = object.identityId ?? "";
|
|
1387
|
-
message.
|
|
1388
|
-
message.reason = object.reason ?? "";
|
|
1387
|
+
message.address = object.address ?? "";
|
|
1389
1388
|
message.amount = object.amount ?? 0;
|
|
1390
1389
|
return message;
|
|
1391
1390
|
},
|
|
@@ -1466,11 +1465,11 @@ function createBaseIdentityDefinition() {
|
|
|
1466
1465
|
return {
|
|
1467
1466
|
identityType: IdentityType.IDENTITY_TYPE_UNSPECIFIED,
|
|
1468
1467
|
initialReputation: 0,
|
|
1469
|
-
minStake: 0,
|
|
1470
1468
|
activationThreshold: 0,
|
|
1469
|
+
minStake: 0,
|
|
1471
1470
|
suspensionDurationEpochs: 0,
|
|
1471
|
+
slashCooldownEpochs: 0,
|
|
1472
1472
|
accuracyThreshold: 0,
|
|
1473
|
-
maxDisputeRate: 0,
|
|
1474
1473
|
};
|
|
1475
1474
|
}
|
|
1476
1475
|
export const IdentityDefinition = {
|
|
@@ -1481,20 +1480,20 @@ export const IdentityDefinition = {
|
|
|
1481
1480
|
if (message.initialReputation !== 0) {
|
|
1482
1481
|
writer.uint32(16).int32(message.initialReputation);
|
|
1483
1482
|
}
|
|
1484
|
-
if (message.minStake !== 0) {
|
|
1485
|
-
writer.uint32(24).int64(message.minStake);
|
|
1486
|
-
}
|
|
1487
1483
|
if (message.activationThreshold !== 0) {
|
|
1488
|
-
writer.uint32(
|
|
1484
|
+
writer.uint32(24).int32(message.activationThreshold);
|
|
1485
|
+
}
|
|
1486
|
+
if (message.minStake !== 0) {
|
|
1487
|
+
writer.uint32(32).int64(message.minStake);
|
|
1489
1488
|
}
|
|
1490
1489
|
if (message.suspensionDurationEpochs !== 0) {
|
|
1491
1490
|
writer.uint32(40).int32(message.suspensionDurationEpochs);
|
|
1492
1491
|
}
|
|
1493
|
-
if (message.
|
|
1494
|
-
writer.uint32(48).int32(message.
|
|
1492
|
+
if (message.slashCooldownEpochs !== 0) {
|
|
1493
|
+
writer.uint32(48).int32(message.slashCooldownEpochs);
|
|
1495
1494
|
}
|
|
1496
|
-
if (message.
|
|
1497
|
-
writer.uint32(56).int32(message.
|
|
1495
|
+
if (message.accuracyThreshold !== 0) {
|
|
1496
|
+
writer.uint32(56).int32(message.accuracyThreshold);
|
|
1498
1497
|
}
|
|
1499
1498
|
return writer;
|
|
1500
1499
|
},
|
|
@@ -1523,14 +1522,14 @@ export const IdentityDefinition = {
|
|
|
1523
1522
|
if (tag !== 24) {
|
|
1524
1523
|
break;
|
|
1525
1524
|
}
|
|
1526
|
-
message.
|
|
1525
|
+
message.activationThreshold = reader.int32();
|
|
1527
1526
|
continue;
|
|
1528
1527
|
}
|
|
1529
1528
|
case 4: {
|
|
1530
1529
|
if (tag !== 32) {
|
|
1531
1530
|
break;
|
|
1532
1531
|
}
|
|
1533
|
-
message.
|
|
1532
|
+
message.minStake = longToNumber(reader.int64());
|
|
1534
1533
|
continue;
|
|
1535
1534
|
}
|
|
1536
1535
|
case 5: {
|
|
@@ -1544,14 +1543,14 @@ export const IdentityDefinition = {
|
|
|
1544
1543
|
if (tag !== 48) {
|
|
1545
1544
|
break;
|
|
1546
1545
|
}
|
|
1547
|
-
message.
|
|
1546
|
+
message.slashCooldownEpochs = reader.int32();
|
|
1548
1547
|
continue;
|
|
1549
1548
|
}
|
|
1550
1549
|
case 7: {
|
|
1551
1550
|
if (tag !== 56) {
|
|
1552
1551
|
break;
|
|
1553
1552
|
}
|
|
1554
|
-
message.
|
|
1553
|
+
message.accuracyThreshold = reader.int32();
|
|
1555
1554
|
continue;
|
|
1556
1555
|
}
|
|
1557
1556
|
}
|
|
@@ -1574,31 +1573,31 @@ export const IdentityDefinition = {
|
|
|
1574
1573
|
: isSet(object.initial_reputation)
|
|
1575
1574
|
? globalThis.Number(object.initial_reputation)
|
|
1576
1575
|
: 0,
|
|
1577
|
-
minStake: isSet(object.minStake)
|
|
1578
|
-
? globalThis.Number(object.minStake)
|
|
1579
|
-
: isSet(object.min_stake)
|
|
1580
|
-
? globalThis.Number(object.min_stake)
|
|
1581
|
-
: 0,
|
|
1582
1576
|
activationThreshold: isSet(object.activationThreshold)
|
|
1583
1577
|
? globalThis.Number(object.activationThreshold)
|
|
1584
1578
|
: isSet(object.activation_threshold)
|
|
1585
1579
|
? globalThis.Number(object.activation_threshold)
|
|
1586
1580
|
: 0,
|
|
1581
|
+
minStake: isSet(object.minStake)
|
|
1582
|
+
? globalThis.Number(object.minStake)
|
|
1583
|
+
: isSet(object.min_stake)
|
|
1584
|
+
? globalThis.Number(object.min_stake)
|
|
1585
|
+
: 0,
|
|
1587
1586
|
suspensionDurationEpochs: isSet(object.suspensionDurationEpochs)
|
|
1588
1587
|
? globalThis.Number(object.suspensionDurationEpochs)
|
|
1589
1588
|
: isSet(object.suspension_duration_epochs)
|
|
1590
1589
|
? globalThis.Number(object.suspension_duration_epochs)
|
|
1591
1590
|
: 0,
|
|
1591
|
+
slashCooldownEpochs: isSet(object.slashCooldownEpochs)
|
|
1592
|
+
? globalThis.Number(object.slashCooldownEpochs)
|
|
1593
|
+
: isSet(object.slash_cooldown_epochs)
|
|
1594
|
+
? globalThis.Number(object.slash_cooldown_epochs)
|
|
1595
|
+
: 0,
|
|
1592
1596
|
accuracyThreshold: isSet(object.accuracyThreshold)
|
|
1593
1597
|
? globalThis.Number(object.accuracyThreshold)
|
|
1594
1598
|
: isSet(object.accuracy_threshold)
|
|
1595
1599
|
? globalThis.Number(object.accuracy_threshold)
|
|
1596
1600
|
: 0,
|
|
1597
|
-
maxDisputeRate: isSet(object.maxDisputeRate)
|
|
1598
|
-
? globalThis.Number(object.maxDisputeRate)
|
|
1599
|
-
: isSet(object.max_dispute_rate)
|
|
1600
|
-
? globalThis.Number(object.max_dispute_rate)
|
|
1601
|
-
: 0,
|
|
1602
1601
|
};
|
|
1603
1602
|
},
|
|
1604
1603
|
toJSON(message) {
|
|
@@ -1609,21 +1608,21 @@ export const IdentityDefinition = {
|
|
|
1609
1608
|
if (message.initialReputation !== 0) {
|
|
1610
1609
|
obj.initialReputation = Math.round(message.initialReputation);
|
|
1611
1610
|
}
|
|
1612
|
-
if (message.minStake !== 0) {
|
|
1613
|
-
obj.minStake = Math.round(message.minStake);
|
|
1614
|
-
}
|
|
1615
1611
|
if (message.activationThreshold !== 0) {
|
|
1616
1612
|
obj.activationThreshold = Math.round(message.activationThreshold);
|
|
1617
1613
|
}
|
|
1614
|
+
if (message.minStake !== 0) {
|
|
1615
|
+
obj.minStake = Math.round(message.minStake);
|
|
1616
|
+
}
|
|
1618
1617
|
if (message.suspensionDurationEpochs !== 0) {
|
|
1619
1618
|
obj.suspensionDurationEpochs = Math.round(message.suspensionDurationEpochs);
|
|
1620
1619
|
}
|
|
1620
|
+
if (message.slashCooldownEpochs !== 0) {
|
|
1621
|
+
obj.slashCooldownEpochs = Math.round(message.slashCooldownEpochs);
|
|
1622
|
+
}
|
|
1621
1623
|
if (message.accuracyThreshold !== 0) {
|
|
1622
1624
|
obj.accuracyThreshold = Math.round(message.accuracyThreshold);
|
|
1623
1625
|
}
|
|
1624
|
-
if (message.maxDisputeRate !== 0) {
|
|
1625
|
-
obj.maxDisputeRate = Math.round(message.maxDisputeRate);
|
|
1626
|
-
}
|
|
1627
1626
|
return obj;
|
|
1628
1627
|
},
|
|
1629
1628
|
create(base) {
|
|
@@ -1633,11 +1632,11 @@ export const IdentityDefinition = {
|
|
|
1633
1632
|
const message = createBaseIdentityDefinition();
|
|
1634
1633
|
message.identityType = object.identityType ?? IdentityType.IDENTITY_TYPE_UNSPECIFIED;
|
|
1635
1634
|
message.initialReputation = object.initialReputation ?? 0;
|
|
1636
|
-
message.minStake = object.minStake ?? 0;
|
|
1637
1635
|
message.activationThreshold = object.activationThreshold ?? 0;
|
|
1636
|
+
message.minStake = object.minStake ?? 0;
|
|
1638
1637
|
message.suspensionDurationEpochs = object.suspensionDurationEpochs ?? 0;
|
|
1638
|
+
message.slashCooldownEpochs = object.slashCooldownEpochs ?? 0;
|
|
1639
1639
|
message.accuracyThreshold = object.accuracyThreshold ?? 0;
|
|
1640
|
-
message.maxDisputeRate = object.maxDisputeRate ?? 0;
|
|
1641
1640
|
return message;
|
|
1642
1641
|
},
|
|
1643
1642
|
};
|