You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
Paul Shapiro f6e497bbcc
updated monero_utils to support calls which are safe over IPC to an electron remote from renderer proc's require
6 years ago
bin lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
configs fix ups to emscripten build procedures; swapped cryptonote_crypto_EMSCRIPTEN with MyMoneroCoreCpp.(js,wasm), and had to introduce blocking to methods which use CNCrypto var due to new async Module init; updated Readme 6 years ago
cryptonote_utils lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
hostAPI lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
monero_utils updated monero_utils to support calls which are safe over IPC to an electron remote from renderer proc's require 6 years ago
src lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
tests lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
.eslintignore updated monero_utils to support calls which are safe over IPC to an electron remote from renderer proc's require 6 years ago
.eslintrc.json Add prettier support 6 years ago
.gitignore lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
.gitmodules removed monero-core-custom top lvl submod as it's now within mymonero-core-cpp 6 years ago
.prettierignore lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
.prettierrc Add prettier support 6 years ago
CMakeLists.txt lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
LICENSE.txt copyright 6 years ago
README.md lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
index.js lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
package.json lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago
wallaby.js lots of moving things around; implemented promise constructor for monero_utils (which is actually MyMoneroCoreBridge, a new class to replace cnUtil).. this was chosen after trying both promises directly in the functions and async/await in one or two decent patterns in order to avoid the requirement that integrators support async/await and to retain the option for calls to monero_utils to remain synchronous - added src/module-post as a post-js in order to fix emscripten .then infinite loop ... this PR does not include any kind of support for calling from electron renderer to electron main - that is, the code to detect electron renderer, then intercept ret.err_msg and throw only if not in electron renderer, and relay ret.err_msg otherwise has been removed for the moment.. will likely be added back 6 years ago

README.md

MyMonero Core JS

Info

  1. Legal
  2. What's in This Repo?
  3. Library API Documentation
  4. Building MyMoneroCoreCpp from Scratch

Contributing

  1. QA
  2. Pull Requests

Info

See LICENSE.txt for license.

All source code copyright © 2014-2018 by MyMonero. All rights reserved.

What's in This Repo?

This repository holds the Javascript source code for the Monero/CryptoNote cryptography and protocols, plus lightwallet functions which power the official MyMonero apps.

There is also a chain of build scripts which is capable of building a JS module by transpiling a subset of Monero source code via emscripten, which relies upon static boost libs, for which there is also a script for building from source.

Contents

  • monero_utils contains Monero- and MyMonero-specific implementations, wrappers, and declarations, and the MyMonero JS and wasm implementations for the underlying cryptography behind Monero.

    • monero_utils/MyMoneroCoreCpp.(js,wasm) are produced by transpiling Monero core C++ code to JS via Emscripten (See Building MyMoneroCoreCpp). A Module instance is managed by monero_utils/MyMoneroCoreBridge.js.
    • A ready-made entrypoint for interacting with MyMoneroCoreBridge is located at monero_utils/monero_utils.js with usage require("./monero_utils/monero_utils").then(function(monero_utils) { })
  • This readme is located at README.md, and the license is located at LICENSE.txt.

Library API Documentation

Coming soon

Building MyMoneroCoreCpp from Scratch

There's no need to build monero_utils/MyMoneroCoreCpp as a build is provided, but if you were for example interested in adding a C++ function, you could use the information in this section to transpile it to JS.

Repository Setup

  • Execute bin/update_submodules

Install Emscripten SDK

Ensure you've properly installed Emscripten and exposed the Emscripten executables in your PATH, e.g.:

source ./emsdk_env.sh

Boost for Emscripten

Depends upon: Emscripten SDK

Download a copy of the contents of the Boost source into ./contrib/boost-sdk/.

  • Execute bin/build-boost-emscripten.sh

Emscripten Module

Depends upon: Repository Setup, Emscripten SDK, Boost for Emscripten

  • Execute bin/build-emcpp.sh

Or if you want to copy the build products to their distribution locations,

  • Execute bin/archive-emcpp.sh

Contributing

QA

Please submit any bugs as Issues unless they have already been reported.

Suggestions and feedback are very welcome!

Pull Requests

We'll merge nearly anything constructive. Contributors welcome and credited in releases.

We often collaborate over IRC in #mymonero on Freenode.

All development happens off the develop branch like the Gitflow Workflow.

Regular contributors

  • 💿 endogenic (Paul Shapiro) Maintainer

  • 🍄 luigi Major contiributor of original JS core crypto and Monero-specific routines; Advisor

  • 🏄‍♂️ paullinator (Paul Puey) API design

  • 🔒 cryptochangement Subaddress send & decode support; Initial tests