mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-23 22:46:35 +01:00
* refactor: ♻️ change schema * chore: 🔧 small changes * chore: 🔧 cleanup * chore: 🔧 cleanup types * chore: 🔧 change to absolute imports Co-authored-by: apotdevin <apotdevincab@gmail.com>
22 lines
650 B
TypeScript
22 lines
650 B
TypeScript
import { getWalletVersion } from 'ln-service';
|
|
import { ContextType } from 'server/types/apiTypes';
|
|
import { to } from 'server/helpers/async';
|
|
import { requestLimiter } from 'server/helpers/rateLimiter';
|
|
import { getAuthLnd, getCorrectAuth } from 'server/helpers/helpers';
|
|
|
|
export const walletResolvers = {
|
|
Query: {
|
|
getWalletInfo: async (_: undefined, params: any, context: ContextType) => {
|
|
await requestLimiter(context.ip, 'getWalletInfo');
|
|
|
|
const auth = getCorrectAuth(params.auth, context);
|
|
const lnd = getAuthLnd(auth);
|
|
|
|
return await to(
|
|
getWalletVersion({
|
|
lnd,
|
|
})
|
|
);
|
|
},
|
|
},
|
|
};
|