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

feat: add revamped exchange functionality, bump version in preparation for 1.1.22 #42

Closed
wants to merge 14 commits into from
Closed
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
6 changes: 5 additions & 1 deletion android/app/src/main/assets/capacitor.config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"appId": "com.mymonero.official_android_application",
"appName": "MyMonero for Android",
"appName": "MyMonero",
"bundledWebRuntime": false,
"npmClient": "npm",
"webDir": "browser_build",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
}
},
"server": {
"hostname": "com.mymonero.android",
"androidScheme": "https"
}
}
2 changes: 0 additions & 2 deletions local_modules/Contacts/Views/ContactFormView.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import commonComponents_navigationBarButtons from '../../MMAppUICommonComponents

//
import emoji_selection from '../../Emoji/emoji_selection';
console.log("Emoji_selection object");
console.log(emoji_selection);

//
class ContactFormView extends View
Expand Down
2 changes: 0 additions & 2 deletions local_modules/Emoji/emoji_set.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,4 @@ function unicodeCodePointOrPairToChar(unicode)
return String.fromCharCode(s);
}
let obj = { Emojis, EmojiCategories }
console.log("Emojis export");
console.log(obj);
export default obj;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// import function for Bitcoin address checking
import validate from 'bitcoin-address-validation';
console.log(validate);

function sendFunds(wallet, xmr_amount, xmr_send_address, sweep_wallet, validation_status_fn, handle_response_fn) {
return new Promise((resolve, reject) => {
Expand Down
1,547 changes: 204 additions & 1,343 deletions local_modules/Exchange/Views/ExchangeContentView.web.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions local_modules/Exchange/Views/ExchangeTabContentView.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class ExchangeTabContentView extends StackAndModalNavigationView
const options = {}

const view = new ExchangeContentView(options, self.context)
console.log(view);
self.exchangeContentView = view
}
self.SetStackViews(
Expand All @@ -53,7 +52,9 @@ class ExchangeTabContentView extends StackAndModalNavigationView
]
)
}

// TabBarItem_icon_customStyle () {
// return 'tabButton-exchange'
// }
TabBarItem_layer_customStyle()
{
return {}
Expand All @@ -65,7 +66,8 @@ class ExchangeTabContentView extends StackAndModalNavigationView
backgroundImage: "url(Exchange/Resources/XMRtoBTCInactive.svg)",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundSize: "39px"
backgroundSize: "39px",
divId: "tabButton-exchange"
}
}
TabBarItem_icon_selected_customStyle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class BackgroundResponseParser
{
constructor(options, context)
{
console.log("Imported backgroundResponseParder.web.js");
if (typeof options.coreBridge_instance == 'undefined' || options.coreBridge_instance == null) {
throw "BackgroundResponseParser.web expected options.coreBridge_instance"
}
Expand Down
1 change: 0 additions & 1 deletion local_modules/MMAppUICommonComponents/contactPicker.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import commonComponents_forms from './forms.web';
//
import emoji_web from '../Emoji/emoji_web';

console.log("Imported contactpicker.web.js");
//
const NamespaceName = "contactPicker"
const haveCSSRulesBeenInjected_documentKey = "__haveCSSRulesBeenInjected_"+NamespaceName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,5 @@ function New_RightSide_ValueDisplayLabelButtonView(context)
}
return view
}
console.log("navigationBarButtons")
console.log(New_RightSide_SaveButtonView);
let obj = { New_GreyButtonView, New_BlueButtonView, New_LeftSide_BackButtonView, New_RightSide_AddButtonView, New_LeftSide_CancelButtonView, New_RightSide_SaveButtonView, New_RightSide_EditButtonView, New_RightSide_ValueDisplayLabelButtonView };
export default obj;
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,9 @@ class ExceptionAlerting
// Imperatives
alertErrMsg(message, handlerId)
{
console.log("invoking alertErrMsg");
const self = this;
self.doToastMessage("Unhandled error. Please inform MyMonero Support of this message: " + message, message);
if (message.indexOf("undefined") !== -1 && message.indexOf("handler") !== -1) {
console.log("ignored error");
return // most likely an error from webflow - can skip erroring these ; TODO: remove this when removing webflow
}
if (typeof message !== 'undefined' && message && message !== "") {
Expand Down
14 changes: 1 addition & 13 deletions local_modules/MainWindow/Views/index.browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@

<meta name="msapplication-config" content="assets/img/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="assets/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/img/favicon/manifest.json">
<link rel="mask-icon" href="assets/img/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="assets/img/favicon/favicon.ico">

<meta http-equiv="Content-Security-Policy"
Expand All @@ -50,25 +48,15 @@
object-src 'none';
font-src 'self' https://js.intercomcdn.com/fonts/;
img-src 'self' data: https://downloads.intercomcdn.com/i/o/ https://js.intercomcdn.com/images/ https://static.intercomassets.com/ https://www.google-analytics.com/r/collect https://www.google-analytics.com/collect https://stats.g.doubleclick.net/r/collect;
connect-src 'self' https://a.y.at https://api-dev.yat.rocks https://thingproxy.freeboard.io https://api.mymonero.com:8443 https://api-iam.intercom.io https://cloudflare-dns.com data: blob:;">
connect-src 'self' https://a.y.at https://api-dev.yat.rocks https://thingproxy.freeboard.io https://api.mymonero.com:443 https://api.mymonero.com:8443 https://api-iam.intercom.io https://cloudflare-dns.com data: blob:;">
<!-- script-src of unsafe-eval required to load wasm files at present but actual eval is disabled in renderer_setup_utils -->
<meta name="apple-itunes-app" content="app-id=1372508199">

<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height">

<link rel="stylesheet" type="text/css" href="assets/css/styles.css">
<link rel="stylesheet" type="text/css" href="assets/css/clear.browser.css">
<script>
window.INTERCOM__APP_ID = /*production*/"hi3rzlw0" // "qa83i5n9"/*development*/ // TODO: select this via webpack env
window.intercomSettings =
{
app_id: window.INTERCOM__APP_ID,
vertical_padding: 100,
hide_default_launcher: true
};
</script>
<style>
body {
background-color: #272527;
Expand Down
2 changes: 0 additions & 2 deletions local_modules/MainWindow/Views/index.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ import { Plugins } from '@capacitor/core';

const { App } = Plugins;

console.log(App);

window.BootApp = function()
{ // encased in a function to prevent scope being lost/freed on mobile
const isDebug = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ class PasswordController_Base extends EventEmitter
OnceBooted_GetNewPasswordAndTypeOrExistingPasswordFromUserAndEmitIt()
{ // This function must be called in order to initiate a password entry screen being shown to the user and to initiate any "password obtained" emits
const self = this
console.log("PasswordController: invoked OnceBooted_GetNewPasswordAndTypeOrExistingPasswordFromUserAndEmitIt");
self._executeWhenBooted(
function()
{
Expand Down
4 changes: 0 additions & 4 deletions local_modules/SendFundsTab/Views/SendFundsView.Full.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ import monero_requestURI_utils from '../../MoneroUtils/monero_requestURI_utils';
import AddContactFromSendTabView from '../../Contacts/Views/AddContactFromSendTabView.web';
import StackAndModalNavigationView from '../../StackNavigation/Views/StackAndModalNavigationView.web';

console.log("SendFundsViewCommonComponentsContactPicker");
console.log(typeof(commonComponents_contactPicker));
console.log(commonComponents_contactPicker.New_contactPickerLayer);
console.log(typeof(commonComponents_contactPicker.New_contactPickerLayer))
//
class SendFundsView extends SendFundsView_Base
{
Expand Down
19 changes: 5 additions & 14 deletions local_modules/SendFundsTab/Views/SendFundsView_Base.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ class SendFundsView extends View
// `
// div.innerHTML = html;
//
console.log(self);
self.form_containerLayer.appendChild(div);
}
_setup_form_walletSelectLayer()
Expand Down Expand Up @@ -416,7 +415,6 @@ class SendFundsView extends View
}
div.appendChild(labelLayer)
//
console.log(self);
const layer = self._new_required_contactPickerLayer()
layer.ContactPicker_inputLayer.autocorrect = "off"
layer.ContactPicker_inputLayer.autocomplete = "off"
Expand Down Expand Up @@ -1595,7 +1593,7 @@ class SendFundsView extends View
}
)
// and of course proceed
__proceedTo_generateSendTransaction(self)
__proceedTo_generateSendTransaction()
}
)
//
Expand All @@ -1621,23 +1619,23 @@ class SendFundsView extends View
_reEnableFormElements()
return
}
__proceedTo_generateSendTransaction(self)
__proceedTo_generateSendTransaction()
}
)
//
return // early return pending alert result
}
}
// fall through
__proceedTo_generateSendTransaction(self)
__proceedTo_generateSendTransaction()
//
function __proceedTo_generateSendTransaction(self)
function __proceedTo_generateSendTransaction()
{
let contact_payment_id = hasPickedAContact ? self.pickedContact.payment_id : undefined;
let cached_OAResolved_address = hasPickedAContact ? self.pickedContact.cached_OAResolved_XMR_address : undefined;
let contact_hasOpenAliasAddress = hasPickedAContact ? self.pickedContact.HasOpenAliasAddress() : undefined;
let contact_address = hasPickedAContact ? self.pickedContact.address : undefined;
console.log(self.isYatHandle);

wallet.SendFunds(
enteredAddressValue, // currency-ready wallet address, but not an OpenAlias address (resolve before calling)
resolvedAddress,
Expand Down Expand Up @@ -2285,7 +2283,6 @@ class SendFundsView extends View
//
__didSelect_actionButton_chooseFile()
{
console.log("Choose file");
const self = this
self.context.userIdleInWindowController.TemporarilyDisable_userIdle() // TODO: this is actually probably a bad idea - remove this and ensure that file picker canceled on app teardown
if (typeof self.context.Cordova_disallowLockDownOnAppPause !== 'undefined') {
Expand All @@ -2296,7 +2293,6 @@ class SendFundsView extends View
"Open Monero Request",
function(err, absoluteFilePath)
{
console.log("In return handler from actionButton)_chooseField");
self.context.userIdleInWindowController.ReEnable_userIdle()
if (typeof self.context.Cordova_disallowLockDownOnAppPause !== 'undefined') {
self.context.Cordova_disallowLockDownOnAppPause -= 1 // remove lock
Expand All @@ -2310,7 +2306,6 @@ class SendFundsView extends View
self.validationMessageLayer.ClearAndHideMessage() // clear to resolve ambiguity in case existing error is displaying
return // nothing picked / canceled
}
console.log(absoluteFilePath);
self._shared_didPickQRCodeWithImageSrcValue(absoluteFilePath)
}
)
Expand All @@ -2319,9 +2314,6 @@ class SendFundsView extends View
async startScanning() {
let self = this;
let result = await CapacitorQRScanner.scan();
console.log("Here is the camera scanning result");
console.log(result);
console.log(result.code);
self._shared_didPickPossibleRequestURIStringForAutofill(result.code)
}
__didSelect_actionButton_useCamera()
Expand Down Expand Up @@ -2490,7 +2482,6 @@ class SendFundsView extends View
fn // this MUST be called
) {
const self = this
console.log(self.constructor.name + " passwordController_DeleteEverything")
self.cancelAny_requestHandle_for_oaResolution()
self._clearForm()
fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class SendTabContentView_Base extends StackAndModalNavigationView
const self = this
{ // walletsListView
const options = {}
console.log('wtaf');
console.log(self);
const SendFundsView = self._required_rootViewClassModule()
const view = new SendFundsView(options, self.context)
self.sendFundsView = view
Expand Down
6 changes: 2 additions & 4 deletions local_modules/Settings/Controllers/SettingsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SettingsController extends EventEmitter
}
}
console.log("💬 Found existing saved " + CollectionName + " with _id", doc._id)
console.log(typeof(doc));

if (doSettingsCleanup == true) {
_deleteSettingsObject(self, cleanupIds);
const mocked_doc = JSON.parse(JSON.stringify(k_defaults_record)) // hamfisted copy
Expand All @@ -139,14 +139,12 @@ class SettingsController extends EventEmitter
})
// for safety's sake, we explicitly force deletion of the index as well
self.context.persister.__deleteIndex(CollectionName, () => {
console.log("Removed index " + CollectionName);
// Removed index
})
}

function _proceedTo_loadStateFromRecord(record_doc)
{
console.log(record_doc);
console.log(typeof(record_doc));
self._id = record_doc._id || undefined
//
self.specificAPIAddressURLAuthority = record_doc.specificAPIAddressURLAuthority
Expand Down
10 changes: 0 additions & 10 deletions local_modules/Settings/Views/SettingsView.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class SettingsView extends View
}
_setup_self_layer()
{
console.log("Settings: invoked _setup_self_layer()");
const self = this
//
const layer = self.layer
Expand All @@ -96,7 +95,6 @@ class SettingsView extends View
}
_setup_form_containerLayer()
{
console.log("Settings: invoked _setup_form_containerLayer()");
const self = this
const containerLayer = document.createElement("div")
self.form_containerLayer = containerLayer
Expand Down Expand Up @@ -129,7 +127,6 @@ class SettingsView extends View
}
_setup_aboutAppButton()
{
console.log("Settings: invoked _setup_aboutAppButton()");
const self = this
const div = document.createElement("div")
div.style.padding = "12px 0 12px 33px"
Expand All @@ -152,7 +149,6 @@ class SettingsView extends View
}
_setup_form_field_changePasswordButton()
{
console.log("Settings: invoked _setup_form_field_changePasswordButton()");
const self = this
const div = commonComponents_forms.New_fieldContainerLayer(self.context)
div.style.padding = "19px 24px 20px 24px"
Expand All @@ -177,7 +173,6 @@ class SettingsView extends View
}
_setup_form_field_appTimeoutSlider()
{
console.log("Settings: invoked _setup_form_field_appTimeoutSlider()");
const self = this
const div = commonComponents_forms.New_fieldContainerLayer(self.context)
div.style.paddingTop = "5px" // special case
Expand Down Expand Up @@ -236,7 +231,6 @@ class SettingsView extends View
}
_setup_form_field_authentication()
{
console.log("Settings: invoked _setup_form_field_authentication()");
const self = this
const div = commonComponents_forms.New_fieldContainerLayer(self.context)
{
Expand Down Expand Up @@ -347,7 +341,6 @@ class SettingsView extends View
}
_setup_form_field_serverURL()
{
console.log("Settings: invoked _setup_form_field_serverURL()");
const self = this
const div = commonComponents_forms.New_fieldContainerLayer(self.context)
{
Expand Down Expand Up @@ -391,7 +384,6 @@ class SettingsView extends View
}
_setup_form_field_appUpdates()
{
console.log("Settings: invoked _setup_form_field_appUpdates()");
const self = this
const div = commonComponents_forms.New_fieldContainerLayer(self.context)
{
Expand Down Expand Up @@ -449,7 +441,6 @@ class SettingsView extends View
}
_setup_form_field_displayCcy()
{
console.log("Settings: invoked _setup_form_field_displayCcy()");
const self = this
let selectLayer_w = 132 // disclosure arrow visual alignment with change pw content right edge
let selectLayer_h = 32
Expand Down Expand Up @@ -537,7 +528,6 @@ class SettingsView extends View
}
_setup_deleteEverythingButton()
{
console.log("Settings: invoked _setup_deleteEverythingButton()");
const self = this
const div = document.createElement("div")
div.style.paddingTop = "23px"
Expand Down
Loading