@ottochain/sdk 1.4.0 → 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.
- package/README.md +8 -7
- package/dist/esm/apps/contracts/index.js +10 -28
- package/dist/esm/apps/corporate/index.js +24 -79
- package/dist/esm/apps/governance/index.js +36 -85
- package/dist/esm/apps/identity/constants.js +22 -27
- package/dist/esm/apps/identity/index.js +7 -35
- package/dist/esm/apps/index.js +6 -32
- package/dist/esm/apps/markets/index.js +6 -27
- package/dist/esm/apps/oracles/index.js +7 -27
- package/dist/esm/errors.js +9 -19
- package/dist/esm/generated/google/protobuf/struct.js +33 -39
- package/dist/esm/generated/google/protobuf/timestamp.js +6 -9
- package/dist/esm/generated/index.js +10 -134
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +48 -54
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +335 -357
- package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +284 -299
- package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +38 -47
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +44 -50
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +77 -86
- package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +66 -72
- package/dist/esm/generated/ottochain/v1/common.js +1 -4
- package/dist/esm/generated/ottochain/v1/fiber.js +90 -96
- package/dist/esm/generated/ottochain/v1/messages.js +79 -82
- package/dist/esm/generated/ottochain/v1/records.js +137 -140
- package/dist/esm/index.js +13 -70
- package/dist/esm/ottochain/drop-nulls.js +1 -5
- package/dist/esm/ottochain/index.js +6 -54
- package/dist/esm/ottochain/metagraph-client.js +12 -16
- package/dist/esm/ottochain/normalize.js +4 -11
- package/dist/esm/ottochain/snapshot.js +10 -20
- package/dist/esm/ottochain/transaction.js +13 -25
- package/dist/esm/ottochain/types.js +1 -2
- package/dist/esm/types.js +2 -7
- package/dist/esm/validation.js +65 -76
- package/dist/esm/verify.js +3 -7
- package/package.json +21 -17
package/README.md
CHANGED
|
@@ -247,25 +247,25 @@ import { ContractState, Contract } from '@ottochain/sdk/apps/contracts';
|
|
|
247
247
|
|
|
248
248
|
```bash
|
|
249
249
|
# Install dependencies
|
|
250
|
-
|
|
250
|
+
pnpm install
|
|
251
251
|
|
|
252
252
|
# Build
|
|
253
|
-
|
|
253
|
+
pnpm run build
|
|
254
254
|
|
|
255
255
|
# Run tests
|
|
256
|
-
|
|
256
|
+
pnpm test
|
|
257
257
|
|
|
258
258
|
# Run tests with coverage
|
|
259
|
-
|
|
259
|
+
pnpm run test:coverage
|
|
260
260
|
|
|
261
261
|
# Lint
|
|
262
|
-
|
|
262
|
+
pnpm run lint
|
|
263
263
|
|
|
264
264
|
# Generate documentation
|
|
265
|
-
|
|
265
|
+
pnpm run docs
|
|
266
266
|
|
|
267
267
|
# Generate protobuf types
|
|
268
|
-
|
|
268
|
+
pnpm run generate
|
|
269
269
|
```
|
|
270
270
|
|
|
271
271
|
## Project Structure
|
|
@@ -303,3 +303,4 @@ ottochain-sdk/
|
|
|
303
303
|
## License
|
|
304
304
|
|
|
305
305
|
Apache-2.0
|
|
306
|
+
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Contracts Application
|
|
4
3
|
*
|
|
@@ -18,43 +17,26 @@
|
|
|
18
17
|
*
|
|
19
18
|
* @packageDocumentation
|
|
20
19
|
*/
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.getEscrowDefinition = exports.getContractDefinition = exports.CONTRACT_DEFINITIONS = exports.contractStateToJSON = exports.contractStateFromJSON = exports.ContractDefinition = exports.DisputeContractRequest = exports.RejectContractRequest = exports.CompleteContractRequest = exports.AcceptContractRequest = exports.ProposeContractRequest = exports.Contract = exports.ContractState = void 0;
|
|
26
20
|
// Re-export generated protobuf types (source of truth)
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, "ContractState", { enumerable: true, get: function () { return contract_js_1.ContractState; } });
|
|
29
|
-
Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return contract_js_1.Contract; } });
|
|
30
|
-
Object.defineProperty(exports, "ProposeContractRequest", { enumerable: true, get: function () { return contract_js_1.ProposeContractRequest; } });
|
|
31
|
-
Object.defineProperty(exports, "AcceptContractRequest", { enumerable: true, get: function () { return contract_js_1.AcceptContractRequest; } });
|
|
32
|
-
Object.defineProperty(exports, "CompleteContractRequest", { enumerable: true, get: function () { return contract_js_1.CompleteContractRequest; } });
|
|
33
|
-
Object.defineProperty(exports, "RejectContractRequest", { enumerable: true, get: function () { return contract_js_1.RejectContractRequest; } });
|
|
34
|
-
Object.defineProperty(exports, "DisputeContractRequest", { enumerable: true, get: function () { return contract_js_1.DisputeContractRequest; } });
|
|
35
|
-
Object.defineProperty(exports, "ContractDefinition", { enumerable: true, get: function () { return contract_js_1.ContractDefinition; } });
|
|
36
|
-
Object.defineProperty(exports, "contractStateFromJSON", { enumerable: true, get: function () { return contract_js_1.contractStateFromJSON; } });
|
|
37
|
-
Object.defineProperty(exports, "contractStateToJSON", { enumerable: true, get: function () { return contract_js_1.contractStateToJSON; } });
|
|
21
|
+
export { ContractState, Contract, ProposeContractRequest, AcceptContractRequest, CompleteContractRequest, RejectContractRequest, DisputeContractRequest, ContractDefinition, contractStateFromJSON, contractStateToJSON, } from '../../generated/ottochain/apps/contracts/v1/contract.js';
|
|
38
22
|
// ---------------------------------------------------------------------------
|
|
39
23
|
// State Machine JSON Definitions
|
|
40
24
|
// ---------------------------------------------------------------------------
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Contract:
|
|
45
|
-
Escrow:
|
|
25
|
+
import contractDef from './state-machines/contract.json';
|
|
26
|
+
import escrowDef from './state-machines/escrow.json';
|
|
27
|
+
export const CONTRACT_DEFINITIONS = {
|
|
28
|
+
Contract: contractDef,
|
|
29
|
+
Escrow: escrowDef,
|
|
46
30
|
};
|
|
47
31
|
/**
|
|
48
32
|
* Get the contract state machine definition.
|
|
49
33
|
*/
|
|
50
|
-
function getContractDefinition() {
|
|
51
|
-
return
|
|
34
|
+
export function getContractDefinition() {
|
|
35
|
+
return contractDef;
|
|
52
36
|
}
|
|
53
|
-
exports.getContractDefinition = getContractDefinition;
|
|
54
37
|
/**
|
|
55
38
|
* Get the escrow state machine definition.
|
|
56
39
|
*/
|
|
57
|
-
function getEscrowDefinition() {
|
|
58
|
-
return
|
|
40
|
+
export function getEscrowDefinition() {
|
|
41
|
+
return escrowDef;
|
|
59
42
|
}
|
|
60
|
-
exports.getEscrowDefinition = getEscrowDefinition;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Corporate Governance Application
|
|
4
3
|
*
|
|
@@ -19,94 +18,40 @@
|
|
|
19
18
|
*
|
|
20
19
|
* @packageDocumentation
|
|
21
20
|
*/
|
|
22
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getCorporateDefinition = exports.CORPORATE_DEFINITIONS = exports.resolutionStatusToJSON = exports.resolutionStatusFromJSON = exports.boardMeetingTypeToJSON = exports.boardMeetingTypeFromJSON = exports.officerStatusToJSON = exports.officerStatusFromJSON = exports.directorStatusToJSON = exports.directorStatusFromJSON = exports.entityStateToJSON = exports.entityStateFromJSON = exports.entityTypeToJSON = exports.entityTypeFromJSON = exports.ProposeResolutionRequest = exports.IssueSharesRequest = exports.AppointDirectorRequest = exports.CreateEntityRequest = exports.ComplianceRequirement = exports.FilingRecord = exports.CorporateCompliance = exports.SecurityTransfer = exports.SecurityIssuance = exports.CorporateSecurities = exports.ResolutionVote = exports.CorporateResolution = exports.ShareHolding = exports.Shareholder = exports.CorporateShareholders = exports.OfficerAction = exports.Officer = exports.CorporateOfficers = exports.MeetingAttendee = exports.BoardMeeting = exports.QuorumRules = exports.SeatInfo = exports.Director = exports.CorporateBoard = exports.ShareStructure = exports.Incorporator = exports.RegisteredAgent = exports.CorporateEntity = exports.ShareClass = exports.Jurisdiction = exports.ResolutionStatus = exports.BoardMeetingType = exports.OfficerStatus = exports.DirectorStatus = exports.EntityState = exports.EntityType = void 0;
|
|
27
21
|
// Re-export generated protobuf types (source of truth)
|
|
28
|
-
|
|
29
|
-
Object.defineProperty(exports, "EntityType", { enumerable: true, get: function () { return corporate_js_1.EntityType; } });
|
|
30
|
-
Object.defineProperty(exports, "EntityState", { enumerable: true, get: function () { return corporate_js_1.EntityState; } });
|
|
31
|
-
Object.defineProperty(exports, "DirectorStatus", { enumerable: true, get: function () { return corporate_js_1.DirectorStatus; } });
|
|
32
|
-
Object.defineProperty(exports, "OfficerStatus", { enumerable: true, get: function () { return corporate_js_1.OfficerStatus; } });
|
|
33
|
-
Object.defineProperty(exports, "BoardMeetingType", { enumerable: true, get: function () { return corporate_js_1.BoardMeetingType; } });
|
|
34
|
-
Object.defineProperty(exports, "ResolutionStatus", { enumerable: true, get: function () { return corporate_js_1.ResolutionStatus; } });
|
|
35
|
-
Object.defineProperty(exports, "Jurisdiction", { enumerable: true, get: function () { return corporate_js_1.Jurisdiction; } });
|
|
36
|
-
Object.defineProperty(exports, "ShareClass", { enumerable: true, get: function () { return corporate_js_1.ShareClass; } });
|
|
37
|
-
Object.defineProperty(exports, "CorporateEntity", { enumerable: true, get: function () { return corporate_js_1.CorporateEntity; } });
|
|
38
|
-
Object.defineProperty(exports, "RegisteredAgent", { enumerable: true, get: function () { return corporate_js_1.RegisteredAgent; } });
|
|
39
|
-
Object.defineProperty(exports, "Incorporator", { enumerable: true, get: function () { return corporate_js_1.Incorporator; } });
|
|
40
|
-
Object.defineProperty(exports, "ShareStructure", { enumerable: true, get: function () { return corporate_js_1.ShareStructure; } });
|
|
41
|
-
Object.defineProperty(exports, "CorporateBoard", { enumerable: true, get: function () { return corporate_js_1.CorporateBoard; } });
|
|
42
|
-
Object.defineProperty(exports, "Director", { enumerable: true, get: function () { return corporate_js_1.Director; } });
|
|
43
|
-
Object.defineProperty(exports, "SeatInfo", { enumerable: true, get: function () { return corporate_js_1.SeatInfo; } });
|
|
44
|
-
Object.defineProperty(exports, "QuorumRules", { enumerable: true, get: function () { return corporate_js_1.QuorumRules; } });
|
|
45
|
-
Object.defineProperty(exports, "BoardMeeting", { enumerable: true, get: function () { return corporate_js_1.BoardMeeting; } });
|
|
46
|
-
Object.defineProperty(exports, "MeetingAttendee", { enumerable: true, get: function () { return corporate_js_1.MeetingAttendee; } });
|
|
47
|
-
Object.defineProperty(exports, "CorporateOfficers", { enumerable: true, get: function () { return corporate_js_1.CorporateOfficers; } });
|
|
48
|
-
Object.defineProperty(exports, "Officer", { enumerable: true, get: function () { return corporate_js_1.Officer; } });
|
|
49
|
-
Object.defineProperty(exports, "OfficerAction", { enumerable: true, get: function () { return corporate_js_1.OfficerAction; } });
|
|
50
|
-
Object.defineProperty(exports, "CorporateShareholders", { enumerable: true, get: function () { return corporate_js_1.CorporateShareholders; } });
|
|
51
|
-
Object.defineProperty(exports, "Shareholder", { enumerable: true, get: function () { return corporate_js_1.Shareholder; } });
|
|
52
|
-
Object.defineProperty(exports, "ShareHolding", { enumerable: true, get: function () { return corporate_js_1.ShareHolding; } });
|
|
53
|
-
Object.defineProperty(exports, "CorporateResolution", { enumerable: true, get: function () { return corporate_js_1.CorporateResolution; } });
|
|
54
|
-
Object.defineProperty(exports, "ResolutionVote", { enumerable: true, get: function () { return corporate_js_1.ResolutionVote; } });
|
|
55
|
-
Object.defineProperty(exports, "CorporateSecurities", { enumerable: true, get: function () { return corporate_js_1.CorporateSecurities; } });
|
|
56
|
-
Object.defineProperty(exports, "SecurityIssuance", { enumerable: true, get: function () { return corporate_js_1.SecurityIssuance; } });
|
|
57
|
-
Object.defineProperty(exports, "SecurityTransfer", { enumerable: true, get: function () { return corporate_js_1.SecurityTransfer; } });
|
|
58
|
-
Object.defineProperty(exports, "CorporateCompliance", { enumerable: true, get: function () { return corporate_js_1.CorporateCompliance; } });
|
|
59
|
-
Object.defineProperty(exports, "FilingRecord", { enumerable: true, get: function () { return corporate_js_1.FilingRecord; } });
|
|
60
|
-
Object.defineProperty(exports, "ComplianceRequirement", { enumerable: true, get: function () { return corporate_js_1.ComplianceRequirement; } });
|
|
61
|
-
Object.defineProperty(exports, "CreateEntityRequest", { enumerable: true, get: function () { return corporate_js_1.CreateEntityRequest; } });
|
|
62
|
-
Object.defineProperty(exports, "AppointDirectorRequest", { enumerable: true, get: function () { return corporate_js_1.AppointDirectorRequest; } });
|
|
63
|
-
Object.defineProperty(exports, "IssueSharesRequest", { enumerable: true, get: function () { return corporate_js_1.IssueSharesRequest; } });
|
|
64
|
-
Object.defineProperty(exports, "ProposeResolutionRequest", { enumerable: true, get: function () { return corporate_js_1.ProposeResolutionRequest; } });
|
|
65
|
-
Object.defineProperty(exports, "entityTypeFromJSON", { enumerable: true, get: function () { return corporate_js_1.entityTypeFromJSON; } });
|
|
66
|
-
Object.defineProperty(exports, "entityTypeToJSON", { enumerable: true, get: function () { return corporate_js_1.entityTypeToJSON; } });
|
|
67
|
-
Object.defineProperty(exports, "entityStateFromJSON", { enumerable: true, get: function () { return corporate_js_1.entityStateFromJSON; } });
|
|
68
|
-
Object.defineProperty(exports, "entityStateToJSON", { enumerable: true, get: function () { return corporate_js_1.entityStateToJSON; } });
|
|
69
|
-
Object.defineProperty(exports, "directorStatusFromJSON", { enumerable: true, get: function () { return corporate_js_1.directorStatusFromJSON; } });
|
|
70
|
-
Object.defineProperty(exports, "directorStatusToJSON", { enumerable: true, get: function () { return corporate_js_1.directorStatusToJSON; } });
|
|
71
|
-
Object.defineProperty(exports, "officerStatusFromJSON", { enumerable: true, get: function () { return corporate_js_1.officerStatusFromJSON; } });
|
|
72
|
-
Object.defineProperty(exports, "officerStatusToJSON", { enumerable: true, get: function () { return corporate_js_1.officerStatusToJSON; } });
|
|
73
|
-
Object.defineProperty(exports, "boardMeetingTypeFromJSON", { enumerable: true, get: function () { return corporate_js_1.boardMeetingTypeFromJSON; } });
|
|
74
|
-
Object.defineProperty(exports, "boardMeetingTypeToJSON", { enumerable: true, get: function () { return corporate_js_1.boardMeetingTypeToJSON; } });
|
|
75
|
-
Object.defineProperty(exports, "resolutionStatusFromJSON", { enumerable: true, get: function () { return corporate_js_1.resolutionStatusFromJSON; } });
|
|
76
|
-
Object.defineProperty(exports, "resolutionStatusToJSON", { enumerable: true, get: function () { return corporate_js_1.resolutionStatusToJSON; } });
|
|
22
|
+
export { EntityType, EntityState, DirectorStatus, OfficerStatus, BoardMeetingType, ResolutionStatus, Jurisdiction, ShareClass, CorporateEntity, RegisteredAgent, Incorporator, ShareStructure, CorporateBoard, Director, SeatInfo, QuorumRules, BoardMeeting, MeetingAttendee, CorporateOfficers, Officer, OfficerAction, CorporateShareholders, Shareholder, ShareHolding, CorporateResolution, ResolutionVote, CorporateSecurities, SecurityIssuance, SecurityTransfer, CorporateCompliance, FilingRecord, ComplianceRequirement, CreateEntityRequest, AppointDirectorRequest, IssueSharesRequest, ProposeResolutionRequest, entityTypeFromJSON, entityTypeToJSON, entityStateFromJSON, entityStateToJSON, directorStatusFromJSON, directorStatusToJSON, officerStatusFromJSON, officerStatusToJSON, boardMeetingTypeFromJSON, boardMeetingTypeToJSON, resolutionStatusFromJSON, resolutionStatusToJSON, } from '../../generated/ottochain/apps/corporate/v1/corporate.js';
|
|
77
23
|
// ---------------------------------------------------------------------------
|
|
78
24
|
// State Machine JSON Definitions
|
|
79
25
|
// ---------------------------------------------------------------------------
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Entity:
|
|
92
|
-
Board:
|
|
93
|
-
Shareholders:
|
|
94
|
-
Officers:
|
|
95
|
-
Securities:
|
|
96
|
-
Compliance:
|
|
97
|
-
Bylaws:
|
|
98
|
-
Committee:
|
|
99
|
-
Proxy:
|
|
100
|
-
Resolution:
|
|
26
|
+
import corporateEntityDef from './state-machines/corporate-entity.json';
|
|
27
|
+
import corporateBoardDef from './state-machines/corporate-board.json';
|
|
28
|
+
import corporateShareholdersDef from './state-machines/corporate-shareholders.json';
|
|
29
|
+
import corporateOfficersDef from './state-machines/corporate-officers.json';
|
|
30
|
+
import corporateSecuritiesDef from './state-machines/corporate-securities.json';
|
|
31
|
+
import corporateComplianceDef from './state-machines/corporate-compliance.json';
|
|
32
|
+
import corporateBylawsDef from './state-machines/corporate-bylaws.json';
|
|
33
|
+
import corporateCommitteeDef from './state-machines/corporate-committee.json';
|
|
34
|
+
import corporateProxyDef from './state-machines/corporate-proxy.json';
|
|
35
|
+
import corporateResolutionDef from './state-machines/corporate-resolution.json';
|
|
36
|
+
export const CORPORATE_DEFINITIONS = {
|
|
37
|
+
Entity: corporateEntityDef,
|
|
38
|
+
Board: corporateBoardDef,
|
|
39
|
+
Shareholders: corporateShareholdersDef,
|
|
40
|
+
Officers: corporateOfficersDef,
|
|
41
|
+
Securities: corporateSecuritiesDef,
|
|
42
|
+
Compliance: corporateComplianceDef,
|
|
43
|
+
Bylaws: corporateBylawsDef,
|
|
44
|
+
Committee: corporateCommitteeDef,
|
|
45
|
+
Proxy: corporateProxyDef,
|
|
46
|
+
Resolution: corporateResolutionDef,
|
|
101
47
|
};
|
|
102
48
|
/**
|
|
103
49
|
* Get the state machine definition for a corporate type.
|
|
104
50
|
*/
|
|
105
|
-
function getCorporateDefinition(type) {
|
|
106
|
-
const def =
|
|
51
|
+
export function getCorporateDefinition(type) {
|
|
52
|
+
const def = CORPORATE_DEFINITIONS[type];
|
|
107
53
|
if (!def) {
|
|
108
54
|
throw new Error(`Unknown corporate type: ${type}`);
|
|
109
55
|
}
|
|
110
56
|
return def;
|
|
111
57
|
}
|
|
112
|
-
exports.getCorporateDefinition = getCorporateDefinition;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Governance & DAO Application
|
|
4
3
|
*
|
|
@@ -18,122 +17,81 @@
|
|
|
18
17
|
*
|
|
19
18
|
* @packageDocumentation
|
|
20
19
|
*/
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.thresholdHasQuorum = exports.isMember = exports.meetsThreshold = exports.canPropose = exports.isPassing = exports.hasQuorum = exports.getVotingPower = exports.hasSigned = exports.isSigner = exports.signaturesNeeded = exports.isThresholdMet = exports.getGovernanceDefinition = exports.getDAODefinition = exports.GOVERNANCE_DEFINITIONS = exports.DAO_DEFINITIONS = exports.voteChoiceToJSON = exports.voteChoiceFromJSON = exports.proposalStatusToJSON = exports.proposalStatusFromJSON = exports.dAOStatusToJSON = exports.dAOStatusFromJSON = exports.dAOTypeToJSON = exports.dAOTypeFromJSON = exports.ExecuteRequest = exports.VoteRequest = exports.ProposeRequest = exports.CreateDAORequest = exports.ThresholdHistoryEntry = exports.ThresholdVotes = exports.ThresholdDAO = exports.TokenProposalResult = exports.TokenDAO = exports.MultisigAction = exports.MultisigDAO = exports.OwnershipTransfer = exports.SingleOwnerAction = exports.SingleOwnerDAO = exports.VoteTally = exports.Vote = exports.Proposal = exports.DAOMetadata = exports.VoteChoice = exports.ProposalStatus = exports.DAOStatus = exports.DAOType = void 0;
|
|
26
20
|
// Re-export generated protobuf types (source of truth)
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, "DAOType", { enumerable: true, get: function () { return governance_js_1.DAOType; } });
|
|
29
|
-
Object.defineProperty(exports, "DAOStatus", { enumerable: true, get: function () { return governance_js_1.DAOStatus; } });
|
|
30
|
-
Object.defineProperty(exports, "ProposalStatus", { enumerable: true, get: function () { return governance_js_1.ProposalStatus; } });
|
|
31
|
-
Object.defineProperty(exports, "VoteChoice", { enumerable: true, get: function () { return governance_js_1.VoteChoice; } });
|
|
32
|
-
Object.defineProperty(exports, "DAOMetadata", { enumerable: true, get: function () { return governance_js_1.DAOMetadata; } });
|
|
33
|
-
Object.defineProperty(exports, "Proposal", { enumerable: true, get: function () { return governance_js_1.Proposal; } });
|
|
34
|
-
Object.defineProperty(exports, "Vote", { enumerable: true, get: function () { return governance_js_1.Vote; } });
|
|
35
|
-
Object.defineProperty(exports, "VoteTally", { enumerable: true, get: function () { return governance_js_1.VoteTally; } });
|
|
36
|
-
Object.defineProperty(exports, "SingleOwnerDAO", { enumerable: true, get: function () { return governance_js_1.SingleOwnerDAO; } });
|
|
37
|
-
Object.defineProperty(exports, "SingleOwnerAction", { enumerable: true, get: function () { return governance_js_1.SingleOwnerAction; } });
|
|
38
|
-
Object.defineProperty(exports, "OwnershipTransfer", { enumerable: true, get: function () { return governance_js_1.OwnershipTransfer; } });
|
|
39
|
-
Object.defineProperty(exports, "MultisigDAO", { enumerable: true, get: function () { return governance_js_1.MultisigDAO; } });
|
|
40
|
-
Object.defineProperty(exports, "MultisigAction", { enumerable: true, get: function () { return governance_js_1.MultisigAction; } });
|
|
41
|
-
Object.defineProperty(exports, "TokenDAO", { enumerable: true, get: function () { return governance_js_1.TokenDAO; } });
|
|
42
|
-
Object.defineProperty(exports, "TokenProposalResult", { enumerable: true, get: function () { return governance_js_1.TokenProposalResult; } });
|
|
43
|
-
Object.defineProperty(exports, "ThresholdDAO", { enumerable: true, get: function () { return governance_js_1.ThresholdDAO; } });
|
|
44
|
-
Object.defineProperty(exports, "ThresholdVotes", { enumerable: true, get: function () { return governance_js_1.ThresholdVotes; } });
|
|
45
|
-
Object.defineProperty(exports, "ThresholdHistoryEntry", { enumerable: true, get: function () { return governance_js_1.ThresholdHistoryEntry; } });
|
|
46
|
-
Object.defineProperty(exports, "CreateDAORequest", { enumerable: true, get: function () { return governance_js_1.CreateDAORequest; } });
|
|
47
|
-
Object.defineProperty(exports, "ProposeRequest", { enumerable: true, get: function () { return governance_js_1.ProposeRequest; } });
|
|
48
|
-
Object.defineProperty(exports, "VoteRequest", { enumerable: true, get: function () { return governance_js_1.VoteRequest; } });
|
|
49
|
-
Object.defineProperty(exports, "ExecuteRequest", { enumerable: true, get: function () { return governance_js_1.ExecuteRequest; } });
|
|
50
|
-
Object.defineProperty(exports, "dAOTypeFromJSON", { enumerable: true, get: function () { return governance_js_1.dAOTypeFromJSON; } });
|
|
51
|
-
Object.defineProperty(exports, "dAOTypeToJSON", { enumerable: true, get: function () { return governance_js_1.dAOTypeToJSON; } });
|
|
52
|
-
Object.defineProperty(exports, "dAOStatusFromJSON", { enumerable: true, get: function () { return governance_js_1.dAOStatusFromJSON; } });
|
|
53
|
-
Object.defineProperty(exports, "dAOStatusToJSON", { enumerable: true, get: function () { return governance_js_1.dAOStatusToJSON; } });
|
|
54
|
-
Object.defineProperty(exports, "proposalStatusFromJSON", { enumerable: true, get: function () { return governance_js_1.proposalStatusFromJSON; } });
|
|
55
|
-
Object.defineProperty(exports, "proposalStatusToJSON", { enumerable: true, get: function () { return governance_js_1.proposalStatusToJSON; } });
|
|
56
|
-
Object.defineProperty(exports, "voteChoiceFromJSON", { enumerable: true, get: function () { return governance_js_1.voteChoiceFromJSON; } });
|
|
57
|
-
Object.defineProperty(exports, "voteChoiceToJSON", { enumerable: true, get: function () { return governance_js_1.voteChoiceToJSON; } });
|
|
21
|
+
export { DAOType, DAOStatus, ProposalStatus, VoteChoice, DAOMetadata, Proposal, Vote, VoteTally, SingleOwnerDAO, SingleOwnerAction, OwnershipTransfer, MultisigDAO, MultisigAction, TokenDAO, TokenProposalResult, ThresholdDAO, ThresholdVotes, ThresholdHistoryEntry, CreateDAORequest, ProposeRequest, VoteRequest, ExecuteRequest, dAOTypeFromJSON, dAOTypeToJSON, dAOStatusFromJSON, dAOStatusToJSON, proposalStatusFromJSON, proposalStatusToJSON, voteChoiceFromJSON, voteChoiceToJSON, } from '../../generated/ottochain/apps/governance/v1/governance.js';
|
|
58
22
|
// ---------------------------------------------------------------------------
|
|
59
23
|
// State Machine JSON Definitions
|
|
60
24
|
// ---------------------------------------------------------------------------
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Single:
|
|
72
|
-
Multisig:
|
|
73
|
-
Threshold:
|
|
74
|
-
Token:
|
|
25
|
+
import daoMultisigDef from './state-machines/dao-multisig.json';
|
|
26
|
+
import daoSingleDef from './state-machines/dao-single.json';
|
|
27
|
+
import daoThresholdDef from './state-machines/dao-threshold.json';
|
|
28
|
+
import daoTokenDef from './state-machines/dao-token.json';
|
|
29
|
+
import govLegislatureDef from './state-machines/governance-legislature.json';
|
|
30
|
+
import govExecutiveDef from './state-machines/governance-executive.json';
|
|
31
|
+
import govJudiciaryDef from './state-machines/governance-judiciary.json';
|
|
32
|
+
import govConstitutionDef from './state-machines/governance-constitution.json';
|
|
33
|
+
import govSimpleDef from './state-machines/governance-simple.json';
|
|
34
|
+
export const DAO_DEFINITIONS = {
|
|
35
|
+
Single: daoSingleDef,
|
|
36
|
+
Multisig: daoMultisigDef,
|
|
37
|
+
Threshold: daoThresholdDef,
|
|
38
|
+
Token: daoTokenDef,
|
|
75
39
|
};
|
|
76
|
-
|
|
77
|
-
Legislature:
|
|
78
|
-
Executive:
|
|
79
|
-
Judiciary:
|
|
80
|
-
Constitution:
|
|
81
|
-
Simple:
|
|
40
|
+
export const GOVERNANCE_DEFINITIONS = {
|
|
41
|
+
Legislature: govLegislatureDef,
|
|
42
|
+
Executive: govExecutiveDef,
|
|
43
|
+
Judiciary: govJudiciaryDef,
|
|
44
|
+
Constitution: govConstitutionDef,
|
|
45
|
+
Simple: govSimpleDef,
|
|
82
46
|
};
|
|
83
47
|
/**
|
|
84
48
|
* Get the state machine definition for a DAO type.
|
|
85
49
|
*/
|
|
86
|
-
function getDAODefinition(daoType) {
|
|
87
|
-
const def =
|
|
50
|
+
export function getDAODefinition(daoType) {
|
|
51
|
+
const def = DAO_DEFINITIONS[daoType];
|
|
88
52
|
if (!def) {
|
|
89
53
|
throw new Error(`Unknown DAO type: ${daoType}`);
|
|
90
54
|
}
|
|
91
55
|
return def;
|
|
92
56
|
}
|
|
93
|
-
exports.getDAODefinition = getDAODefinition;
|
|
94
57
|
/**
|
|
95
58
|
* Get the state machine definition for a governance type.
|
|
96
59
|
*/
|
|
97
|
-
function getGovernanceDefinition(governanceType) {
|
|
98
|
-
const def =
|
|
60
|
+
export function getGovernanceDefinition(governanceType) {
|
|
61
|
+
const def = GOVERNANCE_DEFINITIONS[governanceType];
|
|
99
62
|
if (!def) {
|
|
100
63
|
throw new Error(`Unknown governance type: ${governanceType}`);
|
|
101
64
|
}
|
|
102
65
|
return def;
|
|
103
66
|
}
|
|
104
|
-
exports.getGovernanceDefinition = getGovernanceDefinition;
|
|
105
67
|
/**
|
|
106
68
|
* Check if multisig has enough signatures to execute
|
|
107
69
|
*/
|
|
108
|
-
function isThresholdMet(state) {
|
|
70
|
+
export function isThresholdMet(state) {
|
|
109
71
|
return Object.keys(state.signatures).length >= state.threshold;
|
|
110
72
|
}
|
|
111
|
-
exports.isThresholdMet = isThresholdMet;
|
|
112
73
|
/**
|
|
113
74
|
* Get remaining signatures needed
|
|
114
75
|
*/
|
|
115
|
-
function signaturesNeeded(state) {
|
|
76
|
+
export function signaturesNeeded(state) {
|
|
116
77
|
return Math.max(0, state.threshold - Object.keys(state.signatures).length);
|
|
117
78
|
}
|
|
118
|
-
exports.signaturesNeeded = signaturesNeeded;
|
|
119
79
|
/**
|
|
120
80
|
* Check if agent is a signer
|
|
121
81
|
*/
|
|
122
|
-
function isSigner(state, agent) {
|
|
82
|
+
export function isSigner(state, agent) {
|
|
123
83
|
return state.signers.includes(agent);
|
|
124
84
|
}
|
|
125
|
-
exports.isSigner = isSigner;
|
|
126
85
|
/**
|
|
127
86
|
* Check if agent has signed current proposal
|
|
128
87
|
*/
|
|
129
|
-
function hasSigned(state, agent) {
|
|
88
|
+
export function hasSigned(state, agent) {
|
|
130
89
|
return agent in state.signatures;
|
|
131
90
|
}
|
|
132
|
-
exports.hasSigned = hasSigned;
|
|
133
91
|
/**
|
|
134
92
|
* Get effective voting power (includes delegation)
|
|
135
93
|
*/
|
|
136
|
-
function getVotingPower(state, agent) {
|
|
94
|
+
export function getVotingPower(state, agent) {
|
|
137
95
|
let power = state.balances[agent] ?? 0;
|
|
138
96
|
// Add delegated power
|
|
139
97
|
for (const [delegator, delegatee] of Object.entries(state.delegations)) {
|
|
@@ -143,37 +101,33 @@ function getVotingPower(state, agent) {
|
|
|
143
101
|
}
|
|
144
102
|
return power;
|
|
145
103
|
}
|
|
146
|
-
exports.getVotingPower = getVotingPower;
|
|
147
104
|
/**
|
|
148
105
|
* Check if proposal has quorum
|
|
149
106
|
*/
|
|
150
|
-
function hasQuorum(state) {
|
|
107
|
+
export function hasQuorum(state) {
|
|
151
108
|
if (!state.votes)
|
|
152
109
|
return false;
|
|
153
110
|
const totalVoted = state.votes.votesFor + state.votes.votesAgainst + state.votes.votesAbstain;
|
|
154
111
|
return totalVoted >= state.quorum;
|
|
155
112
|
}
|
|
156
|
-
exports.hasQuorum = hasQuorum;
|
|
157
113
|
/**
|
|
158
114
|
* Check if proposal is passing
|
|
159
115
|
*/
|
|
160
|
-
function isPassing(state) {
|
|
116
|
+
export function isPassing(state) {
|
|
161
117
|
if (!state.votes)
|
|
162
118
|
return false;
|
|
163
119
|
return state.votes.votesFor > state.votes.votesAgainst && hasQuorum(state);
|
|
164
120
|
}
|
|
165
|
-
exports.isPassing = isPassing;
|
|
166
121
|
/**
|
|
167
122
|
* Check if agent can propose
|
|
168
123
|
*/
|
|
169
|
-
function canPropose(state, agent) {
|
|
124
|
+
export function canPropose(state, agent) {
|
|
170
125
|
return (state.balances[agent] ?? 0) >= state.proposalThreshold;
|
|
171
126
|
}
|
|
172
|
-
exports.canPropose = canPropose;
|
|
173
127
|
/**
|
|
174
128
|
* Check if agent meets threshold for action
|
|
175
129
|
*/
|
|
176
|
-
function meetsThreshold(state, reputation, action) {
|
|
130
|
+
export function meetsThreshold(state, reputation, action) {
|
|
177
131
|
switch (action) {
|
|
178
132
|
case 'member':
|
|
179
133
|
return reputation >= state.memberThreshold;
|
|
@@ -183,21 +137,18 @@ function meetsThreshold(state, reputation, action) {
|
|
|
183
137
|
return reputation >= state.proposeThreshold;
|
|
184
138
|
}
|
|
185
139
|
}
|
|
186
|
-
exports.meetsThreshold = meetsThreshold;
|
|
187
140
|
/**
|
|
188
141
|
* Check if agent is a member
|
|
189
142
|
*/
|
|
190
|
-
function isMember(state, agent) {
|
|
143
|
+
export function isMember(state, agent) {
|
|
191
144
|
return state.members.includes(agent);
|
|
192
145
|
}
|
|
193
|
-
exports.isMember = isMember;
|
|
194
146
|
/**
|
|
195
147
|
* Check if threshold proposal has quorum
|
|
196
148
|
*/
|
|
197
|
-
function thresholdHasQuorum(state) {
|
|
149
|
+
export function thresholdHasQuorum(state) {
|
|
198
150
|
if (!state.votes)
|
|
199
151
|
return false;
|
|
200
152
|
const totalVoted = state.votes.votesFor.length + state.votes.votesAgainst.length;
|
|
201
153
|
return totalVoted >= state.quorum;
|
|
202
154
|
}
|
|
203
|
-
exports.thresholdHasQuorum = thresholdHasQuorum;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Identity Constants
|
|
4
3
|
*
|
|
@@ -6,10 +5,8 @@
|
|
|
6
5
|
*
|
|
7
6
|
* @packageDocumentation
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const agent_js_1 = require("../../generated/ottochain/apps/identity/v1/agent.js");
|
|
12
|
-
const attestation_js_1 = require("../../generated/ottochain/apps/identity/v1/attestation.js");
|
|
8
|
+
import { AgentState } from '../../generated/ottochain/apps/identity/v1/agent.js';
|
|
9
|
+
import { AttestationType } from '../../generated/ottochain/apps/identity/v1/attestation.js';
|
|
13
10
|
// ---------------------------------------------------------------------------
|
|
14
11
|
// State Machine Transitions
|
|
15
12
|
// ---------------------------------------------------------------------------
|
|
@@ -17,15 +14,15 @@ const attestation_js_1 = require("../../generated/ottochain/apps/identity/v1/att
|
|
|
17
14
|
* Valid transitions for each agent state.
|
|
18
15
|
* Maps current state to allowed event names.
|
|
19
16
|
*/
|
|
20
|
-
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
17
|
+
export const AGENT_TRANSITIONS = {
|
|
18
|
+
[AgentState.AGENT_STATE_UNSPECIFIED]: [],
|
|
19
|
+
[AgentState.AGENT_STATE_REGISTERED]: ['activate', 'withdraw'],
|
|
20
|
+
[AgentState.AGENT_STATE_ACTIVE]: ['challenge', 'withdraw'],
|
|
21
|
+
[AgentState.AGENT_STATE_CHALLENGED]: ['uphold_challenge', 'dismiss_challenge'],
|
|
22
|
+
[AgentState.AGENT_STATE_SUSPENDED]: ['begin_probation'],
|
|
23
|
+
[AgentState.AGENT_STATE_PROBATION]: ['complete_probation'],
|
|
24
|
+
[AgentState.AGENT_STATE_WITHDRAWN]: [], // Terminal state
|
|
25
|
+
[AgentState.UNRECOGNIZED]: [],
|
|
29
26
|
};
|
|
30
27
|
// ---------------------------------------------------------------------------
|
|
31
28
|
// Reputation Configuration
|
|
@@ -34,25 +31,23 @@ exports.AGENT_TRANSITIONS = {
|
|
|
34
31
|
* Reputation delta by attestation type.
|
|
35
32
|
* These values match the metagraph state machine defaults.
|
|
36
33
|
*/
|
|
37
|
-
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
34
|
+
export const ATTESTATION_DELTAS = {
|
|
35
|
+
[AttestationType.ATTESTATION_TYPE_UNSPECIFIED]: 0,
|
|
36
|
+
[AttestationType.ATTESTATION_TYPE_COMPLETION]: 5,
|
|
37
|
+
[AttestationType.ATTESTATION_TYPE_VOUCH]: 2,
|
|
38
|
+
[AttestationType.ATTESTATION_TYPE_VIOLATION]: -10,
|
|
39
|
+
[AttestationType.ATTESTATION_TYPE_BEHAVIORAL]: 3,
|
|
40
|
+
[AttestationType.UNRECOGNIZED]: 0,
|
|
44
41
|
};
|
|
45
42
|
/**
|
|
46
43
|
* Check if a transition is valid for the given state.
|
|
47
44
|
*/
|
|
48
|
-
function canTransition(state, event) {
|
|
49
|
-
return
|
|
45
|
+
export function canTransition(state, event) {
|
|
46
|
+
return AGENT_TRANSITIONS[state]?.includes(event) ?? false;
|
|
50
47
|
}
|
|
51
|
-
exports.canTransition = canTransition;
|
|
52
48
|
/**
|
|
53
49
|
* Get reputation delta for an attestation type.
|
|
54
50
|
*/
|
|
55
|
-
function getReputationDelta(type) {
|
|
56
|
-
return
|
|
51
|
+
export function getReputationDelta(type) {
|
|
52
|
+
return ATTESTATION_DELTAS[type] ?? 0;
|
|
57
53
|
}
|
|
58
|
-
exports.getReputationDelta = getReputationDelta;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Agent Identity Application
|
|
4
3
|
*
|
|
@@ -17,44 +16,18 @@
|
|
|
17
16
|
*
|
|
18
17
|
* @packageDocumentation
|
|
19
18
|
*/
|
|
20
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.getIdentityDefinition = exports.DEFAULT_REPUTATION_CONFIG = exports.getReputationDelta = exports.canTransition = exports.ATTESTATION_DELTAS = exports.AGENT_TRANSITIONS = exports.attestationTypeToJSON = exports.attestationTypeFromJSON = exports.ReputationConfig = exports.ChallengeRequest = exports.VouchRequest = exports.Attestation = exports.ReputationDelta = exports.AttestationType = exports.platformToJSON = exports.platformFromJSON = exports.agentStateToJSON = exports.agentStateFromJSON = exports.AgentIdentityDefinition = exports.AgentIdentity = exports.PlatformLink = exports.Platform = exports.AgentState = void 0;
|
|
25
19
|
// Re-export generated protobuf types (source of truth)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return agent_js_1.Platform; } });
|
|
29
|
-
Object.defineProperty(exports, "PlatformLink", { enumerable: true, get: function () { return agent_js_1.PlatformLink; } });
|
|
30
|
-
Object.defineProperty(exports, "AgentIdentity", { enumerable: true, get: function () { return agent_js_1.AgentIdentity; } });
|
|
31
|
-
Object.defineProperty(exports, "AgentIdentityDefinition", { enumerable: true, get: function () { return agent_js_1.AgentIdentityDefinition; } });
|
|
32
|
-
Object.defineProperty(exports, "agentStateFromJSON", { enumerable: true, get: function () { return agent_js_1.agentStateFromJSON; } });
|
|
33
|
-
Object.defineProperty(exports, "agentStateToJSON", { enumerable: true, get: function () { return agent_js_1.agentStateToJSON; } });
|
|
34
|
-
Object.defineProperty(exports, "platformFromJSON", { enumerable: true, get: function () { return agent_js_1.platformFromJSON; } });
|
|
35
|
-
Object.defineProperty(exports, "platformToJSON", { enumerable: true, get: function () { return agent_js_1.platformToJSON; } });
|
|
36
|
-
var attestation_js_1 = require("../../generated/ottochain/apps/identity/v1/attestation.js");
|
|
37
|
-
Object.defineProperty(exports, "AttestationType", { enumerable: true, get: function () { return attestation_js_1.AttestationType; } });
|
|
38
|
-
Object.defineProperty(exports, "ReputationDelta", { enumerable: true, get: function () { return attestation_js_1.ReputationDelta; } });
|
|
39
|
-
Object.defineProperty(exports, "Attestation", { enumerable: true, get: function () { return attestation_js_1.Attestation; } });
|
|
40
|
-
Object.defineProperty(exports, "VouchRequest", { enumerable: true, get: function () { return attestation_js_1.VouchRequest; } });
|
|
41
|
-
Object.defineProperty(exports, "ChallengeRequest", { enumerable: true, get: function () { return attestation_js_1.ChallengeRequest; } });
|
|
42
|
-
Object.defineProperty(exports, "ReputationConfig", { enumerable: true, get: function () { return attestation_js_1.ReputationConfig; } });
|
|
43
|
-
Object.defineProperty(exports, "attestationTypeFromJSON", { enumerable: true, get: function () { return attestation_js_1.attestationTypeFromJSON; } });
|
|
44
|
-
Object.defineProperty(exports, "attestationTypeToJSON", { enumerable: true, get: function () { return attestation_js_1.attestationTypeToJSON; } });
|
|
20
|
+
export { AgentState, Platform, PlatformLink, AgentIdentity, AgentIdentityDefinition, agentStateFromJSON, agentStateToJSON, platformFromJSON, platformToJSON, } from '../../generated/ottochain/apps/identity/v1/agent.js';
|
|
21
|
+
export { AttestationType, ReputationDelta, Attestation, VouchRequest, ChallengeRequest, ReputationConfig, attestationTypeFromJSON, attestationTypeToJSON, } from '../../generated/ottochain/apps/identity/v1/attestation.js';
|
|
45
22
|
// Re-export constants and utilities
|
|
46
|
-
|
|
47
|
-
Object.defineProperty(exports, "AGENT_TRANSITIONS", { enumerable: true, get: function () { return constants_js_1.AGENT_TRANSITIONS; } });
|
|
48
|
-
Object.defineProperty(exports, "ATTESTATION_DELTAS", { enumerable: true, get: function () { return constants_js_1.ATTESTATION_DELTAS; } });
|
|
49
|
-
Object.defineProperty(exports, "canTransition", { enumerable: true, get: function () { return constants_js_1.canTransition; } });
|
|
50
|
-
Object.defineProperty(exports, "getReputationDelta", { enumerable: true, get: function () { return constants_js_1.getReputationDelta; } });
|
|
23
|
+
export { AGENT_TRANSITIONS, ATTESTATION_DELTAS, canTransition, getReputationDelta, } from './constants.js';
|
|
51
24
|
// ---------------------------------------------------------------------------
|
|
52
25
|
// Configuration Defaults
|
|
53
26
|
// ---------------------------------------------------------------------------
|
|
54
27
|
/**
|
|
55
28
|
* Default reputation configuration for agent identity
|
|
56
29
|
*/
|
|
57
|
-
|
|
30
|
+
export const DEFAULT_REPUTATION_CONFIG = {
|
|
58
31
|
baseReputation: 10,
|
|
59
32
|
completionDelta: 5,
|
|
60
33
|
vouchDelta: 2,
|
|
@@ -66,13 +39,12 @@ exports.DEFAULT_REPUTATION_CONFIG = {
|
|
|
66
39
|
// ---------------------------------------------------------------------------
|
|
67
40
|
// State Machine JSON Definition
|
|
68
41
|
// ---------------------------------------------------------------------------
|
|
69
|
-
|
|
42
|
+
import agentIdentityDef from './state-machines/agent-identity.json';
|
|
70
43
|
/**
|
|
71
44
|
* Get the agent identity state machine definition.
|
|
72
45
|
*
|
|
73
46
|
* @returns The state machine definition JSON for AgentIdentity
|
|
74
47
|
*/
|
|
75
|
-
function getIdentityDefinition() {
|
|
76
|
-
return
|
|
48
|
+
export function getIdentityDefinition() {
|
|
49
|
+
return agentIdentityDef;
|
|
77
50
|
}
|
|
78
|
-
exports.getIdentityDefinition = getIdentityDefinition;
|