mymonero / mymonero-utils

A collection of npm packages providing the core functionality to the web, desktop, and android apps
13 stars 19 forks source link

Fee property is not in Lightwallet API spec for get_address_txs #149

Open CryptoGrampy opened 1 year ago

CryptoGrampy commented 1 year ago

I noticed when using mymonero-utils that there is a fee property used in a few places for calculating tx amounts, etc. This property in mymonero-utils originates from the get_address_tx response object from api.mymonero.com, but it's not actually part of the lightwallet spec. This results in issues when using the library with a different light wallet server as they don't send the fee property.

If possible, it would be great if the .fee call was replaced with a function for calculating and setting the fee amount on each past tx's internally, and ultimately remove the usage of that API property.

https://github.com/mymonero/mymonero-utils/blob/ec7fb21661ef867d35952491ae0c1624625d4200/packages/mymonero-wallet-manager/src/Wallet.js#L366

vtnerd commented 3 months ago

I made a mistake when doing the spec - fee should've been in the transaction object as a uint64 string. Monero-LWS already does this, but OpenMonero does not.

I think the correct approach is to fix the API and OpenMonero. I will fix the spec and open an issue with OpenMonero.