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
{{ message }}
Repository navigation
Commit 391213e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/reference/stacks.js/stacks-transactions/post-conditions/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,4 +33,4 @@ type PostCondition =
33
33
|PoxPostCondition;
34
34
```
35
35
36
-
`StakingPostCondition` and `PoxPostCondition` were added for Stacks epoch 4.0 and are available in `@stacks/transactions` 7.5.0 and later. See [PostConditionType](../types/PostConditionType.md) for the wire values and the condition codes each type pairs with.
36
+
`StakingPostCondition` and `PoxPostCondition` were added for Stacks epoch 4.0 and are available in `@stacks/transactions` 7.5.0 and later. See [PostCondition](../types/PostCondition.md) for the shape of each, and [PostConditionType](../types/PostConditionType.md) for the wire values and the condition codes each type pairs with.
The post condition object to serialize.`StakingPostCondition` and `PoxPostCondition` were added for Stacks epoch 4.0 and are available in `@stacks/transactions` 7.5.0 and later.
Copy file name to clipboardExpand all lines: docs/reference/stacks.js/stacks-transactions/post-conditions/principal.md
+28-18Lines changed: 28 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Entry point for building post conditions. Starts the post condition builder chain by specifying the principal (address) the condition applies to.
4
4
5
-
The `Pc` builder uses a chainable API pattern: `PRINCIPAL → [AMOUNT] → CODE → ASSET`. PoX conditions are the exception — they terminate directly on the principal.
5
+
The `Pc` builder uses a chainable API pattern: `PRINCIPAL → [AMOUNT] → CODE → ASSET`. PoX conditions are the exception: they terminate directly on the principal.
6
6
7
7
***
8
8
@@ -11,7 +11,7 @@ The `Pc` builder uses a chainable API pattern: `PRINCIPAL → [AMOUNT] → CODE
11
11
```ts
12
12
import { Pc, Cl } from'@stacks/transactions';
13
13
14
-
// STX post condition — principal will send exactly 10,000 microSTX
14
+
// STX post condition: principal will send exactly 10,000 microSTX
* The address can be a standard principal (`ST...`) or a contract principal (`address.contract-name`).
51
-
* After calling `Pc.principal()`, chain one of the amount/comparator methods, then finalize with an asset method — except for the PoX methods, which return a complete post condition on their own.
51
+
* After calling `Pc.principal()`, chain one of the amount/comparator methods, then finalize with an asset method. The PoX methods are the exception: they return a complete post condition on their own.
52
+
* To apply a post condition to the transaction sender without naming an address, use [`Pc.origin`](origin.md).
|`.willNotPerformPox()`|`WillNotPerform`| The principal **must not** perform a gated PoX action |
117
+
|`.mayPerformPox()`|`MayPerform`| The principal **may or may not** perform one; always passes|
118
+
|`.willPerformPox()`|`WillPerform`| The principal **must** perform a gated PoX action |
107
119
108
-
{% hint style="info" %}
109
-
`.willMaybeSendAsset()` comes from [SIP-040](https://github.com/stacksgov/sips/blob/main/sips/sip-040/sip-040-post-conds.md) and is available in `@stacks/transactions` 7.4.0 and later. `.ustxToLock()` and the PoX methods were added for Stacks epoch 4.0 and are available in 7.5.0 and later.
110
-
{% endhint %}
120
+
See [PostConditionType](../types/PostConditionType.md) for the wire values behind these condition codes.
|`maybe-sent` on `NonFungiblePostCondition` (SIP-040) |`@stacks/transactions` 7.4.0, Stacks epoch 3.4 |
56
+
|`StakingPostCondition` and `PoxPostCondition` (SIP-045) |`@stacks/transactions` 7.5.0, Stacks epoch 4.0 |
57
+
47
58
{% hint style="info" %}
48
-
`StakingPostCondition` and `PoxPostCondition` were added for Stacks epoch 4.0 and are available in `@stacks/transactions` 7.5.0 and later. The source labels them SIP-044 in its JSDoc; the post-conditions themselves are specified in [SIP-045 §3.4.3](https://github.com/stacksgov/sips/blob/main/sips/sip-045/sip-045-pox-5-bitcoin-staking.md).
59
+
Staking and PoX post-conditions are specified in [SIP-045 §3.4.3](https://github.com/stacksgov/sips/blob/main/sips/sip-045/sip-045-pox-5-bitcoin-staking.md). The `@stacks/transactions` JSDoc labels these SIP-044; the two SIPs activated together.
`maybe-sent` was added by [SIP-040](https://github.com/stacksgov/sips/blob/main/sips/sip-040/sip-040-post-conds.md) and is available in `@stacks/transactions` 7.4.0 and later. It always passes, and still counts as covering that NFT instance under `Deny` or `Originator` mode.
114
+
`maybe-sent` was added by [SIP-040](https://github.com/stacksgov/sips/blob/main/sips/sip-040/sip-040-post-conds.md). It always passes, and still counts as covering that NFT instance under `Deny` or `Originator` mode.
104
115
105
116
***
106
117
107
118
### StakingPostCondition
108
119
109
-
Guards staking STX, or modifying staked STX, for a principal — for example the pox-5 `stake`, `register-for-bond`, and `stake-update` calls. Uses the same comparators as `StxPostCondition`.
120
+
Guards staking STX, or modifying staked STX, for a principal. For example, the pox-5 `stake`, `register-for-bond`, and `stake-update` calls. Uses the same comparators as `StxPostCondition`.
Guards PoX state changes that do not alter locking status — for example the pox-5 `unstake`, `unstake-sbtc`, `update-bond-registration`, and `announce-l1-early-exit` calls. Carries only a principal and a condition code: there is no asset and no amount.
138
+
Guards PoX state changes that do not alter locking status. For example, the pox-5 `unstake`, `unstake-sbtc`, `update-bond-registration`, and `announce-l1-early-exit` calls. Carries only a principal and a condition code: there is no asset and no amount.
|`Staking`|`0x03`| Guards staking STX, or modifying staked STX, for a principal. Mirrors the `STX` shape — principal, a `FungibleConditionCode`, and an amount. |
44
-
|`PoX`|`0x04`| Guards PoX state changes that do not alter locking status. Carries a principal and a `PoxConditionCode`, with no amount. |
|`Staking`|`0x03`| Guards staking STX, or modifying staked STX, for a principal. Mirrors the `STX` shape: principal, a `FungibleConditionCode`, and an amount. |
44
+
|`PoX`|`0x04`| Guards PoX state changes that do not alter locking status. Carries a principal and a `PoxConditionCode`, with no amount. |
45
+
46
+
See [PostCondition](PostCondition.md) for the object shape behind each of these.
|`Staking` and `PoX` (SIP-045) |`@stacks/transactions` 7.5.0, Stacks epoch 4.0 |
45
56
46
57
{% hint style="info" %}
47
-
`Staking` and `PoX` were added for Stacks epoch 4.0 and are available in `@stacks/transactions` 7.5.0 and later. The source labels them SIP-044 in its JSDoc; the post-conditions themselves are specified in [SIP-045 §3.4.3](https://github.com/stacksgov/sips/blob/main/sips/sip-045/sip-045-pox-5-bitcoin-staking.md).
58
+
Staking and PoXpost-conditions are specified in [SIP-045 §3.4.3](https://github.com/stacksgov/sips/blob/main/sips/sip-045/sip-045-pox-5-bitcoin-staking.md). The `@stacks/transactions` JSDoc labels these SIP-044; the two SIPs activated together.
48
59
{% endhint %}
49
60
50
61
***
@@ -75,7 +86,7 @@ enum NonFungibleConditionCode {
75
86
}
76
87
```
77
88
78
-
`MaybeSent` was added by [SIP-040](https://github.com/stacksgov/sips/blob/main/sips/sip-040/sip-040-post-conds.md), is enabled from epoch 3.4, and is available in `@stacks/transactions` 7.4.0 and later. It always passes, and still counts as covering that NFT instance under `Deny` or `Originator` mode.
89
+
`MaybeSent` was added by [SIP-040](https://github.com/stacksgov/sips/blob/main/sips/sip-040/sip-040-post-conds.md). It always passes, and still counts as covering that NFT instance under `Deny` or `Originator` mode.
0 commit comments