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

fromHex

Deserializes a serialized post condition hex string into a post condition object.


Usage

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

const hex = '00021600000000000000000000000000000000000000000200000000000003e8';
const postCondition = Pc.fromHex(hex);
// {
//   type: 'stx-postcondition',
//   address: 'SP000000000000000000002Q6VF78',
//   condition: 'gt',
//   amount: '1000'
// }

Notes

  • Useful for parsing post conditions from serialized transaction data.

  • The inverse of postConditionToHex.

Reference Link

StakingPostCondition and PoxPostCondition were added for Stacks epoch 4.0 and are available in @stacks/transactions 7.5.0 and later.


Signature


Returns

PostCondition

Which member of the union you get depends on the post condition type byte in the hex string.


Parameters

hex (required)

  • Type: string

A hex-encoded serialized post condition string.

Last updated

Was this helpful?