{
{receipt?.outcome?.outgoing_receipts?.map((rcpt: any) => (
))}
diff --git a/apps/app/src/components/Transactions/Receipts/ReceiptSummaryRow.tsx b/apps/app/src/components/Transactions/Receipts/ReceiptSummaryRow.tsx
index 06417bea..f4e24bfe 100644
--- a/apps/app/src/components/Transactions/Receipts/ReceiptSummaryRow.tsx
+++ b/apps/app/src/components/Transactions/Receipts/ReceiptSummaryRow.tsx
@@ -35,16 +35,16 @@ const ReceiptSummaryRow = (props: Props) => {
const getGasAttached = (actions: Action[]): string => {
const gasAttached = actions
- .map((action) => action.args)
+ .map((action) => action?.args)
.filter(
(args): args is FunctionCallActionView['FunctionCall'] => 'gas' in args,
);
- if (gasAttached.length === 0) {
+ if (gasAttached?.length === 0) {
return '0';
}
- return gasAttached.reduce(
+ return gasAttached?.reduce(
(acc, args) =>
Big(acc || '0')
.plus(args.gas)
@@ -59,8 +59,8 @@ const ReceiptSummaryRow = (props: Props) => {
const isSuccess =
status &&
(('SuccessValue' in status &&
- status.SuccessValue !== null &&
- status.SuccessValue !== undefined) ||
+ status?.SuccessValue !== null &&
+ status?.SuccessValue !== undefined) ||
'SuccessReceiptId' in status);
return (
@@ -78,7 +78,7 @@ const ReceiptSummaryRow = (props: Props) => {
>
{' '}
{receipt.id}
@@ -86,7 +86,7 @@ const ReceiptSummaryRow = (props: Props) => {
- {formatActionKind(action.action_kind)}
+ {formatActionKind(action?.action_kind)}
{action.args?.method_name}
@@ -128,13 +128,13 @@ const ReceiptSummaryRow = (props: Props) => {
- {action.args?.deposit
- ? yoctoToNear(action.args?.deposit, true)
- : action.args?.deposit ?? '0'}{' '}
+ {action?.args?.deposit
+ ? yoctoToNear(action?.args?.deposit, true)
+ : action?.args?.deposit ?? '0'}{' '}
Ⓝ
{currentPrice && networkId === 'mainnet'
? ` ($${fiatValue(
- yoctoToNear(action.args?.deposit ?? 0, false),
+ yoctoToNear(action?.args?.deposit ?? 0, false),
currentPrice,
)})`
: ''}
diff --git a/apps/app/src/pages/txns/[hash].tsx b/apps/app/src/pages/txns/[hash].tsx
index ac2b5413..755bd612 100644
--- a/apps/app/src/pages/txns/[hash].tsx
+++ b/apps/app/src/pages/txns/[hash].tsx
@@ -154,6 +154,7 @@ const Txn = ({
const { transactionStatus, getBlockDetails } = useRpc();
const rpcUrl: string = useRpcStore((state) => state.rpc);
const switchRpc: () => void = useRpcStore((state) => state.switchRpc);
+ const [allRpcProviderError, setAllRpcProviderError] = useState(false);
const requestSignInWithWallet = useAuthStore(
(store) => store.requestSignInWithWallet,
@@ -193,7 +194,13 @@ const Txn = ({
useEffect(() => {
if (rpcError) {
- switchRpc();
+ try {
+ switchRpc();
+ } catch (error) {
+ setRpcError(true);
+ setAllRpcProviderError(true);
+ console.error('Failed to switch RPC:', error);
+ }
}
}, [rpcError, switchRpc]);
@@ -349,13 +356,12 @@ const Txn = ({
{/*
*/}
- {rpcError && error ? (
+ {rpcError && (error || allRpcProviderError) ? (
}
- message="Sorry, we are unable to locate this transaction hash. Please try using a
- different RPC."
+ message="Sorry, we are unable to locate this transaction hash. Please try again later."
mutedText={hash || ''}
/>
@@ -427,6 +433,7 @@ const Txn = ({
txn={txn ? txn : rpcData}
rpcTxn={rpcTxn}
loading={rpcError || !rpcTxn}
+ statsData={statsData}
/>