userToIncomingID getter
This commit is contained in:
parent
db884955fe
commit
1b44fe1fd0
1 changed files with 15 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
|||
const {getUser} = require('../Mediator')
|
||||
|
||||
const Key = require('./key')
|
||||
const Utils = require('./utils')
|
||||
|
||||
|
|
@ -14,3 +16,16 @@ exports.currentOrderAddress = async (pub) => {
|
|||
|
||||
return currAddr
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} pub
|
||||
* @returns {Promise<string|null>}
|
||||
*/
|
||||
exports.userToIncomingID = async (pub) => {
|
||||
const incomingID = await getUser().get(Key.USER_TO_INCOMING).get(pub).then()
|
||||
|
||||
if (typeof incomingID === 'string') return incomingID
|
||||
|
||||
return null
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue