async public Task <string> SendManyAsync(string fromAccount, IDictionary <string, decimal> toAccounts, int minConfirmations = 1, string comment = "") { WalletRequest walletRequest = new WalletRequest("sendmany", new object[] { fromAccount, toAccounts, minConfirmations, comment }); return(await RpcRequestAsync <string>(walletRequest)); }
async public Task <IEnumerable <AccountInfo> > ListAccountsAsync(int minConfirmations = 1) { WalletRequest walletRequest = new WalletRequest("listaccounts", new List <object>() { minConfirmations }); List <AccountInfo> accounts = null; var response = await MakeRequestAsync(walletRequest.ToJsonString()); var accountObj = JObject.Parse(response).SelectToken("result"); if (accountObj is JContainer) { JContainer container = (JContainer)accountObj; accounts = new List <AccountInfo>(); foreach (JToken token in container.Children()) { if (!(token is JProperty)) { continue; } JProperty child = (JProperty)token; AccountInfo account = new AccountInfo(); account.Name = child.Name; account.Balance = child.Value.ToObject <decimal>(); accounts.Add(account); } } return(accounts); }
async public Task <string> SendFromAsync(string fromAccount, string toAddress, decimal amount, int minConfirmations = 1, string comment = "", string toComment = "") { WalletRequest walletRequest = new WalletRequest("sendfrom", new object[] { fromAccount, toAddress, Math.Round(amount, 8), minConfirmations, comment, toComment }); return(await RpcRequestAsync <string>(walletRequest)); }
public void Stop() { WalletRequest walletRequest = new WalletRequest("stop"); RpcRequest <string>(walletRequest); //{"result":"Bitcoin server stopping","error":null,"id":"1"} }
public async Task <JsonResult> SaveRequest(string phoneNo, double requestAmount, string transactionId, string remarks) { WalletRequest walletRequest = new WalletRequest(); walletRequest.Phone = phoneNo; walletRequest.RequestAmount = requestAmount; walletRequest.TransactionId = transactionId; walletRequest.Remarks = remarks; if (HttpContext.User.Identity.Name != null) { var loggedInUser = await _userManager.FindByNameAsync(HttpContext.User.Identity.Name); walletRequest.ApplicationUserId = loggedInUser.Id; } walletRequest.Status = 0; _context.Add(walletRequest); int result = await _context.SaveChangesAsync(); if (result == 1) { return(Json(true)); } else { return(Json(false)); } }
async public Task StopAsync() { WalletRequest walletRequest = new WalletRequest("stop"); await RpcRequestAsync <string>(walletRequest); //{"result":"Bitcoin server stopping","error":null,"id":"1"} }
public RawTransaction DecodeRawTransaction(string transactionHex) { WalletRequest walletRequest = new WalletRequest("decoderawtransaction", new List <object>() { transactionHex }); return(RpcRequest <RawTransaction>(walletRequest)); }
async public Task ImportPrivateKeyAsync(string privateKey, string label = "", bool rescanTransactions = true) { WalletRequest walletRequest = new WalletRequest("importprivkey ", new List <object>() { privateKey, label, rescanTransactions }); await RpcRequestAsync <object>(walletRequest); }
public async Task SendOrderToWalletAsync(Guid userId, string symbol, decimal value, int amount, bool isCloseOrder, string orderType) { using (var client = new WalletClient()) { var assetsRequestDto = new AssetRequestDto(symbol, value); var walletRequest = new WalletRequest(userId, assetsRequestDto, amount, isCloseOrder, orderType); await client.SendOrderAsync(walletRequest); } }
public string GetBlockHash(int index) { WalletRequest walletRequest = new WalletRequest("getblockcount", new List <object>() { index }); return(RpcRequest <string>(walletRequest)); }
async public Task <string> GetBlockHashAsync(int index) { WalletRequest walletRequest = new WalletRequest("getblockcount", new List <object>() { index }); return(await RpcRequestAsync <string>(walletRequest)); }
public string GetRawTransactionHex(string transactionId) { WalletRequest walletRequest = new WalletRequest("getrawtransaction", new List <object>() { transactionId, 0 }); return(RpcRequest <string>(walletRequest)); }
public void BackupWallet(string destination) { WalletRequest walletRequest = new WalletRequest("backupwallet", new List <object>() { destination }); RpcRequest <string>(walletRequest); }
async public Task <bool> MoveAsync(string fromAddress, string toAddress, decimal amount, int minConfirmations = 1, string comment = "") { WalletRequest walletRequest = new WalletRequest("move", new List <object>() { fromAddress, toAddress, Math.Round(amount, 8), minConfirmations, comment }); return(await RpcRequestAsync <bool>(walletRequest)); }
public string GetAccountAddress(string account) { WalletRequest walletRequest = new WalletRequest("getaccountaddress", new List <object>() { account }); return(RpcRequest <string>(walletRequest)); }
async public Task <AddressValidation> ValidateAddressAsync(string address) { WalletRequest walletRequest = new WalletRequest("validateaddress", new List <object>() { address }); return(await RpcRequestAsync <AddressValidation>(walletRequest)); }
async public Task <IEnumerable <WalletTransaction> > ListTransactionsAsync(string account = "*", int count = 10, int startingIndex = 0) { WalletRequest walletRequest = new WalletRequest("listtransactions", new List <object>() { account, count, startingIndex }); return(await RpcRequestAsync <IEnumerable <WalletTransaction> >(walletRequest)); }
public AddressValidation ValidateAddress(string address) { WalletRequest walletRequest = new WalletRequest("validateaddress", new List <object>() { address }); return(RpcRequest <AddressValidation>(walletRequest)); }
async public Task SetWalletPassphraseAsync(string passPhrase, TimeSpan timeSpan) { WalletRequest walletRequest = new WalletRequest("walletpassphrase", new List <object>() { passPhrase, Convert.ToInt32(timeSpan.TotalSeconds) }); await RpcRequestAsync <string>(walletRequest); }
public void SetWalletPassphrase(string passPhrase, TimeSpan timeSpan) { WalletRequest walletRequest = new WalletRequest("walletpassphrase", new List <object>() { passPhrase, Convert.ToInt32(timeSpan.TotalSeconds) }); RpcRequest <string>(walletRequest); }
async public Task <RawTransaction> DecodeRawTransactionAsync(string transactionHex) { WalletRequest walletRequest = new WalletRequest("decoderawtransaction", new List <object>() { transactionHex }); return(await RpcRequestAsync <RawTransaction>(walletRequest)); }
async public Task <Block> GetBlockAsync(string hash) { WalletRequest walletRequest = new WalletRequest("getblock", new List <object>() { hash }); return(await RpcRequestAsync <Block>(walletRequest)); }
public RawTransactionInfo GetRawTransaction(string transactionId) { WalletRequest walletRequest = new WalletRequest("getrawtransaction", new List <object>() { transactionId, 1 }); return(RpcRequest <RawTransactionInfo>(walletRequest)); }
public IEnumerable <string> GetAddressesByAccount(string account) { WalletRequest walletRequest = new WalletRequest("getaddressesbyaccount", new List <object>() { account }); return(RpcRequest <IEnumerable <string> >(walletRequest)); }
async public Task <string> GetRawTransactionHexAsync(string transactionId) { WalletRequest walletRequest = new WalletRequest("getrawtransaction", new List <object>() { transactionId, 0 }); return(await RpcRequestAsync <string>(walletRequest)); }
async public Task <IEnumerable <string> > GetAddressesByAccountAsync(string account) { WalletRequest walletRequest = new WalletRequest("getaddressesbyaccount", new List <object>() { account }); return(await RpcRequestAsync <IEnumerable <string> >(walletRequest)); }
async public Task BackupWalletAsync(string destination) { WalletRequest walletRequest = new WalletRequest("backupwallet", new List <object>() { destination }); await RpcRequestAsync <string>(walletRequest); }
public void ImportPrivateKey(string privateKey, string label = "", bool rescanTransactions = true) { WalletRequest walletRequest = new WalletRequest("importprivkey ", new List <object>() { privateKey, label, rescanTransactions }); RpcRequest <object>(walletRequest); }
async public Task <string> GetAccountAddressAsync(string account) { WalletRequest walletRequest = new WalletRequest("getaccountaddress", new List <object>() { account }); return(await RpcRequestAsync <string>(walletRequest)); }
async public Task <string> SendToAddressAsync(string address, decimal amount, string comment = "", string visibleComment = "") { WalletRequest walletRequest = new WalletRequest("sendtoaddress", new List <object>() { address, Math.Round(amount, 8), comment, visibleComment }); return(await RpcRequestAsync <string>(walletRequest)); }