@verana-labs/vs-agent-sdk 1.11.0-dev.8 → 1.11.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/README.md +172 -0
- package/build/agent/VsAgent.d.ts +8 -2
- package/build/agent/VsAgent.js +121 -41
- package/build/agent/VsAgent.js.map +1 -1
- package/build/agent/createVsAgent.d.ts +2 -0
- package/build/agent/createVsAgent.js +1 -0
- package/build/agent/createVsAgent.js.map +1 -1
- package/build/agent/index.d.ts +2 -0
- package/build/agent/index.js +19 -0
- package/build/agent/index.js.map +1 -0
- package/build/blockchain/IndexerWebSocketService.d.ts +39 -0
- package/build/blockchain/IndexerWebSocketService.js +217 -0
- package/build/blockchain/IndexerWebSocketService.js.map +1 -0
- package/build/blockchain/VeranaChainService.d.ts +32 -0
- package/build/blockchain/VeranaChainService.js +124 -0
- package/build/blockchain/VeranaChainService.js.map +1 -0
- package/build/blockchain/VeranaHelpers.d.ts +4 -0
- package/build/blockchain/VeranaHelpers.js +29 -0
- package/build/blockchain/VeranaHelpers.js.map +1 -0
- package/build/blockchain/VeranaIndexerService.d.ts +11 -0
- package/build/blockchain/VeranaIndexerService.js +43 -0
- package/build/blockchain/VeranaIndexerService.js.map +1 -0
- package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +25 -0
- package/build/blockchain/handlers/IndexerHandlerRegistry.js +34 -0
- package/build/blockchain/handlers/IndexerHandlerRegistry.js.map +1 -0
- package/build/blockchain/handlers/defaultHandlers.d.ts +6 -0
- package/build/blockchain/handlers/defaultHandlers.js +126 -0
- package/build/blockchain/handlers/defaultHandlers.js.map +1 -0
- package/build/blockchain/handlers/index.d.ts +3 -0
- package/build/blockchain/handlers/index.js +20 -0
- package/build/blockchain/handlers/index.js.map +1 -0
- package/build/blockchain/handlers/stateMutations.d.ts +12 -0
- package/build/blockchain/handlers/stateMutations.js +113 -0
- package/build/blockchain/handlers/stateMutations.js.map +1 -0
- package/build/blockchain/index.d.ts +6 -0
- package/build/blockchain/index.js +23 -0
- package/build/blockchain/index.js.map +1 -0
- package/build/blockchain/types.d.ts +158 -0
- package/build/blockchain/types.js +6 -0
- package/build/blockchain/types.js.map +1 -0
- package/build/did/WebDidRegistrar.d.ts +3 -1
- package/build/did/WebDidRegistrar.js +10 -1
- package/build/did/WebDidRegistrar.js.map +1 -1
- package/build/did/migrateWebVhLog.d.ts +34 -0
- package/build/did/migrateWebVhLog.js +230 -0
- package/build/did/migrateWebVhLog.js.map +1 -0
- package/build/index.d.ts +4 -5
- package/build/index.js +5 -5
- package/build/index.js.map +1 -1
- package/build/plugins/setupBaseDidComm.d.ts +2 -0
- package/build/plugins/setupBaseDidComm.js +9 -1
- package/build/plugins/setupBaseDidComm.js.map +1 -1
- package/build/transports/VsAgentWsInboundTransport.js +1 -1
- package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
- package/build/utils/agent.d.ts +2 -1
- package/build/utils/agent.js +16 -10
- package/build/utils/agent.js.map +1 -1
- package/build/utils/setupSelfTr.d.ts +115 -0
- package/build/utils/setupSelfTr.js +452 -0
- package/build/utils/setupSelfTr.js.map +1 -0
- package/build/utils/trustCredentialStore.d.ts +18 -0
- package/build/utils/trustCredentialStore.js +196 -0
- package/build/utils/trustCredentialStore.js.map +1 -0
- package/package.json +18 -11
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultHandlers = void 0;
|
|
4
|
+
exports.buildDefaultIndexerHandlerRegistry = buildDefaultIndexerHandlerRegistry;
|
|
5
|
+
const IndexerHandlerRegistry_1 = require("./IndexerHandlerRegistry");
|
|
6
|
+
const stateMutations_1 = require("./stateMutations");
|
|
7
|
+
/**
|
|
8
|
+
* Default handlers for indexer events emitted by the Verana blockchain.
|
|
9
|
+
*/
|
|
10
|
+
exports.defaultHandlers = [
|
|
11
|
+
{
|
|
12
|
+
msg: 'CreateNewTrustRegistry',
|
|
13
|
+
handle: async (activity, ctx) => {
|
|
14
|
+
(0, stateMutations_1.upsertTrustRegistry)(ctx.state, activity);
|
|
15
|
+
ctx.agent.config.logger.info(`[IndexerWS] CreateNewTrustRegistry entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
msg: 'UpdateTrustRegistry',
|
|
20
|
+
handle: async (activity, ctx) => {
|
|
21
|
+
(0, stateMutations_1.upsertTrustRegistry)(ctx.state, activity);
|
|
22
|
+
ctx.agent.config.logger.info(`[IndexerWS] UpdateTrustRegistry entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
msg: 'AddGovernanceFrameworkDocument',
|
|
27
|
+
handle: async (activity, ctx) => {
|
|
28
|
+
(0, stateMutations_1.upsertTrustRegistry)(ctx.state, activity);
|
|
29
|
+
ctx.agent.config.logger.info(`[IndexerWS] AddGovernanceFrameworkDocument entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
msg: 'IncreaseActiveGFVersion',
|
|
34
|
+
handle: async (activity, ctx) => {
|
|
35
|
+
(0, stateMutations_1.bumpActiveGfVersion)(ctx.state, activity);
|
|
36
|
+
ctx.agent.config.logger.info(`[IndexerWS] IncreaseActiveGFVersion entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
msg: 'CreateNewCredentialSchema',
|
|
41
|
+
handle: async (activity, ctx) => {
|
|
42
|
+
(0, stateMutations_1.upsertCredentialSchema)(ctx.state, activity);
|
|
43
|
+
ctx.agent.config.logger.info(`[IndexerWS] CreateNewCredentialSchema entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
44
|
+
await (0, stateMutations_1.publishVtjscIfOwner)(ctx.state, ctx.agent, String(activity.entity_id));
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
msg: 'UpdateCredentialSchema',
|
|
49
|
+
handle: async (activity, ctx) => {
|
|
50
|
+
(0, stateMutations_1.upsertCredentialSchema)(ctx.state, activity);
|
|
51
|
+
ctx.agent.config.logger.info(`[IndexerWS] UpdateCredentialSchema entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
msg: 'ArchiveCredentialSchema',
|
|
56
|
+
handle: async (activity, ctx) => {
|
|
57
|
+
(0, stateMutations_1.upsertCredentialSchema)(ctx.state, activity);
|
|
58
|
+
ctx.agent.config.logger.info(`[IndexerWS] ArchiveCredentialSchema entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
msg: 'StartPermissionVP',
|
|
63
|
+
handle: async (activity, ctx) => {
|
|
64
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, { vpState: 'PENDING' });
|
|
65
|
+
ctx.agent.config.logger.info(`[IndexerWS] StartPermissionVP entity=${activity.entity_id} block=${ctx.block_height} — TODO §5.1: progress credential acquisition flow (applicant)`);
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
msg: 'RenewPermissionVP',
|
|
70
|
+
handle: async (activity, ctx) => {
|
|
71
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, { vpState: 'PENDING' });
|
|
72
|
+
ctx.agent.config.logger.info(`[IndexerWS] RenewPermissionVP entity=${activity.entity_id} block=${ctx.block_height} — TODO §5.1: progress credential acquisition flow (applicant renewal)`);
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
msg: 'SetPermissionVPToValidated',
|
|
77
|
+
handle: async (activity, ctx) => {
|
|
78
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, { vpState: 'VALIDATED' });
|
|
79
|
+
ctx.agent.config.logger.info(`[IndexerWS] SetPermissionVPToValidated entity=${activity.entity_id} block=${ctx.block_height} — TODO §5.1: progress credential acquisition flow (validator)`);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
msg: 'AdjustPermission',
|
|
84
|
+
handle: async (activity, ctx) => {
|
|
85
|
+
var _a;
|
|
86
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, {
|
|
87
|
+
effectiveUntil: String((_a = activity.changes['effective_until']) !== null && _a !== void 0 ? _a : ''),
|
|
88
|
+
});
|
|
89
|
+
ctx.agent.config.logger.info(`[IndexerWS] AdjustPermission entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
msg: 'RevokePermission',
|
|
94
|
+
handle: async (activity, ctx) => {
|
|
95
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, { revoked: true });
|
|
96
|
+
ctx.agent.config.logger.info(`[IndexerWS] RevokePermission entity=${activity.entity_id} block=${ctx.block_height} — TODO §7.2: remove linked VP from DID doc + delete credential`);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
msg: 'SlashPermissionTrustDeposit',
|
|
101
|
+
handle: async (activity, ctx) => {
|
|
102
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, { slashed: true });
|
|
103
|
+
ctx.agent.config.logger.info(`[IndexerWS] SlashPermissionTrustDeposit entity=${activity.entity_id} block=${ctx.block_height} — TODO §7.2: clean up associated flow state`);
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
msg: 'RepayPermissionSlashedTrustDeposit',
|
|
108
|
+
handle: async (activity, ctx) => {
|
|
109
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, { slashed: false });
|
|
110
|
+
ctx.agent.config.logger.info(`[IndexerWS] RepayPermissionSlashedTrustDeposit entity=${activity.entity_id} block=${ctx.block_height}`);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
msg: 'CancelPermissionVPLastRequest',
|
|
115
|
+
handle: async (activity, ctx) => {
|
|
116
|
+
(0, stateMutations_1.upsertPermission)(ctx.state, activity, {});
|
|
117
|
+
ctx.agent.config.logger.info(`[IndexerWS] CancelPermissionVPLastRequest entity=${activity.entity_id} block=${ctx.block_height} — TODO §7.2: clean up associated flow state`);
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
function buildDefaultIndexerHandlerRegistry() {
|
|
122
|
+
const r = new IndexerHandlerRegistry_1.IndexerHandlerRegistry();
|
|
123
|
+
exports.defaultHandlers.forEach(h => r.register(h));
|
|
124
|
+
return r;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=defaultHandlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultHandlers.js","sourceRoot":"","sources":["../../../src/blockchain/handlers/defaultHandlers.ts"],"names":[],"mappings":";;;AAyJA,gFAIC;AA7JD,qEAAsF;AACtF,qDAMyB;AAEzB;;GAEG;AACU,QAAA,eAAe,GAA0B;IACpD;QACE,GAAG,EAAE,wBAAwB;QAC7B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;YAC9B,IAAA,oCAAmB,EAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;YACxC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAC1B,6CAA6C,QAAQ,CAAC,SAAS,UAAU,GAAG,CAAC,YAAY,EAAE,CAC5F,CAAA;QACH,CAAC;KACF;IACD;QACE,GAAG,EAAE,qBAAqB;QAC1B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE;YAC9B,IAAA,oCAAmB,EAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;YACxC,GAAG,CAAC,KAAK,CAAC,MAAM,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AA;AACV,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./defaultHandlers"), exports);
|
|
18
|
+
__exportStar(require("./IndexerHandlerRegistry"), exports);
|
|
19
|
+
__exportStar(require("./stateMutations"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/blockchain/handlers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,2DAAwC;AACxC,mDAAgC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VsAgent } from '../../agent/VsAgent';
|
|
2
|
+
import { IndexerActivity, VeranaSyncState } from '../types';
|
|
3
|
+
export declare function upsertTrustRegistry(state: VeranaSyncState, activity: IndexerActivity): void;
|
|
4
|
+
export declare function bumpActiveGfVersion(state: VeranaSyncState, activity: IndexerActivity): void;
|
|
5
|
+
export declare function upsertCredentialSchema(state: VeranaSyncState, activity: IndexerActivity): void;
|
|
6
|
+
export declare function upsertPermission(state: VeranaSyncState, activity: IndexerActivity, overrides?: {
|
|
7
|
+
vpState?: string;
|
|
8
|
+
revoked?: boolean;
|
|
9
|
+
slashed?: boolean;
|
|
10
|
+
effectiveUntil?: string;
|
|
11
|
+
}): void;
|
|
12
|
+
export declare function publishVtjscIfOwner(state: VeranaSyncState, agent: VsAgent, schemaEntityId: string): Promise<void>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertTrustRegistry = upsertTrustRegistry;
|
|
4
|
+
exports.bumpActiveGfVersion = bumpActiveGfVersion;
|
|
5
|
+
exports.upsertCredentialSchema = upsertCredentialSchema;
|
|
6
|
+
exports.upsertPermission = upsertPermission;
|
|
7
|
+
exports.publishVtjscIfOwner = publishVtjscIfOwner;
|
|
8
|
+
const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
|
|
9
|
+
const data_1 = require("../../utils/data");
|
|
10
|
+
const trustCredentialStore_1 = require("../../utils/trustCredentialStore");
|
|
11
|
+
const DEFAULT_CHAIN_ID = 'vna-testnet-1';
|
|
12
|
+
function upsertTrustRegistry(state, activity) {
|
|
13
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14
|
+
const block = Number(activity.block_height) || 0;
|
|
15
|
+
const id = String(activity.entity_id);
|
|
16
|
+
const c = activity.changes;
|
|
17
|
+
const existing = state.trustRegistries[id];
|
|
18
|
+
state.trustRegistries[id] = {
|
|
19
|
+
id: Number(id),
|
|
20
|
+
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
|
+
controller: String((_d = (_c = c['controller']) !== null && _c !== void 0 ? _c : existing === null || existing === void 0 ? void 0 : existing.controller) !== null && _d !== void 0 ? _d : ''),
|
|
22
|
+
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
|
+
activeGfVersion: existing === null || existing === void 0 ? void 0 : existing.activeGfVersion,
|
|
24
|
+
lastModifiedBlock: block,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function bumpActiveGfVersion(state, activity) {
|
|
28
|
+
var _a, _b, _c, _d;
|
|
29
|
+
const block = Number(activity.block_height) || 0;
|
|
30
|
+
const id = String(activity.entity_id);
|
|
31
|
+
const existing = state.trustRegistries[id];
|
|
32
|
+
state.trustRegistries[id] = {
|
|
33
|
+
id: Number(id),
|
|
34
|
+
did: String((_a = existing === null || existing === void 0 ? void 0 : existing.did) !== null && _a !== void 0 ? _a : ''),
|
|
35
|
+
controller: String((_b = existing === null || existing === void 0 ? void 0 : existing.controller) !== null && _b !== void 0 ? _b : ''),
|
|
36
|
+
archived: (_c = existing === null || existing === void 0 ? void 0 : existing.archived) !== null && _c !== void 0 ? _c : false,
|
|
37
|
+
activeGfVersion: ((_d = existing === null || existing === void 0 ? void 0 : existing.activeGfVersion) !== null && _d !== void 0 ? _d : 0) + 1,
|
|
38
|
+
lastModifiedBlock: block,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function upsertCredentialSchema(state, activity) {
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
|
+
const block = Number(activity.block_height) || 0;
|
|
44
|
+
const id = String(activity.entity_id);
|
|
45
|
+
const c = activity.changes;
|
|
46
|
+
const existing = state.credentialSchemas[id];
|
|
47
|
+
const archivedRaw = c['archived'];
|
|
48
|
+
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
|
+
state.credentialSchemas[id] = {
|
|
50
|
+
id: Number(id),
|
|
51
|
+
trId: Number((_c = (_b = c['tr_id']) !== null && _b !== void 0 ? _b : existing === null || existing === void 0 ? void 0 : existing.trId) !== null && _c !== void 0 ? _c : 0),
|
|
52
|
+
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['issuer_perm_management_mode']
|
|
54
|
+
? String(c['issuer_perm_management_mode'])
|
|
55
|
+
: existing === null || existing === void 0 ? void 0 : existing.issuerMode,
|
|
56
|
+
verifierMode: c['verifier_perm_management_mode']
|
|
57
|
+
? String(c['verifier_perm_management_mode'])
|
|
58
|
+
: existing === null || existing === void 0 ? void 0 : existing.verifierMode,
|
|
59
|
+
archived,
|
|
60
|
+
lastModifiedBlock: block,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function upsertPermission(state, activity, overrides = {}) {
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
65
|
+
const block = Number(activity.block_height) || 0;
|
|
66
|
+
const id = String(activity.entity_id);
|
|
67
|
+
const c = activity.changes;
|
|
68
|
+
const existing = state.permissions[id];
|
|
69
|
+
state.permissions[id] = {
|
|
70
|
+
id: Number(id),
|
|
71
|
+
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
|
+
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
|
+
type: Number((_f = (_e = c['type']) !== null && _e !== void 0 ? _e : existing === null || existing === void 0 ? void 0 : existing.type) !== null && _f !== void 0 ? _f : 0),
|
|
74
|
+
vpState: (_g = overrides.vpState) !== null && _g !== void 0 ? _g : String((_j = (_h = c['vp_state']) !== null && _h !== void 0 ? _h : existing === null || existing === void 0 ? void 0 : existing.vpState) !== null && _j !== void 0 ? _j : ''),
|
|
75
|
+
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
|
+
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
|
+
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
|
+
lastModifiedBlock: block,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async function publishVtjscIfOwner(state, agent, schemaEntityId) {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const schema = state.credentialSchemas[schemaEntityId];
|
|
84
|
+
if (!schema) {
|
|
85
|
+
agent.config.logger.warn(`[VTJSC] Schema ${schemaEntityId} not found in state`);
|
|
86
|
+
}
|
|
87
|
+
const tr = state.trustRegistries[String(schema.trId)];
|
|
88
|
+
if (!tr) {
|
|
89
|
+
agent.config.logger.warn(`[VTJSC] Trust Registry ${schema.trId} not found in state`);
|
|
90
|
+
}
|
|
91
|
+
const chainId = (_b = (_a = agent.veranaChain) === null || _a === void 0 ? void 0 : _a.getChainId) !== null && _b !== void 0 ? _b : DEFAULT_CHAIN_ID;
|
|
92
|
+
const jsonSchemaRef = `vpr:verana:${chainId}/cs/v1/js/${schema.id}`;
|
|
93
|
+
let digestSRI;
|
|
94
|
+
try {
|
|
95
|
+
digestSRI = await (0, vs_agent_model_1.computeSchemaDigest)(JSON.parse(schema.jsonSchema));
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
agent.config.logger.error(`[VTJSC] Failed to parse/digest schema ${schemaEntityId}`, e);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
await (0, trustCredentialStore_1.createJsc)(agent, agent.publicApiBaseUrl, (0, data_1.getEcsSchemas)(agent.publicApiBaseUrl), {
|
|
103
|
+
schemaBaseId: String(schema.id),
|
|
104
|
+
jsonSchemaRef,
|
|
105
|
+
precomputedDigestSRI: digestSRI,
|
|
106
|
+
});
|
|
107
|
+
agent.config.logger.info(`[VTJSC] Published VTJSC for schema ${schema.id} (TR ${schema.trId}) at block ${state.lastBlockHeight}`);
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
agent.config.logger.error(`[VTJSC] Failed to publish VTJSC for schema ${schema.id}`, e);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=stateMutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateMutations.js","sourceRoot":"","sources":["../../../src/blockchain/handlers/stateMutations.ts"],"names":[],"mappings":";;AASA,kDAcC;AAED,kDAaC;AAED,wDAuBC;AAED,4CA0BC;AAED,kDAsCC;AAnID,gEAAiE;AAGjE,2CAAgD;AAChD,2EAA4D;AAG5D,MAAM,gBAAgB,GAAG,eAAe,CAAA;AAExC,SAAgB,mBAAmB,CAAC,KAAsB,EAAE,QAAyB;;IACnF,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,eAAe,CAAC,EAAE,CAAC,CAAA;IAE1C,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,GAAG;QAC1B,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,UAAU,EAAE,MAAM,CAAC,MAA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AAC;IAED,IAAI,CAAC;QACH,MAAM,IAAA,gCAAS,EAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,EAAE,IAAA,oBAAa,EAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE;YACpF,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,aAAa;YACb,oBAAoB,EAAE,SAAS;SAChC,CAAC,CAAA;QACF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACtB,sCAAsC,MAAM,CAAC,EAAE,QAAQ,MAAM,CAAC,IAAI,cAAc,KAAK,CAAC,eAAe,EAAE,CACxG,CAAA;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,8CAA8C,MAAM,CAAC,EAAE,EAAE,EAAE,CAAU,CAAC,CAAA;IAClG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IndexerWebSocketService"), exports);
|
|
18
|
+
__exportStar(require("./VeranaHelpers"), exports);
|
|
19
|
+
__exportStar(require("./VeranaChainService"), exports);
|
|
20
|
+
__exportStar(require("./VeranaIndexerService"), exports);
|
|
21
|
+
__exportStar(require("./types"), exports);
|
|
22
|
+
__exportStar(require("./handlers"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blockchain/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,kDAA+B;AAC/B,uDAAoC;AACpC,yDAAsC;AACtC,0CAAuB;AACvB,6CAA0B"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { BaseLogger } from '@credo-ts/core';
|
|
2
|
+
export declare const VERANA_BECH32_PREFIX = "verana";
|
|
3
|
+
export declare const RECORD_ID = "verana-blockchain-sync-state";
|
|
4
|
+
export type IndexerEventRecord = {
|
|
5
|
+
type: 'indexer-event';
|
|
6
|
+
event_type: string;
|
|
7
|
+
did: string;
|
|
8
|
+
block_height: number;
|
|
9
|
+
tx_hash: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
payload: {
|
|
12
|
+
module: string;
|
|
13
|
+
action: string;
|
|
14
|
+
message_type: string;
|
|
15
|
+
tx_index: number;
|
|
16
|
+
message_index: number;
|
|
17
|
+
sender: string;
|
|
18
|
+
related_dids: string[];
|
|
19
|
+
entity_type?: string;
|
|
20
|
+
entity_id?: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export interface IndexerEventsResponse {
|
|
24
|
+
events: IndexerEventRecord[];
|
|
25
|
+
count: number;
|
|
26
|
+
after_block_height: number;
|
|
27
|
+
}
|
|
28
|
+
export type IndexerEntityType = 'TrustRegistry' | 'CredentialSchema' | 'Permission' | 'PermissionSession' | 'TrustDeposit';
|
|
29
|
+
export interface IndexerActivity {
|
|
30
|
+
timestamp: string;
|
|
31
|
+
block_height: string | number;
|
|
32
|
+
entity_type: IndexerEntityType | string;
|
|
33
|
+
entity_id: string;
|
|
34
|
+
msg: string;
|
|
35
|
+
changes: Record<string, unknown>;
|
|
36
|
+
account?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface IndexerChangesResponse {
|
|
39
|
+
block_height: number;
|
|
40
|
+
next_change_at: number | null;
|
|
41
|
+
activity: IndexerActivity[];
|
|
42
|
+
}
|
|
43
|
+
export interface VeranaIdxConfig {
|
|
44
|
+
baseUrl: string;
|
|
45
|
+
logger: BaseLogger;
|
|
46
|
+
}
|
|
47
|
+
export interface SyncedTrustRegistry {
|
|
48
|
+
id: number;
|
|
49
|
+
did: string;
|
|
50
|
+
controller: string;
|
|
51
|
+
archived: boolean;
|
|
52
|
+
activeGfVersion?: number;
|
|
53
|
+
lastModifiedBlock: number;
|
|
54
|
+
}
|
|
55
|
+
export interface SyncedCredentialSchema {
|
|
56
|
+
id: number;
|
|
57
|
+
trId: number;
|
|
58
|
+
jsonSchema: string;
|
|
59
|
+
issuerMode?: string;
|
|
60
|
+
verifierMode?: string;
|
|
61
|
+
archived: boolean;
|
|
62
|
+
lastModifiedBlock: number;
|
|
63
|
+
}
|
|
64
|
+
export interface SyncedPermission {
|
|
65
|
+
id: number;
|
|
66
|
+
schemaId: number;
|
|
67
|
+
did: string;
|
|
68
|
+
type: number;
|
|
69
|
+
vpState?: string;
|
|
70
|
+
effectiveUntil?: string;
|
|
71
|
+
revoked: boolean;
|
|
72
|
+
slashed: boolean;
|
|
73
|
+
lastModifiedBlock: number;
|
|
74
|
+
}
|
|
75
|
+
export interface VeranaSyncState {
|
|
76
|
+
lastBlockHeight: number;
|
|
77
|
+
trustRegistries: Record<string, SyncedTrustRegistry>;
|
|
78
|
+
credentialSchemas: Record<string, SyncedCredentialSchema>;
|
|
79
|
+
permissions: Record<string, SyncedPermission>;
|
|
80
|
+
}
|
|
81
|
+
export interface TrustRegistryDto {
|
|
82
|
+
id: number;
|
|
83
|
+
did: string;
|
|
84
|
+
controller: string;
|
|
85
|
+
archived: string | null;
|
|
86
|
+
active_gf_version?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface CredentialSchemaDto {
|
|
89
|
+
id: number;
|
|
90
|
+
tr_id: number;
|
|
91
|
+
json_schema: string;
|
|
92
|
+
issuer_perm_management_mode?: string;
|
|
93
|
+
verifier_perm_management_mode?: string;
|
|
94
|
+
archived: string | null;
|
|
95
|
+
created: string;
|
|
96
|
+
modified: string;
|
|
97
|
+
}
|
|
98
|
+
export interface PermissionDto {
|
|
99
|
+
id: number;
|
|
100
|
+
schema_id: number;
|
|
101
|
+
did: string | null;
|
|
102
|
+
type: number;
|
|
103
|
+
perm_state: 'ACTIVE' | 'REVOKED' | 'SLASHED' | 'REPAID' | 'EXPIRED' | 'FUTURE' | 'INACTIVE';
|
|
104
|
+
vp_state?: string;
|
|
105
|
+
revoked: string | null;
|
|
106
|
+
slashed: string | null;
|
|
107
|
+
effective_until?: string;
|
|
108
|
+
modified: string;
|
|
109
|
+
}
|
|
110
|
+
export interface PermQueryClient {
|
|
111
|
+
GetPermission(req: {
|
|
112
|
+
id: Long;
|
|
113
|
+
}): Promise<{
|
|
114
|
+
permission?: unknown;
|
|
115
|
+
}>;
|
|
116
|
+
FindPermissionsWithDID(req: object): Promise<{
|
|
117
|
+
permissions: unknown[];
|
|
118
|
+
}>;
|
|
119
|
+
GetPermissionSession(req: {
|
|
120
|
+
id: string;
|
|
121
|
+
}): Promise<{
|
|
122
|
+
session?: unknown;
|
|
123
|
+
}>;
|
|
124
|
+
}
|
|
125
|
+
export interface VeranaChainConfig {
|
|
126
|
+
rpcUrl: string;
|
|
127
|
+
chainId?: string;
|
|
128
|
+
mnemonic: string;
|
|
129
|
+
logger: BaseLogger;
|
|
130
|
+
gasPrice?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface StartPermissionVPParams {
|
|
133
|
+
type: number;
|
|
134
|
+
validatorPermId: Long;
|
|
135
|
+
country: string;
|
|
136
|
+
did: string;
|
|
137
|
+
validationFees?: {
|
|
138
|
+
value: Long;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export interface SetPermissionVPToValidatedParams {
|
|
142
|
+
id: Long;
|
|
143
|
+
effectiveUntil?: Date;
|
|
144
|
+
validationFees: Long;
|
|
145
|
+
issuanceFees: Long;
|
|
146
|
+
verificationFees: Long;
|
|
147
|
+
country: string;
|
|
148
|
+
vpSummaryDigestSri: string;
|
|
149
|
+
issuanceFeeDiscount: Long;
|
|
150
|
+
verificationFeeDiscount: Long;
|
|
151
|
+
}
|
|
152
|
+
export interface CreateOrUpdatePermissionSessionParams {
|
|
153
|
+
id: string;
|
|
154
|
+
issuerPermId: Long;
|
|
155
|
+
verifierPermId: Long;
|
|
156
|
+
agentPermId: Long;
|
|
157
|
+
walletAgentPermId: Long;
|
|
158
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RECORD_ID = exports.VERANA_BECH32_PREFIX = void 0;
|
|
4
|
+
exports.VERANA_BECH32_PREFIX = 'verana';
|
|
5
|
+
exports.RECORD_ID = 'verana-blockchain-sync-state';
|
|
6
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blockchain/types.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAG,QAAQ,CAAA;AAC/B,QAAA,SAAS,GAAG,8BAA8B,CAAA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { AgentContext, DidCreateOptions, DidCreateResult, DidDeactivateOptions, DidDeactivateResult, DidRegistrar, DidUpdateOptions, DidUpdateResult, DidDocument } from '@credo-ts/core';
|
|
1
|
+
import { AgentContext, DidCreateOptions, DidCreateResult, DidDeactivateOptions, DidDeactivateResult, DidDocumentKey, DidRegistrar, DidUpdateOptions, DidUpdateResult, DidDocument } from '@credo-ts/core';
|
|
2
2
|
interface WebDidCreateOptions extends DidCreateOptions {
|
|
3
3
|
domain: string;
|
|
4
|
+
keys?: DidDocumentKey[];
|
|
4
5
|
}
|
|
5
6
|
interface WebDidUpdateOptions extends DidUpdateOptions {
|
|
6
7
|
didDocument: DidDocument;
|
|
7
8
|
domain?: string;
|
|
9
|
+
keys?: DidDocumentKey[];
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* DID Registrar implementation for the 'webvh' method.
|
|
@@ -36,6 +36,7 @@ class WebDidRegistrar {
|
|
|
36
36
|
did,
|
|
37
37
|
didDocument,
|
|
38
38
|
role: core_1.DidDocumentRole.Created,
|
|
39
|
+
keys: options.keys,
|
|
39
40
|
});
|
|
40
41
|
didRecord.setTags({ domain });
|
|
41
42
|
await didRepository.save(agentContext, didRecord);
|
|
@@ -61,7 +62,7 @@ class WebDidRegistrar {
|
|
|
61
62
|
* @returns The result of the DID update, with error handling and validation.
|
|
62
63
|
*/
|
|
63
64
|
async update(agentContext, options) {
|
|
64
|
-
var _a;
|
|
65
|
+
var _a, _b, _c;
|
|
65
66
|
try {
|
|
66
67
|
const { domain } = options;
|
|
67
68
|
const did = (_a = options.did) !== null && _a !== void 0 ? _a : `did:web:${domain}`;
|
|
@@ -76,6 +77,14 @@ class WebDidRegistrar {
|
|
|
76
77
|
if (!didRecord)
|
|
77
78
|
return this.handleError('Did not found');
|
|
78
79
|
didRecord.didDocument = inputDidDocument;
|
|
80
|
+
if ((_b = options.keys) === null || _b === void 0 ? void 0 : _b.length) {
|
|
81
|
+
const existingKeys = (_c = didRecord.keys) !== null && _c !== void 0 ? _c : [];
|
|
82
|
+
const existingIds = new Set(existingKeys.map(k => k.didDocumentRelativeKeyId));
|
|
83
|
+
didRecord.keys = [
|
|
84
|
+
...existingKeys,
|
|
85
|
+
...options.keys.filter(k => !existingIds.has(k.didDocumentRelativeKeyId)),
|
|
86
|
+
];
|
|
87
|
+
}
|
|
79
88
|
await didRepository.update(agentContext, didRecord);
|
|
80
89
|
return {
|
|
81
90
|
didDocumentMetadata: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebDidRegistrar.js","sourceRoot":"","sources":["../../src/did/WebDidRegistrar.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"WebDidRegistrar.js","sourceRoot":"","sources":["../../src/did/WebDidRegistrar.ts"],"names":[],"mappings":";;;AAAA,yCAeuB;AAavB;;;GAGG;AACH,MAAa,eAAe;IAA5B;QACE,qBAAgB,GAAa,CAAC,KAAK,CAAC,CAAA;IAiHtC,CAAC;IA/GC;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CAAC,YAA0B,EAAE,OAA4B;;QAC1E,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;YAC1B,MAAM,GAAG,GAAG,MAAA,OAAO,CAAC,GAAG,mCAAI,WAAW,MAAM,EAAE,CAAA;YAC9C,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,WAAW,mCAAI,IAAI,kBAAW,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;YAEvE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;gBACpB,MAAM,IAAI,iBAAU,CAAC,+CAA+C,CAAC,CAAA;YACvE,CAAC;YACD,MAAM,aAAa,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,oBAAa,CAAC,CAAA;YAC3E,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,YAAY,EAAE;gBACzE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;aAC1C,CAAC,CAAA;YACF,IAAI,cAAc;gBAAE,OAAO,IAAI,CAAC,WAAW,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,CAAA;YAElF,MAAM,SAAS,GAAG,IAAI,gBAAS,CA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ACvB,uBAAuB,EAAE,EAAE;YAC3B,QAAQ,EAAE;gBACR,KAAK,EAAE,QAAQ;gBACf,MAAM;aACP;SACF,CAAA;IACH,CAAC;CACF;AAlHD,0CAkHC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AgentContext, DidRecord, Logger } from '@credo-ts/core';
|
|
2
|
+
import { DIDLog, Signer, Verifier } from 'didwebvh-ts';
|
|
3
|
+
export interface RebuildWebVhLogOptions {
|
|
4
|
+
/** Signer using a key that matches the active `updateKeys[0]` of the rebuilt prefix. */
|
|
5
|
+
signer: Signer;
|
|
6
|
+
/** Verifier used both for resolution checks and for the `documentStateIsValid` step inside `updateDID`. */
|
|
7
|
+
verifier: Verifier;
|
|
8
|
+
/** Optional domain hint (matches the tag stored on the DidRecord). */
|
|
9
|
+
domain?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Pure rebuild logic, decoupled from credo / askar so it can be unit-tested.
|
|
13
|
+
*
|
|
14
|
+
* If `log` resolves cleanly under the current didwebvh-ts version, returns `null`
|
|
15
|
+
* (nothing to do). Otherwise, if the failure is the known `<2.7.4` "hash chain
|
|
16
|
+
* broken" bug, rebuilds entries 2..N (preserving entry #1, SCID, every entry's
|
|
17
|
+
* `state` and `parameters`) and returns the new log. For any other resolution
|
|
18
|
+
* error, returns `null` and lets the caller decide what to do.
|
|
19
|
+
*/
|
|
20
|
+
export declare function rebuildWebVhLog(log: DIDLog, { signer, verifier, domain }: RebuildWebVhLogOptions): Promise<DIDLog | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Detect a `did:webvh` log that became unresolvable because of the
|
|
23
|
+
* `didwebvh-ts` <2.7.4 entry-hash bug (placeholder versionId used for entries
|
|
24
|
+
* after the first). If so, rebuild the log preserving:
|
|
25
|
+
* - entry #1 byte-for-byte (preserving the SCID and therefore the public DID)
|
|
26
|
+
* - the `state` and `parameters` of entries 2..N (services, keys, controller, etc.)
|
|
27
|
+
*
|
|
28
|
+
* Only the entryHash and proof of entries 2..N are recomputed/re-signed using
|
|
29
|
+
* the controller key the agent already holds in askar.
|
|
30
|
+
*
|
|
31
|
+
* Returns true if migration ran successfully, false if it was not needed.
|
|
32
|
+
* Throws if the rebuild fails or the result is somehow invalid.
|
|
33
|
+
*/
|
|
34
|
+
export declare function migrateWebVhLogIfBroken(agentContext: AgentContext, didRecord: DidRecord, logger: Logger): Promise<boolean>;
|