For the complete documentation index, see llms.txt. This page is also available as Markdown.

PostConditionType

Enum representing the type of a post-condition. Used internally for serialization.


Usage

import { Pc, PostConditionType } from '@stacks/transactions';

const pc = Pc.principal('STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6')
  .willSendEq(10000)
  .ustx();

pc.type; // 'stx-postcondition'
PostConditionType.STX; // 0x00, the wire value that tag serializes to

Reference Link


Definition

enum PostConditionType {
  STX = 0x00,
  Fungible = 0x01,
  NonFungible = 0x02,
  Staking = 0x03,
  PoX = 0x04,
}

Values

Value
Number
Description

STX

0x00

STX token post-condition

Fungible

0x01

Fungible token (SIP-010) post-condition

NonFungible

0x02

Non-fungible token (SIP-009) post-condition

Staking

0x03

Guards staking STX or modifying staked STX for a principal. Mirrors the STX shape: principal, a FungibleConditionCode, and an amount.

PoX

0x04

Guards PoX state changes that do not alter locking status. Carries a principal and a PoxConditionCode, with no amount.

See PostCondition for the object shape behind each of these.


Availability

Member
Available from

MaybeSent (SIP-040)

@stacks/transactions 7.4.0, Stacks epoch 3.4

Staking and PoX (SIP-045)

@stacks/transactions 7.5.0, Stacks epoch 4.0

Staking and PoX post-conditions are specified in SIP-045 §3.4.3. The @stacks/transactions JSDoc labels these SIP-044; the two SIPs activated together.


The comparator paired with a post-condition depends on its type.

STX, Fungible, and Staking all use FungibleConditionCode:

NonFungible uses NonFungibleConditionCode:

MaybeSent was added by SIP-040. It always passes, and still counts as covering that NFT instance under Deny or Originator mode.

PoX uses PoxConditionCode:

Last updated

Was this helpful?