make invoice expiration times have saner defaults
This commit is contained in:
parent
abb9ca5524
commit
86239a235d
@ -207,10 +207,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
Mutation: {
|
Mutation: {
|
||||||
createInvoice: async (parent, { amount }, { me, models, lnd }) => {
|
createInvoice: async (parent, { amount, expireSecs = 3600 }, { me, models, lnd }) => {
|
||||||
await ssValidate(amountSchema, { amount })
|
await ssValidate(amountSchema, { amount })
|
||||||
|
|
||||||
let expirePivot = { hours: 3 }
|
let expirePivot = { seconds: expireSecs }
|
||||||
let invLimit = INV_PENDING_LIMIT
|
let invLimit = INV_PENDING_LIMIT
|
||||||
let balanceLimit = BALANCE_LIMIT_MSATS
|
let balanceLimit = BALANCE_LIMIT_MSATS
|
||||||
let id = me?.id
|
let id = me?.id
|
||||||
|
@ -9,7 +9,7 @@ export default gql`
|
|||||||
}
|
}
|
||||||
|
|
||||||
extend type Mutation {
|
extend type Mutation {
|
||||||
createInvoice(amount: Int!): Invoice!
|
createInvoice(amount: Int!, expireSecs: Int): Invoice!
|
||||||
createWithdrawl(invoice: String!, maxFee: Int!): Withdrawl!
|
createWithdrawl(invoice: String!, maxFee: Int!): Withdrawl!
|
||||||
sendToLnAddr(addr: String!, amount: Int!, maxFee: Int!): Withdrawl!
|
sendToLnAddr(addr: String!, amount: Int!, maxFee: Int!): Withdrawl!
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ export const useInvoiceable = (fn, options = defaultOptions) => {
|
|||||||
const me = useMe()
|
const me = useMe()
|
||||||
const [createInvoice, { data }] = useMutation(gql`
|
const [createInvoice, { data }] = useMutation(gql`
|
||||||
mutation createInvoice($amount: Int!) {
|
mutation createInvoice($amount: Int!) {
|
||||||
createInvoice(amount: $amount) {
|
createInvoice(amount: $amount, expireSecs: 1800) {
|
||||||
id
|
id
|
||||||
hash
|
hash
|
||||||
hmac
|
hmac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user