WIP wallet history
This commit is contained in:
parent
435f32ac09
commit
ca54abcf09
@ -1,6 +1,7 @@
|
|||||||
import { createInvoice, decodePaymentRequest, subscribeToPayViaRequest } from 'ln-service'
|
import { createInvoice, decodePaymentRequest, subscribeToPayViaRequest } from 'ln-service'
|
||||||
import { UserInputError, AuthenticationError } from 'apollo-server-micro'
|
import { UserInputError, AuthenticationError } from 'apollo-server-micro'
|
||||||
import serialize from './serial'
|
import serialize from './serial'
|
||||||
|
import { decodeCursor } from '../../lib/cursor'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Query: {
|
Query: {
|
||||||
@ -46,6 +47,13 @@ export default {
|
|||||||
},
|
},
|
||||||
connectAddress: async (parent, args, { lnd }) => {
|
connectAddress: async (parent, args, { lnd }) => {
|
||||||
return process.env.LND_CONNECT_ADDRESS
|
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!
|
invoice(id: ID!): Invoice!
|
||||||
withdrawl(id: ID!): Withdrawl!
|
withdrawl(id: ID!): Withdrawl!
|
||||||
connectAddress: String!
|
connectAddress: String!
|
||||||
|
walletHistory(cursor: String): History
|
||||||
}
|
}
|
||||||
|
|
||||||
extend type Mutation {
|
extend type Mutation {
|
||||||
@ -37,4 +38,11 @@ export default gql`
|
|||||||
satsFeePaid: Int
|
satsFeePaid: Int
|
||||||
status: String
|
status: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
union Fact = Invoice | Withdrawl
|
||||||
|
|
||||||
|
type History {
|
||||||
|
facts: [Fact!]!
|
||||||
|
cursor: String
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user