diff --git a/services/gunDB/contact-api/utils/index.js b/services/gunDB/contact-api/utils/index.js index b9121093..5ce3bd4f 100644 --- a/services/gunDB/contact-api/utils/index.js +++ b/services/gunDB/contact-api/utils/index.js @@ -1,6 +1,7 @@ /** * @format */ +const { getUser, mySEA: SEA } = require('../../Mediator') const ErrorCode = require('../errorCode') const Key = require('../key') @@ -16,6 +17,14 @@ const Key = require('../key') */ const delay = ms => new Promise(res => setTimeout(res, ms)) +/** + * @returns {Promise} + */ +const mySecret = () => { + const user = getUser() + return SEA.secret(user._.sea.epub, user._.sea) +} + /** * @template T * @param {Promise} promise @@ -292,5 +301,6 @@ module.exports = { reqWasAccepted, currHandshakeAddress, tryAndWait, + mySecret, promisifyGunNode: require('./promisifygun') }