From cd04f818601b5ecc855be8ed811f346e0491343a Mon Sep 17 00:00:00 2001 From: "yongen.loong" Date: Wed, 24 Jul 2024 22:36:05 +0800 Subject: [PATCH] add transaction result checking --- components/workspace/cli.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/workspace/cli.tsx b/components/workspace/cli.tsx index 21daa04..835d598 100644 --- a/components/workspace/cli.tsx +++ b/components/workspace/cli.tsx @@ -21,6 +21,9 @@ export default function Cli() {
  • clear - clears the terminal
  • build - builds the current workspace
  • deploy - deploys the built smart contract
  • +
  • + check txID - checks the result of transaction +
  • ), @@ -55,6 +58,15 @@ export default function Cli() { return JSON.stringify(err, undefined, 2); } }, + check: async (id: string) => { + if (!id) return `Please enter the Transaction ID.`; + try { + const result = await getResult(id); + return `TransactionId: ${id}, Status: ${result.Status}`; + } catch (err) { + return JSON.stringify(err, undefined, 2); + } + }, }; const { theme, systemTheme } = useTheme();