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

Add Credentials and PermissionedDomain tx Support #1118

Open
wants to merge 18 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 17 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"ts-jest": "^26.5.6",
"ts-node": "^10.9.2",
"typescript": "^4.9.5",
"xrpl": "^3.1.0"
"xrpl": "^4.1.0"
},
"resolutions": {
"jest-environment-jsdom": "29.3.1"
Expand Down
12 changes: 11 additions & 1 deletion public/locales/ca-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
"transaction_type_name_CheckCancel": "Cancel·lar Check",
"transaction_type_name_CheckCash": "Cobrar Check",
"transaction_type_name_CheckCreate": "Crear de Check",
"transaction_type_name_CredentialAccept": null,
"transaction_type_name_CredentialCreate": null,
"transaction_type_name_CredentialDelete": null,
"transaction_type_name_DIDDelete": "Eliminar DID",
"transaction_type_name_DIDSet": "Establir DID",
"transaction_type_name_DepositPreauth": "Preautoritzar Diposit",
Expand All @@ -178,6 +181,8 @@
"transaction_type_name_PaymentChannelClaim": "Reclamar al Canal de Pagament",
"transaction_type_name_PaymentChannelCreate": "Crear Canal de Pagament",
"transaction_type_name_PaymentChannelFund": "Dipositar en Canal de Pagament",
"transaction_type_name_PermissionedDomainDelete": null,
"transaction_type_name_PermissionedDomainSet": null,
"transaction_type_name_SetHook": "Establir Hook",
"transaction_type_name_SetRegularKey": "Establir Clau Regular",
"transaction_type_name_SignerListSet": "Etablir Llista de Signantst",
Expand Down Expand Up @@ -560,5 +565,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
14 changes: 12 additions & 2 deletions public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
"transaction_type_name_CheckCancel": "Check Cancel",
"transaction_type_name_CheckCash": "Check Cash",
"transaction_type_name_CheckCreate": "Check Create",
"transaction_type_name_CredentialAccept": "Credential Accept",
"transaction_type_name_CredentialCreate": "Credential Create",
"transaction_type_name_CredentialDelete": "Credential Delete",
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
"transaction_type_name_DIDDelete": "DID Delete",
"transaction_type_name_DIDSet": "DID Set",
"transaction_type_name_DepositPreauth": "Deposit Preauth",
Expand All @@ -185,6 +188,8 @@
"transaction_type_name_PaymentChannelClaim": "Payment Channel Claim",
"transaction_type_name_PaymentChannelCreate": "Payment Channel Create",
"transaction_type_name_PaymentChannelFund": "Payment Channel Fund",
"transaction_type_name_PermissionedDomainDelete": "Permissioned Domain Delete",
"transaction_type_name_PermissionedDomainSet": "Permissioned Domain Set",
"transaction_type_name_SetHook": "Set Hook",
"transaction_type_name_SetRegularKey": "Set Regular Key",
"transaction_type_name_SignerListSet": "Signer List Set",
Expand Down Expand Up @@ -542,7 +547,7 @@
"deleted": "Deleted",
"holders": "HOLDERS: {{holders}}",
"trustlines": " TRUSTLINES: {{trustlines}}",
"website": "Wesbite",
"website": "Website",
"mpt_issuance_id": "MPT Issuance ID",
"asset_scale": "Asset Scale",
"metadata": "Metadata",
Expand All @@ -560,6 +565,11 @@
"search_results_banner": "Token search by name and account is now available! Try searching for USD",
"enable_amendment_name": "Amendment Name",
"amendment_status": "Amendment Status",
"expected_date": "Expected Date"
"expected_date": "Expected Date",
"credential_type": "Credential Type",
"subject": "Subject",
"expiration": "Expiration",
"domain_id": "Domain ID",
"accepted_credentials": "Accepted Credentials"

}
12 changes: 11 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
"transaction_type_name_CheckCancel": "Cancelar Cheque",
"transaction_type_name_CheckCash": "Cobrar Cheque",
"transaction_type_name_CheckCreate": "Crear Cheque",
"transaction_type_name_CredentialAccept": null,
"transaction_type_name_CredentialCreate": null,
"transaction_type_name_CredentialDelete": null,
"transaction_type_name_DepositPreauth": "Preautorizar Depósito",
"transaction_type_name_Error_Cases": "Casos de Error",
"transaction_type_name_EscrowCancel": "Cancelar Depósito",
Expand All @@ -175,6 +178,8 @@
"transaction_type_name_PaymentChannelClaim": "Reclamar Canal de Pago",
"transaction_type_name_PaymentChannelCreate": "Crear Canal de Pago",
"transaction_type_name_PaymentChannelFund": "Añadir Fondos a Canal de Pago",
"transaction_type_name_PermissionedDomainDelete": null,
"transaction_type_name_PermissionedDomainSet": null,
"transaction_type_name_SetHook": "Añadir Hook",
"transaction_type_name_SetRegularKey": "Configurar Clave Normal",
"transaction_type_name_SignerListSet": "Configurar Lista de Firmantes",
Expand Down Expand Up @@ -556,5 +561,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
12 changes: 11 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
"transaction_type_name_CheckCancel": "Chèque annulé",
"transaction_type_name_CheckCash": "Chèque remis",
"transaction_type_name_CheckCreate": "Chèque créé",
"transaction_type_name_CredentialAccept": null,
"transaction_type_name_CredentialCreate": null,
"transaction_type_name_CredentialDelete": null,
"transaction_type_name_DepositPreauth": "Dépôt préautorisé",
"transaction_type_name_Error_Cases": "Cas d'erreur",
"transaction_type_name_EscrowCancel": "séquestre annulé",
Expand All @@ -177,6 +180,8 @@
"transaction_type_name_PaymentChannelClaim": "Canal de paiement réclamé",
"transaction_type_name_PaymentChannelCreate": "Canal de paiement créé",
"transaction_type_name_PaymentChannelFund": "Canal provisionné",
"transaction_type_name_PermissionedDomainDelete": null,
"transaction_type_name_PermissionedDomainSet": null,
"transaction_type_name_SetRegularKey": "Clé régulière définie",
"transaction_type_name_SignerListSet": "Liste de signataires établie",
"transaction_type_name_TicketCreate": "Ticket créé",
Expand Down Expand Up @@ -557,5 +562,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
12 changes: 11 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@
"transaction_type_name_CheckCancel": "チェックの取消",
"transaction_type_name_CheckCash": "チェックの現金化",
"transaction_type_name_CheckCreate": "チェックの作成",
"transaction_type_name_CredentialAccept": null,
"transaction_type_name_CredentialCreate": null,
"transaction_type_name_CredentialDelete": null,
"transaction_type_name_DepositPreauth": "入金の事前承認",
"transaction_type_name_Error_Cases": "エラーケース",
"transaction_type_name_EscrowCancel": "エスクローの取消",
Expand All @@ -177,6 +180,8 @@
"transaction_type_name_PaymentChannelClaim": "ペイメントチャネル請求",
"transaction_type_name_PaymentChannelCreate": "ペイメントチャネル作成",
"transaction_type_name_PaymentChannelFund": "ペイメントチャネル資金",
"transaction_type_name_PermissionedDomainDelete": null,
"transaction_type_name_PermissionedDomainSet": null,
"transaction_type_name_SetHook": "Hookの設定",
"transaction_type_name_SetRegularKey": "レギュラーキーの設定",
"transaction_type_name_SignerListSet": "署名者リスト設定",
Expand Down Expand Up @@ -556,5 +561,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
12 changes: 11 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
"transaction_type_name_CheckCancel": "수표 취소",
"transaction_type_name_CheckCash": "수표 현금화",
"transaction_type_name_CheckCreate": "수표 생성",
"transaction_type_name_CredentialAccept": null,
"transaction_type_name_CredentialCreate": null,
"transaction_type_name_CredentialDelete": null,
"transaction_type_name_DepositPreauth": "예치 인증",
"transaction_type_name_Error_Cases": "오류 사례",
"transaction_type_name_EscrowCancel": "에스크로 취소",
Expand All @@ -178,6 +181,8 @@
"transaction_type_name_PaymentChannelClaim": "결제 채널 청구",
"transaction_type_name_PaymentChannelCreate": "결제 채널 생성",
"transaction_type_name_PaymentChannelFund": "결제 채널 펀딩",
"transaction_type_name_PermissionedDomainDelete": null,
"transaction_type_name_PermissionedDomainSet": null,
"transaction_type_name_SetHook": "Hook 설정",
"transaction_type_name_SetRegularKey": "일반 키 설정",
"transaction_type_name_SignerListSet": "서명자 목록 설정",
Expand Down Expand Up @@ -554,5 +559,10 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null,
"domain_id": null,
"accepted_credentials": null
}
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>
</>
)
}
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 className="issuer">
<span className="label">{t('issuer')}: </span>
<span className="case-sensitive">{issuer}</span>
</div>

<div className="credential-type">
<span className="label">{t('credential_type')}: </span>
<span className="case-sensitive">
{convertHexToString(credentialType)}
</span>
</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
TransactionAction,
TransactionCategory,
TransactionMapping,
} from '../types'

import { Simple } from './Simple'

export const CredentialAcceptTransaction: TransactionMapping = {
Simple,
action: TransactionAction.MODIFY,
category: TransactionCategory.ACCOUNT,
}
Loading
Loading