public static OutputScript ParseScript(byte[] script) { PubKeyHash pubKeyHash; if (PubKeyHash.TryFromScript(script, out pubKeyHash)) { return(pubKeyHash); } ScriptHash scriptHash; if (ScriptHash.TryFromScript(script, out scriptHash)) { return(scriptHash); } PubKey pubKey; if (PubKey.TryFromScript(script, out pubKey)) { return(pubKey); } return(new Unrecognized(script)); }
public static OutputScript ParseScript(byte[] script) { Secp256k1PubKeyHash secp256k1PubKeyHash; if (Secp256k1PubKeyHash.TryFromScript(script, out secp256k1PubKeyHash)) { return(secp256k1PubKeyHash); } Ed25519PubKeyHash ed25519PubKeyHash; if (Ed25519PubKeyHash.TryFromScript(script, out ed25519PubKeyHash)) { return(ed25519PubKeyHash); } SecSchnorrPubKeyHash secSchnorrPubKeyHash; if (SecSchnorrPubKeyHash.TryFromScript(script, out secSchnorrPubKeyHash)) { return(secSchnorrPubKeyHash); } ScriptHash scriptHash; if (ScriptHash.TryFromScript(script, out scriptHash)) { return(scriptHash); } PubKey pubKey; if (PubKey.TryFromScript(script, out pubKey)) { return(pubKey); } return(new Unrecognized(script)); }