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.
Signature
Returns
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?