max amount for alby

This commit is contained in:
keyan 2022-09-06 09:37:53 -05:00
parent 7efc86427d
commit 52de4a253e

View File

@ -153,7 +153,8 @@ export function WithdrawlForm () {
try { try {
const provider = await requestProvider() const provider = await requestProvider()
const { paymentRequest: invoice } = await provider.makeInvoice({ 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 } }) const { data } = await createWithdrawl({ variables: { invoice, maxFee: MAX_FEE_DEFAULT } })
router.push(`/withdrawals/${data.createWithdrawl.id}`) router.push(`/withdrawals/${data.createWithdrawl.id}`)