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

}
5 changes: 4 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,8 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null
}
5 changes: 4 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,5 +557,8 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null
}
5 changes: 4 additions & 1 deletion public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -556,5 +556,8 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": null
}
5 changes: 4 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,5 +554,8 @@
"search_results_banner": null,
"enable_amendment_name": null,
"amendment_status": null,
"expected_date": null
"expected_date": null,
"credential_type": null,
"subject": null,
"expiration": 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">
{convertHexToString(Account)}
</SimpleRow>
)}
{Issuer && (
<SimpleRow label={t('issuer')} data-test="issuer">
{convertHexToString(Issuer)}
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
</SimpleRow>
)}
{CredentialType && (
<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,13 @@
import {
TransactionAction,
TransactionCategory,
TransactionMapping,
} from '../types'

import { Simple } from './Simple'

export const CredentialAcceptTransaction: TransactionMapping = {
Simple,
action: TransactionAction.ACCEPT,
achowdhry-ripple marked this conversation as resolved.
Show resolved Hide resolved
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">
{convertHexToString(Account)}
</SimpleRow>
)}
{Subject && (
<SimpleRow label={t('subject')} data-test="subject">
{convertHexToString(Subject)}
</SimpleRow>
)}
{CredentialType && (
<SimpleRow label={t('credential_type')} data-test="credential-type">
{convertHexToString(CredentialType)}
</SimpleRow>
)}
{Expiration && (
<SimpleRow label={t('expiration')} data-test="expiration">
{convertHexToString(Expiration)}
</SimpleRow>
)}
{URI && (
<SimpleRow label={t('uri')} data-test="uri">
{convertHexToString(URI)}
</SimpleRow>
)}
</>
)
}

export { Simple }
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 CredentialCreateTransaction: TransactionMapping = {
Simple,
action: TransactionAction.CREATE,
category: TransactionCategory.ACCOUNT,
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useTranslation } from 'react-i18next'
import { type CredentialDelete } from 'xrpl'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { SimpleRow } from '../SimpleRow'
import { convertHexToString } from '../../../../../rippled/lib/utils'

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

return (
<>
{Account && (
<SimpleRow label={t('account')} data-test="account">
{convertHexToString(Account)}
</SimpleRow>
)}
{Subject && (
<SimpleRow label={t('subject')} data-test="subject">
{convertHexToString(Subject)}
</SimpleRow>
)}
{Issuer && (
<SimpleRow label={t('issuer')} data-test="issuer">
{convertHexToString(Issuer)}
</SimpleRow>
)}
{CredentialType && (
<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,13 @@
import {
TransactionAction,
TransactionCategory,
TransactionMapping,
} from '../types'

import { Simple } from './Simple'

export const CredentialDeleteTransaction: TransactionMapping = {
Simple,
action: TransactionAction.CANCEL,
category: TransactionCategory.ACCOUNT,
}
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions src/containers/shared/components/Transaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import { AMMVote } from './AMMVote'
import { AccountDeleteTransaction as AccountDelete } from './AccountDelete'
import { AccountSetTransaction as AccountSet } from './AccountSet'
import { CredentialAcceptTransaction as CredentialAccept } from './CredentialAccept'
import { CredentialAcceptTransaction as CredentialCreate } from './CredentialCreate'

Check failure on line 10 in src/containers/shared/components/Transaction/index.ts

View workflow job for this annotation

GitHub Actions / typescript-check (18.12)

'"./CredentialCreate"' has no exported member named 'CredentialAcceptTransaction'. Did you mean 'CredentialCreateTransaction'?
import { CredentialAcceptTransaction as CredentialDelete } from './CredentialDelete'

Check failure on line 11 in src/containers/shared/components/Transaction/index.ts

View workflow job for this annotation

GitHub Actions / typescript-check (18.12)

'"./CredentialDelete"' has no exported member named 'CredentialAcceptTransaction'. Did you mean 'CredentialDeleteTransaction'?
import { DIDSetTransaction as DIDSet } from './DIDSet'
import { DepositPreauthTransaction as DepositPreauth } from './DepositPreauth'
import { EnableAmendmentTransaction as EnableAmendment } from './EnableAmendment'
Expand Down Expand Up @@ -56,6 +59,9 @@
AccountDelete,
AccountSet,
Clawback,
CredentialAccept,
CredentialCreate,
CredentialDelete,
DIDSet,
DepositPreauth,
EnableAmendment,
Expand Down
Loading
Loading