public static DirectDownloadParameterBuilder CreateFromDataHash(string dataHash, string digest)
        {
            CheckParameter(dataHash != null, "dataHash is required");
            //CheckParameter(() => Multihash.fromBase58(dataHash) != null, "dataHash should be a valid ipfs hash");

            var builder = new DirectDownloadParameterBuilder
            {
                DataHash       = dataHash,
                Digest         = digest,
                ValidateDigest = true
            };

            return(builder);
        }
        public static DirectDownloadParameterBuilder CreateFromTransactionHash(string transactionHash,
                                                                               string accountPrivateKey, bool?validateDigest)
        {
            CheckParameter(transactionHash != null, "transactionHash is required");
            CheckParameter(() => accountPrivateKey == null || KeyPair.CreateFromPrivateKey(accountPrivateKey) != null,
                           "accountPrivateKey should be a valid private key");

            var builder = new DirectDownloadParameterBuilder
            {
                TransactionHash   = transactionHash,
                AccountPrivateKey = accountPrivateKey,
                ValidateDigest    = validateDigest ?? false
            };

            return(builder);
        }
Пример #3
0
 public static DirectDownloadParameterBuilder CreateFromDataHash(string dataHash, string digest = null)
 {
     return(DirectDownloadParameterBuilder.CreateFromDataHash(dataHash, digest));
 }
Пример #4
0
 public static DirectDownloadParameterBuilder CreateFromTransactionHash(string transactionHash,
                                                                        string accountPrivateKey = null, bool?validateDigest = null)
 {
     return(DirectDownloadParameterBuilder.CreateFromTransactionHash(transactionHash, accountPrivateKey,
                                                                     validateDigest));
 }