/// <summary> /// Submit a transaction to the network. /// /// This method will check if any of the destination accounts require a memo. /// </summary> /// <param name="transactionEnvelopeBase64"></param> /// <returns></returns> public Task <SubmitTransactionResponse> SubmitTransaction(string transactionEnvelopeBase64) { var options = new SubmitTransactionOptions { SkipMemoRequiredCheck = false }; return(SubmitTransaction(transactionEnvelopeBase64, options)); }
/// <summary> /// Submit a transaction to the network. /// /// This method will check if any of the destination accounts require a memo. /// </summary> /// <param name="transaction"></param> /// <returns></returns> public Task <SubmitTransactionResponse> SubmitTransaction(Transaction transaction) { var options = new SubmitTransactionOptions { SkipMemoRequiredCheck = false }; return(SubmitTransaction(transaction.ToEnvelopeXdrBase64(), options)); }
public Task <SubmitTransactionResponse> SubmitTransaction(FeeBumpTransaction feeBump) { var options = new SubmitTransactionOptions { FeeBumpTransaction = true }; return(SubmitTransaction(feeBump.ToEnvelopeXdrBase64(), options)); }
/// <summary> /// Submit a transaction to the network. /// /// This method will check if any of the destination accounts require a memo. Change the SkipMemoRequiredCheck /// options to change this behaviour. /// </summary> /// <param name="transactionEnvelopeBase64"></param> /// <param name="options"></param> /// <returns></returns> public async Task <SubmitTransactionResponse> SubmitTransaction(string transactionEnvelopeBase64, SubmitTransactionOptions options) { if (!options.SkipMemoRequiredCheck) { var tx = Transaction.FromEnvelopeXdr(transactionEnvelopeBase64); await CheckMemoRequired(tx); } var transactionUri = new UriBuilder(_serverUri).SetPath("/transactions").Uri; var paramsPairs = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("tx", transactionEnvelopeBase64) }; var response = await _httpClient.PostAsync(transactionUri, new FormUrlEncodedContent(paramsPairs.ToArray())); if (response.Content != null) { var responseString = await response.Content.ReadAsStringAsync(); var submitTransactionResponse = JsonSingleton.GetInstance <SubmitTransactionResponse>(responseString); return(submitTransactionResponse); } return(null); }
/// <summary> /// Submit a transaction to the network. /// /// This method will check if any of the destination accounts require a memo. Change the SkipMemoRequiredCheck /// options to change this behaviour. /// </summary> /// <param name="transaction"></param> /// <param name="options"></param> /// <returns></returns> public Task <SubmitTransactionResponse> SubmitTransaction(Transaction transaction, SubmitTransactionOptions options) { return(SubmitTransaction(transaction.ToEnvelopeXdrBase64(), options)); }
public Task <SubmitTransactionResponse> SubmitTransaction(FeeBumpTransaction feeBump, SubmitTransactionOptions options) { options.FeeBumpTransaction = true; return(SubmitTransaction(feeBump.ToEnvelopeXdrBase64(), options)); }
/// <summary> /// Submit a transaction to the network. /// /// This method will check if any of the destination accounts require a memo. Change the SkipMemoRequiredCheck /// options to change this behaviour. /// </summary> /// <param name="transactionEnvelopeBase64"></param> /// <param name="options"></param> /// <returns></returns> public async Task <SubmitTransactionResponse> SubmitTransaction(string transactionEnvelopeBase64, SubmitTransactionOptions options) { if (!options.SkipMemoRequiredCheck) { TransactionBase tx; if (options.FeeBumpTransaction) { tx = FeeBumpTransaction.FromEnvelopeXdr(transactionEnvelopeBase64); } else { tx = Transaction.FromEnvelopeXdr(transactionEnvelopeBase64); } await CheckMemoRequired(tx); } var transactionUri = new UriBuilder(_serverUri).SetPath("/transactions").Uri; var paramsPairs = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("tx", transactionEnvelopeBase64) }; var response = await _httpClient.PostAsync(transactionUri, new FormUrlEncodedContent(paramsPairs.ToArray())); if (options.EnsureSuccess && !response.IsSuccessStatusCode) { string responseString = string.Empty; if (response.Content != null) { responseString = await response.Content.ReadAsStringAsync(); } throw new ConnectionErrorException($"Status code ({response.StatusCode}) is not success.{ (!string.IsNullOrEmpty(responseString) ? " Content: " + responseString : "") }"); } if (response.Content != null) { var responseString = await response.Content.ReadAsStringAsync(); var submitTransactionResponse = JsonSingleton.GetInstance <SubmitTransactionResponse>(responseString); return(submitTransactionResponse); } return(null); }