helium-ledger-app icon indicating copy to clipboard operation
helium-ledger-app copied to clipboard

Implement Max Payment

Open owmo-dev opened this issue 3 years ago • 3 comments

Feature Request

Adding a --deduct flag to the pay command, which would automatically determine how much HNT would be required to complete a transaction. If the wallet's remaining HNT is not sufficient, using the flag would then deduct it from the payment amount and prompt the user if they want to proceed with the new transfer amount.

My exact use-case is wanting to send the full amount of HNT in one wallet to another address. It's difficult to manually determine the exact math required to make the transfer result in a 0HNT wallet.

owmo-dev avatar Jul 02 '21 05:07 owmo-dev

@ctrlshiftmake is this feature available now?

mfalkvidd avatar Jul 25 '21 06:07 mfalkvidd

No it's not. But I implemented very similar logic here: https://github.com/helium/helium-wallet-rs/pull/76

It's actually slightly easier here because Ledger still uses payment_v1 for now. So the cost will always be $0.35 in DC (not iterative logic necessary).

lthiery avatar Jul 25 '21 16:07 lthiery

There has been blockchain work to make the underlying payment_v2 transaction support a "max payment" option which effectively sweeps the entire balance (minus the DC cost).

When that is live, we will go towards integrating that feature in ledger-app and ledger-cli.

lthiery avatar May 31 '22 06:05 lthiery