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

Add utility `postConditionToHex`

Open aryzing opened this issue 1 year ago • 1 comments

Problem

In the wake of the increasingly adopted WebBTC standard, and from how the [Integration of WebBTC Request Standard for Stacks Wallets SIP](Integration of WebBTC Request Standard for Stacks Wallets) is evolving, it would be helpful to have hex conversion helpers for all values recommended by the SIP to be used as hex,

  • [done] Clarity values (covered by cvToHex)
  • Post Conditions
  • Transactions

Although user can 2-step this process by first serializing to bytes and then converting to hex, having a helper would make for a nicer DX.

Solution

Similar to the cvToHex helper, it would be helpful to have postConditionToHex() and txToHex() helpers.

aryzing avatar Feb 21 '24 08:02 aryzing

Good point, thanks! There might exist some helpers, but I'll add aliases or build out the missing functions.

janniks avatar Feb 26 '24 13:02 janniks