Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native build #87

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/mymonero-monero-client/prepare.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ set -e # Exit on any error
# Dependencies

## These should be audited!
# Use the webassembly-cleanup branch:
mymonero_core_cpp_url='https://github.com/mymonero/mymonero-core-cpp'
mymonero_core_cpp_hash='69408962a900c64483311c42768fa876381d3d57'
mymonero_core_cpp_hash='005fcf096ef429ddc157f489d69b1d3ca7d16244'

# Use the master branch:
monero_core_custom_url='https://github.com/mymonero/monero-core-custom'
monero_core_custom_hash='c601fdc3a7aa0c449a3e2c99df230f503fb67e3c'
monero_core_custom_hash='936afd97467375511032d6a4eef6e76c982148dd'

if [ "$(basename "$(pwd)")" != "mymonero-core-js" ]; then
if [ "$(basename "$(pwd)")" != "mymonero-monero-client" ]; then
echo "Should be ran from the repo dir!"
exit 1
fi
Expand All @@ -34,8 +37,8 @@ function clonerepo { # source, target, commit

echo "Cloning dependencies..."
rm -rf 'src/submodules' && mkdir -p 'src/submodules'
clonerepo "${mymonero_core_cpp_url}" 'src/submodules/mymonero-core-cpp' #"${mymonero_core_cpp_hash}"
clonerepo "${monero_core_custom_url}" 'src/submodules/monero-core-custom' #"${monero_core_custom_hash}"
clonerepo "${mymonero_core_cpp_url}" 'src/submodules/mymonero-core-cpp' "${mymonero_core_cpp_hash}"
clonerepo "${monero_core_custom_url}" 'src/submodules/monero-core-custom' "${monero_core_custom_hash}"

# Prepare for build

Expand Down
15 changes: 7 additions & 8 deletions packages/mymonero-monero-client/src/WABridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ class WABridge {
/**
* Creates a transfer of funds to the recipient address and returns the raw signed tx.
* @param {object} options
* @param {number} options.amount
* @param {string} options.recipientAddress
* @param {number} options.priority
* @param {string} options.address
* @param {string} options.privateViewKey
* @param {string} options.publicSpendKey
* @param {string} options.privateSpendKey
* @param {array} options.destinations - Array of to_address and send_amount
* @param {boolean} options.shouldSweep
* @param {string} options.nettype - The network name eg MAINNET.
* @param {object} options.unspentOuts - List of unspent outs as well as per byte fee.
* @param {randomOutsCallback} options.randomOutsCb - Used to fetch the random outs from the light wallet service.
* @returns
* @returns {object} - Signed transaction
*/
async createTransaction (options) {
const self = this
Expand Down Expand Up @@ -176,7 +175,7 @@ class WABridge {
* Derives the seed and keys from the mnemonic string.
* @param {string} mnemonic - The string of mnemonic words.
* @param {string} nettype - The network name eg MAINNET.
* @returns {array} List of public and private keys.
* @returns {object} List of public and private keys.
*/
seedAndKeysFromMnemonic (mnemonic, nettype) {
checkNetType(nettype)
Expand Down Expand Up @@ -205,7 +204,7 @@ class WABridge {
* @param {string} privateSpendKey - The wallet private spend key.
* @param {string} seed - The seed as optional.
* @param {string} nettype - The network name eg MAINNET.
* @returns {array} Returns if its valid, view only and the public view and spend keys.
* @returns {object} Returns if its valid, view only and the public view and spend keys.
*/
isValidKeys (address, privateViewKey, privateSpendKey, seed, nettype) {
checkNetType(nettype)
Expand All @@ -227,7 +226,7 @@ class WABridge {
* Decodes address to provide spend and view keys.
* @param {string} address - The primary address to decode.
* @param {string} nettype - The network name eg MAINNET.
* @returns {array} Break down of the address.
* @returns {object} Break down of the address.
*/
decodeAddress (address, nettype) {
checkNetType(nettype)
Expand All @@ -249,7 +248,7 @@ class WABridge {
* Creates a new wallet based on the locale.
* @param {string} localeLanguageCode The locale based on language and Country. eg. en-US.
* @param {string} nettype - The network name eg MAINNET.
* @returns {array} mnemonic details as well as the public and private keys.
* @returns {object} mnemonic details as well as the public and private keys.
*/
generateWallet (localeLanguageCode, nettype) {
checkNetType(nettype)
Expand Down Expand Up @@ -291,7 +290,7 @@ class WABridge {
* (Deprecated) Returns a list of public amd private keys derived from the seed.
* @param {string} seed - The seed string. not to be confused with the mnemonic seed.
* @param {string} nettype - The network name eg MAINNET.
* @returns {array} A breakdown of the public and private keys.
* @returns {object} A breakdown of the public and private keys.
*/
addressAndKeysFromSeed (seed, nettype) {
checkNetType(nettype)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/foreach.hpp>
#include <emscripten.h>
#include <unordered_map>
#include <memory>
//
Expand Down