Skip to content

Commit

Permalink
add transaction result checking
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jul 24, 2024
1 parent 4a3211b commit cd04f81
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/workspace/cli.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export default function Cli() {
<li className="ml-8">clear - clears the terminal</li>
<li className="ml-8">build - builds the current workspace</li>
<li className="ml-8">deploy - deploys the built smart contract</li>
<li className="ml-8">
check txID - checks the result of transaction
</li>
</ol>
</div>
),
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit cd04f81

Please sign in to comment.