fix qr withdrawal
This commit is contained in:
parent
0fe1d45c8f
commit
d3fac7f968
@ -436,11 +436,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createWithdrawal (parent, { invoice, maxFee }, { me, models, lnd, headers }) {
|
async function createWithdrawal (parent, { invoice, maxFee }, { me, models, lnd }) {
|
||||||
await ssValidate(withdrawlSchema, { invoice, maxFee })
|
await ssValidate(withdrawlSchema, { invoice, maxFee })
|
||||||
|
|
||||||
await assertGofacYourself({ models, headers })
|
|
||||||
|
|
||||||
// remove 'lightning:' prefix if present
|
// remove 'lightning:' prefix if present
|
||||||
invoice = invoice.replace(/^lightning:/, '')
|
invoice = invoice.replace(/^lightning:/, '')
|
||||||
|
|
||||||
|
@ -1,17 +1,23 @@
|
|||||||
// verify k1 exists
|
// verify k1 exists
|
||||||
// send back
|
// send back
|
||||||
import models from '../../api/models'
|
import models from '../../api/models'
|
||||||
|
import assertGofacYourself from '../../api/resolvers/ofac'
|
||||||
import getSSRApolloClient from '../../api/ssrApollo'
|
import getSSRApolloClient from '../../api/ssrApollo'
|
||||||
import { CREATE_WITHDRAWL } from '../../fragments/wallet'
|
import { CREATE_WITHDRAWL } from '../../fragments/wallet'
|
||||||
import { datePivot } from '../../lib/time'
|
import { datePivot } from '../../lib/time'
|
||||||
|
|
||||||
export default async ({ query }, res) => {
|
export default async ({ query, headers }, res) => {
|
||||||
if (!query.k1) {
|
if (!query.k1) {
|
||||||
return res.status(400).json({ status: 'ERROR', reason: 'k1 not provided' })
|
return res.status(400).json({ status: 'ERROR', reason: 'k1 not provided' })
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.pr) {
|
if (query.pr) {
|
||||||
return doWithdrawal(query, res)
|
try {
|
||||||
|
await assertGofacYourself({ models, headers })
|
||||||
|
return doWithdrawal(query, res)
|
||||||
|
} catch (e) {
|
||||||
|
return res.status(400).json({ status: 'ERROR', reason: e.message })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let reason
|
let reason
|
||||||
|
Loading…
x
Reference in New Issue
Block a user