WIP wallet history

This commit is contained in:
keyan 2021-11-30 09:23:26 -06:00
parent 435f32ac09
commit ca54abcf09
2 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import { createInvoice, decodePaymentRequest, subscribeToPayViaRequest } from 'ln-service'
import { UserInputError, AuthenticationError } from 'apollo-server-micro'
import serialize from './serial'
import { decodeCursor } from '../../lib/cursor'
export default {
Query: {
@ -46,6 +47,13 @@ export default {
},
connectAddress: async (parent, args, { lnd }) => {
return process.env.LND_CONNECT_ADDRESS
},
walletHistory: async (parent, { cursor }, { me, models, lnd }) => {
const decodedCursor = decodeCursor(cursor)
if (!me) {
throw new AuthenticationError('you must be logged in')
}
}
},

View File

@ -5,6 +5,7 @@ export default gql`
invoice(id: ID!): Invoice!
withdrawl(id: ID!): Withdrawl!
connectAddress: String!
walletHistory(cursor: String): History
}
extend type Mutation {
@ -37,4 +38,11 @@ export default gql`
satsFeePaid: Int
status: String
}
union Fact = Invoice | Withdrawl
type History {
facts: [Fact!]!
cursor: String
}
`