Skip to content

feat: add SIP-044 staking, pox post-conditions, clarity 6 - #1869

Merged
jannik-stacks merged 5 commits into
mainfrom
feat-add-new-pox-post-conditions
Jun 22, 2026
Merged

feat: add SIP-044 staking, pox post-conditions, clarity 6#1869
jannik-stacks merged 5 commits into
mainfrom
feat-add-new-pox-post-conditions

Conversation

@jannik-stacks

Copy link
Copy Markdown
Collaborator
  • adds new PCs (READMEs show usage)
  • clarity 6 support (not default yet)

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Public API Surface Changes

1 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 = StakingPostConditionWire

Changed

ClarityVersion (enum)

- { Clarity1 = 1, Clarity2 = 2, Clarity3 = 3, Clarity4 = 4, Clarity5 = 5 }
+ { Clarity1 = 1, Clarity2 = 2, Clarity3 = 3, Clarity4 = 4, Clarity5 = 5, Clarity6 = 6 }

PostConditionType (enum)

- { 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and PoX (0x04) post-condition types, including constants, TS types, and wire serialization/deserialization.
  • Extends post-condition conversions (postConditionToWire / wireToPostCondition) and the Pc builder (.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.

Comment thread packages/transactions/tests/postcondition.test.ts
Comment thread packages/transactions/tests/postcondition.test.ts
Comment thread packages/transactions/src/postcondition-types.ts
Comment thread packages/transactions/src/postcondition-types.ts
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/transactions/src/wire/serialization.ts 81.81% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

edgar-stacks
edgar-stacks previously approved these changes Jun 22, 2026
edgar-stacks
edgar-stacks previously approved these changes Jun 22, 2026
@jannik-stacks
jannik-stacks merged commit b7f0ed3 into main Jun 22, 2026
7 checks passed
@jannik-stacks
jannik-stacks deleted the feat-add-new-pox-post-conditions branch June 22, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants