bitcoin-sv / ts-sdk

Other
51 stars 13 forks source link

Decode OpReturn util #74

Closed tiagolr closed 6 months ago

tiagolr commented 6 months ago

Small util to decode op_return scripts to UTF-8.

I notice this PR has some differences in documentation, I only ran npm run lint and npm run doc before submitting, strange. The doc changes come from adding this line to Utils.js import Script from '../script/Script.js' and then running doc.

ty-everett commented 6 months ago

For people who use the OP_RETURN script template, this may prove useful. But as it's template-specific, I think it makes more sense to have as a static method on the script template within the templates repository, rather than shipping it in the core library itself.

I've spoken with people within the BSV Association and received the necessary approvals, so I'll be creating the new templates repository very soon. In the initial version, I'll be sure to incorporate this within the OP_RETURN template.

Template classes have the lock and unlock methods, but I think they can definitely incorporate other functionality as well, such as decoding scripts.

ty-everett commented 6 months ago

Implemented within the new Templates repository:

https://github.com/bitcoin-sv/ts-templates