diff --git a/services/gunDB/contact-api/getters.js b/services/gunDB/contact-api/getters.js index fa704e37..d0cc8baa 100644 --- a/services/gunDB/contact-api/getters.js +++ b/services/gunDB/contact-api/getters.js @@ -1,3 +1,5 @@ +const {getUser} = require('../Mediator') + const Key = require('./key') const Utils = require('./utils') @@ -13,4 +15,17 @@ exports.currentOrderAddress = async (pub) => { } return currAddr +} + +/** + * @param {string} pub + * @returns {Promise} + */ +exports.userToIncomingID = async (pub) => { + const incomingID = await getUser().get(Key.USER_TO_INCOMING).get(pub).then() + + if (typeof incomingID === 'string') return incomingID + + return null + } \ No newline at end of file