buildOutput function

Output buildOutput(
  1. String address,
  2. BigInt value,
  3. UTXONetworkType networkType
)

Implementation

Output buildOutput(String address, BigInt value, UTXONetworkType networkType) {
  final lockingScript = P2Hash(address).publicKeyScript;

  return switch (networkType) {
    BITCOIN_NETWORK() ||
    BITCOINCASH_NETWORK() ||
    ZENIQ_NETWORK() ||
    LITECOIN_NETWORK() =>
      BTCOutput(
        value: value,
        scriptPubKey: lockingScript,
      ),
    EUROCOIN_NETWORK() => EC8Output(
        value: value,
        scriptPubKey: lockingScript,
      ),
  };
}