Browse Source

feat: check tx status

irt #608
master-legacy
Alexander Graebe 4 years ago
committed by Alexander Graebe
parent
commit
af37f88136
  1. 16
      develop/connect/use-with-clarity.md

16
develop/connect/use-with-clarity.md

@ -246,4 +246,18 @@ const MyComponent = () => {
<span onClick={onClick}>Call my contract</span>
);
};
```
```
## 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/<txId>'
```
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 <a
href="https://blockstack.github.io/stacks-blockchain-sidecar/#operation/get_transaction_by_id">Get Transaction endpoint</a> for more details." %}
Loading…
Cancel
Save