diff --git a/src/routes.js b/src/routes.js index 0446ae40..44f262c4 100644 --- a/src/routes.js +++ b/src/routes.js @@ -2456,99 +2456,6 @@ module.exports = async ( ap.get(`/api/gun/me`, apiGunMeGet) ap.put(`/api/gun/me`, apiGunMePut) - ap.get(`/api/gun/dev/currentHandshakeAddress`, async (_, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait((_, u) => - u.get(GunKey.CURRENT_HANDSHAKE_ADDRESS).then() - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - - ap.get( - `/api/gun/dev/handshakeNodes/:handshakeAddress`, - async (req, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - g => - new Promise(res => { - g.get(GunKey.HANDSHAKE_NODES) - .get(req.params.handshakeAddress) - .load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - } - ) - - ap.get(`/api/gun/dev/user/:publicKey`, async (req, res) => { - try { - const { tryAndWait } = require('../services/gunDB/contact-api/utils') - - const data = await tryAndWait( - g => - new Promise(res => { - g.user(req.params.publicKey).load(data => { - res(data) - }) - }), - v => { - if (typeof v !== 'object') { - return true - } - - if (v === null) { - return true - } - - // load sometimes returns an empty set on the first try - return size(v) === 0 - } - ) - - return res.status(200).json({ - data - }) - } catch (err) { - return res.status(500).json({ - errorMessage: err.message - }) - } - }) - ap.get(`/api/gun/auth`, (_, res) => { const { isAuthenticated } = require('../services/gunDB/Mediator')