postConditionToHex
Converts a post condition object to a hex-encoded string.
Usage
import { postConditionToHex } from '@stacks/transactions';
const hex = postConditionToHex({
type: 'stx-postcondition',
address: 'SP000000000000000000002Q6VF78',
condition: 'eq',
amount: '1000000000000000000',
});Notes
The inverse of
Pc.fromHex.Useful for serializing post conditions for storage or transmission.
Signature
Returns
string
The wire-format serialization: the same bytes the post condition occupies inside a signed transaction.
Parameters
postcondition (required)
Type:
PostCondition
The post condition object to serialize.
Last updated
Was this helpful?