XRPLF / xrpl-hooks-ide

XRPL Hooks Builder - Add smart contract functionality to the XRP Ledger
https://hooks-builder.xrpl.org
17 stars 5 forks source link

Transaction amount UI. #294

Closed muzam1l closed 1 year ago

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
xrpl-hooks-ide ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 17, 2023 at 2:42PM (UTC)
muzam1l commented 1 year ago

that the currency must have 3 characters.

Well, Currency can also be a hexadecimal string. https://xrpl.org/currency-formats.html#nonstandard-currency-codes

muzam1l commented 1 year ago

but why does it change the field name in OfferCreate (from TakerPays to Amount)?

OfferCreate transaction meta seems wrong already, so will update that accordingly.

vbar commented 1 year ago

that the currency must have 3 characters.

Well, Currency can also be a hexadecimal string. https://xrpl.org/currency-formats.html#nonstandard-currency-codes

Well, yes, if you want to have another dropdown there there to select the format - but isn't the GUI getting rather complicated?

muzam1l commented 1 year ago

that the currency must have 3 characters.

Well, Currency can also be a hexadecimal string. https://xrpl.org/currency-formats.html#nonstandard-currency-codes

Well, yes, if you want to have another dropdown there there to select the format - but isn't the GUI getting rather complicated?

Well, we are not doing any formatting on the Currency field. Users have to enter the correct hexadecimal currency code if they wish to use that.

vbar commented 1 year ago

Well, we are not doing any formatting on the Currency field. Users have to enter the correct hexadecimal currency code if they wish to use that.

OK, in that case the required length is either 3 for the normal code, or 40 for the quoted hexadecimal - right?

muzam1l commented 1 year ago

OK, in that case the required length is either 3 for the normal code, or 40 for the quoted hexadecimal - right?

Well, we currently only do structural validation, everywhere not just amounts, and rely on xrpl runtime to do input validation 😅. So yeah, input/pattern validation can be some other pr!

vbar commented 1 year ago

OK, in that case the required length is either 3 for the normal code, or 40 for the quoted hexadecimal - right?

Well, we currently only do structural validation, everywhere not just amounts, and rely on xrpl runtime to do input validation sweat_smile. So yeah, input/pattern validation can be some other pr!

But fields that must be filled in are checked to be non-empty - right? For example Payment cannot get a fee estimate until it has specified both sender account and destination - while in this PR, when switching the amount to tokens, the Fee button is enabled but doesn't work...

muzam1l commented 1 year ago

while in this PR, when switching the amount to tokens, the Fee button is enabled but doesn't work.

That would be a bug. Even if there is some missing validation in UI, the backend is supposed to give all errors correctly!