StricaHQ / typhonjs

Pure javascript Cardano wallet library
Apache License 2.0
61 stars 12 forks source link

Need to update calculateMinUtxoAmount() for Babbage era #21

Closed inimrod closed 7 months ago

inimrod commented 2 years ago

Since the Vasil HF, per the official docs:

the minUTxO formula is now calculated using original bytes instead of lovelacePerUTxOWord. For more details, see CIP-55.

As of typhonjs v1.2.7, the calculateMinUtxoAmount() in utils is still using the old formula. This now needs to be updated.

mahnunchik commented 1 year ago

Any news?

ashisherc commented 1 year ago

is this a road blocker somehow?

mahnunchik commented 1 year ago

It is not possible to send less then 1 ADA, currently the method calculateMinUtxoAmount calculates 0.999978 ADA. Even on https://typhonwallet.io/#/wallet

inimrod commented 1 year ago

is this a road blocker somehow?

Not strictly, but the current workarounds are either costly, or messy (at least for me 😄). I've got quite a few txs now that failed because the minUtxo is calculated incorrectly and ends up being lower than required, especially in cases where there's a lot of tokens in the bundle.

What works for me right now is manually setting the lovelacePerUtxoWord param to 34482 like it was, before Vasil. But this makes the minUtxo more than what's actually required now.

ashisherc commented 1 year ago

Noted, will update the lib shortly!

ashisherc commented 1 year ago

This update requires breaking changes. The lib will function fine by setting lovelacePerUtxoWord param to 34482, hence will update this method along with the babbage era upgrades.

ashisherc commented 7 months ago

updated with https://github.com/StricaHQ/typhonjs/pull/34