Depends on D15100
- Fix typo in toLocaleString() implementation
- Use tokenUtxo.slpToken.amount which, in the chronik utxo object, is already undecimalized (so save the op)
Differential D15101
[Cashtab] Update getSlpSendTargetOutputs to match optimizations of getSlpBurnTargetOutput bytesofman on Jan 5 2024, 18:30. Authored by
Details
Depends on D15100
npm test
Diff Detail
Event Timeline
Comment Actions AFAICT it's not only the error message that is changed, but also the behavior. Comment Actions tokenUtxo.tokenQty !== tokenUtxo.slpToken.amount ... er well, it does, but only when decimals = 0. new BN(tokenUtxo.tokenQty).times(10 ** decimals) === new BN(tokenUtxo.slpToken.amount) --> always true, assuming no issues with chronik indexing and delivery chronik stores the "what's the actual amount when we take into account decimals" value at tokenUtxo.tokenQty as a string. The SLP-spec-friendly way of storing it (integer) is kept at tokenUtxo.slpToken.amount as a string. So, we should just use the string that is already an integer, instead of re-converting this new string.
Comment Actions You misunderstood what I wrote, and that's my fault. I wrote the token is named T, so 10.6T is not Tera but 10.6 of the token quantity. |