stacks-archive / stacks-transactions-js

The JavaScript library for generating Stacks 2.0 transactions
19 stars 17 forks source link

Tx validation utility helpers #46

Closed kyranjamie closed 3 years ago

kyranjamie commented 4 years ago

Building the explorer, would be really handy to have utility functions to validate tx hashes and addresses.

To be clear, I mean whether a given input matches that of a valid hash format, not a look up to see whether the tx exists.

Is this the kind of functionality we think should live here?

yknl commented 4 years ago

For validating tx hashes, you can check that it's a valid sha512/256 hash. That's pretty much all you can do in terms of validation. For address format validation, there's the c32check lib which this lib uses internally: https://github.com/blockstack/c32check

agraebe commented 3 years ago

can this issue be closed or do you have another follow up @kyranjamie ?