explorer icon indicating copy to clipboard operation
explorer copied to clipboard

Credentials: decode simple CredentialType values

Open mDuo13 opened this issue 1 year ago • 2 comments

This applies to CredentialCreate, CredentialAccept, and CredentialDelete transaction views, as well as anywhere else Credential details are displayed (currently I think that's all).

Similar to how the explorer decodes other hex values like accounts' Domain value or extended currency codes, I expect the CredentialType field to be decoded into human-readable text, at least if it decodes into reasonable plain text using ASCII. (Or UTF-8, although that has a lot more edge cases to account for.) Obviously you would want to exclude or escape special characters so that you don't end up with cross-site scripting, or right-to-left text, or other glitchiness, similar to how you do with Domains, Memos, and other examples.

I would expect this to display the CredentialType as test_cred1 for example. (Test transaction on Devnet): Screenshot of the "Simple" view of a sample transaction. The CredentialType is displayed as the hex "746573745F6372656431"

mDuo13 avatar Nov 11 '24 22:11 mDuo13

Credential support hasn't actually been added yet, this is just the default processing.

mvadari avatar Nov 11 '24 23:11 mvadari

Hello, DepositPreauth transaction also deals with arrays of credentials. It is helpful to decode those hex-strings as well. Here's an exanple: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0070d-credentials#124-depositpreauth

ckeshava avatar Nov 11 '24 23:11 ckeshava

Fixed by #1118

mvadari avatar Apr 01 '25 20:04 mvadari