@verana-labs/vs-agent-sdk 1.12.0-dev.1 → 1.12.0-dev.11
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 +7 -26
- package/build/agent/VsAgent.d.ts +6 -0
- package/build/agent/VsAgent.js +14 -4
- package/build/agent/VsAgent.js.map +1 -1
- package/build/agent/createVsAgent.d.ts +1 -0
- package/build/agent/createVsAgent.js +1 -0
- package/build/agent/createVsAgent.js.map +1 -1
- package/build/blockchain/IndexerWebSocketService.d.ts +0 -4
- package/build/blockchain/IndexerWebSocketService.js +30 -30
- package/build/blockchain/IndexerWebSocketService.js.map +1 -1
- package/build/blockchain/VeranaChainService.d.ts +14 -15
- package/build/blockchain/VeranaChainService.js +122 -63
- package/build/blockchain/VeranaChainService.js.map +1 -1
- package/build/blockchain/VeranaHelpers.js +2 -2
- package/build/blockchain/VeranaHelpers.js.map +1 -1
- package/build/blockchain/VeranaIndexerService.d.ts +3 -4
- package/build/blockchain/VeranaIndexerService.js +8 -19
- package/build/blockchain/VeranaIndexerService.js.map +1 -1
- package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +1 -0
- package/build/blockchain/handlers/IndexerHandlerRegistry.js.map +1 -1
- package/build/blockchain/handlers/defaultHandlers.js +37 -32
- package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
- package/build/blockchain/handlers/stateMutations.d.ts +12 -4
- package/build/blockchain/handlers/stateMutations.js +103 -28
- package/build/blockchain/handlers/stateMutations.js.map +1 -1
- package/build/blockchain/types.d.ts +189 -49
- package/build/blockchain/types.js +8 -1
- package/build/blockchain/types.js.map +1 -1
- package/build/credentials/FullTailsFileService.d.ts +4 -4
- package/build/credentials/FullTailsFileService.js +78 -71
- package/build/credentials/FullTailsFileService.js.map +1 -1
- package/build/did/adminApiService.d.ts +2 -0
- package/build/did/adminApiService.js +17 -0
- package/build/did/adminApiService.js.map +1 -0
- package/build/index.d.ts +4 -4
- package/build/index.js +9 -6
- package/build/index.js.map +1 -1
- package/build/plugins/setupBaseDidComm.d.ts +3 -1
- package/build/plugins/setupBaseDidComm.js +3 -1
- package/build/plugins/setupBaseDidComm.js.map +1 -1
- package/build/types.d.ts +1 -0
- package/build/types.js +2 -1
- package/build/types.js.map +1 -1
- package/build/utils/trustCredentialStore.js +2 -0
- package/build/utils/trustCredentialStore.js.map +1 -1
- package/build/vtFlow/VtFlowOrchestrator.d.ts +38 -0
- package/build/vtFlow/VtFlowOrchestrator.js +247 -0
- package/build/vtFlow/VtFlowOrchestrator.js.map +1 -0
- package/build/vtFlow/assertVerifiableService.d.ts +8 -0
- package/build/vtFlow/assertVerifiableService.js +28 -0
- package/build/vtFlow/assertVerifiableService.js.map +1 -0
- package/build/vtFlow/credentialDigest.d.ts +3 -0
- package/build/vtFlow/credentialDigest.js +23 -0
- package/build/vtFlow/credentialDigest.js.map +1 -0
- package/build/vtFlow/index.d.ts +2 -0
- package/build/vtFlow/index.js +19 -0
- package/build/vtFlow/index.js.map +1 -0
- package/package.json +15 -11
|
@@ -1,40 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.upsertEcosystem = upsertEcosystem;
|
|
4
|
+
exports.bumpActiveVersion = bumpActiveVersion;
|
|
5
5
|
exports.upsertCredentialSchema = upsertCredentialSchema;
|
|
6
|
-
exports.
|
|
6
|
+
exports.upsertParticipant = upsertParticipant;
|
|
7
|
+
exports.reconcileVtFlowRecordsForParticipant = reconcileVtFlowRecordsForParticipant;
|
|
8
|
+
exports.markVtFlowRecordsValidated = markVtFlowRecordsValidated;
|
|
9
|
+
exports.setVtFlowRecordsParticipantRevoked = setVtFlowRecordsParticipantRevoked;
|
|
10
|
+
exports.setVtFlowRecordsParticipantSlashed = setVtFlowRecordsParticipantSlashed;
|
|
11
|
+
exports.terminateVtFlowRecordsByApplicant = terminateVtFlowRecordsByApplicant;
|
|
12
|
+
exports.startParticipantOPAutoFlow = startParticipantOPAutoFlow;
|
|
7
13
|
exports.publishVtjscIfOwner = publishVtjscIfOwner;
|
|
14
|
+
const credo_ts_didcomm_vt_flow_1 = require("@verana-labs/credo-ts-didcomm-vt-flow");
|
|
8
15
|
const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
|
|
9
16
|
const data_1 = require("../../utils/data");
|
|
10
17
|
const trustCredentialStore_1 = require("../../utils/trustCredentialStore");
|
|
18
|
+
const vtFlow_1 = require("../../vtFlow");
|
|
11
19
|
const DEFAULT_CHAIN_ID = 'vna-testnet-1';
|
|
12
|
-
function
|
|
20
|
+
function upsertEcosystem(state, activity) {
|
|
13
21
|
var _a, _b, _c, _d, _e, _f;
|
|
14
22
|
const block = Number(activity.block_height) || 0;
|
|
15
23
|
const id = String(activity.entity_id);
|
|
16
24
|
const c = activity.changes;
|
|
17
|
-
const existing = state.
|
|
18
|
-
state.
|
|
25
|
+
const existing = state.ecosystems[id];
|
|
26
|
+
state.ecosystems[id] = {
|
|
19
27
|
id: Number(id),
|
|
20
28
|
did: String((_b = (_a = c['did']) !== null && _a !== void 0 ? _a : existing === null || existing === void 0 ? void 0 : existing.did) !== null && _b !== void 0 ? _b : ''),
|
|
21
|
-
|
|
29
|
+
corporationId: Number((_d = (_c = c['corporation_id']) !== null && _c !== void 0 ? _c : existing === null || existing === void 0 ? void 0 : existing.corporationId) !== null && _d !== void 0 ? _d : 0),
|
|
22
30
|
archived: Boolean((_f = (_e = c['archived']) !== null && _e !== void 0 ? _e : existing === null || existing === void 0 ? void 0 : existing.archived) !== null && _f !== void 0 ? _f : false),
|
|
23
|
-
|
|
31
|
+
activeVersion: existing === null || existing === void 0 ? void 0 : existing.activeVersion,
|
|
24
32
|
lastModifiedBlock: block,
|
|
25
33
|
};
|
|
26
34
|
}
|
|
27
|
-
function
|
|
35
|
+
function bumpActiveVersion(state, activity) {
|
|
28
36
|
var _a, _b, _c, _d;
|
|
29
37
|
const block = Number(activity.block_height) || 0;
|
|
30
38
|
const id = String(activity.entity_id);
|
|
31
|
-
const existing = state.
|
|
32
|
-
state.
|
|
39
|
+
const existing = state.ecosystems[id];
|
|
40
|
+
state.ecosystems[id] = {
|
|
33
41
|
id: Number(id),
|
|
34
42
|
did: String((_a = existing === null || existing === void 0 ? void 0 : existing.did) !== null && _a !== void 0 ? _a : ''),
|
|
35
|
-
|
|
43
|
+
corporationId: (_b = existing === null || existing === void 0 ? void 0 : existing.corporationId) !== null && _b !== void 0 ? _b : 0,
|
|
36
44
|
archived: (_c = existing === null || existing === void 0 ? void 0 : existing.archived) !== null && _c !== void 0 ? _c : false,
|
|
37
|
-
|
|
45
|
+
activeVersion: ((_d = existing === null || existing === void 0 ? void 0 : existing.activeVersion) !== null && _d !== void 0 ? _d : 0) + 1,
|
|
38
46
|
lastModifiedBlock: block,
|
|
39
47
|
};
|
|
40
48
|
}
|
|
@@ -48,45 +56,112 @@ function upsertCredentialSchema(state, activity) {
|
|
|
48
56
|
const archived = archivedRaw !== undefined ? archivedRaw !== null && archivedRaw !== false : ((_a = existing === null || existing === void 0 ? void 0 : existing.archived) !== null && _a !== void 0 ? _a : false);
|
|
49
57
|
state.credentialSchemas[id] = {
|
|
50
58
|
id: Number(id),
|
|
51
|
-
|
|
59
|
+
ecosystemId: Number((_c = (_b = c['ecosystem_id']) !== null && _b !== void 0 ? _b : existing === null || existing === void 0 ? void 0 : existing.ecosystemId) !== null && _c !== void 0 ? _c : 0),
|
|
52
60
|
jsonSchema: String((_e = (_d = c['json_schema']) !== null && _d !== void 0 ? _d : existing === null || existing === void 0 ? void 0 : existing.jsonSchema) !== null && _e !== void 0 ? _e : ''),
|
|
53
|
-
issuerMode: c['
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
verifierMode: c['verifier_perm_management_mode']
|
|
57
|
-
? String(c['verifier_perm_management_mode'])
|
|
61
|
+
issuerMode: c['issuer_onboarding_mode'] ? String(c['issuer_onboarding_mode']) : existing === null || existing === void 0 ? void 0 : existing.issuerMode,
|
|
62
|
+
verifierMode: c['verifier_onboarding_mode']
|
|
63
|
+
? String(c['verifier_onboarding_mode'])
|
|
58
64
|
: existing === null || existing === void 0 ? void 0 : existing.verifierMode,
|
|
59
65
|
archived,
|
|
60
66
|
lastModifiedBlock: block,
|
|
61
67
|
};
|
|
62
68
|
}
|
|
63
|
-
function
|
|
69
|
+
function upsertParticipant(state, activity, overrides = {}) {
|
|
64
70
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
65
71
|
const block = Number(activity.block_height) || 0;
|
|
66
72
|
const id = String(activity.entity_id);
|
|
67
73
|
const c = activity.changes;
|
|
68
|
-
const existing = state.
|
|
69
|
-
state.
|
|
74
|
+
const existing = state.participants[id];
|
|
75
|
+
state.participants[id] = {
|
|
70
76
|
id: Number(id),
|
|
71
77
|
schemaId: Number((_b = (_a = c['schema_id']) !== null && _a !== void 0 ? _a : existing === null || existing === void 0 ? void 0 : existing.schemaId) !== null && _b !== void 0 ? _b : 0),
|
|
72
78
|
did: String((_d = (_c = c['did']) !== null && _c !== void 0 ? _c : existing === null || existing === void 0 ? void 0 : existing.did) !== null && _d !== void 0 ? _d : ''),
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
role: Number((_f = (_e = c['role']) !== null && _e !== void 0 ? _e : existing === null || existing === void 0 ? void 0 : existing.role) !== null && _f !== void 0 ? _f : 0),
|
|
80
|
+
opState: (_g = overrides.opState) !== null && _g !== void 0 ? _g : String((_j = (_h = c['op_state']) !== null && _h !== void 0 ? _h : existing === null || existing === void 0 ? void 0 : existing.opState) !== null && _j !== void 0 ? _j : ''),
|
|
75
81
|
effectiveUntil: (_l = (_k = overrides.effectiveUntil) !== null && _k !== void 0 ? _k : existing === null || existing === void 0 ? void 0 : existing.effectiveUntil) !== null && _l !== void 0 ? _l : '',
|
|
76
82
|
revoked: (_o = (_m = overrides.revoked) !== null && _m !== void 0 ? _m : existing === null || existing === void 0 ? void 0 : existing.revoked) !== null && _o !== void 0 ? _o : false,
|
|
77
83
|
slashed: (_q = (_p = overrides.slashed) !== null && _p !== void 0 ? _p : existing === null || existing === void 0 ? void 0 : existing.slashed) !== null && _q !== void 0 ? _q : false,
|
|
78
84
|
lastModifiedBlock: block,
|
|
79
85
|
};
|
|
80
86
|
}
|
|
87
|
+
async function reconcileVtFlowRecordsForParticipant(agent, participantId, reconcile, errorLabel) {
|
|
88
|
+
const agentContext = agent.context;
|
|
89
|
+
const service = agentContext.dependencyManager.resolve(credo_ts_didcomm_vt_flow_1.VtFlowService);
|
|
90
|
+
const records = await service.findAllByQuery(agentContext, { participantId });
|
|
91
|
+
for (const record of records) {
|
|
92
|
+
try {
|
|
93
|
+
const transitionedTo = await reconcile(record, service, agentContext);
|
|
94
|
+
if (transitionedTo) {
|
|
95
|
+
agent.config.logger.info(`[IndexerWS] VtFlowRecord ${record.id} transitioned to ${transitionedTo} (participant=${participantId})`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
agent.config.logger.error(`[IndexerWS] ${errorLabel} for record ${record.id}`, e);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function markVtFlowRecordsValidated(agent, participantId) {
|
|
104
|
+
await reconcileVtFlowRecordsForParticipant(agent, participantId, async (record, service, agentContext) => {
|
|
105
|
+
if (record.state !== credo_ts_didcomm_vt_flow_1.VtFlowState.Validating && record.state !== credo_ts_didcomm_vt_flow_1.VtFlowState.OobPending) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
await service.markValidated(agentContext, record.id);
|
|
109
|
+
return 'VALIDATED';
|
|
110
|
+
}, 'Failed to markValidated');
|
|
111
|
+
}
|
|
112
|
+
async function setVtFlowRecordsParticipantRevoked(agent, participantId) {
|
|
113
|
+
await reconcileVtFlowRecordsForParticipant(agent, participantId, async (record, service, agentContext) => {
|
|
114
|
+
if (record.state === credo_ts_didcomm_vt_flow_1.VtFlowState.ParticipantRevoked ||
|
|
115
|
+
record.state === credo_ts_didcomm_vt_flow_1.VtFlowState.ParticipantSlashed) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
await service.updateState(agentContext, record, credo_ts_didcomm_vt_flow_1.VtFlowState.ParticipantRevoked);
|
|
119
|
+
return 'PARTICIPANT_REVOKED';
|
|
120
|
+
}, 'Failed to set PARTICIPANT_REVOKED');
|
|
121
|
+
}
|
|
122
|
+
async function setVtFlowRecordsParticipantSlashed(agent, participantId) {
|
|
123
|
+
await reconcileVtFlowRecordsForParticipant(agent, participantId, async (record, service, agentContext) => {
|
|
124
|
+
if (record.state === credo_ts_didcomm_vt_flow_1.VtFlowState.ParticipantSlashed ||
|
|
125
|
+
record.state === credo_ts_didcomm_vt_flow_1.VtFlowState.ParticipantRevoked) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
await service.updateState(agentContext, record, credo_ts_didcomm_vt_flow_1.VtFlowState.ParticipantSlashed);
|
|
129
|
+
return 'PARTICIPANT_SLASHED';
|
|
130
|
+
}, 'Failed to set PARTICIPANT_SLASHED');
|
|
131
|
+
}
|
|
132
|
+
async function terminateVtFlowRecordsByApplicant(agent, participantId) {
|
|
133
|
+
await reconcileVtFlowRecordsForParticipant(agent, participantId, async (record, service, agentContext) => {
|
|
134
|
+
await service.updateState(agentContext, record, credo_ts_didcomm_vt_flow_1.VtFlowState.TerminatedByApplicant);
|
|
135
|
+
return 'TERMINATED_BY_APPLICANT';
|
|
136
|
+
}, 'Failed to terminate record');
|
|
137
|
+
}
|
|
138
|
+
async function startParticipantOPAutoFlow(agent, activity) {
|
|
139
|
+
const chain = agent.veranaChain;
|
|
140
|
+
if (!chain)
|
|
141
|
+
return;
|
|
142
|
+
const applicantParticipantId = Number(activity.entity_id);
|
|
143
|
+
if (!Number.isFinite(applicantParticipantId))
|
|
144
|
+
return;
|
|
145
|
+
const holderParticipant = await chain.getParticipant(applicantParticipantId);
|
|
146
|
+
if (!holderParticipant || holderParticipant.did !== agent.did)
|
|
147
|
+
return;
|
|
148
|
+
try {
|
|
149
|
+
const orchestrator = new vtFlow_1.VtFlowOrchestrator(agent);
|
|
150
|
+
await orchestrator.startOnboardingProcess({ applicantParticipantId });
|
|
151
|
+
}
|
|
152
|
+
catch (err) {
|
|
153
|
+
agent.config.logger.error(`[IndexerWS] StartParticipantOP auto-flow failed: ${err.message}\n${err.stack}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
81
156
|
async function publishVtjscIfOwner(state, agent, schemaEntityId) {
|
|
82
157
|
var _a, _b;
|
|
83
158
|
const schema = state.credentialSchemas[schemaEntityId];
|
|
84
159
|
if (!schema) {
|
|
85
160
|
agent.config.logger.warn(`[VTJSC] Schema ${schemaEntityId} not found in state`);
|
|
86
161
|
}
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
89
|
-
agent.config.logger.warn(`[VTJSC]
|
|
162
|
+
const ecosystem = state.ecosystems[String(schema.ecosystemId)];
|
|
163
|
+
if (!ecosystem) {
|
|
164
|
+
agent.config.logger.warn(`[VTJSC] Ecosystem ${schema.ecosystemId} not found in state`);
|
|
90
165
|
}
|
|
91
166
|
const chainId = (_b = (_a = agent.veranaChain) === null || _a === void 0 ? void 0 : _a.getChainId) !== null && _b !== void 0 ? _b : DEFAULT_CHAIN_ID;
|
|
92
167
|
const jsonSchemaRef = `vpr:verana:${chainId}/cs/v1/js/${schema.id}`;
|
|
@@ -104,7 +179,7 @@ async function publishVtjscIfOwner(state, agent, schemaEntityId) {
|
|
|
104
179
|
jsonSchemaRef,
|
|
105
180
|
precomputedDigestSRI: digestSRI,
|
|
106
181
|
});
|
|
107
|
-
agent.config.logger.info(`[VTJSC] Published VTJSC for schema ${schema.id} (
|
|
182
|
+
agent.config.logger.info(`[VTJSC] Published VTJSC for schema ${schema.id} (Ecosystem ${schema.ecosystemId}) at block ${state.lastBlockHeight}`);
|
|
108
183
|
}
|
|
109
184
|
catch (e) {
|
|
110
185
|
agent.config.logger.error(`[VTJSC] Failed to publish VTJSC for schema ${schema.id}`, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stateMutations.js","sourceRoot":"","sources":["../../../src/blockchain/handlers/stateMutations.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"stateMutations.js","sourceRoot":"","sources":["../../../src/blockchain/handlers/stateMutations.ts"],"names":[],"mappings":";;AAYA,0CAcC;AAED,8CAaC;AAED,wDAqBC;AAED,8CA0BC;AAED,oFA6BC;AAED,gEAaC;AAED,gFAmBC;AAED,gFAmBC;AAED,8EAaC;AAED,gEAeC;AAED,kDAsCC;AA3PD,oFAAgG;AAChG,gEAAiE;AAGjE,2CAAgD;AAChD,2EAA4D;AAC5D,yCAAiD;AAGjD,MAAM,gBAAgB,GAAG,eAAe,CAAA;AAExC,SAAgB,eAAe,CAAC,KAAsB,EAAE,QAAyB;;IAC/E,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IAChD,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IACrC,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAA;IAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IAErC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG;QACrB,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;QACd,GAAG,EAAE,MAAM,CAAC,MAAA,MAAA,CAAC,CAAC,KAAK,CAAC,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,GAAG,mCAAI,EAAE,CAAC;QAC5C,aAAa,EAAE,MAAM,CAAC,MAAA,MAAA,CAAC,CAAC,gBAAgB,CAAC,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,mCAAI,CAAC,CAAC;QAC1E,QAAQ,EAAE,OAAO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E,EAAE,EAAE,CAAU,CAAC,CAAA;IAClG,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { BaseLogger } from '@credo-ts/core';
|
|
2
|
+
export declare enum ValidationState {
|
|
3
|
+
UNSPECIFIED = 0,
|
|
4
|
+
PENDING = 1,
|
|
5
|
+
VALIDATED = 2,
|
|
6
|
+
TERMINATED = 3
|
|
7
|
+
}
|
|
8
|
+
export interface Participant {
|
|
9
|
+
id: number;
|
|
10
|
+
schemaId: number;
|
|
11
|
+
role: number;
|
|
12
|
+
did: string;
|
|
13
|
+
corporation: string;
|
|
14
|
+
validatorParticipantId: number;
|
|
15
|
+
opState?: ValidationState;
|
|
16
|
+
opSummaryDigest: string;
|
|
17
|
+
revoked: Date | undefined;
|
|
18
|
+
slashed: Date | undefined;
|
|
19
|
+
}
|
|
2
20
|
export declare const VERANA_BECH32_PREFIX = "verana";
|
|
3
21
|
export declare const RECORD_ID = "verana-blockchain-sync-state";
|
|
4
22
|
export type IndexerEventRecord = {
|
|
@@ -18,14 +36,33 @@ export type IndexerEventRecord = {
|
|
|
18
36
|
related_dids: string[];
|
|
19
37
|
entity_type?: string;
|
|
20
38
|
entity_id?: string;
|
|
39
|
+
corporation_id?: number;
|
|
40
|
+
related_corporation_ids?: number[];
|
|
21
41
|
};
|
|
22
42
|
};
|
|
43
|
+
export interface IndexerReadyMessage {
|
|
44
|
+
type: 'ready';
|
|
45
|
+
block: number;
|
|
46
|
+
blockTime: string;
|
|
47
|
+
blockIntervalMs: number;
|
|
48
|
+
}
|
|
49
|
+
export interface IndexerBlockMessage {
|
|
50
|
+
type: 'block';
|
|
51
|
+
block: number;
|
|
52
|
+
blockTime: string;
|
|
53
|
+
events: IndexerEventRecord[];
|
|
54
|
+
}
|
|
55
|
+
export interface IndexerSubscribeMessage {
|
|
56
|
+
action: 'subscribe';
|
|
57
|
+
dids?: string[];
|
|
58
|
+
corporationId?: number;
|
|
59
|
+
}
|
|
23
60
|
export interface IndexerEventsResponse {
|
|
24
61
|
events: IndexerEventRecord[];
|
|
25
62
|
count: number;
|
|
26
63
|
after_block_height: number;
|
|
27
64
|
}
|
|
28
|
-
export type IndexerEntityType = '
|
|
65
|
+
export type IndexerEntityType = 'Ecosystem' | 'CredentialSchema' | 'Participant' | 'ParticipantSession' | 'TrustDeposit';
|
|
29
66
|
export interface IndexerActivity {
|
|
30
67
|
timestamp: string;
|
|
31
68
|
block_height: string | number;
|
|
@@ -44,29 +81,29 @@ export interface VeranaIdxConfig {
|
|
|
44
81
|
baseUrl: string;
|
|
45
82
|
logger: BaseLogger;
|
|
46
83
|
}
|
|
47
|
-
export interface
|
|
84
|
+
export interface SyncedEcosystem {
|
|
48
85
|
id: number;
|
|
49
86
|
did: string;
|
|
50
|
-
|
|
87
|
+
corporationId: number;
|
|
51
88
|
archived: boolean;
|
|
52
|
-
|
|
89
|
+
activeVersion?: number;
|
|
53
90
|
lastModifiedBlock: number;
|
|
54
91
|
}
|
|
55
92
|
export interface SyncedCredentialSchema {
|
|
56
93
|
id: number;
|
|
57
|
-
|
|
94
|
+
ecosystemId: number;
|
|
58
95
|
jsonSchema: string;
|
|
59
96
|
issuerMode?: string;
|
|
60
97
|
verifierMode?: string;
|
|
61
98
|
archived: boolean;
|
|
62
99
|
lastModifiedBlock: number;
|
|
63
100
|
}
|
|
64
|
-
export interface
|
|
101
|
+
export interface SyncedParticipant {
|
|
65
102
|
id: number;
|
|
66
103
|
schemaId: number;
|
|
67
104
|
did: string;
|
|
68
|
-
|
|
69
|
-
|
|
105
|
+
role: number;
|
|
106
|
+
opState?: string;
|
|
70
107
|
effectiveUntil?: string;
|
|
71
108
|
revoked: boolean;
|
|
72
109
|
slashed: boolean;
|
|
@@ -74,49 +111,62 @@ export interface SyncedPermission {
|
|
|
74
111
|
}
|
|
75
112
|
export interface VeranaSyncState {
|
|
76
113
|
lastBlockHeight: number;
|
|
77
|
-
|
|
114
|
+
ecosystems: Record<string, SyncedEcosystem>;
|
|
78
115
|
credentialSchemas: Record<string, SyncedCredentialSchema>;
|
|
79
|
-
|
|
116
|
+
participants: Record<string, SyncedParticipant>;
|
|
80
117
|
}
|
|
81
|
-
export interface
|
|
118
|
+
export interface EcosystemDto {
|
|
82
119
|
id: number;
|
|
83
120
|
did: string;
|
|
84
|
-
|
|
121
|
+
corporation_id: number;
|
|
85
122
|
archived: string | null;
|
|
86
|
-
|
|
123
|
+
active_version?: number;
|
|
87
124
|
}
|
|
88
125
|
export interface CredentialSchemaDto {
|
|
89
126
|
id: number;
|
|
90
|
-
|
|
127
|
+
ecosystem_id: number;
|
|
91
128
|
json_schema: string;
|
|
92
|
-
|
|
93
|
-
|
|
129
|
+
issuer_onboarding_mode?: string;
|
|
130
|
+
verifier_onboarding_mode?: string;
|
|
94
131
|
archived: string | null;
|
|
95
132
|
created: string;
|
|
96
133
|
modified: string;
|
|
97
134
|
}
|
|
98
|
-
export interface
|
|
135
|
+
export interface ParticipantDto {
|
|
99
136
|
id: number;
|
|
100
137
|
schema_id: number;
|
|
101
138
|
did: string | null;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
vp_state?: string;
|
|
139
|
+
role: string;
|
|
140
|
+
op_state?: string;
|
|
105
141
|
revoked: string | null;
|
|
106
142
|
slashed: string | null;
|
|
107
143
|
effective_until?: string;
|
|
108
144
|
modified: string;
|
|
145
|
+
validator_participant_id?: number | null;
|
|
146
|
+
op_summary_digest?: string;
|
|
109
147
|
}
|
|
110
|
-
export interface
|
|
111
|
-
|
|
112
|
-
|
|
148
|
+
export interface RawParticipant {
|
|
149
|
+
id: number;
|
|
150
|
+
schemaId: number;
|
|
151
|
+
role: number;
|
|
152
|
+
did: string;
|
|
153
|
+
corporationId?: number;
|
|
154
|
+
validatorParticipantId: number;
|
|
155
|
+
opState?: number;
|
|
156
|
+
opSummaryDigest?: string;
|
|
157
|
+
revoked: Date | undefined;
|
|
158
|
+
slashed: Date | undefined;
|
|
159
|
+
}
|
|
160
|
+
export interface ParticipantQueryClient {
|
|
161
|
+
GetParticipant(req: {
|
|
162
|
+
id: number;
|
|
113
163
|
}): Promise<{
|
|
114
|
-
|
|
164
|
+
participant?: RawParticipant;
|
|
115
165
|
}>;
|
|
116
|
-
|
|
117
|
-
|
|
166
|
+
FindParticipantsWithDID(req: object): Promise<{
|
|
167
|
+
participants: RawParticipant[];
|
|
118
168
|
}>;
|
|
119
|
-
|
|
169
|
+
GetParticipantSession(req: {
|
|
120
170
|
id: string;
|
|
121
171
|
}): Promise<{
|
|
122
172
|
session?: unknown;
|
|
@@ -128,31 +178,121 @@ export interface VeranaChainConfig {
|
|
|
128
178
|
mnemonic: string;
|
|
129
179
|
logger: BaseLogger;
|
|
130
180
|
gasPrice?: string;
|
|
181
|
+
corporationAddress?: string;
|
|
182
|
+
autoTriggerResolver?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* FIXME(verana setValidated->AUTHZ-CHECK-3): temporary. On the current chain, validating a participant
|
|
185
|
+
* (OperatorAuthorization) and creating its session (VSOperatorAuthorization) need two mutually-exclusive
|
|
186
|
+
* account permissions, so one account cannot do both. When set, the session is signed by this second
|
|
187
|
+
* account. Remove once the chain authorizes both under one vs_operator (AUTHZ-CHECK-3).
|
|
188
|
+
*/
|
|
189
|
+
sessionOperatorMnemonic?: string;
|
|
131
190
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
191
|
+
/** Wrapper for optional uint64 values per `verana.pp.v1.OptionalUInt64`. */
|
|
192
|
+
export interface OptionalUInt64 {
|
|
193
|
+
value: number;
|
|
194
|
+
}
|
|
195
|
+
export interface StartParticipantOPParams {
|
|
196
|
+
role: number;
|
|
197
|
+
validatorParticipantId: number;
|
|
136
198
|
did: string;
|
|
137
|
-
validationFees?:
|
|
138
|
-
|
|
139
|
-
|
|
199
|
+
validationFees?: OptionalUInt64;
|
|
200
|
+
issuanceFees?: OptionalUInt64;
|
|
201
|
+
verificationFees?: OptionalUInt64;
|
|
140
202
|
}
|
|
141
|
-
export interface
|
|
142
|
-
id:
|
|
203
|
+
export interface SetParticipantOPToValidatedParams {
|
|
204
|
+
id: number;
|
|
143
205
|
effectiveUntil?: Date;
|
|
144
|
-
validationFees
|
|
145
|
-
issuanceFees
|
|
146
|
-
verificationFees
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
export interface
|
|
206
|
+
validationFees?: number;
|
|
207
|
+
issuanceFees?: number;
|
|
208
|
+
verificationFees?: number;
|
|
209
|
+
opSummaryDigest: string;
|
|
210
|
+
issuanceFeeDiscount?: number;
|
|
211
|
+
verificationFeeDiscount?: number;
|
|
212
|
+
corporation?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface CreateOrUpdateParticipantSessionParams {
|
|
153
215
|
id: string;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
216
|
+
issuerParticipantId?: number;
|
|
217
|
+
verifierParticipantId?: number;
|
|
218
|
+
agentParticipantId: number;
|
|
219
|
+
walletAgentParticipantId: number;
|
|
220
|
+
digest?: string;
|
|
221
|
+
corporation?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface Coin {
|
|
224
|
+
denom: string;
|
|
225
|
+
amount: string;
|
|
226
|
+
}
|
|
227
|
+
export interface DurationParam {
|
|
228
|
+
seconds: number;
|
|
229
|
+
nanos?: number;
|
|
230
|
+
}
|
|
231
|
+
export interface GrantOperatorAuthorizationParams {
|
|
232
|
+
grantee: string;
|
|
233
|
+
msgTypes: string[];
|
|
234
|
+
expiration?: Date;
|
|
235
|
+
authzSpendLimit?: Coin[];
|
|
236
|
+
authzSpendLimitPeriod?: DurationParam;
|
|
237
|
+
withFeegrant?: boolean;
|
|
238
|
+
feegrantSpendLimit?: Coin[];
|
|
239
|
+
feegrantSpendLimitPeriod?: DurationParam;
|
|
240
|
+
feeSpendLimit?: Coin[];
|
|
241
|
+
}
|
|
242
|
+
export interface RevokeOperatorAuthorizationParams {
|
|
243
|
+
grantee: string;
|
|
244
|
+
}
|
|
245
|
+
export interface CreateEcosystemParams {
|
|
246
|
+
did: string;
|
|
247
|
+
language: string;
|
|
248
|
+
docUrl: string;
|
|
249
|
+
docDigestSri: string;
|
|
250
|
+
aka?: string;
|
|
251
|
+
}
|
|
252
|
+
export interface ArchiveEcosystemParams {
|
|
253
|
+
ecosystemId: number;
|
|
254
|
+
archive: boolean;
|
|
255
|
+
}
|
|
256
|
+
/** Wrapper for optional uint32 values per `verana.cs.v1.OptionalUInt32`. */
|
|
257
|
+
export interface OptionalUInt32 {
|
|
258
|
+
value: number;
|
|
259
|
+
}
|
|
260
|
+
export interface CreateCredentialSchemaParams {
|
|
261
|
+
ecosystemId: number;
|
|
262
|
+
jsonSchema: string;
|
|
263
|
+
issuerOnboardingMode?: number;
|
|
264
|
+
verifierOnboardingMode?: number;
|
|
265
|
+
holderOnboardingMode?: number;
|
|
266
|
+
pricingAssetType?: number;
|
|
267
|
+
pricingAsset?: string;
|
|
268
|
+
digestAlgorithm?: string;
|
|
269
|
+
issuerGrantorValidationValidityPeriod?: OptionalUInt32;
|
|
270
|
+
verifierGrantorValidationValidityPeriod?: OptionalUInt32;
|
|
271
|
+
issuerValidationValidityPeriod?: OptionalUInt32;
|
|
272
|
+
verifierValidationValidityPeriod?: OptionalUInt32;
|
|
273
|
+
holderValidationValidityPeriod?: OptionalUInt32;
|
|
274
|
+
}
|
|
275
|
+
export interface CreateRootParticipantParams {
|
|
276
|
+
schemaId: number;
|
|
277
|
+
did: string;
|
|
278
|
+
effectiveFrom?: Date;
|
|
279
|
+
effectiveUntil?: Date;
|
|
280
|
+
validationFees?: number;
|
|
281
|
+
issuanceFees?: number;
|
|
282
|
+
verificationFees?: number;
|
|
283
|
+
}
|
|
284
|
+
export interface SelfCreateParticipantParams {
|
|
285
|
+
role: number;
|
|
286
|
+
validatorParticipantId: number;
|
|
287
|
+
did: string;
|
|
288
|
+
effectiveFrom?: Date;
|
|
289
|
+
effectiveUntil?: Date;
|
|
290
|
+
validationFees?: number;
|
|
291
|
+
verificationFees?: number;
|
|
292
|
+
vsOperator?: string;
|
|
293
|
+
vsOperatorAuthzEnabled?: boolean;
|
|
294
|
+
vsOperatorAuthzSpendLimit?: Coin[];
|
|
295
|
+
vsOperatorAuthzWithFeegrant?: boolean;
|
|
296
|
+
vsOperatorAuthzFeeSpendLimit?: Coin[];
|
|
297
|
+
vsOperatorAuthzSpendPeriod?: DurationParam;
|
|
158
298
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RECORD_ID = exports.VERANA_BECH32_PREFIX = void 0;
|
|
3
|
+
exports.RECORD_ID = exports.VERANA_BECH32_PREFIX = exports.ValidationState = void 0;
|
|
4
|
+
var ValidationState;
|
|
5
|
+
(function (ValidationState) {
|
|
6
|
+
ValidationState[ValidationState["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
7
|
+
ValidationState[ValidationState["PENDING"] = 1] = "PENDING";
|
|
8
|
+
ValidationState[ValidationState["VALIDATED"] = 2] = "VALIDATED";
|
|
9
|
+
ValidationState[ValidationState["TERMINATED"] = 3] = "TERMINATED";
|
|
10
|
+
})(ValidationState || (exports.ValidationState = ValidationState = {}));
|
|
4
11
|
exports.VERANA_BECH32_PREFIX = 'verana';
|
|
5
12
|
exports.RECORD_ID = 'verana-blockchain-sync-state';
|
|
6
13
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blockchain/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blockchain/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,mEAAe,CAAA;IACf,2DAAW,CAAA;IACX,+DAAa,CAAA;IACb,iEAAc,CAAA;AAChB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAeY,QAAA,oBAAoB,GAAG,QAAQ,CAAA;AAC/B,QAAA,SAAS,GAAG,8BAA8B,CAAA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { AnonCredsRevocationRegistryDefinition } from '@credo-ts/anoncreds';
|
|
2
2
|
import type { AgentContext } from '@credo-ts/core';
|
|
3
3
|
import { BasicTailsFileService } from '@credo-ts/anoncreds';
|
|
4
|
+
export declare function isValidTailsFileName(name: string): boolean;
|
|
5
|
+
export declare function getTailsDirectoryPath(agentContext: AgentContext): string;
|
|
6
|
+
export declare function migrateLegacyTailsFiles(agentContext: AgentContext): void;
|
|
4
7
|
export declare class FullTailsFileService extends BasicTailsFileService {
|
|
5
8
|
private tailsServerBaseUrl;
|
|
6
9
|
constructor(options: {
|
|
7
|
-
tailsDirectoryPath?: string;
|
|
8
10
|
tailsServerBaseUrl: string;
|
|
9
11
|
});
|
|
10
12
|
uploadTailsFile(agentContext: AgentContext, options: {
|
|
@@ -13,6 +15,4 @@ export declare class FullTailsFileService extends BasicTailsFileService {
|
|
|
13
15
|
tailsFileUrl: string;
|
|
14
16
|
}>;
|
|
15
17
|
}
|
|
16
|
-
export declare
|
|
17
|
-
export declare const tailsIndex: Record<string, string>;
|
|
18
|
-
export declare function deleteTailsEntry(tailsFileUrl: string): void;
|
|
18
|
+
export declare function deleteTailsFile(agentContext: AgentContext, tailsFileUrl: string): void;
|