Skip to content

Commit

Permalink
Fix View XDR for non-transaction types (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits authored Nov 13, 2024
1 parent 2ae8660 commit 7dd1d21
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/app/(sidebar)/xdr/view/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,18 @@ export default function ViewXdr() {
};

const xdrJsonDecoded = xdrDecodeJson();
const txn = xdrJsonDecoded?.jsonString
? TransactionBuilder.fromXDR(xdr.blob, network.passphrase)
: null;

const txnFromXdr = () => {
try {
return xdrJsonDecoded?.jsonString
? TransactionBuilder.fromXDR(xdr.blob, network.passphrase)
: null;
} catch (e) {
return null;
}
};

const txn = txnFromXdr();

const prettifyJsonString = (jsonString: string): string => {
try {
Expand Down

0 comments on commit 7dd1d21

Please sign in to comment.