stacker.news/fragments/wallet.js

71 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-10-26 20:49:37 +00:00
import { gql } from '@apollo/client'
2021-12-16 20:02:17 +00:00
import { ITEM_FIELDS } from './items'
2022-05-18 19:31:24 +00:00
import { USER_FIELDS } from './users'
2021-10-26 20:49:37 +00:00
export const INVOICE = gql`
query Invoice($id: ID!) {
invoice(id: $id) {
id
bolt11
2022-11-15 20:51:55 +00:00
satsReceived
2021-10-26 20:49:37 +00:00
cancelled
confirmedAt
expiresAt
}
}`
export const WITHDRAWL = gql`
query Withdrawl($id: ID!) {
withdrawl(id: $id) {
id
bolt11
satsPaid
satsFeePaying
satsFeePaid
status
}
}`
2021-10-28 19:59:53 +00:00
2021-12-15 16:50:11 +00:00
export const WALLET_HISTORY = gql`
2021-12-16 20:02:17 +00:00
${ITEM_FIELDS}
2022-05-18 19:31:24 +00:00
${USER_FIELDS}
2021-12-16 20:02:17 +00:00
2021-12-16 17:27:12 +00:00
query WalletHistory($cursor: String, $inc: String) {
2022-05-18 19:31:24 +00:00
me {
...UserFields
}
2021-12-16 17:27:12 +00:00
walletHistory(cursor: $cursor, inc: $inc) {
2021-12-15 16:50:11 +00:00
facts {
id
2021-12-16 17:27:12 +00:00
factId
2021-12-15 16:50:11 +00:00
type
createdAt
2022-11-15 20:51:55 +00:00
sats
satsFee
2021-12-15 16:50:11 +00:00
status
type
description
2021-12-16 20:02:17 +00:00
item {
...ItemFields
text
}
2021-12-15 16:50:11 +00:00
}
cursor
}
}
`
2021-10-28 19:59:53 +00:00
export const CREATE_WITHDRAWL = gql`
mutation createWithdrawl($invoice: String!, $maxFee: Int!) {
createWithdrawl(invoice: $invoice, maxFee: $maxFee) {
id
}
}`
2022-01-23 17:21:55 +00:00
export const SEND_TO_LNADDR = gql`
mutation sendToLnAddr($addr: String!, $amount: Int!, $maxFee: Int!) {
sendToLnAddr(addr: $addr, amount: $amount, maxFee: $maxFee) {
id
}
}`