max amount for alby

This commit is contained in:
keyan 2022-09-06 09:37:53 -05:00
parent 7efc86427d
commit 52de4a253e
1 changed files with 2 additions and 1 deletions

View File

@ -153,7 +153,8 @@ export function WithdrawlForm () {
try {
const provider = await requestProvider()
const { paymentRequest: invoice } = await provider.makeInvoice({
defaultMemo: `Withdrawal for @${me.name} on SN`
defaultMemo: `Withdrawal for @${me.name} on SN`,
maximumAmount: Math.max(me.sats - MAX_FEE_DEFAULT, 0)
})
const { data } = await createWithdrawl({ variables: { invoice, maxFee: MAX_FEE_DEFAULT } })
router.push(`/withdrawals/${data.createWithdrawl.id}`)