@opendatalabs/vana-sdk
Version:
A TypeScript library for interacting with Vana Network smart contracts.
18 lines • 572 B
JavaScript
function wrapCryptoError(operation, error) {
const message = error instanceof Error ? error.message : "Unknown error";
return new Error(`${operation} failed: ${message}`);
}
function validateEncryptedDataStructure(data) {
if (!data || typeof data !== "object") {
throw new Error("Invalid encrypted data format");
}
const obj = data;
if (!obj.encrypted || !obj.iv || !obj.ephemeralPublicKey) {
throw new Error("Invalid encrypted data format");
}
}
export {
validateEncryptedDataStructure,
wrapCryptoError
};
//# sourceMappingURL=error-utils.js.map