SatsAllDay 56111efd6a
SN wallet transaction details (#550)
* display bolt11 info and preimage for invoices

* Remove preimage attempt for wdrwl, since it doesn't make sense

Other various code cleanup

* Only include preimage for confirmed paid and settled invoices
2023-10-20 19:25:22 -05:00

74 lines
1.5 KiB
JavaScript

import { gql } from '@apollo/client'
import { ITEM_FULL_FIELDS } from './items'
export const INVOICE = gql`
query Invoice($id: ID!) {
invoice(id: $id) {
id
hash
bolt11
satsRequested
satsReceived
cancelled
confirmedAt
expiresAt
nostr
isHeld
comment
lud18Data
preimage
}
}`
export const WITHDRAWL = gql`
query Withdrawl($id: ID!) {
withdrawl(id: $id) {
id
bolt11
satsPaid
satsFeePaying
satsFeePaid
status
}
}`
export const WALLET_HISTORY = gql`
${ITEM_FULL_FIELDS}
query WalletHistory($cursor: String, $inc: String) {
walletHistory(cursor: $cursor, inc: $inc) {
facts {
id
factId
type
createdAt
sats
satsFee
status
type
description
invoiceComment
invoicePayerData
item {
...ItemFullFields
}
}
cursor
}
}
`
export const CREATE_WITHDRAWL = gql`
mutation createWithdrawl($invoice: String!, $maxFee: Int!) {
createWithdrawl(invoice: $invoice, maxFee: $maxFee) {
id
}
}`
export const SEND_TO_LNADDR = gql`
mutation sendToLnAddr($addr: String!, $amount: Int!, $maxFee: Int!, $comment: String, $identifier: Boolean, $name: String, $email: String) {
sendToLnAddr(addr: $addr, amount: $amount, maxFee: $maxFee, comment: $comment, identifier: $identifier, name: $name, email: $email) {
id
}
}`