示例#1
0
        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);
            }

            return(new Unrecognized(script));
        }