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 9 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
6 changes: 5 additions & 1 deletion public/locales/ca-CA/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,9 @@
"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
}
12 changes: 10 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 Down Expand Up @@ -542,7 +545,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 +563,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"

}
7 changes: 6 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,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
}
7 changes: 6 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,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
}
7 changes: 6 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,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
}
7 changes: 6 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,5 +554,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,35 @@
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'

const Simple: TransactionSimpleComponent = (
props: TransactionSimpleProps<CredentialAccept>,
) => {
const { t } = useTranslation()
const { data } = props
const { Account, Issuer, CredentialType } = data.instructions
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved

return (
<>
{Account && (
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
<SimpleRow label={t('account')} data-test="account">
{Account}
</SimpleRow>
)}
{Issuer && (
<SimpleRow label={t('issuer')} data-test="issuer">
{Issuer}
</SimpleRow>
)}
{CredentialType && (
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
<SimpleRow label={t('credential_type')} data-test="credential-type">
{convertHexToString(CredentialType)}
</SimpleRow>
)}
</>
)
}

export { Simple }
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 { Account, Issuer, CredentialType } = instructions
return (
<div className="credential">
{Account && (
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
<div className="uri">
<span className="label">{t('account')}: </span>
<span className="case-sensitive">{Account}</span>
</div>
)}
{Issuer && (
<div className="issuer">
<span className="label">{t('issuer')}: </span>
<span className="case-sensitive">{Issuer}</span>
</div>
)}
{CredentialType && (
<div className="credential-type">
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
<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,
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { useTranslation } from 'react-i18next'
import { type CredentialCreate } from 'xrpl'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { SimpleRow } from '../SimpleRow'
import { convertHexToString } from '../../../../../rippled/lib/utils'

const Simple: TransactionSimpleComponent = (
props: TransactionSimpleProps<CredentialCreate>,
) => {
const { t } = useTranslation()
const { data } = props
const { Account, Subject, CredentialType, Expiration, URI } =
data.instructions

return (
<>
{Account && (
<SimpleRow label={t('account')} data-test="account">
{Account}
</SimpleRow>
)}
{Subject && (
<SimpleRow label={t('subject')} data-test="subject">
{Subject}
</SimpleRow>
)}
{CredentialType && (
<SimpleRow label={t('credential_type')} data-test="credential-type">
{convertHexToString(CredentialType)}
</SimpleRow>
)}
{Expiration && (
<SimpleRow label={t('expiration')} data-test="expiration">
{Expiration}
</SimpleRow>
)}
{URI && (
<SimpleRow label={t('uri')} data-test="uri">
{convertHexToString(URI)}
</SimpleRow>
)}
</>
)
}

export { Simple }
Loading
Loading