diff --git a/client/src/pages/transaction/details.tsx b/client/src/pages/transaction/details.tsx index 47d69e9b..4d79eb0c 100644 --- a/client/src/pages/transaction/details.tsx +++ b/client/src/pages/transaction/details.tsx @@ -30,8 +30,9 @@ const methodDetails: { }; export function details(data: any) { - const detailFn = methodDetails[data.method]; - const prettyMethod = PrettyMethods[data.method] || "Unknown"; + const method = data.method || data._method; + const detailFn = methodDetails[method]; + const prettyMethod = PrettyMethods[method] || "Unknown"; let txn: TableObject = { Type: ( @@ -39,7 +40,7 @@ export function details(data: any) { {prettyMethod} {" "} - ({data.method}) + ({method}) ), }; @@ -48,7 +49,7 @@ export function details(data: any) { txn = { ...txn, ...detailFn(data) }; } - if (data.argument.memo) { + if (data.argument && data.argument.memo) { txn = { ...txn, Memo: ( diff --git a/client/src/pages/transaction/ledger-send.tsx b/client/src/pages/transaction/ledger-send.tsx index 3b5b2163..1a5de688 100644 --- a/client/src/pages/transaction/ledger-send.tsx +++ b/client/src/pages/transaction/ledger-send.tsx @@ -3,29 +3,48 @@ import { Link } from "react-router-dom"; import { useFindToken } from "./tokens"; export function useLedgerSend(data: any) { - const token = useFindToken(data.argument.symbol); + let symbol: string = ""; + let from: string = ""; + let to: string = ""; + let amount: any = ""; + + if (!data.argument) { + if (data._method === "ledger.send") { + symbol = data.symbol; + from = data.from; + to = data.to; + amount = data.amount; + } + } else { + symbol = data.argument.symbol; + from = data.argument.from; + to = data.argument.to; + amount = data.argument.amount; + } + + const token = useFindToken(symbol); return { From: ( - {data.argument.from} + {from} ), To: ( - {data.argument.to} + {to} ), Amount: `${parseFloat(( - data.argument.amount / + amount / 10 ** token.precision ).toFixed(token.precision).toLocaleString())} ${token.symbol}`, };