feat: add SIP-044 staking, pox post-conditions, clarity 6 - #1869
Merged
Conversation
jannik-stacks
commented
Jun 22, 2026
Collaborator
- adds new PCs (READMEs show usage)
- clarity 6 support (not default yet)
Contributor
Public API Surface Changes1 package affected · +8 added · ~2 changed @stacks/transactions (+8, ~2)Added+ PoxComparator: type = PoxComparator
+ poxConditionByteToType: function = (wireType: PoxConditionCode) => PoxComparator
+ PoxConditionCode: enum = { WillNotPerform = 48, MayPerform = 49, WillPerform = 50 }
+ poxConditionTypeToByte: function = (condition: PoxComparator) => PoxConditionCode
+ PoxPostCondition: interface = PoxPostCondition
+ PoxPostConditionWire: interface = PoxPostConditionWire
+ StakingPostCondition: interface = StakingPostCondition
+ StakingPostConditionWire: interface = StakingPostConditionWireChanged
- { Clarity1 = 1, Clarity2 = 2, Clarity3 = 3, Clarity4 = 4, Clarity5 = 5 }
+ { Clarity1 = 1, Clarity2 = 2, Clarity3 = 3, Clarity4 = 4, Clarity5 = 5, Clarity6 = 6 }
- { STX = 0, Fungible = 1, NonFungible = 2 }
+ { STX = 0, Fungible = 1, NonFungible = 2, Staking = 3, PoX = 4 }View full JSONL diff+ ["@stacks/transactions",".","named","PoxComparator","type","PoxComparator"]
+ ["@stacks/transactions",".","named","poxConditionByteToType","function","(wireType: PoxConditionCode) => PoxComparator"]
+ ["@stacks/transactions",".","named","PoxConditionCode","enum","{ WillNotPerform = 48, MayPerform = 49, WillPerform = 50 }"]
+ ["@stacks/transactions",".","named","poxConditionTypeToByte","function","(condition: PoxComparator) => PoxConditionCode"]
+ ["@stacks/transactions",".","named","PoxPostCondition","interface","PoxPostCondition"]
+ ["@stacks/transactions",".","named","PoxPostConditionWire","interface","PoxPostConditionWire"]
+ ["@stacks/transactions",".","named","StakingPostCondition","interface","StakingPostCondition"]
+ ["@stacks/transactions",".","named","StakingPostConditionWire","interface","StakingPostConditionWire"]
- ["@stacks/transactions",".","named","ClarityVersion","enum","{ Clarity1 = 1, Clarity2 = 2, Clarity3 = 3, Clarity4 = 4, Clarity5 = 5 }"]
+ ["@stacks/transactions",".","named","ClarityVersion","enum","{ Clarity1 = 1, Clarity2 = 2, Clarity3 = 3, Clarity4 = 4, Clarity5 = 5, Clarity6 = 6 }"]
- ["@stacks/transactions",".","named","PostConditionType","enum","{ STX = 0, Fungible = 1, NonFungible = 2 }"]
+ ["@stacks/transactions",".","named","PostConditionType","enum","{ STX = 0, Fungible = 1, NonFungible = 2, Staking = 3, PoX = 4 }"]Updated 2026-06-22 16:34:40 UTC |
There was a problem hiding this comment.
Pull request overview
Adds SIP-044 post-condition support to @stacks/transactions, extending the post-condition model/wire format and the Pc builder API to cover staking and PoX gating use-cases, with updated docs and tests.
Changes:
- Introduces
Staking(0x03) andPoX(0x04) post-condition types, including constants, TS types, and wire serialization/deserialization. - Extends post-condition conversions (
postConditionToWire/wireToPostCondition) and thePcbuilder (.stake(),.willPerformPox(),.willNotPerformPox(),.mayPerformPox()). - Adds/updates tests and README examples, plus a changeset for a minor bump.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/transactions/tests/postcondition.test.ts | Adds SIP-044 wire-format round-trip tests for staking and PoX post-conditions (including origin principal cases). |
| packages/transactions/tests/pc.test.ts | Adds Pc builder tests for .stake() and PoX builder methods, plus hex round-trips. |
| packages/transactions/src/wire/types.ts | Adds wire interfaces and extends the PostConditionWire union for staking/PoX. |
| packages/transactions/src/wire/serialization.ts | Updates post-condition wire (de)serialization to handle staking (amount-bearing) and PoX (no-amount) variants. |
| packages/transactions/src/postcondition.ts | Adds PoX condition mapping helpers and updates post-condition ↔ wire conversions for new types. |
| packages/transactions/src/postcondition-types.ts | Adds public TS types/docs for StakingPostCondition, PoxPostCondition, and PoxComparator. |
| packages/transactions/src/pc.ts | Adds Pc builder methods for staking and PoX post-conditions. |
| packages/transactions/src/constants.ts | Adds SIP-044 enums: PostConditionType.Staking, PostConditionType.PoX, and PoxConditionCode. |
| packages/transactions/README.md | Documents new post-condition types and shows usage examples. |
| .changeset/legal-wasps-shout.md | Declares a minor release for the SIP-044 post-condition additions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
edgar-stacks
previously approved these changes
Jun 22, 2026
edgar-stacks
previously approved these changes
Jun 22, 2026
jannik-stacks
enabled auto-merge (squash)
June 22, 2026 16:34
edgar-stacks
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.