diff --git a/monero_utils/MyMoneroCoreBridgeEssentialsClass.js b/monero_utils/MyMoneroCoreBridgeEssentialsClass.js index daf44be..046144f 100644 --- a/monero_utils/MyMoneroCoreBridgeEssentialsClass.js +++ b/monero_utils/MyMoneroCoreBridgeEssentialsClass.js @@ -307,7 +307,7 @@ class MyMoneroCoreBridgeEssentialsClass extends MyMoneroBridgeClass_Base } return ret.retVal; } - estimated_tx_network_fee(fee_per_kb__string, priority, optl__fee_per_b_string) // this is until we switch the server over to fee per b + estimated_tx_network_fee(fee_per_kb__string, priority, optl__fee_per_b_string, optl__fork_version) // this is until we switch the server over to fee per b { // TODO update this API to take object rather than arg list const args = { @@ -316,6 +316,11 @@ class MyMoneroCoreBridgeEssentialsClass extends MyMoneroBridgeClass_Base : (new JSBigInt(fee_per_kb__string)).divide(1024).toString()/*kib -> b*/, priority: "" + priority, }; + if (typeof optl__fork_version !== 'undefined' && optl__fork_version !== null) { + args.fork_version = "" + optl__fork_version + } else { + // it will default to 0 which means use the latest fork rules + } const args_str = JSON.stringify(args); const ret_string = this.Module.estimated_tx_network_fee(args_str); const ret = JSON.parse(ret_string); diff --git a/tests/index.node.js b/tests/index.node.js index 3547a6f..714a220 100644 --- a/tests/index.node.js +++ b/tests/index.node.js @@ -46,8 +46,8 @@ async function t1() try { var fee = new mymonero.JSBigInt((await mymonero.monero_utils_promise).estimated_tx_network_fee( - "0", 1, "24658" - // fee_per_kb__string, priority, fee_per_b__string + "0", 1, "24658", 10 + // fee_per_kb__string, priority, fee_per_b__string, optl__fork_version )); console.log("estimated_tx_network_fee", mymonero.monero_amount_format_utils.formatMoneyFull(fee), "XMR") } catch (e) {