Bitshala-Incubator / silent-pay

a TS library for silent payments
MIT License
8 stars 10 forks source link

Add `getPublicKeyFromInput()` to `Transaction` class #11

Open theanmolsharma opened 7 months ago

theanmolsharma commented 7 months ago

Add the following function to Transaction class

getPublicKeyFromInput(index: number): Buffer | null {}

This function should extract the public key from the script or witness property of the input whichever is relevant based on the input type. The following output script types contain public key in script:

The following output script types contain public key in witness:

For all other script types, the function should return null

rajarshimaitra commented 7 months ago

Same as the other one. How about Options?

And also a doc of this behavior on the functions, explaining which one throws None and why.

theanmolsharma commented 7 months ago

Same as the other one. How about Options?

And also a doc of this behavior on the functions, explaining which one throws None and why.

replied in #12