-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Credentials and PermissionedDomain tx Support (#1118)
## High Level Overview of Change <!-- Please include a summary/list of the changes. If too broad, please consider splitting into multiple PRs. --> Adds CredentialCreate, CredentialAccept, CredentialDelete, PermissionedDomainDelete, and PermissionedDomainSet transaction pages to the explorer. ### Context of Change <!-- Please include the context of a change. If a bug fix, when was the bug introduced? What was the behavior? If a new feature, why was this architecture chosen? What were the alternatives? If a refactor, how is this better than the previous implementation? If there is a design document for this feature, please link it here. --> https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0070d-credentials https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0080d-permissioned-domains ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (non-breaking change that only restructures code) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Translation Updates - [ ] Release ### TypeScript/Hooks Update <!-- In an effort to modernize the codebase, you should convert the files that you work with to React Hooks and TypeScript. If this is not possible (e.g. it's too many changes, touching too many files, etc.) please explain why here. --> - [ ] Updated files to React Hooks - [ ] Updated files to TypeScript ## Before / After <!-- If just refactoring / back-end changes, this can be just an in-English description of the change at a technical level. If a UI change, screenshots should be included. --> CredentialAccept Simple <img width="1465" alt="Screenshot 2025-02-20 at 1 29 42 PM" src="https://github.com/user-attachments/assets/f4bf274a-a945-4ace-b659-d30912c39ff6" /> CredentialCreate Simple <img width="1427" alt="Screenshot 2025-02-20 at 1 31 04 PM" src="https://github.com/user-attachments/assets/42f3df6c-ef65-4432-920a-ebb9c05e9d2d" /> CredentialDelete Simple <img width="1323" alt="Screenshot 2025-02-20 at 1 31 50 PM" src="https://github.com/user-attachments/assets/6d5ec4d7-2466-4105-bc52-db705903c33e" /> CredentialAccept TableDetail <img width="992" alt="Screenshot 2025-02-20 at 1 52 37 PM" src="https://github.com/user-attachments/assets/702af132-9e7c-47f0-bf26-5530545ee949" /> CredentialCreate TableDetail <img width="1087" alt="Screenshot 2025-02-20 at 1 53 56 PM" src="https://github.com/user-attachments/assets/945bd71e-aa4e-4b08-a9a0-144c65fe38d1" /> CredentialDelete TableDetail <img width="1014" alt="Screenshot 2025-02-20 at 1 58 52 PM" src="https://github.com/user-attachments/assets/1198099b-448c-46c1-b76c-8870dc92f789" /> PermissionedDomainSet Simple <img width="1101" alt="Screenshot 2025-02-20 at 5 10 59 PM" src="https://github.com/user-attachments/assets/6258417b-25b7-4eeb-b920-aede1c3de02c" /> PermissionedDomainDelete Simple <img width="1134" alt="Screenshot 2025-02-20 at 5 11 56 PM" src="https://github.com/user-attachments/assets/f72d146f-99dd-4c1a-9de9-e38cbb50b97f" /> PermissionedDomainSet TableDetail PermissionedDomainDelete TableDetail ## Test Plan <!-- Please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce. --> <!-- ## Future Tasks For future tasks related to PR. --> --------- Co-authored-by: Kenny Lei <[email protected]>
- Loading branch information
1 parent
baaf892
commit 7173dfb
Showing
39 changed files
with
1,137 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/containers/shared/components/Transaction/CredentialAccept/Simple.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { type CredentialAccept } from 'xrpl' | ||
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types' | ||
import { SimpleRow } from '../SimpleRow' | ||
import { convertHexToString } from '../../../../../rippled/lib/utils' | ||
|
||
export const Simple: TransactionSimpleComponent = ( | ||
props: TransactionSimpleProps<CredentialAccept>, | ||
) => { | ||
const { t } = useTranslation() | ||
const { data } = props | ||
const { Issuer: issuer, CredentialType: credentialType } = data.instructions | ||
|
||
return ( | ||
<> | ||
<SimpleRow label={t('issuer')} data-test="issuer"> | ||
{issuer} | ||
</SimpleRow> | ||
|
||
<SimpleRow label={t('credential_type')} data-test="credential-type"> | ||
{convertHexToString(credentialType)} | ||
</SimpleRow> | ||
</> | ||
) | ||
} |
26 changes: 26 additions & 0 deletions
26
src/containers/shared/components/Transaction/CredentialAccept/TableDetail.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { type CredentialAccept } from 'xrpl' | ||
import { TransactionTableDetailProps } from '../types' | ||
import { convertHexToString } from '../../../../../rippled/lib/utils' | ||
|
||
export const TableDetail = ({ | ||
instructions, | ||
}: TransactionTableDetailProps<CredentialAccept>) => { | ||
const { t } = useTranslation() | ||
const { Issuer: issuer, CredentialType: credentialType } = instructions | ||
return ( | ||
<div className="credentialAccept"> | ||
<div data-test="issuer"> | ||
<span className="label">{t('issuer')}: </span> | ||
<span className="case-sensitive">{issuer}</span> | ||
</div> | ||
|
||
<div data-test="credential-type"> | ||
<span className="label">{t('credential_type')}: </span> | ||
<span className="case-sensitive"> | ||
{convertHexToString(credentialType)} | ||
</span> | ||
</div> | ||
</div> | ||
) | ||
} |
Oops, something went wrong.