getOutputScriptFromTypeAndHash function

String getOutputScriptFromTypeAndHash(
  1. AddressType type,
  2. String hash
)

Get output script from type and hash

Implementation

String getOutputScriptFromTypeAndHash(AddressType type, String hash) {
  String outputScript;
  if (type == AddressType.p2pkh) {
    outputScript = '76a914${hash}88ac';
  } else {
    outputScript = 'a914${hash}87';
  }
  return outputScript;
}