UNPKG

@lighthouse-web3/sdk

Version:

NPM package and CLI tool to interact with lighthouse protocol

17 lines (16 loc) 725 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const kavach_1 = require("@lighthouse-web3/kavach"); exports.default = async (publicKey, cid, signedMessage, conditions, aggregator = undefined, chainType = 'evm') => { // send encryption key const { isSuccess, error } = await (0, kavach_1.accessControl)(publicKey, cid, signedMessage, conditions, aggregator, chainType); if (!isSuccess || error) { const errorMessage = typeof error === 'string' ? error : error instanceof Error ? error.message : JSON.stringify(error); throw new Error(errorMessage); } return { data: { cid: cid, status: 'Success' } }; };