WIP wallet history
This commit is contained in:
parent
435f32ac09
commit
ca54abcf09
|
@ -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')
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue