Returns the address an output script pays to.
Standard scripts (P2PKH, P2SH, P2WPKH, P2WSH, P2TR and future segwit versions) map to their address. A name output maps to the address of the owner's script behind its name prefix, see nameScriptOwner.
The output script.
Optional
The network whose address prefixes to use. Defaults to Bitcoin.
The address.
If the script does not pay to an address.
Returns the address an output script pays to.
Standard scripts (P2PKH, P2SH, P2WPKH, P2WSH, P2TR and future segwit versions) map to their address. A name output maps to the address of the owner's script behind its name prefix, see nameScriptOwner.