Skip to main content

decodescript

Command#

pacprotocol-cli decodescript "hexstring"

Decode a hex-encoded script.

Arguments#

hexstring#

(string)

the hex encoded script

Examples#

pacprotocol-cli decodescript "hexstring"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/

Result#

{
"asm":"asm", #(string) Script public key
"hex":"hex", #(string) hex encoded public key
"type":"type", #(string) The output type
"reqSigs": n, #(numeric) The required signatures
"addresses": [ #(json array of string)
"address" #(string) PAC address
,...
],
"p2sh","address" #(string) address of P2SH script wrapping this redeem script #(not returned if the script is already a P2SH).
}

Running following help command

pacprotocol-cli help decodescript

Will produce following output:

decodescript "hexstring"
Decode a hex-encoded script.
Arguments:
1. "hexstring" (string) the hex encoded script
Result:
{
"asm":"asm", (string) Script public key
"hex":"hex", (string) hex encoded public key
"type":"type", (string) The output type
"reqSigs": n, (numeric) The required signatures
"addresses": [ (json array of string)
"address" (string) PAC address
,...
],
"p2sh","address" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).
}
Examples:
> pacprotocol-cli decodescript "hexstring"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/