Exemple #1
0
 private static string NotNull(WitKeyId segwitKeyId)
 {
     if (segwitKeyId == null)
     {
         throw new ArgumentNullException("segwitKeyId");
     }
     return(null);
 }
Exemple #2
0
        public CoinWitPubKeyAddress(string bech32, Network expectedNetwork)
            : base(Validate(bech32, ref expectedNetwork), expectedNetwork)
        {
            this.Type = EncoderType;
            var  encoder = expectedNetwork.GetBech32Encoder(EncoderType, true);
            byte witVersion;
            var  decoded = encoder.Decode(bech32, out witVersion);

            _Hash = new WitKeyId(decoded);
        }
Exemple #3
0
 public CoinWitPubKeyAddress(WitKeyId segwitKeyId, Network network) :
     base(NotNull(segwitKeyId) ?? Network.CreateBech32(EncoderType, segwitKeyId.ToBytes(), 0, network), network)
 {
     Type  = EncoderType;
     _Hash = segwitKeyId;
 }
Exemple #4
0
        //public virtual CoinPubKeyAddress CreateP2SH(ScriptId scriptId, Network network)
        //{
        //    return new CoinPubKeyAddress(scriptId, network);
        //}

        public virtual CoinAddress CreateP2WPKH(WitKeyId witKeyId, Network network)
        {
            return(new CoinWitPubKeyAddress(witKeyId, network));
        }
Exemple #5
0
 public Script GenerateScriptPubKey(WitKeyId pubkeyHash)
 {
     return(pubkeyHash.ScriptPubKey);
 }