feat: internal utility functions for token management (creation, deletion, etc)

Including tests
This commit is contained in:
Julian Lam
2023-04-28 15:28:00 -04:00
parent e0149462b3
commit 7b8bffd763
4 changed files with 203 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ settingsController.social = async function (req, res) {
settingsController.api = async (req, res) => {
const { tokens } = await meta.settings.get('core.api');
const scores = await api.utils.getLastSeen(tokens.map(t => t.token));
const scores = await api.utils.tokens.getLastSeen(tokens.map(t => t.token));
const [lastSeen, lastSeenISO] = tokens.reduce((memo, cur, idx) => {
memo[0][cur.token] = scores[idx];