stacks.js icon indicating copy to clipboard operation
stacks.js copied to clipboard

Make `postConditionFromMode` public

Open aryzing opened this issue 1 year ago • 0 comments

Problem

@stacksjs/transactions makes both post condition mode types available as exports:

https://github.com/hirosystems/stacks.js/blob/fd0bf26b5f29fc3c1bf79581d0ad9b89f0d7f15a/packages/transactions/src/postcondition-types.ts#L44

https://github.com/hirosystems/stacks.js/blob/fd0bf26b5f29fc3c1bf79581d0ad9b89f0d7f15a/packages/transactions/src/constants.ts#L88

but not the helper to that unifies into a single type,

https://github.com/hirosystems/stacks.js/blob/fd0bf26b5f29fc3c1bf79581d0ad9b89f0d7f15a/packages/transactions/src/postcondition.ts#L97

which makes it hard for clients to likewise allow for both types, and treat them in a stable manenr

Solution

Make postConditionModeFrom available for import for clients.

Additional context

Let me know if there's a better or preferred way of handling these two types, or if one will be soon deprecated?

aryzing avatar Nov 28 '24 13:11 aryzing