You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/stacks/stacks.js/concepts/post-conditions.mdx
+33-2
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ More precisely, adding post-conditions to a transaction can ensure that:
15
15
Post-conditions aren't perfect. They can't say anything about the end-state after a transaction. In other words, they can't guarantee the receipt of FTs/NFTs, since they only check for sending.
16
16
</Callout>
17
17
18
-
Here's an example of a post-condition where the `principal` must send 1000 uSTX, or else the transaction will abort:
18
+
Here's an example of a post-condition using the `Pc` helper, where the `principal` must send 1000 uSTX, or else the transaction will abort:
This code sends the signed transaction to the Stacks blockchain. The `broadcastTransaction` function returns a response containing the transaction ID, which can be used to track the transaction on the blockchain.
@@ -161,7 +150,7 @@ This code sends the signed transaction to the Stacks blockchain. The `broadcastT
161
150
162
151
Handle the transaction results by checking the transaction status and responding accordingly.
163
152
164
-
```ts
153
+
```ts -cn
165
154
if (broadcastResponse.success) {
166
155
console.log('Transaction successful with ID:', broadcastResponse.txid);
Copy file name to clipboardExpand all lines: content/docs/stacks/stacks.js/guides/post-conditions.mdx
+6-6
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Post-conditions can be added to contract calls and FT/NFT transfers to ensure as
32
32
33
33
For instance, the following post-condition ensures that the principal initiating the transaction must send exactly 1000 uSTX, or else the transaction will abort.
0 commit comments