From af37f88136e63ca7c5ce9e634db57ae261d39d29 Mon Sep 17 00:00:00 2001 From: Alexander Graebe Date: Fri, 10 Jul 2020 10:22:35 -0700 Subject: [PATCH] feat: check tx status irt #608 --- develop/connect/use-with-clarity.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/develop/connect/use-with-clarity.md b/develop/connect/use-with-clarity.md index 20b5b2a9..7351c4b6 100644 --- a/develop/connect/use-with-clarity.md +++ b/develop/connect/use-with-clarity.md @@ -246,4 +246,18 @@ const MyComponent = () => { Call my contract ); }; -``` \ No newline at end of file +``` + +## Checking transaction status +You may want to check the status of a transaction after signing and broadcasting it. For instance, your app might want to enable certain components only _after_ a transaction was successfully processed on the blockchain. + +Following the steps above, you'll receive a transaction ID (`txId`) as part of the `finished` callback method once your user signed the transaction. Equipped with the ID, you can use the [Stacks Blockstack API](https://docs.blockstack.org/common/core_ref.html#stacks-blockchain-api) to request the status of the transaction. + +```bash +curl 'https://sidecar.staging.blockstack.xyz/sidecar/v1/tx/' +``` + +The API will respond with a JSON object that includes a `tx_status` field. Once the response returns `success`, the transactions was successfully processed. + +{% include note.html content="Review the API reference of the Get Transaction endpoint for more details." %} \ No newline at end of file