Skip to content

Commit 7173dfb

Browse files
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 <3003853+kennyzlei@users.noreply.github.com>
1 parent baaf892 commit 7173dfb

39 files changed

+1137
-40
lines changed

package-lock.json

Lines changed: 17 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"ts-jest": "^26.5.6",
107107
"ts-node": "^10.9.2",
108108
"typescript": "^4.9.5",
109-
"xrpl": "^3.1.0"
109+
"xrpl": "^4.2.0"
110110
},
111111
"resolutions": {
112112
"jest-environment-jsdom": "29.3.1"

public/locales/ca-CA/translations.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
"transaction_type_name_CheckCancel": "Cancel·lar Check",
159159
"transaction_type_name_CheckCash": "Cobrar Check",
160160
"transaction_type_name_CheckCreate": "Crear de Check",
161+
"transaction_type_name_CredentialAccept": null,
162+
"transaction_type_name_CredentialCreate": null,
163+
"transaction_type_name_CredentialDelete": null,
161164
"transaction_type_name_DIDDelete": "Eliminar DID",
162165
"transaction_type_name_DIDSet": "Establir DID",
163166
"transaction_type_name_DepositPreauth": "Preautoritzar Diposit",
@@ -179,6 +182,8 @@
179182
"transaction_type_name_PaymentChannelClaim": "Reclamar al Canal de Pagament",
180183
"transaction_type_name_PaymentChannelCreate": "Crear Canal de Pagament",
181184
"transaction_type_name_PaymentChannelFund": "Dipositar en Canal de Pagament",
185+
"transaction_type_name_PermissionedDomainDelete": null,
186+
"transaction_type_name_PermissionedDomainSet": null,
182187
"transaction_type_name_SetHook": "Establir Hook",
183188
"transaction_type_name_SetRegularKey": "Establir Clau Regular",
184189
"transaction_type_name_SignerListSet": "Etablir Llista de Signantst",
@@ -562,5 +567,11 @@
562567
"enable_amendment_name": null,
563568
"amendment_status": null,
564569
"expected_date": null,
570+
"credential_type": null,
571+
"credential_issuer": null,
572+
"subject": null,
573+
"expiration": null,
574+
"domain_id": null,
575+
"accepted_credentials": null,
565576
"action_from_and": null
566577
}

public/locales/en-US/translations.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
"transaction_type_name_CheckCancel": "Check Cancel",
162162
"transaction_type_name_CheckCash": "Check Cash",
163163
"transaction_type_name_CheckCreate": "Check Create",
164+
"transaction_type_name_CredentialAccept": "Credential Accept",
165+
"transaction_type_name_CredentialCreate": "Credential Create",
166+
"transaction_type_name_CredentialDelete": "Credential Delete",
164167
"transaction_type_name_DIDDelete": "DID Delete",
165168
"transaction_type_name_DIDSet": "DID Set",
166169
"transaction_type_name_DepositPreauth": "Deposit Preauth",
@@ -186,6 +189,8 @@
186189
"transaction_type_name_PaymentChannelClaim": "Payment Channel Claim",
187190
"transaction_type_name_PaymentChannelCreate": "Payment Channel Create",
188191
"transaction_type_name_PaymentChannelFund": "Payment Channel Fund",
192+
"transaction_type_name_PermissionedDomainDelete": "Permissioned Domain Delete",
193+
"transaction_type_name_PermissionedDomainSet": "Permissioned Domain Set",
189194
"transaction_type_name_SetHook": "Set Hook",
190195
"transaction_type_name_SetRegularKey": "Set Regular Key",
191196
"transaction_type_name_SignerListSet": "Signer List Set",
@@ -544,7 +549,7 @@
544549
"deleted": "Deleted",
545550
"holders": "HOLDERS: {{holders}}",
546551
"trustlines": " TRUSTLINES: {{trustlines}}",
547-
"website": "Wesbite",
552+
"website": "Website",
548553
"mpt_issuance_id": "MPT Issuance ID",
549554
"asset_scale": "Asset Scale",
550555
"metadata": "Metadata",
@@ -562,5 +567,12 @@
562567
"search_results_banner": "Token search by name and account is now available! Try searching for USD",
563568
"enable_amendment_name": "Amendment Name",
564569
"amendment_status": "Amendment Status",
570+
"expected_date": "Expected Date",
571+
"credential_type": "Credential Type",
572+
"credential_issuer": "Credential Issuer",
573+
"subject": "Subject",
574+
"expiration": "Expiration",
575+
"domain_id": "Domain ID",
576+
"accepted_credentials": "Accepted Credentials",
565577
"expected_date": "Expected Date"
566578
}

public/locales/es-ES/translations.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
"transaction_type_name_CheckCancel": "Cancelar Cheque",
159159
"transaction_type_name_CheckCash": "Cobrar Cheque",
160160
"transaction_type_name_CheckCreate": "Crear Cheque",
161+
"transaction_type_name_CredentialAccept": null,
162+
"transaction_type_name_CredentialCreate": null,
163+
"transaction_type_name_CredentialDelete": null,
161164
"transaction_type_name_DepositPreauth": "Preautorizar Depósito",
162165
"transaction_type_name_Error_Cases": "Casos de Error",
163166
"transaction_type_name_EscrowCancel": "Cancelar Depósito",
@@ -176,6 +179,8 @@
176179
"transaction_type_name_PaymentChannelClaim": "Reclamar Canal de Pago",
177180
"transaction_type_name_PaymentChannelCreate": "Crear Canal de Pago",
178181
"transaction_type_name_PaymentChannelFund": "Añadir Fondos a Canal de Pago",
182+
"transaction_type_name_PermissionedDomainDelete": null,
183+
"transaction_type_name_PermissionedDomainSet": null,
179184
"transaction_type_name_SetHook": "Añadir Hook",
180185
"transaction_type_name_SetRegularKey": "Configurar Clave Normal",
181186
"transaction_type_name_SignerListSet": "Configurar Lista de Firmantes",
@@ -558,5 +563,11 @@
558563
"enable_amendment_name": null,
559564
"amendment_status": null,
560565
"expected_date": null,
561-
"action_from_and": null
566+
"credential_type": null,
567+
"credential_issuer": null,
568+
"subject": null,
569+
"expiration": null,
570+
"domain_id": null,
571+
"accepted_credentials": null
572+
"action_from_and": null,
562573
}

public/locales/fr-FR/translations.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159
"transaction_type_name_CheckCancel": "Chèque annulé",
160160
"transaction_type_name_CheckCash": "Chèque remis",
161161
"transaction_type_name_CheckCreate": "Chèque créé",
162+
"transaction_type_name_CredentialAccept": null,
163+
"transaction_type_name_CredentialCreate": null,
164+
"transaction_type_name_CredentialDelete": null,
162165
"transaction_type_name_DepositPreauth": "Dépôt préautorisé",
163166
"transaction_type_name_Error_Cases": "Cas d'erreur",
164167
"transaction_type_name_EscrowCancel": "séquestre annulé",
@@ -178,6 +181,8 @@
178181
"transaction_type_name_PaymentChannelClaim": "Canal de paiement réclamé",
179182
"transaction_type_name_PaymentChannelCreate": "Canal de paiement créé",
180183
"transaction_type_name_PaymentChannelFund": "Canal provisionné",
184+
"transaction_type_name_PermissionedDomainDelete": null,
185+
"transaction_type_name_PermissionedDomainSet": null,
181186
"transaction_type_name_SetRegularKey": "Clé régulière définie",
182187
"transaction_type_name_SignerListSet": "Liste de signataires établie",
183188
"transaction_type_name_TicketCreate": "Ticket créé",
@@ -559,5 +564,11 @@
559564
"enable_amendment_name": null,
560565
"amendment_status": null,
561566
"expected_date": null,
567+
"credential_type": null,
568+
"credential_issuer": null,
569+
"subject": null,
570+
"expiration": null,
571+
"domain_id": null,
572+
"accepted_credentials": null,
562573
"action_from_and": null
563574
}

public/locales/ja-JP/translations.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159
"transaction_type_name_CheckCancel": "チェックの取消",
160160
"transaction_type_name_CheckCash": "チェックの現金化",
161161
"transaction_type_name_CheckCreate": "チェックの作成",
162+
"transaction_type_name_CredentialAccept": null,
163+
"transaction_type_name_CredentialCreate": null,
164+
"transaction_type_name_CredentialDelete": null,
162165
"transaction_type_name_DepositPreauth": "入金の事前承認",
163166
"transaction_type_name_Error_Cases": "エラーケース",
164167
"transaction_type_name_EscrowCancel": "エスクローの取消",
@@ -178,6 +181,8 @@
178181
"transaction_type_name_PaymentChannelClaim": "ペイメントチャネル請求",
179182
"transaction_type_name_PaymentChannelCreate": "ペイメントチャネル作成",
180183
"transaction_type_name_PaymentChannelFund": "ペイメントチャネル資金",
184+
"transaction_type_name_PermissionedDomainDelete": null,
185+
"transaction_type_name_PermissionedDomainSet": null,
181186
"transaction_type_name_SetHook": "Hookの設定",
182187
"transaction_type_name_SetRegularKey": "レギュラーキーの設定",
183188
"transaction_type_name_SignerListSet": "署名者リスト設定",
@@ -558,5 +563,11 @@
558563
"enable_amendment_name": null,
559564
"amendment_status": null,
560565
"expected_date": null,
566+
"credential_type": null,
567+
"credential_issuer": null,
568+
"subject": null,
569+
"expiration": null,
570+
"domain_id": null,
571+
"accepted_credentials": null,
561572
"action_from_and": null
562573
}

public/locales/ko-KR/translations.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@
161161
"transaction_type_name_CheckCancel": "수표 취소",
162162
"transaction_type_name_CheckCash": "수표 현금화",
163163
"transaction_type_name_CheckCreate": "수표 생성",
164+
"transaction_type_name_CredentialAccept": null,
165+
"transaction_type_name_CredentialCreate": null,
166+
"transaction_type_name_CredentialDelete": null,
164167
"transaction_type_name_DepositPreauth": "예치 인증",
165168
"transaction_type_name_Error_Cases": "오류 사례",
166169
"transaction_type_name_EscrowCancel": "에스크로 취소",
@@ -179,6 +182,8 @@
179182
"transaction_type_name_PaymentChannelClaim": "결제 채널 청구",
180183
"transaction_type_name_PaymentChannelCreate": "결제 채널 생성",
181184
"transaction_type_name_PaymentChannelFund": "결제 채널 펀딩",
185+
"transaction_type_name_PermissionedDomainDelete": null,
186+
"transaction_type_name_PermissionedDomainSet": null,
182187
"transaction_type_name_SetHook": "Hook 설정",
183188
"transaction_type_name_SetRegularKey": "일반 키 설정",
184189
"transaction_type_name_SignerListSet": "서명자 목록 설정",
@@ -556,5 +561,11 @@
556561
"enable_amendment_name": null,
557562
"amendment_status": null,
558563
"expected_date": null,
564+
"credential_type": null,
565+
"credential_issuer": null,
566+
"subject": null,
567+
"expiration": null,
568+
"domain_id": null,
569+
"accepted_credentials": null,
559570
"action_from_and": null
560571
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { useTranslation } from 'react-i18next'
2+
import { type CredentialAccept } from 'xrpl'
3+
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
4+
import { SimpleRow } from '../SimpleRow'
5+
import { convertHexToString } from '../../../../../rippled/lib/utils'
6+
7+
export const Simple: TransactionSimpleComponent = (
8+
props: TransactionSimpleProps<CredentialAccept>,
9+
) => {
10+
const { t } = useTranslation()
11+
const { data } = props
12+
const { Issuer: issuer, CredentialType: credentialType } = data.instructions
13+
14+
return (
15+
<>
16+
<SimpleRow label={t('issuer')} data-test="issuer">
17+
{issuer}
18+
</SimpleRow>
19+
20+
<SimpleRow label={t('credential_type')} data-test="credential-type">
21+
{convertHexToString(credentialType)}
22+
</SimpleRow>
23+
</>
24+
)
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { useTranslation } from 'react-i18next'
2+
import { type CredentialAccept } from 'xrpl'
3+
import { TransactionTableDetailProps } from '../types'
4+
import { convertHexToString } from '../../../../../rippled/lib/utils'
5+
6+
export const TableDetail = ({
7+
instructions,
8+
}: TransactionTableDetailProps<CredentialAccept>) => {
9+
const { t } = useTranslation()
10+
const { Issuer: issuer, CredentialType: credentialType } = instructions
11+
return (
12+
<div className="credentialAccept">
13+
<div data-test="issuer">
14+
<span className="label">{t('issuer')}: </span>
15+
<span className="case-sensitive">{issuer}</span>
16+
</div>
17+
18+
<div data-test="credential-type">
19+
<span className="label">{t('credential_type')}: </span>
20+
<span className="case-sensitive">
21+
{convertHexToString(credentialType)}
22+
</span>
23+
</div>
24+
</div>
25+
)
26+
}

0 commit comments

Comments
 (0)