예제 #1
0
 public Base58Data CreateBase58Data(Base58Type type, string base58)
 {
     if (type == Base58Type.EXT_PUBLIC_KEY)
     {
         return(CreateBitcoinExtPubKey(base58));
     }
     if (type == Base58Type.EXT_SECRET_KEY)
     {
         return(CreateBitcoinExtKey(base58));
     }
     if (type == Base58Type.PUBKEY_ADDRESS)
     {
         return(CreateBitcoinAddress(base58));
     }
     if (type == Base58Type.SCRIPT_ADDRESS)
     {
         return(CreateBitcoinScriptAddress(base58));
     }
     if (type == Base58Type.SECRET_KEY)
     {
         return(CreateBitcoinSecret(base58));
     }
     if (type == Base58Type.CONFIRMATION_CODE)
     {
         return(CreateConfirmationCode(base58));
     }
     if (type == Base58Type.ENCRYPTED_SECRET_KEY_EC)
     {
         return(CreateEncryptedKeyEC(base58));
     }
     if (type == Base58Type.ENCRYPTED_SECRET_KEY_NO_EC)
     {
         return(CreateEncryptedKeyNoEC(base58));
     }
     if (type == Base58Type.PASSPHRASE_CODE)
     {
         return(CreatePassphraseCode(base58));
     }
     if (type == Base58Type.STEALTH_ADDRESS)
     {
         return(CreateStealthAddress(base58));
     }
     if (type == Base58Type.ASSET_ID)
     {
         return(CreateAssetId(base58));
     }
     if (type == Base58Type.COLORED_ADDRESS)
     {
         return(CreateColoredAddress(base58));
     }
     if (type == Base58Type.WITNESS_P2WPKH)
     {
         return(CreateWitPubKeyAddress(base58));
     }
     if (type == Base58Type.WITNESS_P2WSH)
     {
         return(CreateWitScriptAddress(base58));
     }
     throw new NotSupportedException("Invalid Base58Data type : " + type.ToString());
 }
예제 #2
0
 private IBase58Data CreateBase58Data(Base58Type type, string base58)
 {
     if (type == Base58Type.PUBKEY_ADDRESS)
     {
         return(new BitcoinPubKeyAddress(base58, this));
     }
     if (type == Base58Type.SECRET_KEY)
     {
         return(CreateBitcoinSecret(base58));
     }
     throw new NotSupportedException("Invalid Base58Data type : " + type.ToString());
 }