diff --git a/src/containers/Transactions/DetailTab/Meta/DirectoryNode.tsx b/src/containers/Transactions/DetailTab/Meta/DirectoryNode.tsx
index 650384a76..0d594d689 100644
--- a/src/containers/Transactions/DetailTab/Meta/DirectoryNode.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/DirectoryNode.tsx
@@ -1,18 +1,28 @@
+import { Trans } from 'react-i18next'
import { Account } from '../../../shared/components/Account'
+import { RouteLink } from '../../../shared/routing'
+import { ENTRY_ROUTE } from '../../../App/routes'
import type { DirectoryNodeRenderFunction } from './types'
const render: DirectoryNodeRenderFunction = (t, action, node, index) => {
const fields = node.FinalFields || node.NewFields
return (
- {t(
- fields.Owner
- ? 'transaction_owned_directory'
- : 'transaction_unowned_directory',
- {
- action,
- },
- )}
+
+ {/* The inner text will be replaced by the content of in translations.json */}
+
+ ),
+ }}
+ />
{fields.Owner && (
{' '}
diff --git a/src/containers/Transactions/DetailTab/Meta/MPToken.tsx b/src/containers/Transactions/DetailTab/Meta/MPToken.tsx
index 30a8eb8bc..fbe90faa1 100644
--- a/src/containers/Transactions/DetailTab/Meta/MPToken.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/MPToken.tsx
@@ -1,6 +1,8 @@
import { Trans } from 'react-i18next'
import { Account } from '../../../shared/components/Account'
import { computeMPTokenBalanceChange } from '../../../shared/utils'
+import { RouteLink } from '../../../shared/routing'
+import { ENTRY_ROUTE } from '../../../App/routes'
import type { MetaRenderFunction } from './types'
const render: MetaRenderFunction = (_t, _language, action, node, index) => {
@@ -12,7 +14,11 @@ const render: MetaRenderFunction = (_t, _language, action, node, index) => {
const line1 = (
- It {action} an MPToken node of
+ It {action} an MPToken
+
+ node
+
+ of
)
diff --git a/src/containers/Transactions/DetailTab/Meta/MPTokenIssuance.tsx b/src/containers/Transactions/DetailTab/Meta/MPTokenIssuance.tsx
index 98bb1d9d0..c8c98576d 100644
--- a/src/containers/Transactions/DetailTab/Meta/MPTokenIssuance.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/MPTokenIssuance.tsx
@@ -1,6 +1,8 @@
import { Trans } from 'react-i18next'
import { Account } from '../../../shared/components/Account'
import { computeMPTIssuanceBalanceChange } from '../../../shared/utils'
+import { RouteLink } from '../../../shared/routing'
+import { ENTRY_ROUTE } from '../../../App/routes'
import type { MetaRenderFunction } from './types'
const render: MetaRenderFunction = (_t, _language, action, node, index) => {
@@ -12,7 +14,11 @@ const render: MetaRenderFunction = (_t, _language, action, node, index) => {
const line1 = (
- It {action} an MPTokenIssuance node of
+ It {action} an MPTokenIssuance
+
+ node
+
+ of
)
diff --git a/src/containers/Transactions/DetailTab/Meta/Offer.tsx b/src/containers/Transactions/DetailTab/Meta/Offer.tsx
index e0eb69e24..d569fd87a 100644
--- a/src/containers/Transactions/DetailTab/Meta/Offer.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/Offer.tsx
@@ -7,6 +7,8 @@ import {
} from '../../../shared/transactionUtils'
import { localizeNumber } from '../../../shared/utils'
import { Account } from '../../../shared/components/Account'
+import { ENTRY_ROUTE } from '../../../App/routes'
+import { RouteLink } from '../../../shared/routing'
import Currency from '../../../shared/components/Currency'
import type { MetaRenderFunctionWithTx, MetaNode } from './types'
@@ -209,6 +211,11 @@ const render: MetaRenderFunctionWithTx = (
/>
),
Account: ,
+ Link: (
+
+ {/* Content from i18n */}
+
+ ),
}}
/>
{lines}
diff --git a/src/containers/Transactions/DetailTab/Meta/PayChannel.tsx b/src/containers/Transactions/DetailTab/Meta/PayChannel.tsx
index 39f8ea5cb..8aaffd8f8 100644
--- a/src/containers/Transactions/DetailTab/Meta/PayChannel.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/PayChannel.tsx
@@ -2,6 +2,8 @@ import { Trans } from 'react-i18next'
import { CURRENCY_OPTIONS } from '../../../shared/transactionUtils'
import { localizeNumber } from '../../../shared/utils'
import { Account } from '../../../shared/components/Account'
+import { RouteLink } from '../../../shared/routing'
+import { ENTRY_ROUTE } from '../../../App/routes'
import type { MetaRenderFunction } from './types'
const MILLION = 1000000
@@ -15,7 +17,11 @@ const render: MetaRenderFunction = (_t, language, action, node, index) => {
const line1 = (
- It {action} a PayChannel node from
+ It {action} a PayChannel
+
+ node
+
+ from
to
diff --git a/src/containers/Transactions/DetailTab/Meta/RippleState.tsx b/src/containers/Transactions/DetailTab/Meta/RippleState.tsx
index d6a1decb6..969c6fd1b 100644
--- a/src/containers/Transactions/DetailTab/Meta/RippleState.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/RippleState.tsx
@@ -4,6 +4,8 @@ import {
localizeNumber,
computeRippleStateBalanceChange,
} from '../../../shared/utils'
+import { RouteLink } from '../../../shared/routing'
+import { ENTRY_ROUTE } from '../../../App/routes'
import Currency from '../../../shared/components/Currency'
import type { MetaRenderFunction } from './types'
@@ -19,16 +21,20 @@ const render: MetaRenderFunction = (_t, language, action, node, index) => {
} = computeRippleStateBalanceChange(node)
const line1 = (
-
- It {action} a{' '}
-
-
-
- RippleState node between
-
- and
-
-
+ ,
+ Link: (
+
+ {/* Content from i18n */}
+
+ ),
+ Account: ,
+ CounterAccount: ,
+ }}
+ />
)
const line2 = change ? (
diff --git a/src/containers/Transactions/DetailTab/Meta/index.tsx b/src/containers/Transactions/DetailTab/Meta/index.tsx
index 39ebf7ed3..8f3dc2600 100644
--- a/src/containers/Transactions/DetailTab/Meta/index.tsx
+++ b/src/containers/Transactions/DetailTab/Meta/index.tsx
@@ -1,6 +1,5 @@
import { FC } from 'react'
-import { useTranslation } from 'react-i18next'
-import { TFunction } from 'i18next'
+import { Trans, useTranslation } from 'react-i18next'
import renderAccountRoot from './AccountRoot'
import renderDirectoryNode from './DirectoryNode'
import renderOffer from './Offer'
@@ -10,15 +9,23 @@ import renderMPToken from './MPToken'
import renderMPTokenIssuance from './MPTokenIssuance'
import { groupAffectedNodes } from '../../../shared/transactionUtils'
import { useLanguage } from '../../../shared/hooks'
+import { RouteLink } from '../../../shared/routing'
+import { ENTRY_ROUTE } from '../../../App/routes'
-const renderDefault = (
- t: TFunction<'translations', undefined>,
- action: string,
- node: any,
- index: number,
-) => (
+const renderDefault = (action: string, node: any, index: number) => (
- {t('node_meta_type', { action })} {node.LedgerEntryType}
+
+ {/* The inner text will be replaced by the content of in translations.json */}
+
+ ),
+ }}
+ />{' '}
+ {node.LedgerEntryType}
)
@@ -44,7 +51,7 @@ export const TransactionMeta: FC<{ data: any }> = ({ data }) => {
case 'MPToken':
return renderMPToken(t, language, action, node, index)
default:
- return renderDefault(t, action, node, index)
+ return renderDefault(action, node, index)
}
})
diff --git a/src/containers/Transactions/index.tsx b/src/containers/Transactions/index.tsx
index d9de459b1..5396dbc77 100644
--- a/src/containers/Transactions/index.tsx
+++ b/src/containers/Transactions/index.tsx
@@ -53,6 +53,7 @@ export const Transaction = () => {
const { t } = useTranslation()
const rippledSocket = useContext(SocketContext)
const { trackException, trackScreenLoaded } = useAnalytics()
+
const { isLoading, data, error, isError } = useQuery(
['transaction', identifier],
() => {
diff --git a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx
index e2ca6d49a..aa823ad93 100644
--- a/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx
+++ b/src/containers/shared/components/Transaction/NFTokenAcceptOffer/Simple.tsx
@@ -5,6 +5,8 @@ import { Amount } from '../../Amount'
import { NFTokenAcceptOfferInstructions } from './types'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { NFTokenLink } from '../../NFTokenLink'
+import { ENTRY_ROUTE } from '../../../../App/routes'
+import { RouteLink } from '../../../routing'
export const Simple: TransactionSimpleComponent = ({
data,
@@ -20,7 +22,9 @@ export const Simple: TransactionSimpleComponent = ({
className="dt"
data-testid="offer-id"
>
- {offer}
+
+ {offer}
+
))}
{amount && seller && buyer && tokenID && (
diff --git a/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx b/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx
index 6df38b784..c53488236 100644
--- a/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx
+++ b/src/containers/shared/components/Transaction/NFTokenCancelOffer/Simple.tsx
@@ -5,6 +5,8 @@ import { Amount } from '../../Amount'
import { NFTokenCancelOfferInstructions } from './types'
import { TransactionSimpleComponent, TransactionSimpleProps } from '../types'
import { NFTokenLink } from '../../NFTokenLink'
+import { ENTRY_ROUTE } from '../../../../App/routes'
+import { RouteLink } from '../../../routing'
export const Simple: TransactionSimpleComponent = ({
data,
@@ -21,7 +23,9 @@ export const Simple: TransactionSimpleComponent = ({
className="dt"
data-testid="offer-id"
>
- {offerID}
+
+ {offerID}
+
{offerID && (
- {offerID}
+
+ {offerID}
+
)}
- {channel}
+
+ {channel}
+
)}
>
diff --git a/src/rippled/lib/rippled.ts b/src/rippled/lib/rippled.ts
index c8881f3c3..feb2bfd80 100644
--- a/src/rippled/lib/rippled.ts
+++ b/src/rippled/lib/rippled.ts
@@ -92,64 +92,66 @@ const getLedger = async (
// get ledger_entry
const getLedgerEntry = async (
rippledSocket: ExplorerXrplClient,
- { index }: { index: string },
+ index: string,
+ includeDeleted: boolean = false,
): Promise => {
const request = {
command: 'ledger_entry',
index,
ledger_index: 'validated',
+ include_deleted: includeDeleted,
}
const resp = await query(rippledSocket, request)
- if (resp.error_message === 'entryNotFound') {
+ if (resp.error === 'entryNotFound') {
throw new Error('ledger entry not found', 404)
}
- if (resp.error_message === 'invalidParams') {
+ if (resp.error === 'invalidParams') {
throw new Error('invalidParams for ledger_entry', 404)
}
- if (resp.error_message === 'lgrNotFound') {
+ if (resp.error === 'lgrNotFound') {
throw new Error('invalid ledger index/hash', 400)
}
- if (resp.error_message === 'malformedAddress') {
+ if (resp.error === 'malformedAddress') {
throw new Error(
'The ledger_entry request improperly specified an Address field.',
404,
)
}
- if (resp.error_message === 'malformedCurrency') {
+ if (resp.error === 'malformedCurrency') {
throw new Error(
'The ledger_entry request improperly specified a Currency Code field.',
404,
)
}
- if (resp.error_message === 'malformedOwner') {
+ if (resp.error === 'malformedOwner') {
throw new Error(
'The ledger_entry request improperly specified the escrow.owner sub-field.',
404,
)
}
- if (resp.error_message === 'malformedRequest') {
+ if (resp.error === 'malformedRequest') {
throw new Error(
'The ledger_entry request provided an invalid combination of fields, or provided the wrong type for one or more fields.',
404,
)
}
- if (resp.error_message === 'unknownOption') {
+ if (resp.error === 'unknownOption') {
throw new Error(
'The fields provided in the ledger_entry request did not match any of the expected request formats.',
404,
)
}
- if (resp.error_message) {
- throw new Error(resp.error_message, 500)
+ if (resp.error) {
+ throw new Error(resp.error, 500)
}
return resp