zencashjs
zencashjs copied to clipboard
How to convert deserialized script into address
About outs when eg using zencashjs.transaction.deserializeTx method. I can only get satoshis and script, I want to know how to get the real address through script
{ version: 1, locktime: 0, ins: [{ output: [Object], script: '', sequence: 'ffffffff', prevScriptPubKey: '' }], outs: [{ satoshis: 100000, script: '76a914da46f44467949ac9321b16402c32bbeede5e3e5f88ac200206260143838b5ff52dc2eb7b4b8099d4e4c99dc3ef19794289a2cd4c10070000b4' }] }
example:How to get the corresponding address through 76a914da46f44467949ac9321b16402c32bbeede5e3e5f88ac200206260143838b5ff52dc2eb7b4b8099d4e4c99dc3ef19794289a2cd4c10070000b4
You can use: zen-cli decodescript '76a914da46f44467949ac9321b16402c32bbeede5e3e5f88ac200206260143838b5ff52dc2eb7b4b8099d4e4c99dc3ef19794289a2cd4c10070000b4'
Thanks. Is there no sdk at present? Is there a js version or a java version? I don’t know much about the c language.
The only way to decode is with the zend cli as far as I know.
It can be called from a node.js project using rpc calls. It just means having a local node available.
OK, thanks. I'll try to see if I can convert the decrypted c code into js or java