import { DidCommV1Service, DidDocumentBuilder, DidKey, createPeerDidDocumentFromServices, didDocumentToNumAlgo2Did, didKeyToEd25519PublicJwk } from "@credo-ts/core";

//#region ../didcomm/src/modules/oob/helpers.ts
function outOfBandServiceToInlineKeysNumAlgo2Did(service) {
	return didDocumentToNumAlgo2Did(new DidDocumentBuilder("").addService(new DidCommV1Service({
		id: service.id,
		serviceEndpoint: service.serviceEndpoint,
		accept: service.accept,
		recipientKeys: service.recipientKeys.map((recipientKey) => {
			const did = DidKey.fromDid(recipientKey);
			return `${did.did}#${did.publicJwk.fingerprint}`;
		}),
		routingKeys: service.routingKeys?.map((routingKey) => {
			const did = DidKey.fromDid(routingKey);
			return `${did.did}#${did.publicJwk.fingerprint}`;
		})
	})).build());
}
function outOfBandServiceToNumAlgo2Did(service) {
	const { didDocument } = createPeerDidDocumentFromServices([{
		id: service.id,
		recipientKeys: service.recipientKeys.map(didKeyToEd25519PublicJwk),
		serviceEndpoint: service.serviceEndpoint,
		routingKeys: service.routingKeys?.map(didKeyToEd25519PublicJwk) ?? []
	}], false);
	return didDocumentToNumAlgo2Did(didDocument);
}

//#endregion
export { outOfBandServiceToInlineKeysNumAlgo2Did, outOfBandServiceToNumAlgo2Did };
//# sourceMappingURL=helpers.mjs.map