diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e107ac..60b5961 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.2) -set(PROJECT_NAME +set(PROJECT_NAME/home/mwo/mymonero-app-js/local_modules/mymonero_core_js/monero_utils/monero_sendingFunds_utils.js openmonero) project(${PROJECT_NAME}) diff --git a/README.md b/README.md index aa81682..a2b1872 100755 --- a/README.md +++ b/README.md @@ -22,13 +22,10 @@ to MyMonero. They include: - added support of testnet and stagenet networks, and mainnet without relying transactions - improved handling of mempool, coinbase, locked and unlocked transactions. - view only mode added. - - private tx key given to a user which can be used to prove sending xmr to a recipient. - Cross-Origin Resource Sharing (CORS) disabled. - - transaction confirmation window added to double check tx details before its commited. - ability to select transaction priority. - legacy address + payment_id system replaced with integrated addresses for better privacy. - free, time based imports of recent transactions added. - - new transaction details window. - sending xmr to a subaddress (not receiving nor generating subaddresses for now). ## Live stagenet version @@ -99,7 +96,7 @@ git clone --recursive https://github.com/monero-project/monero cd monero/ -make +USE_SINGLE_BUILDDIR=1 make ``` #### Compilation of the OpenMonero (don't run it yet) diff --git a/html/js/cn_util.js b/html/js/cn_util.js index 70944d6..14f48b1 100644 --- a/html/js/cn_util.js +++ b/html/js/cn_util.js @@ -230,6 +230,11 @@ var cnUtil = (function(initConfig) { return mn_random(128); }; + // Generate a 64-bit crypto random + this.rand_8 = function() { + return mn_random(64); + }; + this.encode_varint = function(i) { i = new JSBigInt(i); var out = ''; diff --git a/html/js/controllers/send_coins.js b/html/js/controllers/send_coins.js old mode 100644 new mode 100755 index b90276e..cb90d3a --- a/html/js/controllers/send_coins.js +++ b/html/js/controllers/send_coins.js @@ -60,16 +60,16 @@ class HostedMoneroAPIClient parameters.use_dust = true // Client now filters unmixable by dustthreshold amount (unless sweeping) + non-rct parameters.dust_threshold = mymonero_core_js.monero_config.dustThreshold.toString() const endpointPath = 'get_unspent_outs' - self.$http.post(config.apiUrl + endpointPath, parameters).success( + self.$http.post(config.apiUrl + endpointPath, parameters).then( function(data) { console.log(data); - __proceedTo_parseAndCallBack(data) + __proceedTo_parseAndCallBack(data.data) } - ).error( + ).catch( function(data) { - console.log("error", data); + console.log("error", data.data); fn(data && data.Error ? data.Error : "Something went wrong with getting your available balance for spending"); } ); @@ -90,6 +90,7 @@ class HostedMoneroAPIClient fn(err) return } + console.log("returnValuesByKey", returnValuesByKey); console.log("returnValuesByKey.per_kb_fee" , returnValuesByKey.per_kb_fee) const per_kb_fee__String = returnValuesByKey.per_kb_fee if (per_kb_fee__String == null || per_kb_fee__String == "" || typeof per_kb_fee__String === 'undefined') { @@ -144,12 +145,12 @@ class HostedMoneroAPIClient count: mixinNumber + 1 // Add one to mixin so we can skip real output key if necessary } const endpointPath = 'get_random_outs' - self.$http.post(config.apiUrl + endpointPath, parameters).success( + self.$http.post(config.apiUrl + endpointPath, parameters).then( function(data) { - __proceedTo_parseAndCallBack(data) + __proceedTo_parseAndCallBack(data.data) } - ).error( + ).catch( function(data) { fn(data && data.Error ? data.Error : "Something went wrong while getting decoy outputs"); @@ -191,12 +192,12 @@ class HostedMoneroAPIClient }; parameters.tx = serializedSignedTx const endpointPath = 'submit_raw_tx' - self.$http.post(config.apiUrl + endpointPath, parameters).success( + self.$http.post(config.apiUrl + endpointPath, parameters).then( function(data) { - __proceedTo_parseAndCallBack(data) + __proceedTo_parseAndCallBack(data.data) } - ).error( + ).catch( function(data) { fn(data && data.Error ? data.Error : "Something went wrong with getting your available balance for spending"); @@ -331,7 +332,7 @@ thinwalletCtrls.controller('SendCoinsCtrl', function($scope, $http, $q, AccountS var domain = target.address.replace(/@/g, "."); $http.post(config.apiUrl + "get_txt_records", { domain: domain - }).success(function(data) { + }).then(function(data) { var records = data.records; var oaRecords = []; console.log(domain + ": ", data.records); @@ -386,7 +387,7 @@ thinwalletCtrls.controller('SendCoinsCtrl', function($scope, $http, $q, AccountS fn("Failed to decode OpenAlias address: " + oaRecords[0].address + ": " + e); return; } - }).error(function(data) { + }).catch(function(data) { fn("Failed to resolve DNS records for '" + domain + "': " + ((data || {}).Error || data || "Unknown error")); return }); diff --git a/html/partials/send-coins.html b/html/partials/send-coins.html index 88663fa..c6cc790 100755 --- a/html/partials/send-coins.html +++ b/html/partials/send-coins.html @@ -52,6 +52,7 @@ data-name="Receiver Address 2" ng-model="payment_id"> + + @@ -100,6 +104,7 @@
{{sent_tx.tx_id}}
+ diff --git a/src/CurrentBlockchainStatus.cpp b/src/CurrentBlockchainStatus.cpp index 6e54ca0..7fc48d1 100755 --- a/src/CurrentBlockchainStatus.cpp +++ b/src/CurrentBlockchainStatus.cpp @@ -196,7 +196,7 @@ CurrentBlockchainStatus::get_tx_with_output( // and second is local index of the output i in that tx tx_out_idx = mcore->get_output_tx_and_index(amount, output_idx); } - catch (const OUTPUT_DNE &e) + catch (const OUTPUT_DNE& e) { string out_msg = fmt::format( @@ -204,7 +204,7 @@ CurrentBlockchainStatus::get_tx_with_output( amount, output_idx ); - OMERROR << out_msg; + OMERROR << out_msg << ' ' << e.what(); return false; } @@ -340,17 +340,16 @@ CurrentBlockchainStatus::get_output( uint64_t CurrentBlockchainStatus::get_dynamic_per_kb_fee_estimate() const { - return mcore->get_dynamic_per_kb_fee_estimate( - FEE_ESTIMATE_GRACE_BLOCKS)*1024; -} + const double byte_to_kbyte_factor = 1024; -//uint64_t -//CurrentBlockchainStatus::get_dynamic_base_fee_estimate() const -//{ -// return mcore->get_dynamic_base_fee_estimate( -// FEE_ESTIMATE_GRACE_BLOCKS); -//} + uint64_t fee_per_byte = mcore->get_dynamic_base_fee_estimate( + FEE_ESTIMATE_GRACE_BLOCKS); + uint64_t fee_per_kB = static_cast( + fee_per_byte * byte_to_kbyte_factor); + + return fee_per_kB; +} bool diff --git a/src/MicroCore.h b/src/MicroCore.h index 99365c9..2aa18ac 100755 --- a/src/MicroCore.h +++ b/src/MicroCore.h @@ -167,12 +167,6 @@ public: return core_storage.get_outs(req, res); } - virtual uint64_t - get_dynamic_per_kb_fee_estimate(uint64_t const& grace_blocks) const - { - return core_storage.get_dynamic_base_fee_estimate(grace_blocks); - } - virtual uint64_t get_dynamic_base_fee_estimate(uint64_t const& grace_blocks) const { diff --git a/src/YourMoneroRequests.cpp b/src/YourMoneroRequests.cpp index 3c46ea9..6af6c07 100755 --- a/src/YourMoneroRequests.cpp +++ b/src/YourMoneroRequests.cpp @@ -728,15 +728,15 @@ YourMoneroRequests::get_unspent_outs( } // if (xmr_accounts->select_txs(acc.id, txs)) - j_response["amount"] = total_outputs_amount; + j_response["amount"] = std::to_string(total_outputs_amount); // need proper per_kb_fee estimate as // it is already using dynanamic fees. frontend // uses old fixed fees. - j_response["per_kb_fee"] = current_bc_status - ->get_dynamic_per_kb_fee_estimate(); + j_response["per_kb_fee"] = std::to_string(current_bc_status + ->get_dynamic_per_kb_fee_estimate()); } // if (current_bc_status->search_thread_exist(xmr_address))