Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: withdraw functionality #32

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
12 changes: 3 additions & 9 deletions src/commands/withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ export const withdraw = async (context: Context, blockIo: any) => {
return;
}

if (availableBalance < +amount) {
// 2 doge are left to make sure to cover the fees
if (availableBalance + 2 < +amount) {
await context.sendText(
`Looks like this amount is above your balance - you only have ${availableBalance} doge!`
);
return;
}

if (+amount < 2) {
await context.sendText(
`Such low amount! Much too low to cover fees! ${utils.generateWow()}`
`Looks like this amount is above your balance (+ 2 doge to cover fees) - you only have ${availableBalance} doge!`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fee is 1 DOGE... but I think is fine anyway :)

);
return;
}
Expand Down