private static string NotNull(WitKeyId segwitKeyId) { if (segwitKeyId == null) { throw new ArgumentNullException("segwitKeyId"); } return(null); }
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); }
public CoinWitPubKeyAddress(WitKeyId segwitKeyId, Network network) : base(NotNull(segwitKeyId) ?? Network.CreateBech32(EncoderType, segwitKeyId.ToBytes(), 0, network), network) { Type = EncoderType; _Hash = segwitKeyId; }
//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)); }
public Script GenerateScriptPubKey(WitKeyId pubkeyHash) { return(pubkeyHash.ScriptPubKey); }