UNPKG

@iexec/dataprotector

Version:

This product enables users to confidentially store data–such as mail address, documents, personal information ...

19 lines 776 B
import { WorkflowError } from '../../utils/errors.js'; import { addressOrEnsSchema, throwIfMissing } from '../../utils/validators.js'; export const transferOwnership = async ({ iexec = throwIfMissing(), protectedData, newOwner, }) => { const vProtectedData = addressOrEnsSchema() .required() .label('protectedData') .validateSync(protectedData); const vNewOwner = addressOrEnsSchema() .required() .label('newOwner') .validateSync(newOwner); return iexec.dataset.transferDataset(vProtectedData, vNewOwner).catch((e) => { throw new WorkflowError({ message: 'Failed to transfer protectedData ownership', errorCause: e, }); }); }; //# sourceMappingURL=transferOwnership.js.map