Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials: decode simple CredentialType values #1080

Open
mDuo13 opened this issue Nov 11, 2024 · 2 comments
Open

Credentials: decode simple CredentialType values #1080

mDuo13 opened this issue Nov 11, 2024 · 2 comments

Comments

@mDuo13
Copy link

mDuo13 commented Nov 11, 2024

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"

@mvadari
Copy link
Collaborator

mvadari commented Nov 11, 2024

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

@ckeshava
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants