From 3622956a7d5df0c6fbc07b3fcf80d3aba8aaa556 Mon Sep 17 00:00:00 2001 From: Paul V Puey Date: Sat, 29 Jan 2022 20:59:55 -0800 Subject: [PATCH 01/50] New translations enUS.json (Italian) --- src/locales/strings/it.json | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/locales/strings/it.json b/src/locales/strings/it.json index 060bf94885b..a62e37a1a59 100644 --- a/src/locales/strings/it.json +++ b/src/locales/strings/it.json @@ -24,11 +24,11 @@ "error_token_exists": "Una valuta denominata %s esiste già", "error_bitpay_empty_output_invoice": "Nessun output nella richiesta di pagamento è stato ricevuto", "error_bitpay_empty_verification_hex_req": "Hex di transazione vuota generato", - "error_bitpay_invalid_payment_option": "BitPay invoice does not support this currency. Supported currencies: %s", + "error_bitpay_invalid_payment_option": "L'invoice di BitPay non supporta questa valuta. Valute supportate: %s", "error_bitpay_fetch": "BitPay %s fetch error (%s)%s", "error_bitpay_multi_output_invoice": "Output multipli trovati nella richiesta di pagamento", "error_bitpay_multi_tx_invoice": "Più transazioni trovate nella richiesta di pagamento", - "error_bitpay_no_payment_option": "No currencies available for this BitPay invoice. Supported currencies: %s", + "error_bitpay_no_payment_option": "Nessuna valuta disponibile per questa fattura BitPay. Valute supportate: %s", "error_bitpay_tx_verification_failed": "Verifica della transazione BitPay non corrispondente", "warning_low_fee_selected": "Commissione bassa selezionata", "warning_custom_fee_selected": "Hai selezionato Personalizzata", @@ -299,28 +299,28 @@ "settings_currency_notifications_percent_change_hour": "Variazione del %1$s%% in 1 ora", "settings_currency_notifications_percent_change_hours": "Variazione del %1$s%% in %2$s ore", "staking_change_add_header": "Stake %s", - "staking_change_add_amount_title": "Amount to stake", - "staking_change_explaner1": "Stake your coins to earn passive income on your funds", - "staking_change_explaner2": "Staked coins are unusable for the duration of the stake", + "staking_change_add_amount_title": "Importo da mettere in stake", + "staking_change_explaner1": "Metti in stake le tue monete per guadagnare reddito passivo sui tuoi fondi", + "staking_change_explaner2": "Le monete in stake sono inutilizzabili per tutto il periodo di stake", "staking_change_remove_header": "Unstake %s", - "staking_change_remove_amount_title": "Amount to unstake", - "staking_change_remove_unlock_date": "Unlock date", - "staking_change_unlock_explainer_title": "Unstaked Funds", - "staking_change_unlock_explainer1": "Unstaked funds are not immediately available. ", - "staking_change_unlock_explainer2": "These continue to be locked and unusable for 7 days after you unstake the funds.", + "staking_change_remove_amount_title": "Importo da togliere dallo stake", + "staking_change_remove_unlock_date": "Data di sblocco", + "staking_change_unlock_explainer_title": "Fondi non in staking", + "staking_change_unlock_explainer1": "I fondi tolti dallo stake non sono immediatamente disponibili. ", + "staking_change_unlock_explainer2": "Questi continuano ad essere bloccati e inutilizzabili per 7 giorni dopo aver tolto i fondi dallo stake.", "staking_overview_header": "Stake %s", - "staking_overview_explainer": "You have the following funds staked:", - "staking_locked_title": "Unstaked and locked until %1s", - "staking_stake_funds_button": "Stake More Funds", + "staking_overview_explainer": "Hai i seguenti fondi in stake:", + "staking_locked_title": "Tolti dallo stake e bloccati fino al %1s", + "staking_stake_funds_button": "Metti in stake altri fondi", "staking_unstake_funds_button": "Unstake", - "staking_status": "%1s locked (%2s)", - "staking_success": "Successfully staked", - "staking_unstake_success": "Successfully unstaked", - "staking_estimated_rewards": "Estimated Rewards", - "staking_estimated_return": "Estimated Return: %1s APY", - "staking_estimated_return_up_to": "Estimated Return: up to %1s APY", - "staking_no_fio_address_error": "Unable to stake without a FIO addresses", - "staking_no_bundled_txs_error": "Not enough bundled transactions for FIO address %1", + "staking_status": "%1s bloccati (%2s)", + "staking_success": "Messi in stake con successo", + "staking_unstake_success": "Tolti dallo stake con successo", + "staking_estimated_rewards": "Ricompense stimate", + "staking_estimated_return": "Ritorno stimato: %1s APY", + "staking_estimated_return_up_to": "Ritorno stimato: fino a %1s APY", + "staking_no_fio_address_error": "Impossibile fare stake senza un indirizzo FIO", + "staking_no_bundled_txs_error": "Transazioni in bundle non sufficienti per l'indirizzo FIO %1", "string_cancel_cap": "Annulla", "string_cancel": "ANNULLA", "string_ok_cap": "OK", From 2cfac49dda0a7c8007e3001fd2c5ef60da857313 Mon Sep 17 00:00:00 2001 From: Paul V Puey Date: Sat, 29 Jan 2022 20:59:57 -0800 Subject: [PATCH 02/50] New translations enUS.json (Spanish) --- src/locales/strings/es.json | 124 ++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/src/locales/strings/es.json b/src/locales/strings/es.json index 0f95c8e2b96..a0eb3d97664 100644 --- a/src/locales/strings/es.json +++ b/src/locales/strings/es.json @@ -1,16 +1,16 @@ { - "app_name": "Cartera Edge", + "app_name": "Edge Wallet", "app_name_short": "Edge", "bitpay_metadata_name": "BitPay Invoice ID: %s", "bitcoin_received": "Has recibido %1$s", - "dialog_title": "Auto cierre de sesión", + "dialog_title": "Fijar tiempo para desconexión automática", "share_subject": "Hola, creo que deberías probar %s", - "share_message": "Puedes comprar, guardar y intercambiar con decenas de criptomonedas en una sola aplicación.", - "drawer_exchange_rate_loading": "Cargando Tipo de Cambio", - "drawer_exchange": "Intercambio", + "share_message": "Puedes comprar, almacenar y operar con decenas de criptomonedas en una sola aplicación.", + "drawer_exchange_rate_loading": "Cargando tipo de cambio", + "drawer_exchange": "Exchange", "drawer_request": "Solicitud", "drawer_scan_qr_send": "Scan QR", - "drawer_sweep_private_key": "Retirar clave privada (Sweep Pk)", + "drawer_sweep_private_key": "Barrer clave privada (Sweep Pk)", "drawer_wallets": "Carteras", "drawer_fio_names": "Nombres FIO", "drawer_fio_requests": "Solicitudes FIO", @@ -37,31 +37,31 @@ "alert_dropdown_alert": "¡Alerta! ", "alert_dropdown_warning": "¡Advertencia! ", "azteco_success": "Has canjeado una tarjeta de bitcoin Azteco. Los fondos deberían llegar pronto.", - "azteco_invalid_code": "Código Azteco inválido.", - "azteco_service_unavailable": "Error contactando con el servidor Azteco. Por favor, inténtalo de nuevo más tarde.", - "azteco_btc_only": "Por favor, elija una cartera BTC y vuelva a escanear.", - "max_spend_unavailable_modal_title": "Gasto Máximo No Disponible", + "azteco_invalid_code": "Código Azteco incorrecto.", + "azteco_service_unavailable": "Error contactando con el servidor de Azteco. Por favor, inténtalo de nuevo más tarde.", + "azteco_btc_only": "Por favor, elige una cartera BTC y vuelve a escanear.", + "max_spend_unavailable_modal_title": "Gasto máximo no disponible", "max_spend_unavailable_modal_message": "No podemos calcular la cantidad máxima disponible para la moneda %s. Por favor introduce una cantidad.", - "edge_description": "Esta aplicación quiere crear o acceder al correspondiente cartera en tu cuenta Edge.\n\nNo tendrá acceso a ninguna otra cartera.", - "edge_description_warning": "Advertencia: La aplicación \"%1$s\" esta solicitando acceso completo a tu cuenta y todas las carteras.\n\nUnicamente acepta esta petición si confíes en esta aplicación y en el lugar donde fue descargada.", - "exchange_failed": "No se pudo completar el intercambio", - "exchange_succeeded": "Intercambio realizado", + "edge_description": "Esta aplicación quiere crear o acceder a su cartera en tu cuenta Edge.\n\nNo tendrá acceso a ninguna otra cartera.", + "edge_description_warning": "Advertencia: La aplicación \"%1$s\" esta solicitando acceso completo a tu cuenta y todas las carteras.\n\nNo aceptes esta petición de login a no ser que confíes en esta aplicación y en el lugar donde fue descargada.", + "exchange_failed": "No se pudo completar el cambio", + "exchange_succeeded": "Cambio realizado", "exchange_congratulations": "¡ Felicidades!", "exchange_congratulations_msg": "¡Tu intercambio se ha completado con éxito!", "exchange_congratulations_msg_info": "Los intercambios pueden tardar entre unos minutos y hasta 24 horas en procesarse.", "no_exchange_amount": "Ninguna cantidad seleccionada", - "select_exchange_amount": "Ingresa una cantidad para intercambiar", - "select_exchange_amount_short": "Ingresa Monto", - "exchanges_may_take_minutes": "Casas de cambio pueden tardar varios minutos en procesar las transacciones. Por favor comprueba tu cartera de destino después de unos minutos", + "select_exchange_amount": "Introduce una cantidad para cambiar", + "select_exchange_amount_short": "Introduce una cantidad", + "exchanges_may_take_minutes": "Las casas de cambio pueden tardar varios minutos en procesar las transacciones. Por favor comprueba tu cartera de destino después de unos minutos", "fragment_wallets_addwallet_fiat_hint": "Elije una moneda fiat", "managetokens_top_instructions": "Seleccionar tokens para mostrar en la cartera:", "manage_tokens_duplicate_currency_code": "Ya existe un token con ese código de moneda.", "addtoken_top_instructions": "Para añadir un token, por favor rellene estos datos y pulse \"Guardar\" ", "accept_button_text": "Aceptar", - "addtoken_contract_address_input_text": "Dirección del contrato", + "addtoken_contract_address_input_text": "Dirección del smart contract", "addtoken_currency_code_input_text": "Código del token", "addtoken_default_error_message": "No es posible editar el token", - "addtoken_invalid_information": "Por favor ingresa la información del token correcta e inténtelo de nuevo", + "addtoken_invalid_information": "Por favor introduzca la información del token correcta e inténtelo de nuevo", "addtoken_denomination_input_text": "Número de decimales", "addtoken_name_input_text": "Nombre del token", "addtoken_add": "Añadir token personalizado", @@ -70,15 +70,15 @@ "edittoken_delete_prompt": "¿Seguro que quieres eliminar este token?", "edittoken_delete_title": "No es posible editar el token", "edittoken_duplicate_currency_code": "Ya existe un token con ese código de token.", - "edittoken_invalid_decimal_places": "Ingresa un número de decimales válido por favor.", + "edittoken_invalid_decimal_places": "Introduce un número de decimales válido por favor.", "edittoken_improper_token_load": "Imposible cargar los datos iniciales.", "fragment_create_wallet_create_wallet": "Crear cartera", "fragment_create_wallet_select_valid": "Seleccione datos válidos por favor", - "fragment_insufficient_funds": "Insufficient fondos", + "fragment_insufficient_funds": "no hay suficiente saldo", "fragment_request_copy_title": "Copiar", "fragment_request_subtitle": "Solicitud", - "fragment_request_address_copied": "Dirección de recibir copiada al portapapeles", - "fragment_copied": "Copiado correctamente en el portapapeles", + "fragment_request_address_copied": "Dirección de recepción copiada al portapapeles", + "fragment_copied": "¡Copiado correctamente en el portapapeles", "request_minimum_notification_title": "Saldo mínimo requerido", "request_xrp_minimum_notification_body": "Ripple (XRP) wallets require a 10 XRP minimum balance. You must deposit at least 10 XRP to this address before this wallet will show a balance or transactions. 10 XRP will be unspendable for the lifetime of this wallet address.", "request_xrp_minimum_notification_alert_body": "This wallet will always require a 10 XRP minimum", @@ -92,14 +92,14 @@ "fragment_send_subtitle": "Enviar", "fragment_send_from_label": "De", "fragment_stake_label": "Stake", - "fragment_transaction_exchange": "Intercambiar", + "fragment_transaction_exchange": "Exchange", "fragment_transaction_expense": "Gasto", "fragment_transaction_income": "Ingreso", "fragment_transaction_list_receive_prefix": "Recibido ", "fragment_transaction_list_sent_prefix": "Enviado ", "fragment_transaction_transfer": "Transferir", "fragment_wallet_unconfirmed": "Pendiente", - "fragment_transaction_list_tx_dropped": "Descartado", + "fragment_transaction_list_tx_dropped": "Cancelada", "fragment_transaction_list_tx_synchronizing": "Sincronizando", "fragment_transaction_list_confirmation_progress": "%s de %s confirmaciones", "fragment_transaction_list_transaction": "Transacciones", @@ -108,7 +108,7 @@ "transaction_list_search": "Buscar Transacciones", "transaction_list_search_no_result": "No se han encontrado resultados para tu búsqueda", "fragment_wallets_addwallet_name_hint": "Nombre de la nueva cartera", - "fragment_wallets_balance_text": "Saldo Total", + "fragment_wallets_balance_text": "Balance total", "fragment_wallets_delete_wallet": "Archivar cartera", "fragment_wallets_resync_wallet": "Resincronizar la cartera", "fragment_wallets_split_wallet": "Dividir la cartera", @@ -119,15 +119,15 @@ "fragment_wallets_export_transactions": "Exportar transacciones", "fragment_wallets_header": "Mis carteras", "fragment_wallets_rename_wallet": "Renombrar cartera", - "fragment_wallets_resync_wallet_first_confirm_message_mobile": "¿Estás seguro de que quieres resincronizar?\n", + "fragment_wallets_resync_wallet_first_confirm_message_mobile": "¿Estás seguro de que quieres resincronizar?", "fragment_wallets_split_wallet_bch_to_bsv": "Estás a punto de dividir tu cartera BCH y crear una nueva cartera BSV desde tus claves privadas de BCH. Esto requiere una transacción de BCH para proteger tus fondos de un gasto no intencionado en la cadena incorrecta. Esto generará un pequeño coste de transacción en la cartera BCH. Por favor asegúrate de que esta transacción inicial se confirma antes de hacer más transacciones con BCH. Estás seguro de que quieres dividir\n", - "fragment_wallets_split_wallet_first_confirm_message_mobile": "¿Estás seguro de que quieres partir la cartera? (Wallet split)\n", + "fragment_wallets_split_wallet_first_confirm_message_mobile": "¿Estás seguro de que quieres partir la cartera? (Wallet split)", "fragment_wallets_get_seed_wallet_first_confirm_message_mobile": "¿ Estás seguro de que quieres revelar la semilla privada de la siguiente cartera?\n", "fragment_wallets_get_raw_key_wallet_confirm_message": "¿ Estás seguro de que quieres revelar la semilla privada de la siguiente cartera?", "fragmet_wallets_delete_wallet_first_confirm_message_mobile": "¿Está seguro de que desea archivar ", "fragmet_wallets_delete_fio_extra_message_mobile": "Eliminar esta cartera FIO eliminará el acceso a cualquier dirección FIO que hayas vinculado a esta cartera.", "fragmet_wallets_delete_eth_extra_message": "Archivar esta cartera también archivará cualquier token habilitado para esta cartera.", - "wallet_list_add_wallet": "Añadir carpeta", + "wallet_list_add_wallet": "Crear cartera", "wallet_list_add_token": "Añadir token", "wallet_list_add_token_modal_title": "Es necesaria una cartera Ethereum o RSK", "wallet_list_add_token_modal_message": "Por favor crea primera una cartera Ethereum o RSK para guardar tus tokens", @@ -147,32 +147,32 @@ "create_wallet_import_input_key_or_seed_instructions": "Introduce tu semilla privada para verificar y restaurar la cartera asociada", "create_wallet_import_input_key_or_seed_prompt": "Clave privada o semilla privada", "create_wallet_import_active_key_input_prompt": "Clave Privada Activa", - "create_wallet_import_active_key_instructions": "Ingresa tu semilla privada para verificar y restaurar la cartera asociada:", - "create_wallet_import_successful": "Importación Exitosa!", - "create_wallet_select_valid_crypto": "Seleccione un tipo de cartera válido", + "create_wallet_import_active_key_instructions": "Introduce tu semilla privada para verificar y restaurar la cartera asociada:", + "create_wallet_import_successful": "¡Importación correcta!", + "create_wallet_select_valid_crypto": "Seleccione un tipo de cartera válido por favor", "create_wallet_invalid_input": "Entrada inválida", - "create_wallet_select_valid_fiat": "Seleccione una moneda fiat", + "create_wallet_select_valid_fiat": "Seleccione una moneda fiat por favor", "create_wallet_choose_crypto": "Seleccione un tipo de cartera", "create_wallet_invalid_name": "Nombre de cartera inválido", - "create_wallet_enter_valid_name": "Ingresa un nombre de cartera válido", - "create_wallet_top_instructions": "Verifica la infromación de la cartera y envíalo:", + "create_wallet_enter_valid_name": "Introduzca un nombre de cartera válido por favor", + "create_wallet_top_instructions": "Comprueba dos veces la infromación de la cartera y envía por favor:", "create_wallet_name_label": "Nombre de la cartera:", "create_wallet_crypto_type_label": "Tipo de cartera:", "create_wallet_fiat_type_label": "Moneda fiat de la cartera:", "create_wallet_failed_import_header": "Fallo en la importación de la clave", - "create_wallet_failed_message": "La creación de la cartera falló por exceder el tiempo de espera. Por favor comprueba tu conexión a internet e vuevla a inténtarlo más tarde.", - "create_wallet_create_account": "Crear Cuenta", - "create_wallet_account_activate": "Activar Cuenta", - "create_wallet_account_handle": "Alias de Cuenta", + "create_wallet_failed_message": "La creación de la cartera falló por exceder el tiempo de espera. Por favor comprueba tu conexión a internet e inténtalo de nuevo más tarde.", + "create_wallet_create_account": "Crear cuenta", + "create_wallet_account_activate": "Activar cuenta", + "create_wallet_account_handle": "Alias de la cuenta", "create_wallet_account_select_instructions_with_cost": "Todas las nuevas carteras de %1$s requieren un pago inicial para activar la cuenta y nombre. Este pago es un requisito de la red %2$s y no de %3$s. El coste actual equivale a %4$s pero puede fluctuar en el futuro. Selecciona una cartera desde la que pagar:", "create_wallet_account_make_payment": "Estás a punto de realizar el siguiente pago para activar tu cuenta de %s:", - "create_wallet_account_select_wallet": "Seleccionar Cartera", - "create_wallet_account_review_instructions": "Crear un alias de cuenta único, éste también será el nombre de tu cartera de %s:", + "create_wallet_account_select_wallet": "Seleccionar cartera", + "create_wallet_account_review_instructions": "Crear un alias de cuenta único, éste será también el nombre de tu cartera de %s:", "create_wallet_account_requirements_eos": "• Debe tener exactamente 12 caracteres\n• Debe incluir sólo letras minúsculas a-z o números 1-5\n", "create_wallet_account_invalid_account_name": "Nombre de cuenta inválido. No cumple los requisitos", "create_wallet_account_account_name_unavailable": "Nombre de cuenta no disponible. Por favor elige otro", "create_wallet_account_unknown_error": "Error desconocido comprobando el nombre de la cuenta. Por favor inténtalo más tarde", - "create_wallet_account_confirm": "Verifique la cartera y el información del pago antes de enviar.", + "create_wallet_account_confirm": "Comprueba doblemente la información de la cartera y el pago antes de enviar.", "create_wallet_account_amount_due": "Importe:", "create_wallet_account_error_sending_transaction": "Error enviando la transacción", "create_wallet_account_payment_sent_title": "Pago Enviado", @@ -240,10 +240,10 @@ "send_confirmation_fee_modal_alert_message_fragment_eth": "El uso de una tarifa demasiado baja puede resultar en una transacción fallida y pérdida de la comisión gastada.", "transaction_failure": "Fallo en la transacción", "transaction_failure_message": "%s.", - "transaction_success": "Transacción Exitosa", + "transaction_success": "Transacción correcta", "transaction_success_message": "Tu transacción ha sido enviada correctamente.", - "incorrect_pin": "NIP incorrecto", - "invalid_spend_request": "Solicitud de gasto inválida", + "incorrect_pin": "PIN incorrecto", + "invalid_spend_request": "Petición de gasto inválida", "invalid_custom_fee": "Tarifa mínima es", "settings_account_title_cap": "Cuenta", "settings_button_change_password": "Cambiar contraseña", @@ -252,15 +252,15 @@ "settings_dark_theme": "Tema Oscuro", "settings_button_lock_settings": "Pulsar para bloquear la configuración de la cuenta", "settings_button_password_recovery": "Configurar recuperación de contraseña", - "settings_button_logout": "Cerrar sesión", - "settings_button_pin": "Cambiar NIP", - "settings_exchange_settings": "Configuración de Intercambio", + "settings_button_logout": "Salir", + "settings_button_pin": "Cambiar el PIN", + "settings_exchange_settings": "Ajustes de cambio", "settings_exchange_instruction": "Activar o desactivar las casas de cambio disponibles para ti", "settings_notifications_switch": "Habilitar alertas de precios", "swap_preferred_header": "Casa de cambio preferida", "swap_preferred_cheapest": "Elegir mejor precio", "swap_preferred_instructions": "Cuando varias casas de cambio pueden ejecutar una orden, preferir:", - "swap_preferred_promo_instructions": "Cuando varias casas de cambio pueden completar un pedido, la promoción actual prefiere:", + "swap_preferred_promo_instructions": "Cuando múltiples intercambios pueden llenar un pedido, la promoción actual siempre prefiere:", "settings_button_send_logs": "Enviar registros (logs)", "settings_button_setup_two_factor": "Configurar seguridad de 2 factores", "settings_button_unlock_settings": "Pulsa para desbloquear la configuración de la cuenta", @@ -280,16 +280,16 @@ "settings_seconds": "Segundo(s)", "settings_select_currency": "Selecciona una moneda", "settings_title_auto_logoff": "Desconexión automática después de", - "settings_title_currency": "Moneda Predeterminada", - "settings_title_pin_login": "NIP Re-login", + "settings_title_currency": "Moneda por defecto", + "settings_title_pin_login": "PIN Re-login", "settings_title": "Configuración", - "settings_enable_custom_nodes": "Activar Nodos Personalizados", + "settings_enable_custom_nodes": "Activar nodos personalizados", "settings_add_custom_node": "Añadir nodo personalizado", "settings_edit_custom_node": "Editar nodo personalizado", "settings_custom_node_url": "URL del nodo", "settings_promotion_affiliation_header": "Programa de afiliación", "settings_promotion_header": "Códigos de promoción", - "settings_promotion_add": "Ingresar código de promoción", + "settings_promotion_add": "Introduce el código de promoción", "settings_promotion_device_normal": "Esta aplicación fue instalada normalmente.", "settings_promotion_device_installer": "Esta aplicación fue instalada a través de %s.", "settings_promotion_device_currencies": "Las nuevas cuentas tendrán carteras para: %s", @@ -389,19 +389,19 @@ "string_master_private_key": "Clave privada maestra", "string_split_wallet": "Dividir %s", "string_add_edit_tokens": "Añadir /Editar Tokens", - "string_get_raw_keys": "Obtener llaves crudas", - "string_raw_keys": "Llaves Crudas", + "string_get_raw_keys": "Obtener llaves en bruto", + "string_raw_keys": "Llaves en bruto (raw keys)", "title_create_wallet_select_crypto": "Seleccionar tipo de cartera", "title_create_wallet_select_fiat": "Seleccionar Fiat", - "title_back": "Atrás", + "title_back": "Volver", "title_change_mining_fee": "Cambiar comisión de minado", "title_change_password": "Cambiar contraseña", - "title_change_pin": "Cambiar NIP", - "title_create_wallet": "Crear Cartera", - "title_export_transactions": "Exportar Transacciones", - "title_default_fiat": "Moneda fiat preferido", + "title_change_pin": "Cambiar PIN", + "title_create_wallet": "Crear cartera", + "title_export_transactions": "Exportar transacciones", + "title_default_fiat": "Moneda fiat por defecto", "title_edge_login": "Edge Login", - "title_exchange": "Intercambio", + "title_exchange": "Casa de cambio", "title_fio_sent_request_details": "Detalles de la solicitud enviados", "title_fio_address_settings": "Ajustes de dirección", "title_fio_domain_settings": "Ajustes de dominio", @@ -410,7 +410,7 @@ "title_fio_renew": "Renovar", "title_fio_make_public_domain": "Hacer público el dominio", "title_fio_make_private_domain": "Hacer Dominio Privado", - "title_fio_transfer_domain": "Transfer FIO Domain", + "title_fio_transfer_domain": "Transferir dominio FIO", "title_fio_transfer_address": "Transferir dirección FIO", "title_fio_address": "Direcciones FIO", "title_fio_names": "Nombres FIO", From dffa61a2a76c228f3a58b19e295d0fa2adc29957 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 31 Jan 2022 10:25:33 -0800 Subject: [PATCH 03/50] Upgrade to react-native-reanimated v2.3.1 --- ios/Podfile.lock | 5 ++--- package.json | 2 +- yarn.lock | 36 +++++++++++++++++++++++++++++++----- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0f4314258e7..e39c5187fed 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -537,7 +537,7 @@ PODS: - React-Core - RNQrGenerator (1.1.7): - React - - RNReanimated (2.2.0): + - RNReanimated (2.3.1): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -563,7 +563,6 @@ PODS: - React-RCTNetwork - React-RCTSettings - React-RCTText - - React-RCTVibration - ReactCommon/turbomodule/core - Yoga - RNShare (7.1.2): @@ -1074,7 +1073,7 @@ SPEC CHECKSUMS: RNLocalize: 43f6c30d8e19ad92282ae434d310fb463b31f419 RNPermissions: 58c1eb5638504e3afda963a8b0f43b6752132b05 RNQrGenerator: 86fb623932ed29627c6a95b8dc94af5e93d8abe1 - RNReanimated: 9c13c86454bfd54dab7505c1a054470bfecd2563 + RNReanimated: 7f143675d94978c3555345d5bfa8ed6ae800c5d3 RNShare: 0fec82bd2e67d09f895937ccb4f5a097e714dec2 RNSound: da030221e6ac7e8290c6b43f2b5f2133a8e225b0 RNStoreReview: 62d6afd7c37db711a594bbffca6b0ea3a812b7a8 diff --git a/package.json b/package.json index 3e17d693abd..e7337d06294 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "react-native-patina": "^0.1.6", "react-native-permissions": "^3.0.0", "react-native-popup-menu": "0.13.3", - "react-native-reanimated": "^2.2.0", + "react-native-reanimated": "^2.3.1", "react-native-router-flux": "4.0.6", "react-native-safari-view": "^2.1.0", "react-native-safe-area-view": "0.14.9", diff --git a/yarn.lock b/yarn.lock index efdacde4bb2..c2a8df0580a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2057,6 +2057,11 @@ dependencies: "@types/node" "*" +"@types/invariant@^2.2.35": + version "2.2.35" + resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.35.tgz#cd3ebf581a6557452735688d8daba6cf0bd5a3be" + integrity sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" @@ -11130,6 +11135,11 @@ react-devtools-core@^4.6.0: shell-quote "^1.6.1" ws "^7" +react-freeze@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/react-freeze/-/react-freeze-1.0.0.tgz#b21c65fe1783743007c8c9a2952b1c8879a77354" + integrity sha512-yQaiOqDmoKqks56LN9MTgY06O0qQHgV4FUrikH357DydArSZHQhl0BJFqGKIZoTqi8JizF9Dxhuk1FIZD6qCaw== + "react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" @@ -11321,14 +11331,17 @@ react-native-popup-menu@0.13.3: resolved "https://registry.yarnpkg.com/react-native-popup-menu/-/react-native-popup-menu-0.13.3.tgz#3f4203945acb4954d08d5b50a0345ccc18657eba" integrity sha1-P0IDlFrLSVTQjVtQoDRczBhlfro= -react-native-reanimated@^2.0.0, react-native-reanimated@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.2.0.tgz#a6412c56b4e591d1f00fac949f62d0c72c357c78" - integrity sha512-lOJDd+5w1gY6DHGXG2jD1dsjzQmXQ2699HUc3IztvI2WP4zUT+UAA+zSG+5JiBS5DUnTL8YhhkmUQmr1KNGO5w== +react-native-reanimated@^2.0.0, react-native-reanimated@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.3.1.tgz#c7abad48f9e6c84610b0d5e270088ecd61750382" + integrity sha512-nzjVqwkB8eeyPKT2KoiA9EEz17ZMFSGMoOTC17Z9b5nE2Z4ZHjHM5EKhY0TlwzXFUuJAE9PhOfxF0wIO/maZSA== dependencies: "@babel/plugin-transform-object-assign" "^7.10.4" - fbjs "^3.0.0" + "@types/invariant" "^2.2.35" + invariant "^2.2.4" + lodash.isequal "^4.5.0" mockdate "^3.0.2" + react-native-screens "^3.4.0" string-hash-64 "^1.0.3" react-native-router-flux@4.0.6: @@ -11359,6 +11372,14 @@ react-native-screens@^1.0.0-alpha.11: resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz#7a120377b52aa9bbb94d0b8541a014026be9289b" integrity sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA== +react-native-screens@^3.4.0: + version "3.10.2" + resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.10.2.tgz#cbf505d61c09e29ad5b335309951a3bd81f0df19" + integrity sha512-bMKSpwMeqAoXBqTJiDEG1ogM1cMk66sEmpp/4dGqdX59v+OwMqPeTuBk37qaSuS7gPOFFKsNW2X3ymGvBT4iEw== + dependencies: + react-freeze "^1.0.0" + warn-once "^0.1.0" + react-native-share@^5.1.4: version "5.1.4" resolved "https://registry.yarnpkg.com/react-native-share/-/react-native-share-5.1.4.tgz#0b9d51f6ca724728cb0c5b3ed3a883ee54d7a11b" @@ -14119,6 +14140,11 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" +warn-once@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/warn-once/-/warn-once-0.1.0.tgz#4f58d89b84f968d0389176aa99e0cf0f14ffd4c8" + integrity sha512-recZTSvuaH/On5ZU5ywq66y99lImWqzP93+AiUo9LUwG8gXHW+LJjhOd6REJHm7qb0niYqrEQJvbHSQfuJtTqA== + watchpack-chokidar2@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957" From f3431997cfa017f4ff8ee7d2b345ca5075d72ec2 Mon Sep 17 00:00:00 2001 From: Samuel Holmes Date: Mon, 31 Jan 2022 17:10:33 -0800 Subject: [PATCH 04/50] Constrain FIO staking APY return to two decimals --- src/components/scenes/StakingChangeScene.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scenes/StakingChangeScene.js b/src/components/scenes/StakingChangeScene.js index c4bf2cfb6fb..07c7f7f5478 100644 --- a/src/components/scenes/StakingChangeScene.js +++ b/src/components/scenes/StakingChangeScene.js @@ -167,7 +167,7 @@ export const StakingChangeSceneComponent = (props: Props) => { if (currencyPlugin != null && currencyPlugin.otherMethods != null && currencyPlugin.otherMethods.getStakeEstReturn != null) { currencyPlugin.otherMethods .getStakeEstReturn(exchangeAmount) - .then(apy => setApy(apy)) + .then(apy => setApy(parseFloat(apy.toFixed(2)))) .catch(() => { // }) From 1df8b5fd7544972f1b9edfdeb27e78bb8bd93ee9 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 31 Jan 2022 22:21:44 -0800 Subject: [PATCH 05/50] Remove strange previously-uncaught syntax error --- src/components/themed/OutlinedTextInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/themed/OutlinedTextInput.js b/src/components/themed/OutlinedTextInput.js index 4d358065547..1416e03d412 100644 --- a/src/components/themed/OutlinedTextInput.js +++ b/src/components/themed/OutlinedTextInput.js @@ -191,7 +191,7 @@ const OutlinedTextInputComponent = React.forwardRef((props: Props, ref) => { // Animated styles: const getColor = useCallback( - (errorValue, focusValue, focusColor? = theme.iconTappable) => { + (errorValue, focusValue, focusColor = theme.iconTappable) => { 'worklet' const interFocusColor = interpolateColor(focusValue, [0, 1], [theme.secondaryText, focusColor]) return interpolateColor(errorValue, [0, 1], [interFocusColor, theme.dangerText]) From b7ba484f63309e06409ec9a0f3873a90ae9e8cad Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Tue, 1 Feb 2022 19:14:54 +0200 Subject: [PATCH 06/50] Get proper wallet for FioActionSubmit denomination info --- src/modules/FioAddress/components/FioActionSubmit.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/FioAddress/components/FioActionSubmit.js b/src/modules/FioAddress/components/FioActionSubmit.js index f66d1e9df83..0ea627e5560 100644 --- a/src/modules/FioAddress/components/FioActionSubmit.js +++ b/src/modules/FioAddress/components/FioActionSubmit.js @@ -16,7 +16,6 @@ import { Tile } from '../../../components/themed/Tile' import { FIO_STR } from '../../../constants/WalletAndCurrencyConstants.js' import s from '../../../locales/strings' import { getDisplayDenomination } from '../../../selectors/DenominationSelectors.js' -import { getSelectedCurrencyWallet } from '../../../selectors/WalletSelectors.js' import { connect } from '../../../types/reactRedux.js' import { DECIMAL_PRECISION, truncateDecimals } from '../../../util/utils' import { Slider } from '../../UI/components/Slider/Slider' @@ -271,8 +270,8 @@ const getStyles = cacheStyles((theme: Theme) => ({ })) export const FioActionSubmit = connect( - state => ({ - denominationMultiplier: getDisplayDenomination(state, getSelectedCurrencyWallet(state).currencyInfo.pluginId, FIO_STR).multiplier, + (state, ownProps) => ({ + denominationMultiplier: getDisplayDenomination(state, ownProps.fioWallet.currencyInfo.pluginId, FIO_STR).multiplier, currencyWallets: state.core.account.currencyWallets, fioWallets: state.ui.wallets.fioWallets }), From 1d1b5fdfb08700fcbd00b1fc79d102b8591283ca Mon Sep 17 00:00:00 2001 From: Samuel Holmes Date: Tue, 1 Feb 2022 10:08:59 -0800 Subject: [PATCH 07/50] Upgrade edge-currency-accountbased@^0.11.10 --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index e7337d06294..8a307e9d0eb 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "detox": "^18.10.0", "disklet": "^0.4.5", "edge-core-js": "^0.19.4", - "edge-currency-accountbased": "^0.11.9", + "edge-currency-accountbased": "^0.11.10", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.8", diff --git a/yarn.lock b/yarn.lock index c2a8df0580a..3e4ed7f286b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5347,10 +5347,10 @@ edge-core-js@^0.19.4: yaob "^0.3.7" yavent "^0.1.3" -edge-currency-accountbased@^0.11.9: - version "0.11.9" - resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.11.9.tgz#b91ce0ee04a9f1699a7c49a1900d328b950a01d5" - integrity sha512-YGHXlxOkkIDzt/kqGmVISbRW2lEXyJGBOI4jo2+cQ5EFhTw0C0q5G34W88qPEKceI+fZSikA7ySFMzhsxTKvLg== +edge-currency-accountbased@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.11.10.tgz#af7cbcd6b2e5242abf1e05bdb63565a10bd2bf70" + integrity sha512-9CI4Ee6Y+bM3zHG1v+hz8oMtb5qz1Yo/TGbDASiPSypisQEmJbhrWBwKlOW9UhbENRrqtG+Q77BT7dx1jxFiHg== dependencies: "@binance-chain/javascript-sdk" "^2.14.4" "@ethereumjs/common" "^2.4.0" @@ -5575,7 +5575,7 @@ envinfo@^7.7.2, envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -"eosjs-api@https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb", "eosjs-api@https://github.com/EdgeApp/eosjs-api.git#prepare-script": +"eosjs-api@git+https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb", "eosjs-api@https://github.com/EdgeApp/eosjs-api.git#prepare-script": version "7.0.4" resolved "https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb" dependencies: @@ -6105,9 +6105,9 @@ ethereumjs-util@^7.1.0: ethjs-util "0.1.6" rlp "^2.2.4" -"ethereumjs-wallet@https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef": +"ethereumjs-wallet@git+https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef": version "0.6.0" - resolved "https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef" + resolved "git+https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef" dependencies: aes-js "^0.2.3" bs58check "^1.0.8" @@ -6396,9 +6396,9 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -"eztz.js@https://github.com/EdgeApp/eztz.git#edge-fixes": +"eztz.js@git+https://github.com/EdgeApp/eztz.git#edge-fixes": version "0.0.1" - resolved "https://github.com/EdgeApp/eztz.git#6937ce236912dae8da8409838518023a88eacf6c" + resolved "git+https://github.com/EdgeApp/eztz.git#6937ce236912dae8da8409838518023a88eacf6c" dependencies: bignumber.js "^7.2.1" bip39 "^3.0.2" From 2510750032b4c13f6195a65eaa5851cb49ccd249 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 27 Jan 2022 17:39:06 +0200 Subject: [PATCH 08/50] Set available balance for FioSubmitAction --- src/modules/FioAddress/components/FioActionSubmit.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/FioAddress/components/FioActionSubmit.js b/src/modules/FioAddress/components/FioActionSubmit.js index f66d1e9df83..c4de2cd4c83 100644 --- a/src/modules/FioAddress/components/FioActionSubmit.js +++ b/src/modules/FioAddress/components/FioActionSubmit.js @@ -13,7 +13,7 @@ import { cacheStyles, withTheme } from '../../../components/services/ThemeContex import { EdgeText } from '../../../components/themed/EdgeText' import { MainButton } from '../../../components/themed/MainButton.js' import { Tile } from '../../../components/themed/Tile' -import { FIO_STR } from '../../../constants/WalletAndCurrencyConstants.js' +import { FIO_STR, SPECIAL_CURRENCY_INFO, STAKING_BALANCES } from '../../../constants/WalletAndCurrencyConstants' import s from '../../../locales/strings' import { getDisplayDenomination } from '../../../selectors/DenominationSelectors.js' import { getSelectedCurrencyWallet } from '../../../selectors/WalletSelectors.js' @@ -164,7 +164,12 @@ class FioActionSubmitComponent extends React.Component { const { addressTitles } = this.props const { paymentWallet } = this.state if (paymentWallet) { - const balance = paymentWallet.balances[paymentWallet.currencyInfo.currencyCode] ?? '0' + const { currencyCode } = paymentWallet.currencyInfo + let balance = paymentWallet.balances[currencyCode] ?? '0' + if (SPECIAL_CURRENCY_INFO[currencyCode]?.isStakingSupported) { + const lockedBalance = paymentWallet.balances[`${currencyCode}${STAKING_BALANCES.locked}`] ?? '0' + balance = bns.sub(balance, lockedBalance) + } this.setState({ balance: this.formatFio(balance) }) } else { showError(addressTitles ? s.strings.fio_wallet_missing_for_fio_address : s.strings.fio_wallet_missing_for_fio_domain) From e088618eaae932cd08033f0f64f0638f398909f8 Mon Sep 17 00:00:00 2001 From: Samuel Holmes Date: Tue, 1 Feb 2022 10:32:58 -0800 Subject: [PATCH 09/50] Change wording from "Remaining" to "Available" in FioSubmitAction --- src/locales/en_US.js | 2 +- src/locales/strings/enUS.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/en_US.js b/src/locales/en_US.js index 3449e809b2e..b0eed4cc811 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -707,7 +707,7 @@ const strings = { fio_address_confirm_screen_registration_label: 'Registration Fee', fio_address_confirm_screen_free_label: 'Free', fio_address_confirm_screen_fio_label: 'FIO', - fio_address_confirm_screen_balance_label: 'Remaining FIO Balance', + fio_address_confirm_screen_balance_label: 'Available FIO Balance', fio_address_confirm_screen_disabled_slider_label: 'Not enough FIO', fio_address_details_screen_alert_title: 'FIO Address Created', fio_address_details_screen_alert_message: 'Your FIO Address is now registered and ready for use.', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 83dbefe44bc..16d615c2265 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -656,7 +656,7 @@ "fio_address_confirm_screen_registration_label": "Registration Fee", "fio_address_confirm_screen_free_label": "Free", "fio_address_confirm_screen_fio_label": "FIO", - "fio_address_confirm_screen_balance_label": "Remaining FIO Balance", + "fio_address_confirm_screen_balance_label": "Available FIO Balance", "fio_address_confirm_screen_disabled_slider_label": "Not enough FIO", "fio_address_details_screen_alert_title": "FIO Address Created", "fio_address_details_screen_alert_message": "Your FIO Address is now registered and ready for use.", From 9b58679cc98c8c7a5668af0eee63ac1bec42a22e Mon Sep 17 00:00:00 2001 From: Samuel Holmes Date: Tue, 1 Feb 2022 11:27:31 -0800 Subject: [PATCH 10/50] Fix transitive dependencies in yarn.lock --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3e4ed7f286b..87a039a9fd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5575,7 +5575,7 @@ envinfo@^7.7.2, envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -"eosjs-api@git+https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb", "eosjs-api@https://github.com/EdgeApp/eosjs-api.git#prepare-script": +"eosjs-api@https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb", "eosjs-api@https://github.com/EdgeApp/eosjs-api.git#prepare-script": version "7.0.4" resolved "https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb" dependencies: @@ -6105,9 +6105,9 @@ ethereumjs-util@^7.1.0: ethjs-util "0.1.6" rlp "^2.2.4" -"ethereumjs-wallet@git+https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef": +"ethereumjs-wallet@https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef": version "0.6.0" - resolved "git+https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef" + resolved "https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef" dependencies: aes-js "^0.2.3" bs58check "^1.0.8" @@ -6396,9 +6396,9 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -"eztz.js@git+https://github.com/EdgeApp/eztz.git#edge-fixes": +"eztz.js@https://github.com/EdgeApp/eztz.git#edge-fixes": version "0.0.1" - resolved "git+https://github.com/EdgeApp/eztz.git#6937ce236912dae8da8409838518023a88eacf6c" + resolved "https://github.com/EdgeApp/eztz.git#6937ce236912dae8da8409838518023a88eacf6c" dependencies: bignumber.js "^7.2.1" bip39 "^3.0.2" From 72f1f6e677b3f77f815034c47f8c36fcf0269e1b Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 1 Feb 2022 13:05:10 -0800 Subject: [PATCH 11/50] Fix Reanimated red-box error on login Worklet functions cannot take default parameters, so get rid of that. --- src/components/themed/OutlinedTextInput.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/themed/OutlinedTextInput.js b/src/components/themed/OutlinedTextInput.js index 1416e03d412..deb0ef63c64 100644 --- a/src/components/themed/OutlinedTextInput.js +++ b/src/components/themed/OutlinedTextInput.js @@ -190,10 +190,10 @@ const OutlinedTextInputComponent = React.forwardRef((props: Props, ref) => { } // Animated styles: - const getColor = useCallback( - (errorValue, focusValue, focusColor = theme.iconTappable) => { + const getBorderColor = useCallback<(errorValue: number, focusValue: number) => string>( + (errorValue, focusValue) => { 'worklet' - const interFocusColor = interpolateColor(focusValue, [0, 1], [theme.secondaryText, focusColor]) + const interFocusColor = interpolateColor(focusValue, [0, 1], [theme.secondaryText, theme.iconTappable]) return interpolateColor(errorValue, [0, 1], [interFocusColor, theme.dangerText]) }, [theme] @@ -201,27 +201,27 @@ const OutlinedTextInputComponent = React.forwardRef((props: Props, ref) => { const bottomStyle = useAnimatedStyle(() => { const counterProgress = hasValue ? 1 : focusAnimation.value return { - borderColor: getColor(errorAnimation.value, focusAnimation.value), + borderColor: getBorderColor(errorAnimation.value, focusAnimation.value), right: maxLength !== undefined ? counterRight + counterProgress * (2 * counterPadding + counterWidth) : cornerPadding } }) const leftStyle = useAnimatedStyle(() => ({ - borderColor: getColor(errorAnimation.value, focusAnimation.value) + borderColor: getBorderColor(errorAnimation.value, focusAnimation.value) })) const rightStyle = useAnimatedStyle(() => ({ - borderColor: getColor(errorAnimation.value, focusAnimation.value) + borderColor: getBorderColor(errorAnimation.value, focusAnimation.value) })) const topStyle = useAnimatedStyle(() => { const counterProgress = hasLabel ? (hasValue ? 1 : focusAnimation.value) : 0 return { - borderColor: getColor(errorAnimation.value, focusAnimation.value), + borderColor: getBorderColor(errorAnimation.value, focusAnimation.value), left: labelLeft + counterProgress * (2 * labelPadding + labelWidth * (1 - labelShrink)) } }) const labelStyle = useAnimatedStyle(() => { const labelProgressAlt = hasValue ? 1 : focusAnimationAlt.value return { - color: getColor(errorAnimation.value, focusAnimation.value), + color: getBorderColor(errorAnimation.value, focusAnimation.value), transform: [ { translateX: labelProgressAlt * labelTranslateX }, { translateY: labelProgressAlt * labelTranslateY }, @@ -232,7 +232,7 @@ const OutlinedTextInputComponent = React.forwardRef((props: Props, ref) => { const counterStyle = useAnimatedStyle(() => { const counterProgress = hasValue ? 1 : focusAnimation.value return { - color: getColor(errorAnimation.value, focusAnimation.value, theme.secondaryText), + color: interpolateColor(errorAnimation.value, [0, 1], [theme.secondaryText, theme.dangerText]), opacity: counterProgress, transform: [{ translateX: (1 - counterProgress) * counterTranslateX }, { scale: counterProgress }] } From bf113d7f7b56b4554ff5dc370fef688427de75ba Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 1 Feb 2022 14:09:23 -0800 Subject: [PATCH 12/50] Use exchangeCurrencyCode instead of display currency name --- src/components/scenes/CryptoExchangeScene.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/scenes/CryptoExchangeScene.js b/src/components/scenes/CryptoExchangeScene.js index 885da532711..41915fe20f3 100644 --- a/src/components/scenes/CryptoExchangeScene.js +++ b/src/components/scenes/CryptoExchangeScene.js @@ -365,7 +365,6 @@ export const CryptoExchangeScene = connect( if (fromWalletId != null && currencyWallets[fromWalletId] != null) { const { fromNativeAmount, fromWalletPrimaryInfo } = cryptoExchange const { - displayDenomination: { name: fromCurrencyCode }, exchangeDenomination: { multiplier }, exchangeCurrencyCode } = fromWalletPrimaryInfo @@ -383,7 +382,7 @@ export const CryptoExchangeScene = connect( fromWalletBalances, fromFiatCurrencyCode, fromIsoFiatCurrencyCode, - fromCurrencyCode, + fromCurrencyCode: exchangeCurrencyCode, fromWalletPrimaryInfo, fromExchangeAmount: bns.div(fromNativeAmount, multiplier, DECIMAL_PRECISION), fromFiatToCrypto: getExchangeRate(state, exchangeCurrencyCode, fromIsoFiatCurrencyCode), @@ -395,7 +394,6 @@ export const CryptoExchangeScene = connect( if (toWalletId != null && currencyWallets[toWalletId] != null) { const { toNativeAmount, toWalletPrimaryInfo } = cryptoExchange const { - displayDenomination: { name: toCurrencyCode }, exchangeDenomination: { multiplier }, exchangeCurrencyCode } = toWalletPrimaryInfo @@ -405,7 +403,7 @@ export const CryptoExchangeScene = connect( Object.assign(result, { toWalletId, toWalletName, - toCurrencyCode, + toCurrencyCode: exchangeCurrencyCode, toFiatCurrencyCode, toIsoFiatCurrencyCode, toWalletPrimaryInfo, From 55182a536f508570223c823e24390d6fb4fac410 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 1 Feb 2022 16:05:48 -0800 Subject: [PATCH 13/50] Create utility to safely use a GuiWallet where it may not exist yet There are some scenes and components that attempt to access new GuiWallets before they exist in state. This utility wraps the GuiWallet and returns safe defaults where these edge cases exist. --- src/components/scenes/ManageTokensScene.js | 4 ++-- src/components/themed/WalletList.js | 24 +++++++++---------- .../themed/WalletListCurrencyRow.js | 4 ++-- src/types/types.js | 13 ++++++++++ 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/components/scenes/ManageTokensScene.js b/src/components/scenes/ManageTokensScene.js index 308266695d4..5cdf6d6082e 100644 --- a/src/components/scenes/ManageTokensScene.js +++ b/src/components/scenes/ManageTokensScene.js @@ -12,7 +12,7 @@ import { getSpecialCurrencyInfo, PREFERRED_TOKENS } from '../../constants/Wallet import s from '../../locales/strings.js' import { connect } from '../../types/reactRedux.js' import { type NavigationProp, type RouteProp } from '../../types/routerTypes.js' -import type { CustomTokenInfo, GuiWallet } from '../../types/types.js' +import { type CustomTokenInfo, type GuiWallet, asSafeDefaultGuiWallet } from '../../types/types.js' import { mergeTokensRemoveInvisible } from '../../util/utils' import { SceneWrapper } from '../common/SceneWrapper.js' import { WalletListModal } from '../modals/WalletListModal' @@ -266,7 +266,7 @@ export const ManageTokensScene = connect( manageTokensPending: state.ui.wallets.manageTokensPending, settingsCustomTokens: state.ui.settings.customTokens, wallets: state.ui.wallets.byId, - enabledTokens: state.ui.wallets.byId[params.walletId].enabledTokens + enabledTokens: asSafeDefaultGuiWallet(state.ui.wallets.byId[params.walletId]).enabledTokens }), dispatch => ({ setEnabledTokensList(walletId: string, enabledTokens: string[], oldEnabledTokensList: string[]) { diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 1a529fbe3ff..59bdb9a5ada 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -11,6 +11,7 @@ import { type SettingsState } from '../../reducers/scenes/SettingsReducer.js' import { calculateWalletFiatBalanceUsingDefaultIsoFiat } from '../../selectors/WalletSelectors.js' import { connect } from '../../types/reactRedux.js' import type { CreateTokenType, CreateWalletType, CustomTokenInfo, FlatListItem, GuiWallet, MostRecentWallet } from '../../types/types.js' +import { asSafeDefaultGuiWallet } from '../../types/types.js' import { getCreateWalletTypes, getCurrencyIcon, getCurrencyInfos } from '../../util/CurrencyInfoHelpers.js' import { type FilterDetailsType, alphabeticalSort, checkCurrencyCodes, checkFilterWallet } from '../../util/utils' import { WalletListMenuModal } from '../modals/WalletListMenuModal.js' @@ -158,17 +159,16 @@ class WalletListComponent extends React.PureComponent { : () => {} }) } else if (wallet != null) { - const { enabledTokens } = wallet + const { enabledTokens, name, currencyCode, currencyNames } = asSafeDefaultGuiWallet(wallet) const { customTokens } = this.props // Initialize wallets - if (this.checkFilterWallet({ name: wallet.name, currencyCode: wallet.currencyCode, currencyName: wallet.currencyNames[wallet.currencyCode] })) { + if (this.checkFilterWallet({ name, currencyCode, currencyName: currencyNames[currencyCode] })) { walletList.push({ id: walletId, - fullCurrencyCode: wallet.currencyCode, - key: `${walletId}-${wallet.currencyCode}`, - onPress: () => - this.props.onPress != null ? this.props.onPress(walletId, wallet.currencyCode) : this.props.selectWallet(walletId, wallet.currencyCode) + fullCurrencyCode: currencyCode, + key: `${walletId}-${currencyCode}`, + onPress: () => (this.props.onPress != null ? this.props.onPress(walletId, currencyCode) : this.props.selectWallet(walletId, currencyCode)) }) } @@ -182,18 +182,16 @@ class WalletListComponent extends React.PureComponent { }) // Initialize tokens - for (const currencyCode of enabledNotHiddenTokens) { - const fullCurrencyCode = `${wallet.currencyCode}-${currencyCode}` - const customTokenInfo = wallet.currencyNames[currencyCode] ? undefined : customTokens.find(token => token.currencyCode === currencyCode) + for (const tokenCode of enabledNotHiddenTokens) { + const fullCurrencyCode = `${currencyCode}-${tokenCode}` + const customTokenInfo = currencyNames[tokenCode] ? undefined : customTokens.find(token => token.currencyCode === tokenCode) - if ( - this.checkFilterWallet({ name: wallet.name, currencyCode, currencyName: customTokenInfo?.currencyName ?? wallet.currencyNames[currencyCode] ?? '' }) - ) { + if (this.checkFilterWallet({ name, currencyCode, currencyName: customTokenInfo?.currencyName ?? currencyNames[tokenCode] ?? '' })) { walletList.push({ id: walletId, fullCurrencyCode: fullCurrencyCode, key: `${walletId}-${fullCurrencyCode}`, - onPress: () => (this.props.onPress != null ? this.props.onPress(walletId, currencyCode) : this.props.selectWallet(walletId, currencyCode)) + onPress: () => (this.props.onPress != null ? this.props.onPress(walletId, tokenCode) : this.props.selectWallet(walletId, tokenCode)) }) } } diff --git a/src/components/themed/WalletListCurrencyRow.js b/src/components/themed/WalletListCurrencyRow.js index 24f415a2480..c52c07e9dae 100644 --- a/src/components/themed/WalletListCurrencyRow.js +++ b/src/components/themed/WalletListCurrencyRow.js @@ -8,7 +8,7 @@ import { formatNumber } from '../../locales/intl.js' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors.js' import { calculateWalletFiatBalanceWithoutState } from '../../selectors/WalletSelectors.js' import { connect } from '../../types/reactRedux.js' -import { type GuiExchangeRates } from '../../types/types.js' +import { type GuiExchangeRates, asSafeDefaultGuiWallet } from '../../types/types.js' import { getCryptoAmount, getCurrencyInfo, getDenomFromIsoCode, getFiatSymbol, getYesterdayDateRoundDownHour, zeroString } from '../../util/utils' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' import { CardContent } from './CardContent' @@ -171,7 +171,7 @@ export const WalletListCurrencyRow = connect( (state, ownProps) => { const { currencyCode, walletName, walletId } = ownProps const wallet = state.core.account.currencyWallets[walletId] - const guiWallet = state.ui.wallets.byId[walletId] + const guiWallet = asSafeDefaultGuiWallet(state.ui.wallets.byId[walletId]) const exchangeRates = state.exchangeRates const showBalance = state.ui.settings.isAccountBalanceVisible diff --git a/src/types/types.js b/src/types/types.js index 75c1d08b4f3..2b626e3c31e 100644 --- a/src/types/types.js +++ b/src/types/types.js @@ -33,6 +33,19 @@ export type GuiWallet = { blockHeight: number | null } +// FIXME: Bandaid for when the GuiWallet object isn't quite ready when some components are loaded +export const asSafeDefaultGuiWallet = (guiWallet: T): T => ({ + ...asOptional( + asObject({ + name: asOptional(asString, ''), + currencyNames: asOptional(asObject(asString), {}), + currencyCode: asOptional(asString, ''), + enabledTokens: asOptional(asArray(asString), []) + }) + )(guiWallet), + ...guiWallet +}) + export type GuiDenomination = EdgeDenomination export type GuiCurrencyInfo = { displayCurrencyCode: string, From 83e6b7fc94d86f9fd1a32070cc0e97499e796b33 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 1 Feb 2022 16:24:26 -0800 Subject: [PATCH 14/50] Upgrade edge-plugin-bity --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8a307e9d0eb..26b42bc16c8 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.8", "edge-login-ui-rn": "^0.9.29", - "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#2bcedc778201f67e425ab17dd19bce7af05e1cff", + "edge-plugin-bity": "https://github.com/EdgeApp/edge-plugin-bity.git#c2e4d320b1863ebad5fb994f5bd03ccd6a0cb9c8", "edge-plugin-simplex": "https://github.com/EdgeApp/edge-plugin-simplex.git#4842daad5fd560cd462f4668ab17c521a16a6cd9", "edge-plugin-wyre": "https://github.com/EdgeApp/edge-plugin-wyre.git#6412ad28462278b84313537f21a53d307633c5d0", "qrcode-generator": "^1.4.4", diff --git a/yarn.lock b/yarn.lock index 87a039a9fd6..5a5418c4e3e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5450,9 +5450,9 @@ edge-login-ui-rn@^0.9.29: sprintf-js "^1.0.3" zxcvbn "^4.4.2" -"edge-plugin-bity@https://github.com/EdgeApp/edge-plugin-bity.git#2bcedc778201f67e425ab17dd19bce7af05e1cff": +"edge-plugin-bity@https://github.com/EdgeApp/edge-plugin-bity.git#c2e4d320b1863ebad5fb994f5bd03ccd6a0cb9c8": version "0.0.1" - resolved "https://github.com/EdgeApp/edge-plugin-bity.git#2bcedc778201f67e425ab17dd19bce7af05e1cff" + resolved "https://github.com/EdgeApp/edge-plugin-bity.git#c2e4d320b1863ebad5fb994f5bd03ccd6a0cb9c8" dependencies: cleaners "^0.3.1" From 71343c82609cb54ca0f8d45144f782df3e8dc2a4 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 1 Feb 2022 17:51:05 -0800 Subject: [PATCH 15/50] Protect against undefined balance This appears to be the only balances reference without a safe backup value --- src/components/modals/FlipInputModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/modals/FlipInputModal.js b/src/components/modals/FlipInputModal.js index 40c42bc182a..285279fe499 100644 --- a/src/components/modals/FlipInputModal.js +++ b/src/components/modals/FlipInputModal.js @@ -353,7 +353,7 @@ export const FlipInputModal = connect( return { // Balances - balanceCrypto: wallet.balances[currencyCode], + balanceCrypto: wallet.balances[currencyCode] ?? '0', // FlipInput flipInputHeaderText: sprintf(s.strings.send_from_wallet, name), From af9ba2ddebb0c1ec01af9db7b0f45aab45f750f7 Mon Sep 17 00:00:00 2001 From: eliran zach Date: Wed, 2 Feb 2022 00:35:35 -0800 Subject: [PATCH 16/50] Upgrade edge-currency-accountbased@^0.11.11 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 26b42bc16c8..bedc24ecfef 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "detox": "^18.10.0", "disklet": "^0.4.5", "edge-core-js": "^0.19.4", - "edge-currency-accountbased": "^0.11.10", + "edge-currency-accountbased": "^0.11.11", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.8", diff --git a/yarn.lock b/yarn.lock index 5a5418c4e3e..2d4e6ebc0f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5347,10 +5347,10 @@ edge-core-js@^0.19.4: yaob "^0.3.7" yavent "^0.1.3" -edge-currency-accountbased@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.11.10.tgz#af7cbcd6b2e5242abf1e05bdb63565a10bd2bf70" - integrity sha512-9CI4Ee6Y+bM3zHG1v+hz8oMtb5qz1Yo/TGbDASiPSypisQEmJbhrWBwKlOW9UhbENRrqtG+Q77BT7dx1jxFiHg== +edge-currency-accountbased@^0.11.11: + version "0.11.11" + resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.11.11.tgz#33974960371902999f2776e56428d47851a129db" + integrity sha512-ryKYyx9rdV3qrefY4/Nz1q/ZU19leesUjzCjKKLmgJPsnOh1SWDkN2zHgbLcdDksLQzcednIK1CmKcRAJ2dO+Q== dependencies: "@binance-chain/javascript-sdk" "^2.14.4" "@ethereumjs/common" "^2.4.0" From b6d1f5e8a463df8bcd065f0fb7d6095657d087e6 Mon Sep 17 00:00:00 2001 From: Github Action Date: Wed, 2 Feb 2022 19:59:07 +0000 Subject: [PATCH 17/50] File sync from EdgeApp/edge-workflows --- .github/workflows/pr-rebase.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-rebase.yml b/.github/workflows/pr-rebase.yml index c75e93c9457..30d950e710c 100644 --- a/.github/workflows/pr-rebase.yml +++ b/.github/workflows/pr-rebase.yml @@ -8,8 +8,9 @@ jobs: if: >- github.event.issue.pull_request != '' && ( - contains(github.event.comment.body, '/rebase') || - contains(github.event.comment.body, '/autosquash') + contains(github.event.comment.body, '/autosquash') || + contains(github.event.comment.body, '/fixup') || + contains(github.event.comment.body, '/rebase') ) runs-on: ubuntu-latest steps: @@ -21,6 +22,6 @@ jobs: - name: Automatic Rebase uses: samholmes/rebase@autosquash with: - autosquash: ${{ contains(github.event.comment.body, '/autosquash') || contains(github.event.comment.body, '/rebase-autosquash') }} + autosquash: ${{ true }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 983e2ab2f621b8d6f06dba86da1c749135beb423 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Feb 2022 19:34:20 -0800 Subject: [PATCH 18/50] Don't try to render a WalletListCurrencyRow if the GuiWallet isn't present --- src/components/themed/WalletListSwipeRow.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/themed/WalletListSwipeRow.js b/src/components/themed/WalletListSwipeRow.js index c4cd1e2724c..f7487c8cc7e 100644 --- a/src/components/themed/WalletListSwipeRow.js +++ b/src/components/themed/WalletListSwipeRow.js @@ -133,6 +133,7 @@ class WalletListSwipeRowComponent extends React.PureComponent Date: Wed, 2 Feb 2022 19:36:19 -0800 Subject: [PATCH 19/50] Render empty row if currencyWallet isn't ready WalletListCurrencyRow will crash if the new currencyWallet isn't created yet --- src/components/themed/WalletList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 59bdb9a5ada..c8f0702ef77 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -244,7 +244,7 @@ class WalletListComponent extends React.PureComponent { } renderRow = (data: FlatListItem, rowMap: { [string]: SwipeRow }) => { - const { isModal, onPress, selectWallet, showSlidingTutorial, wallets } = this.props + const { isModal, onPress, selectWallet, showSlidingTutorial, wallets, account } = this.props // Create Wallet/Token if (data.item.id == null) { @@ -255,7 +255,7 @@ class WalletListComponent extends React.PureComponent { const walletId = data.item.id.replace(/:.*/, '') const guiWallet = wallets[walletId] - if (guiWallet == null) { + if (guiWallet == null || account.currencyWallets[walletId] == null) { const { key, onLongPress } = data.item return } else { From ea293255228c4a884673c39c1e1806f6b77c1b53 Mon Sep 17 00:00:00 2001 From: eliran zach Date: Thu, 3 Feb 2022 02:11:08 -0800 Subject: [PATCH 20/50] Should use 'fullCurrencyCode' and not 'currencyCode' when it's a token wallet --- src/components/themed/WalletList.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 59bdb9a5ada..5d54c40b8f5 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -186,7 +186,7 @@ class WalletListComponent extends React.PureComponent { const fullCurrencyCode = `${currencyCode}-${tokenCode}` const customTokenInfo = currencyNames[tokenCode] ? undefined : customTokens.find(token => token.currencyCode === tokenCode) - if (this.checkFilterWallet({ name, currencyCode, currencyName: customTokenInfo?.currencyName ?? currencyNames[tokenCode] ?? '' })) { + if (this.checkFilterWallet({ name, currencyCode: fullCurrencyCode, currencyName: customTokenInfo?.currencyName ?? currencyNames[tokenCode] ?? '' })) { walletList.push({ id: walletId, fullCurrencyCode: fullCurrencyCode, @@ -221,9 +221,8 @@ class WalletListComponent extends React.PureComponent { for (const currencyInfo of currencyInfos) { for (const metaToken of currencyInfo.metaTokens) { const { currencyCode, currencyName } = metaToken - - if (this.checkFilterWallet({ name: '', currencyCode, currencyName }) && !this.checkFromExistingWallets(walletList, currencyCode)) { - const fullCurrencyCode = `${currencyInfo.currencyCode}-${currencyCode}` + const fullCurrencyCode = `${currencyInfo.currencyCode}-${currencyCode}` + if (this.checkFilterWallet({ name: '', currencyCode: fullCurrencyCode, currencyName }) && !this.checkFromExistingWallets(walletList, currencyCode)) { sortedWalletlist.push({ id: null, fullCurrencyCode, From 5e99c80f292a3592e54eed1a52805288f85fa04e Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 2 Feb 2022 16:33:24 -0800 Subject: [PATCH 21/50] Replace calculateWalletFiatBalanceWithoutState and calculateWalletFiatBalanceUsingDefaultIsoFiat These two functions didn't handle custom tokens. They were replaced with a new function called calculateFiatBalance that accepts an exchange denomination instead of a currency code. --- src/components/themed/WalletList.js | 17 +++++++----- .../themed/WalletListCurrencyRow.js | 4 +-- .../themed/WalletListSortableRow.js | 22 +++++++++------- src/selectors/WalletSelectors.js | 26 +++---------------- 4 files changed, 29 insertions(+), 40 deletions(-) diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index 59bdb9a5ada..e0b0ed59434 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -1,14 +1,14 @@ // @flow -import { type EdgeAccount } from 'edge-core-js' +import { type EdgeAccount, type EdgeDenomination } from 'edge-core-js' import * as React from 'react' import { RefreshControl } from 'react-native' import { SwipeListView, SwipeRow } from 'react-native-swipe-list-view' import { selectWallet } from '../../actions/WalletActions.js' import s from '../../locales/strings' -import { type SettingsState } from '../../reducers/scenes/SettingsReducer.js' -import { calculateWalletFiatBalanceUsingDefaultIsoFiat } from '../../selectors/WalletSelectors.js' +import { getExchangeDenominationFromState } from '../../selectors/DenominationSelectors.js' +import { calculateFiatBalance } from '../../selectors/WalletSelectors.js' import { connect } from '../../types/reactRedux.js' import type { CreateTokenType, CreateWalletType, CustomTokenInfo, FlatListItem, GuiWallet, MostRecentWallet } from '../../types/types.js' import { asSafeDefaultGuiWallet } from '../../types/types.js' @@ -65,12 +65,12 @@ type StateProps = { customTokens: CustomTokenInfo[], exchangeRates: { [string]: string }, mostRecentWallets: MostRecentWallet[], - settings: SettingsState, walletsSort: SortOption, wallets: { [walletId: string]: GuiWallet } } type DispatchProps = { + getExchangeDenomination: (pluginId: string, currencyCode: string) => EdgeDenomination, selectWallet: (walletId: string, currencyCode: string) => void } @@ -79,10 +79,11 @@ type Props = OwnProps & StateProps & DispatchProps & ThemeProps class WalletListComponent extends React.PureComponent { sortWalletList(walletList: WalletListItem[]): WalletListItem[] { const getFiatBalance = (wallet: GuiWallet, fullCurrencyCode: string): number => { - const { account, settings, exchangeRates } = this.props + const { account, exchangeRates, getExchangeDenomination } = this.props const currencyWallet = account.currencyWallets[wallet.id] const currencyCode = getSortOptionsCurrencyCode(fullCurrencyCode) - const fiatBalanceString = calculateWalletFiatBalanceUsingDefaultIsoFiat(currencyWallet, currencyCode, settings, exchangeRates) + const exchangeDenomination = getExchangeDenomination(currencyWallet.currencyInfo.pluginId, currencyCode) + const fiatBalanceString = calculateFiatBalance(currencyWallet, exchangeDenomination, exchangeRates) return parseFloat(fiatBalanceString) } @@ -379,11 +380,13 @@ export const WalletList = connect( exchangeRates: state.exchangeRates, mostRecentWallets: state.ui.settings.mostRecentWallets, walletsSort: state.ui.settings.walletsSort, - settings: state.ui.settings, wallets: state.ui.wallets.byId } }, dispatch => ({ + getExchangeDenomination(pluginId: string, currencyCode: string) { + return dispatch(getExchangeDenominationFromState(pluginId, currencyCode)) + }, selectWallet(walletId: string, currencyCode) { dispatch(selectWallet(walletId, currencyCode, true)) } diff --git a/src/components/themed/WalletListCurrencyRow.js b/src/components/themed/WalletListCurrencyRow.js index c52c07e9dae..3714eeb02dc 100644 --- a/src/components/themed/WalletListCurrencyRow.js +++ b/src/components/themed/WalletListCurrencyRow.js @@ -6,7 +6,7 @@ import * as React from 'react' import { formatNumber } from '../../locales/intl.js' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors.js' -import { calculateWalletFiatBalanceWithoutState } from '../../selectors/WalletSelectors.js' +import { calculateFiatBalance } from '../../selectors/WalletSelectors.js' import { connect } from '../../types/reactRedux.js' import { type GuiExchangeRates, asSafeDefaultGuiWallet } from '../../types/types.js' import { getCryptoAmount, getCurrencyInfo, getDenomFromIsoCode, getFiatSymbol, getYesterdayDateRoundDownHour, zeroString } from '../../util/utils' @@ -192,7 +192,7 @@ export const WalletListCurrencyRow = connect( // Fiat Balance const walletFiatSymbol = getFiatSymbol(guiWallet.isoFiatCurrencyCode) - const fiatBalance = calculateWalletFiatBalanceWithoutState(wallet, currencyCode, exchangeRates) + const fiatBalance = calculateFiatBalance(wallet, exchangeDenomination, exchangeRates) const fiatBalanceFormat = fiatBalance && parseFloat(fiatBalance) > 0.000001 ? fiatBalance : '0' const fiatBalanceSymbol = showBalance && exchangeRate ? walletFiatSymbol : '' const fiatBalanceString = showBalance && exchangeRate ? fiatBalanceFormat : '' diff --git a/src/components/themed/WalletListSortableRow.js b/src/components/themed/WalletListSortableRow.js index c9e6b3710a0..9558bb26ff7 100644 --- a/src/components/themed/WalletListSortableRow.js +++ b/src/components/themed/WalletListSortableRow.js @@ -8,8 +8,8 @@ import FastImage from 'react-native-fast-image' import Ionicon from 'react-native-vector-icons/Ionicons' import { formatNumberInput } from '../../locales/intl.js' -import { getDisplayDenominationFromState } from '../../selectors/DenominationSelectors.js' -import { calculateWalletFiatBalanceWithoutState } from '../../selectors/WalletSelectors.js' +import { getDisplayDenominationFromState, getExchangeDenomination } from '../../selectors/DenominationSelectors.js' +import { calculateFiatBalance } from '../../selectors/WalletSelectors.js' import { connect } from '../../types/reactRedux.js' import { type GuiExchangeRates } from '../../types/types.js' import { getCurrencyIcon } from '../../util/CurrencyInfoHelpers.js' @@ -25,7 +25,8 @@ type OwnProps = { type StateProps = { exchangeRates: GuiExchangeRates, showBalance: boolean, - walletFiatSymbol: string | null + walletFiatSymbol: string | null, + exchangeDenomination: EdgeDenomination | null } type DispatchProps = { @@ -36,12 +37,12 @@ type Props = OwnProps & StateProps & ThemeProps & DispatchProps class WalletListSortableRowComponent extends React.PureComponent { render() { - const { wallet, walletFiatSymbol, exchangeRates, showBalance, theme, getDisplayDenomination } = this.props + const { wallet, walletFiatSymbol, exchangeRates, showBalance, theme, getDisplayDenomination, exchangeDenomination } = this.props // $FlowFixMe react-native-sortable-listview sneakily injects this prop: const { sortHandlers } = this.props const styles = getStyles(theme) - if (wallet == null) { + if (wallet == null || exchangeDenomination == null) { return ( @@ -53,18 +54,18 @@ class WalletListSortableRowComponent extends React.PureComponent { ) } - const displayDenomination = getDisplayDenomination(wallet.currencyInfo.pluginId, wallet.currencyInfo.currencyCode) + const { currencyCode, pluginId } = wallet.currencyInfo + const displayDenomination = getDisplayDenomination(pluginId, currencyCode) const multiplier = displayDenomination.multiplier const name = getWalletName(wallet) const symbol = displayDenomination.symbol - const currencyCode = wallet.currencyInfo.currencyCode const { symbolImageDarkMono } = getCurrencyIcon(currencyCode) const balance = wallet.balances[currencyCode] ?? '0' const preliminaryCryptoAmount = truncateDecimals(bns.div(balance, multiplier, DECIMAL_PRECISION)) const finalCryptoAmount = formatNumberInput(decimalOrZero(preliminaryCryptoAmount, 6)) // make it show zero if infinitesimal number const finalCryptoAmountString = showBalance ? `${symbol || ''} ${finalCryptoAmount}` : '' - const fiatBalance = calculateWalletFiatBalanceWithoutState(wallet, currencyCode, exchangeRates) + const fiatBalance = calculateFiatBalance(wallet, exchangeDenomination, exchangeRates) const fiatBalanceFormat = fiatBalance && parseFloat(fiatBalance) > 0.000001 ? fiatBalance : 0 const fiatBalanceSymbol = showBalance && walletFiatSymbol ? walletFiatSymbol : '' const fiatBalanceString = showBalance ? fiatBalanceFormat : '' @@ -168,7 +169,10 @@ export const WalletListSortableRow = connect ({ showBalance: state.ui.settings.isAccountBalanceVisible, exchangeRates: state.exchangeRates, - walletFiatSymbol: ownProps.wallet ? getFiatSymbol(ownProps.wallet.fiatCurrencyCode) : null + walletFiatSymbol: ownProps.wallet ? getFiatSymbol(ownProps.wallet.fiatCurrencyCode) : null, + exchangeDenomination: ownProps.wallet + ? getExchangeDenomination(state, ownProps.wallet.currencyInfo.pluginId, ownProps.wallet.currencyInfo.currencyCode) + : null }), dispatch => ({ getDisplayDenomination(pluginId: string, currencyCode: string) { diff --git a/src/selectors/WalletSelectors.js b/src/selectors/WalletSelectors.js index a2f7f0529b0..08be7f8baaf 100644 --- a/src/selectors/WalletSelectors.js +++ b/src/selectors/WalletSelectors.js @@ -1,11 +1,10 @@ // @flow import { bns } from 'biggystring' -import { type EdgeCurrencyInfo, type EdgeCurrencyWallet } from 'edge-core-js' +import { type EdgeCurrencyInfo, type EdgeCurrencyWallet, type EdgeDenomination } from 'edge-core-js' import { FIAT_PRECISION } from '../constants/WalletAndCurrencyConstants.js' import { formatNumber } from '../locales/intl.js' -import { type SettingsState } from '../reducers/scenes/SettingsReducer.js' import { getDenominationFromCurrencyInfo } from '../selectors/DenominationSelectors.js' import { type RootState } from '../types/reduxTypes.js' import { type GuiWallet } from '../types/types.js' @@ -73,34 +72,17 @@ export const convertCurrencyFromExchangeRates = ( return convertedAmount } -export const calculateWalletFiatBalanceWithoutState = (wallet: EdgeCurrencyWallet, currencyCode: string, exchangeRates: { [string]: string }): string => { - let fiatValue = '0' // default to zero if not calculable +export const calculateFiatBalance = (wallet: EdgeCurrencyWallet, exchangeDenomination: EdgeDenomination, exchangeRates: { [string]: string }): string => { + const currencyCode = exchangeDenomination.name const nativeBalance = wallet.balances[currencyCode] ?? '0' if (zeroString(nativeBalance)) return '0' - const exchangeDenomination = getDenominationFromCurrencyInfo(wallet.currencyInfo, currencyCode) - if (!exchangeDenomination) return '0' const nativeToExchangeRatio: string = exchangeDenomination.multiplier const cryptoAmount = convertNativeToExchange(nativeToExchangeRatio)(nativeBalance) const { isoFiatCurrencyCode } = getWalletFiat(wallet) - fiatValue = convertCurrencyFromExchangeRates(exchangeRates, currencyCode, isoFiatCurrencyCode, cryptoAmount) + const fiatValue = convertCurrencyFromExchangeRates(exchangeRates, currencyCode, isoFiatCurrencyCode, cryptoAmount) return formatNumber(fiatValue, { toFixed: FIAT_PRECISION }) || '0' } -export const calculateWalletFiatBalanceUsingDefaultIsoFiat = ( - wallet: EdgeCurrencyWallet, - currencyCode: string, - settings: SettingsState, - exchangeRates: { [string]: string } -): string => { - const nativeBalance = wallet.balances[currencyCode] - if (zeroString(nativeBalance)) return '0' - const exchangeDenomination = getDenominationFromCurrencyInfo(wallet.currencyInfo, currencyCode) - if (!exchangeDenomination) return '0' - const nativeToExchangeRatio: string = exchangeDenomination.multiplier - const cryptoAmount = convertNativeToExchange(nativeToExchangeRatio)(nativeBalance) - return convertCurrencyFromExchangeRates(exchangeRates, currencyCode, settings.defaultIsoFiat, cryptoAmount) || '0' -} - export const convertNativeToExchangeRateDenomination = (currencyInfo: EdgeCurrencyInfo, currencyCode: string, nativeAmount: string): string => { const exchangeDenomination = getDenominationFromCurrencyInfo(currencyInfo, currencyCode) if (!exchangeDenomination || zeroString(nativeAmount)) return '0' From 86a801b7a1f5ef9c7944f56e5bbb6eaa1f4dc4aa Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Mon, 31 Jan 2022 18:32:24 -0800 Subject: [PATCH 22/50] Update error strings --- src/locales/en_US.js | 5 +++-- src/locales/strings/enUS.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/locales/en_US.js b/src/locales/en_US.js index b0eed4cc811..f6dcdd05d92 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -32,11 +32,12 @@ const strings = { error_bitpay_empty_output_invoice: 'Received no output in payment request', error_bitpay_empty_verification_hex_req: 'Generated empty transaction hex(es)', - error_bitpay_invalid_payment_option: 'BitPay invoice does not support this currency. Supported currencies: %s', + error_bitpay_currency_not_supported: 'BitPay invoice payments in %s not currently supported. Please choose another payment currency.', + error_bitpay_invalid_payment_option: 'BitPay invoice does not accept this currency. Accepted currencies: %s', error_bitpay_fetch: 'BitPay %s fetch error (%s)%s', error_bitpay_multi_output_invoice: 'Multiple outputs found in payment request', error_bitpay_multi_tx_invoice: 'Multiple transactions found in payment request', - error_bitpay_no_payment_option: 'No currencies available for this BitPay invoice. Supported currencies: %s', + error_bitpay_no_payment_option: 'No currencies available for this BitPay invoice. Accepted currencies: %s', error_bitpay_tx_verification_failed: 'BitPay transaction verification mismatch', // Warning messages: diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 16d615c2265..adf72cf1f49 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -24,11 +24,12 @@ "error_token_exists": "A currency named %s already exists", "error_bitpay_empty_output_invoice": "Received no output in payment request", "error_bitpay_empty_verification_hex_req": "Generated empty transaction hex(es)", - "error_bitpay_invalid_payment_option": "BitPay invoice does not support this currency. Supported currencies: %s", + "error_bitpay_currency_not_supported": "BitPay invoice payments in %s not currently supported. Please choose another payment currency.", + "error_bitpay_invalid_payment_option": "BitPay invoice does not accept this currency. Accepted currencies: %s", "error_bitpay_fetch": "BitPay %s fetch error (%s)%s", "error_bitpay_multi_output_invoice": "Multiple outputs found in payment request", "error_bitpay_multi_tx_invoice": "Multiple transactions found in payment request", - "error_bitpay_no_payment_option": "No currencies available for this BitPay invoice. Supported currencies: %s", + "error_bitpay_no_payment_option": "No currencies available for this BitPay invoice. Accepted currencies: %s", "error_bitpay_tx_verification_failed": "BitPay transaction verification mismatch", "warning_low_fee_selected": "Low Fee Selected", "warning_custom_fee_selected": "Custom Fee Selected", From 006ed7f2ee90d363fce8711f22c5eed91bcfbaed Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Mon, 31 Jan 2022 18:34:17 -0800 Subject: [PATCH 23/50] Fix detection of no available payment wallets Properly detect the condition where the user does not have any wallets that can satisfy the BitPay invoice Disallow paying BitPay invoices with ETH --- src/actions/BitPayActions.js | 21 ++++++++++++--------- src/components/themed/AddressTile.js | 8 +++++++- src/constants/WalletAndCurrencyConstants.js | 2 +- src/types/BitPayError.js | 3 +++ 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/actions/BitPayActions.js b/src/actions/BitPayActions.js index 5062c96ea8e..b6d43264db2 100644 --- a/src/actions/BitPayActions.js +++ b/src/actions/BitPayActions.js @@ -75,7 +75,7 @@ export async function launchBitPay( const optionsResponse = asBpOptionsResponse(responseJson) const paymentId = optionsResponse.paymentId const options = optionsResponse.paymentOptions - const isTestBp = uri.includes('test.bitpay.com') + const isTestBp = uri.toLowerCase().includes('test.bitpay.com') const paymentCurrencies: string[] = options .map(po => po.currency) .filter(currency => { @@ -90,23 +90,26 @@ export async function launchBitPay( // Select payment wallet, if this wasn't called directly from a wallet's // send scene - let selectedWallet, currencyCode + let selectedWallet, selectedCurrencyCode if (params.wallet) { // Ensure the core wallet is accepted by this invoice as a payment option - currencyCode = params.wallet.currencyInfo.currencyCode - if (!paymentCurrencies.includes(currencyCode)) { + selectedCurrencyCode = params.wallet.currencyInfo.currencyCode + if (!paymentCurrencies.includes(selectedCurrencyCode)) { throw new BitPayError(BitPayErrorCode.InvalidPaymentOption, { text: paymentCurrencies.join(', ') }) } selectedWallet = params.wallet } else { // Check if user owns any wallets that are accepted by the invoice - if (paymentCurrencies.length === 0) { + const { currencyWallets = {} } = params + const matchingWallets: string[] = Object.keys(currencyWallets).filter(key => paymentCurrencies.includes(currencyWallets[key].currencyInfo.currencyCode)) + if (matchingWallets.length === 0) { throw new BitPayError(BitPayErrorCode.NoPaymentOption, { text: paymentCurrencies.join(', ') }) } else { const walletListResult = await Airship.show(bridge => ( )) const { walletId, currencyCode } = walletListResult + selectedCurrencyCode = currencyCode if (!walletId || !currencyCode || !params.currencyWallets) { // No wallet selected return @@ -118,7 +121,7 @@ export async function launchBitPay( if (selectedWallet == null) return // Normalize our test BTC currency code with BitPay Testnet's expectation - const requestCurrencyCode = isTestBp && currencyCode === 'TESTBTC' ? 'BTC' : currencyCode + const requestCurrencyCode = isTestBp && selectedCurrencyCode === 'TESTBTC' ? 'BTC' : selectedCurrencyCode // Fetch the invoice (payment-request) instructions const initOpts = { @@ -149,7 +152,7 @@ export async function launchBitPay( // Make the spend to generate the tx hexes const requiredFeeRate = invoiceInstruction.requiredFeeRate const spendInfo: EdgeSpendInfo = { - currencyCode, + selectedCurrencyCode, spendTargets: [ { nativeAmount: instructionOutput.amount.toString(), @@ -203,7 +206,7 @@ export async function launchBitPay( // fees into customNetworkFee. const spendTarget = spendInfo.spendTargets[0] const guiMakeSpendInfo = { - currencyCode, + selectedCurrencyCode, nativeAmount: spendTarget.nativeAmount, publicAddress: spendTarget.publicAddress, networkFeeOption: 'custom', @@ -224,7 +227,7 @@ export async function launchBitPay( Actions.push('send', { guiMakeSpendInfo, selectedWalletId: selectedWallet.id, - selectedCurrencyCode: currencyCode + selectedCurrencyCode }) } diff --git a/src/components/themed/AddressTile.js b/src/components/themed/AddressTile.js index 9f56969f5f5..42088fce92e 100644 --- a/src/components/themed/AddressTile.js +++ b/src/components/themed/AddressTile.js @@ -12,8 +12,10 @@ import { addressWarnings } from '../../actions/ScanActions.js' import { CURRENCY_PLUGIN_NAMES } from '../../constants/WalletAndCurrencyConstants' import s from '../../locales/strings.js' import { checkPubAddress } from '../../modules/FioAddress/util' +import { BitPayError, BitPayErrorCode } from '../../types/BitPayError.js' import { connect } from '../../types/reactRedux.js' import { type GuiMakeSpendInfo } from '../../types/types.js' +import { parseDeepLink } from '../../util/DeepLinkParser.js' import { AddressModal } from '../modals/AddressModal' import { ScanModal } from '../modals/ScanModal.js' import { Airship, showError } from '../services/AirshipInstance' @@ -121,7 +123,11 @@ class AddressTileComponent extends React.PureComponent { // set address onChangeAddress({ fioAddress, isSendUsingFioAddress: !!fioAddress }, parsedUri) } catch (e) { - showError(`${s.strings.scan_invalid_address_error_title} ${s.strings.scan_invalid_address_error_description}`) + const currencyInfo = coreWallet.currencyInfo + const ercTokenStandard = currencyInfo.defaultSettings?.otherSettings ?? '' + if (ercTokenStandard === 'ERC20' && parseDeepLink(address).type === 'bitPay') + showError(new BitPayError(BitPayErrorCode.CurrencyNotSupported, { text: currencyInfo.currencyCode })) + else showError(`${s.strings.scan_invalid_address_error_title} ${s.strings.scan_invalid_address_error_description}`) this.setState({ loading: false }) } } diff --git a/src/constants/WalletAndCurrencyConstants.js b/src/constants/WalletAndCurrencyConstants.js index 2009eb66e8f..dc7c08d6831 100644 --- a/src/constants/WalletAndCurrencyConstants.js +++ b/src/constants/WalletAndCurrencyConstants.js @@ -368,7 +368,7 @@ export const SPECIAL_CURRENCY_INFO: { }, isCustomTokensSupported: true, isRbfSupported: true, - isBitPayProtocolSupported: true + isBitPayProtocolSupported: false }, ETC: { dummyPublicAddress: '0x0d73358506663d484945ba85d0cd435ad610b0a0', diff --git a/src/types/BitPayError.js b/src/types/BitPayError.js index 025a03c1c14..66af2bf6f1a 100644 --- a/src/types/BitPayError.js +++ b/src/types/BitPayError.js @@ -16,6 +16,7 @@ type BitPayErrorOptions = { type BitPayErrorHandler = (error: BitPayErrorOptions) => string export const BitPayErrorCode = { + CurrencyNotSupported: 'CurrencyNotSupported', EmptyOutputInvoice: 'EmptyOutputInvoice', EmptyVerificationHexReq: 'EmptyVerificationHexReq', FetchFailed: 'FetchFailed', @@ -31,6 +32,7 @@ export const BitPayErrorCode = { * Internal Mapping object from BitPayErrorCode to a BitPayErrorHandler */ const HandlersByCode = { + [BitPayErrorCode.CurrencyNotSupported]: (params: { text: string }) => sprintf(s.strings.error_bitpay_currency_not_supported, params.text), [BitPayErrorCode.EmptyOutputInvoice]: () => s.strings.error_bitpay_empty_output_invoice, [BitPayErrorCode.EmptyVerificationHexReq]: () => s.strings.error_bitpay_empty_verification_hex_req, [BitPayErrorCode.FetchFailed]: (params: { header: string, statusCode: string, text?: string }) => @@ -45,6 +47,7 @@ const HandlersByCode = { /** * BitPay Error class is designed to control every error being thrown by BitPay * @param code - Error Code + * - CurrencyNotSupported - The invoice only wants coins the app doesn't support. * - EmptyOutputInvoice - Invoice response contained no target output * - EmptyVerificationHexReq - No hex strings generated for verification request * - FetchFailed - Fetch returned status other than 200 From 58dc3656484362f9770e30bbc2af7fdd4caef9ae Mon Sep 17 00:00:00 2001 From: eliran zach Date: Thu, 3 Feb 2022 05:55:06 -0800 Subject: [PATCH 24/50] Prevent currencies that needs activation from being created from the wallet list modal --- src/components/modals/WalletListModal.js | 6 ++++-- src/components/scenes/CryptoExchangeScene.js | 4 +++- src/components/themed/WalletList.js | 8 ++++++-- src/util/CurrencyInfoHelpers.js | 11 ++++++++--- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/modals/WalletListModal.js b/src/components/modals/WalletListModal.js index 26159fa47f9..60c019aa18e 100644 --- a/src/components/modals/WalletListModal.js +++ b/src/components/modals/WalletListModal.js @@ -20,7 +20,8 @@ type OwnProps = { showCreateWallet?: boolean, excludeWalletIds?: string[], allowedCurrencyCodes?: string[], - excludeCurrencyCodes?: string[] + excludeCurrencyCodes?: string[], + filterActivation?: boolean } type State = { @@ -47,7 +48,7 @@ export class WalletListModal extends React.PureComponent { handleClearText = () => this.setState({ search: '' }) render() { - const { bridge, excludeWalletIds, allowedCurrencyCodes, excludeCurrencyCodes, showCreateWallet, headerTitle } = this.props + const { bridge, excludeWalletIds, allowedCurrencyCodes, excludeCurrencyCodes, showCreateWallet, headerTitle, filterActivation } = this.props const { search, searching } = this.state return ( bridge.resolve({})}> @@ -71,6 +72,7 @@ export class WalletListModal extends React.PureComponent { excludeCurrencyCodes={excludeCurrencyCodes} searchText={search} searching={searching} + filterActivation={filterActivation} isModal /> bridge.resolve({})} /> diff --git a/src/components/scenes/CryptoExchangeScene.js b/src/components/scenes/CryptoExchangeScene.js index 41915fe20f3..72fb3d50a0a 100644 --- a/src/components/scenes/CryptoExchangeScene.js +++ b/src/components/scenes/CryptoExchangeScene.js @@ -79,7 +79,8 @@ type State = { toAmountNative: string } -const disabledCurrencyCodes = Object.keys(SPECIAL_CURRENCY_INFO).filter(code => !!SPECIAL_CURRENCY_INFO[code].keysOnlyMode) +// Prevent currencies that are "watch only" from being allowed to exchange +const disabledCurrencyCodes = Object.keys(SPECIAL_CURRENCY_INFO).filter(code => SPECIAL_CURRENCY_INFO[code].keysOnlyMode ?? false) const defaultFromWalletInfo = { fromCurrencyCode: '', @@ -243,6 +244,7 @@ class CryptoExchangeComponent extends React.Component { headerTitle={whichWallet === 'to' ? s.strings.select_recv_wallet : s.strings.select_src_wallet} showCreateWallet={whichWallet === 'to'} excludeCurrencyCodes={whichWallet === 'to' ? disabledCurrencyCodes : []} + filterActivation /> )).then(({ walletId, currencyCode }: WalletListResult) => { if (walletId != null && currencyCode != null) { diff --git a/src/components/themed/WalletList.js b/src/components/themed/WalletList.js index e92a7b08cc2..8084b56ed1c 100644 --- a/src/components/themed/WalletList.js +++ b/src/components/themed/WalletList.js @@ -55,6 +55,7 @@ type OwnProps = { excludeCurrencyCodes?: string[], activateSearch?: () => void, showSlidingTutorial?: boolean, + filterActivation?: boolean, isModal?: boolean, onPress?: (walletId: string, currencyCode: string) => void } @@ -140,7 +141,7 @@ class WalletListComponent extends React.PureComponent { } getWalletList(): WalletListItem[] { - const { activeWalletIds, account, excludeWalletIds, isModal, searching, showCreateWallet, wallets } = this.props + const { activeWalletIds, account, excludeWalletIds, isModal, searching, showCreateWallet, wallets, filterActivation } = this.props const walletList = [] for (const walletId of activeWalletIds) { @@ -203,7 +204,7 @@ class WalletListComponent extends React.PureComponent { if (showCreateWallet) { // Initialize Create Wallets - const createWalletCurrencies = getCreateWalletTypes(account) + const createWalletCurrencies = getCreateWalletTypes(account, filterActivation) for (const createWalletCurrency of createWalletCurrencies) { const { currencyCode, currencyName } = createWalletCurrency @@ -222,7 +223,10 @@ class WalletListComponent extends React.PureComponent { for (const currencyInfo of currencyInfos) { for (const metaToken of currencyInfo.metaTokens) { const { currencyCode, currencyName } = metaToken + // Fix for when the token code and chain code are the same (like EOS/TLOS) + if (currencyCode === currencyInfo.currencyCode) continue const fullCurrencyCode = `${currencyInfo.currencyCode}-${currencyCode}` + if (this.checkFilterWallet({ name: '', currencyCode: fullCurrencyCode, currencyName }) && !this.checkFromExistingWallets(walletList, currencyCode)) { sortedWalletlist.push({ id: null, diff --git a/src/util/CurrencyInfoHelpers.js b/src/util/CurrencyInfoHelpers.js index 00c41d1c456..dde1bf6c2f6 100644 --- a/src/util/CurrencyInfoHelpers.js +++ b/src/util/CurrencyInfoHelpers.js @@ -2,7 +2,7 @@ import { type EdgeAccount, type EdgeCurrencyInfo } from 'edge-core-js' -import { IMAGE_SERVER_URL, WALLET_TYPE_ORDER } from '../constants/WalletAndCurrencyConstants.js' +import { IMAGE_SERVER_URL, SPECIAL_CURRENCY_INFO, WALLET_TYPE_ORDER } from '../constants/WalletAndCurrencyConstants.js' import { type CreateWalletType } from '../types/types.js' /** @@ -14,6 +14,8 @@ type CurrencyIcons = { symbolImageDarkMono: string } +const activationRequiredCurrencyCodes = Object.keys(SPECIAL_CURRENCY_INFO).filter(code => SPECIAL_CURRENCY_INFO[code].isAccountActivationRequired ?? false) + export function getCurrencyIcon(chainCode: string, currencyCode: string = chainCode): CurrencyIcons { const url = `${IMAGE_SERVER_URL}/${chainCode}/${currencyCode}` return { @@ -69,13 +71,16 @@ export function makeCreateWalletType(currencyInfo: EdgeCurrencyInfo): CreateWall /** * Grab a list of wallet types for the wallet creation scenes. */ -export function getCreateWalletTypes(account: EdgeAccount): CreateWalletType[] { +export function getCreateWalletTypes(account: EdgeAccount, filterActivation: boolean = false): CreateWalletType[] { const infos = sortCurrencyInfos(getCurrencyInfos(account)) const out: CreateWalletType[] = [] for (const currencyInfo of infos) { const { currencyCode } = currencyInfo - if (currencyInfo.pluginId === 'fio' && global.isFioDisabled) continue // FIO disable changes + // Prevent currencies that needs activation from being created from a modal + if (filterActivation && activationRequiredCurrencyCodes.includes(currencyCode.toUpperCase())) continue + // FIO disable changes + if (currencyInfo.pluginId === 'fio' && global.isFioDisabled) continue if (currencyInfo.pluginId === 'bitcoin') { out.push({ currencyName: 'Bitcoin (Segwit)', From c1736b98f1491ff835f75d7f6ab3e26932280196 Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 3 Feb 2022 15:56:22 +0200 Subject: [PATCH 25/50] Fix denomination for fio request list items --- src/components/scenes/FioRequestListScene.js | 5 +++-- src/modules/FioRequest/components/FioRequestRow.js | 13 ++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/scenes/FioRequestListScene.js b/src/components/scenes/FioRequestListScene.js index cb3cace66ec..941272d9849 100644 --- a/src/components/scenes/FioRequestListScene.js +++ b/src/components/scenes/FioRequestListScene.js @@ -388,12 +388,13 @@ class FioRequestList extends React.Component { const { fioWallets = [], currencyWallets, navigation, getExchangeDenomination } = this.props const fioWalletByAddress = fioWallets.find(wallet => wallet.id === pendingRequest.fioWalletId) || null if (!fioWalletByAddress) return showError(s.strings.fio_wallet_missing_for_fio_address) - const exchangeDenomination = getExchangeDenomination(fioWalletByAddress.currencyInfo.pluginId, pendingRequest.content.token_code.toUpperCase()) + const currencyWallet = currencyWallets[walletId] + const exchangeDenomination = getExchangeDenomination(currencyWallet.currencyInfo.pluginId, pendingRequest.content.token_code.toUpperCase()) let nativeAmount = bns.mul(pendingRequest.content.amount, exchangeDenomination.multiplier) nativeAmount = bns.toFixed(nativeAmount, 0, 0) const currencyCode = pendingRequest.content.token_code.toUpperCase() - const parsedUri = await currencyWallets[walletId].parseUri(pendingRequest.content.payee_public_address, currencyCode) + const parsedUri = await currencyWallet.parseUri(pendingRequest.content.payee_public_address, currencyCode) const guiMakeSpendInfo = { fioPendingRequest: pendingRequest, fioAddress: pendingRequest.payee_fio_address, diff --git a/src/modules/FioRequest/components/FioRequestRow.js b/src/modules/FioRequest/components/FioRequestRow.js index 04876436b8f..b6a2e00671f 100644 --- a/src/modules/FioRequest/components/FioRequestRow.js +++ b/src/modules/FioRequest/components/FioRequestRow.js @@ -12,7 +12,7 @@ import { EdgeText } from '../../../components/themed/EdgeText' import { formatNumber, formatTime } from '../../../locales/intl.js' import s from '../../../locales/strings' import { getDisplayDenomination } from '../../../selectors/DenominationSelectors.js' -import { getSelectedCurrencyWallet, getSelectedWallet } from '../../../selectors/WalletSelectors.js' +import { getSelectedWallet } from '../../../selectors/WalletSelectors.js' import { connect } from '../../../types/reactRedux.js' import { type FioRequest, type GuiWallet } from '../../../types/types' import { getFiatSymbol } from '../../../util/utils' @@ -174,10 +174,17 @@ export const FioRequestRowConnector = connect( fiatAmount: '' } } - const currencyWallet = getSelectedCurrencyWallet(state) const tokenCode = fioRequest.content.token_code.toUpperCase() try { - displayDenomination = getDisplayDenomination(state, currencyWallet.currencyInfo.pluginId, tokenCode) + const { allCurrencyInfos } = state.ui.settings.plugins + const plugin = allCurrencyInfos.find(plugin => { + const { currencyCode: pluginCurrencyCode } = plugin + if (pluginCurrencyCode == null) return false + return pluginCurrencyCode.toUpperCase() === fioRequest.content.chain_code.toUpperCase() + }) + + if (plugin == null) throw new Error(`No plugin match for this chain code - ${fioRequest.content.chain_code.toUpperCase()}`) + displayDenomination = getDisplayDenomination(state, plugin.pluginId, tokenCode) } catch (e) { console.log('No denomination for this Token Code -', tokenCode) } From ca648b37b6fb9b8f49f4176a374333d12e8cd24c Mon Sep 17 00:00:00 2001 From: andreyvEze Date: Thu, 3 Feb 2022 16:04:14 +0200 Subject: [PATCH 26/50] Fix denomination on fio request confirmation --- src/components/scenes/FioRequestConfirmationScene.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/scenes/FioRequestConfirmationScene.js b/src/components/scenes/FioRequestConfirmationScene.js index 12c73476dac..1295a47e189 100644 --- a/src/components/scenes/FioRequestConfirmationScene.js +++ b/src/components/scenes/FioRequestConfirmationScene.js @@ -12,7 +12,7 @@ import { addToFioAddressCache, checkPubAddress, getRemainingBundles } from '../. import { Slider } from '../../modules/UI/components/Slider/Slider' import type { CcWalletMap } from '../../reducers/FioReducer' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors.js' -import { getExchangeRate, getSelectedWallet } from '../../selectors/WalletSelectors.js' +import { getExchangeRate, getSelectedCurrencyWallet, getSelectedWallet } from '../../selectors/WalletSelectors' import { connect } from '../../types/reactRedux.js' import { type NavigationProp, type RouteProp } from '../../types/routerTypes.js' import type { GuiCurrencyInfo, GuiDenomination, GuiWallet } from '../../types/types' @@ -317,6 +317,7 @@ const getStyles = cacheStyles((theme: Theme) => ({ export const FioRequestConfirmationScene = connect( state => { const guiWallet: GuiWallet = getSelectedWallet(state) + const selectedWallet: EdgeCurrencyWallet = getSelectedCurrencyWallet(state) const { account } = state.core const currencyCode: string = state.ui.wallets.selectedCurrencyCode const fioWallets: EdgeCurrencyWallet[] = state.ui.wallets.fioWallets @@ -339,8 +340,8 @@ export const FioRequestConfirmationScene = connect( } } - const primaryDisplayDenomination: GuiDenomination = getDisplayDenomination(state, fioWallets[0].currencyInfo.pluginId, currencyCode) - const primaryExchangeDenomination: GuiDenomination = getExchangeDenomination(state, fioWallets[0].currencyInfo.pluginId, currencyCode) + const primaryDisplayDenomination: GuiDenomination = getDisplayDenomination(state, selectedWallet.currencyInfo.pluginId, currencyCode) + const primaryExchangeDenomination: GuiDenomination = getExchangeDenomination(state, selectedWallet.currencyInfo.pluginId, currencyCode) const secondaryExchangeDenomination: GuiDenomination = getDenomFromIsoCode(guiWallet.fiatCurrencyCode) const secondaryDisplayDenomination: GuiDenomination = secondaryExchangeDenomination const primaryExchangeCurrencyCode: string = primaryExchangeDenomination.name From 79110e1972a4ee111b4a6c0f78c7b2e14e3e6a98 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 3 Feb 2022 07:52:31 -0800 Subject: [PATCH 27/50] Update Changelog --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e9a80fde6..23f87e1b378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # edge-react-gui +## 2.10.0 (2022-02-03) + +- FIO: Add staking support +- Add many new AVAX, MATIC, and FTM tokens +- Transak: Reenable India support +- Add support for Bitpay JSON Payment Protocol v2 +- Fix max send for tokens +- Disable activation-needed currencies from being created in Exchange scene +- Fix Advanced transaction details device description +- Fix race conditions in ManageTokensScene and Create wallet flow +- Organize currency settings by pluginId +- Consolidate denomination selectors +- Allow archiving of broken wallets +- Various visual fixes +- Upgrade edge-core-js v0.19.4 + - added: EdgeCurrencyWallet.stakingStatus, along with matching engine methods for returning and updating this. + - fixed: Removed unnecessary C++ compiler flags. + - fix: Correctly select swaps with the best price. + - fix: Correctly prefer swap plugins with active promo codes. + - changed: Add more logging to the swap procedure. + - fix: Only write the deviceDescription on sent transactions. + - fix: Add a native requiresMainQueueSetup method to silence a warning on iOS +- Upgrade edge-currency-accountbased to v0.11.11 + - FIO: Add edge-core-js staking API support + - FIO: Fix bugs with unlock dates + - FIO: Fix bug by removing zero-amount transactions for staking actions + - Add ETH, FTM, MATIC and AVAX EVM-based tokens + - Initialize walletLocalData balance when enabling tokens + - ZEC: Enable max spend + - ZEC: Update checkpoints + - Miscellaneous cleanups: improve logging, general refactoring and removal of dead code +- Upgrade edge-exchange-plugins to v0.12.8 + - Coingecko: Add new tokens + - Coingecko: Fix BNT unique ID + - Add constant rates for AVAX wrapped tokens + ## 2.9.0 (2022-01-14) - Add Avalanche (AVAX) C-Chain support From da83b0d6562a9bb1e44b9b1dd321c01670da0441 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Wed, 2 Feb 2022 23:34:10 -0800 Subject: [PATCH 28/50] Upgrade to redux-flipper v2.0.1 The v1 plugin is no longer available in the Flipper UI, so we need to update the app-side code to match v2. --- ios/Podfile.lock | 4 ++-- package.json | 4 ++-- yarn.lock | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e39c5187fed..91ff22db8c0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -414,7 +414,7 @@ PODS: - react-native-fast-crypto (2.0.0): - OpenSSL-Universal - React - - react-native-flipper (0.87.0): + - react-native-flipper (0.131.1): - React-Core - react-native-image-picker (4.0.6): - React-Core @@ -1037,7 +1037,7 @@ SPEC CHECKSUMS: react-native-camera: b322bc25f47536219473c6d00c666d221f7f2695 react-native-contacts: 493b583e87eb9cb1ab09268e89e526baf1a7cb30 react-native-fast-crypto: b6dea8324fb1b095dd4f29a80356b43acb3ee2e9 - react-native-flipper: a5770950f79017f17f50b316cb74b66d14192c79 + react-native-flipper: 8d0ada062fbc2c7460cc0d343aded6fc3f9c90dc react-native-image-picker: a6e56460d34905c849ada551db30897dc7f3d535 react-native-mail: 8fdcd3aef007c33a6877a18eb4cf7447a1d4ce4a react-native-mymonero-core: c5e0e039b4977be65ed936a1d5301da3448edff7 diff --git a/package.json b/package.json index bedc24ecfef..4b5913af824 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "react-native-extra-dimensions-android": "^1.2.5", "react-native-fast-crypto": "^2.0.0", "react-native-fast-image": "^8.3.7", - "react-native-flipper": "^0.87.0", + "react-native-flipper": "^0.131.1", "react-native-fs": "https://github.com/EdgeApp/react-native-fs.git#edge/removeEncoding", "react-native-gesture-handler": "^1.10.3", "react-native-image-picker": "^4.0.6", @@ -155,7 +155,7 @@ "react-native-zcash": "^0.2.0", "react-redux": "^7.2.4", "redux": "^4.1.0", - "redux-flipper": "^1.4.2", + "redux-flipper": "^2.0.1", "redux-thunk": "^2.3.0", "rn-qr-generator": "^1.1.7", "sprintf-js": "^1.1.1", diff --git a/yarn.lock b/yarn.lock index 2d4e6ebc0f2..7eee1e97d15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11248,10 +11248,10 @@ react-native-fast-image@^8.3.7: resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-8.3.7.tgz#c4877de17903101f6d94b6736a4f7e5d7b019224" integrity sha512-J++Ad04PTUe4YgjyGv63gfgV8Fz1gZKAgQHpblf8Z87D9dxfc8UfXHTPv9VLGdTJU4IzdTnQqzoFgDtWdsvBsQ== -react-native-flipper@^0.87.0: - version "0.87.0" - resolved "https://registry.yarnpkg.com/react-native-flipper/-/react-native-flipper-0.87.0.tgz#7442994a5dd3fadd64b78293835af36bcf7fa891" - integrity sha512-WCi0j/4gRxYbEizVHN9kNWKx7m/sBajxXXhhTQBmhNLywSData+za62e5XtTGTnHoS8bDC5ev65PKAA7ncM9Lg== +react-native-flipper@^0.131.1: + version "0.131.1" + resolved "https://registry.yarnpkg.com/react-native-flipper/-/react-native-flipper-0.131.1.tgz#b1a43e40a442187fa78c5ed6d478471ff4a2686c" + integrity sha512-X65VbZgwVRVYAc3OBdHi0h8dJR/Mgxdg8WoQLGgaYyhHcaqsF06GjOzBJLwNjN3TK5Gih228IFqLqI9Rwl2dEA== "react-native-fs@https://github.com/EdgeApp/react-native-fs.git#edge/removeEncoding": version "2.13.3" @@ -11707,10 +11707,10 @@ rechoir@^0.7.0: dependencies: resolve "^1.9.0" -redux-flipper@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/redux-flipper/-/redux-flipper-1.4.2.tgz#da765a675136e9893a002730703ec58d2f0e359b" - integrity sha512-VfSdmWATaZD2BHAiMOEzxk+KSiSTAv/N5AyY64+dU+qif/KfinSHWW3+YVMCO+5rxne1Fr92YwsYJl8l9injDA== +redux-flipper@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/redux-flipper/-/redux-flipper-2.0.1.tgz#a43603a13e6f06a48c627ae7c144579bd4f1fa54" + integrity sha512-JqgnL+fUp3h2fPQRszItLkarTbIf5gjU4Sn0IY/ZxUo6oUUmMh4Lx2J7BBy78cE8KEW9prRRpvJ6NH2uc/QktA== dependencies: cycle "^1.0.3" dayjs "^1.8.29" From 7c95636d6180f836ff6cfc28e010808af6680031 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 3 Feb 2022 16:26:08 -0800 Subject: [PATCH 29/50] Add formatTimeDate method --- src/locales/intl.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/locales/intl.js b/src/locales/intl.js index e1c11f78cf3..5ee45b5ca13 100644 --- a/src/locales/intl.js +++ b/src/locales/intl.js @@ -195,7 +195,7 @@ export function formatDate(date: Date, monthShort: boolean = false): string { } /** - * Returns time string depending on locale + * Returns h:mm am/pm time string depending on locale */ export function formatTime(date: Date): string { try { @@ -206,6 +206,13 @@ export function formatTime(date: Date): string { return format(date, 'h:mm bb') } +/** + * Returns 'h:mm am/pm, date' string depending on locale. + */ +export function formatTimeDate(date: Date, monthShort: boolean = false): string { + return `${formatTime(date)}, ${formatDate(date, monthShort)}` +} + export function setIntlLocale(l: IntlLocaleType): void { if (!l) throw new Error('Please select locale for internationalization') From 8df5fe9ea2c7608352c09de32212b7ced740292f Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 3 Feb 2022 16:27:13 -0800 Subject: [PATCH 30/50] Update StakingOverviewScene to show time in addition to date --- src/components/scenes/StakingOverviewScene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/scenes/StakingOverviewScene.js b/src/components/scenes/StakingOverviewScene.js index a1fcf2ddcfc..f6f5d9e96a2 100644 --- a/src/components/scenes/StakingOverviewScene.js +++ b/src/components/scenes/StakingOverviewScene.js @@ -9,7 +9,7 @@ import { sprintf } from 'sprintf-js' import { refreshAllFioAddresses } from '../../actions/FioAddressActions' import fioLogo from '../../assets/images/fio/fio_logo.png' import { STAKING_BALANCES } from '../../constants/WalletAndCurrencyConstants' -import { formatDate, formatNumber } from '../../locales/intl' +import { formatNumber, formatTimeDate } from '../../locales/intl' import s from '../../locales/strings.js' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' import { convertCurrency } from '../../selectors/WalletSelectors' @@ -83,7 +83,7 @@ export const StakingOverviewSceneComponent = (props: Props) => { // $FlowFixMe Flow does not understand that unlockDate here can't be undefined id: new Date(unlockDate).toDateString(), // $FlowFixMe Flow does not understand that unlockDate here can't be undefined - title: sprintf(s.strings.staking_locked_title, formatDate(new Date(unlockDate), true)), + title: sprintf(s.strings.staking_locked_title, formatTimeDate(new Date(unlockDate), true)), amount: formatNumber(bns.add(convertNativeToDenomination(currencyDenomination.multiplier)(nativeAmount), '0')) })) ) From b77b8643c34f4737063761797b8483d9321ea468 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 3 Feb 2022 16:29:18 -0800 Subject: [PATCH 31/50] Update StakingChangeScene to show time in addition to date --- src/components/scenes/StakingChangeScene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/scenes/StakingChangeScene.js b/src/components/scenes/StakingChangeScene.js index 07c7f7f5478..dc825daeba5 100644 --- a/src/components/scenes/StakingChangeScene.js +++ b/src/components/scenes/StakingChangeScene.js @@ -10,7 +10,7 @@ import { sprintf } from 'sprintf-js' import { refreshAllFioAddresses } from '../../actions/FioAddressActions' import fioLogo from '../../assets/images/fio/fio_logo.png' import { CURRENCY_PLUGIN_NAMES, SPECIAL_CURRENCY_INFO, STAKING_BALANCES } from '../../constants/WalletAndCurrencyConstants' -import { formatDate, formatNumber } from '../../locales/intl' +import { formatNumber, formatTimeDate } from '../../locales/intl' import s from '../../locales/strings.js' import { Slider } from '../../modules/UI/components/Slider/Slider' import { getDisplayDenomination, getExchangeDenomination } from '../../selectors/DenominationSelectors' @@ -261,7 +261,7 @@ export const StakingChangeSceneComponent = (props: Props) => { if (SPECIAL_CURRENCY_INFO[currencyCode].stakeLockPeriod != null) { const DAY_INTERVAL = 1000 * 60 * 60 * 24 const beginingOfGmtDay = Math.floor(Date.now() / DAY_INTERVAL) * DAY_INTERVAL - unlockDate = formatDate(new Date(beginingOfGmtDay + SPECIAL_CURRENCY_INFO[currencyCode].stakeLockPeriod), true) + unlockDate = formatTimeDate(new Date(beginingOfGmtDay + SPECIAL_CURRENCY_INFO[currencyCode].stakeLockPeriod), true) } let estReward = '0' if (tx != null && tx.otherParams != null && tx.otherParams.ui != null && tx.otherParams.ui.estReward != null) { From be344db7526f0a0e7b26f7105151990e9f368ef1 Mon Sep 17 00:00:00 2001 From: Jon Tzeng Date: Thu, 3 Feb 2022 17:57:24 -0800 Subject: [PATCH 32/50] Show BitPay error properly for ERC20 wallets Previous fix was not properly detecting if the selected wallet was ERC20 --- src/components/themed/AddressTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/themed/AddressTile.js b/src/components/themed/AddressTile.js index 42088fce92e..87968d960d5 100644 --- a/src/components/themed/AddressTile.js +++ b/src/components/themed/AddressTile.js @@ -124,7 +124,7 @@ class AddressTileComponent extends React.PureComponent { onChangeAddress({ fioAddress, isSendUsingFioAddress: !!fioAddress }, parsedUri) } catch (e) { const currencyInfo = coreWallet.currencyInfo - const ercTokenStandard = currencyInfo.defaultSettings?.otherSettings ?? '' + const ercTokenStandard = currencyInfo.defaultSettings?.otherSettings?.ercTokenStandard ?? '' if (ercTokenStandard === 'ERC20' && parseDeepLink(address).type === 'bitPay') showError(new BitPayError(BitPayErrorCode.CurrencyNotSupported, { text: currencyInfo.currencyCode })) else showError(`${s.strings.scan_invalid_address_error_title} ${s.strings.scan_invalid_address_error_description}`) From a658f59eeb961a445fa9b7cf61fe3b73aeda66c3 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 4 Feb 2022 13:06:06 -0800 Subject: [PATCH 33/50] Upgrade to deprecated-react-native-listview v0.0.7 --- package.json | 1 + ...precated-react-native-listview+0.0.5.patch | 291 ------------------ yarn.lock | 8 +- 3 files changed, 5 insertions(+), 295 deletions(-) delete mode 100644 patches/deprecated-react-native-listview+0.0.5.patch diff --git a/package.json b/package.json index 4b5913af824..58643f3730e 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "process-nextick-args": "2.0.0", "randombytes": "2.1.0", "react-native-material-textfield": "0.16.1", + "deprecated-react-native-listview": "0.0.7", "react-native-safe-area-view": "0.14.9", "readable-stream": "2.3.6", "regenerator-runtime": "0.13.2", diff --git a/patches/deprecated-react-native-listview+0.0.5.patch b/patches/deprecated-react-native-listview+0.0.5.patch deleted file mode 100644 index 731b40b941f..00000000000 --- a/patches/deprecated-react-native-listview+0.0.5.patch +++ /dev/null @@ -1,291 +0,0 @@ -diff --git a/node_modules/deprecated-react-native-listview/InternalListViewType.js b/node_modules/deprecated-react-native-listview/InternalListViewType.js -index d3c2e64..d5062bc 100644 ---- a/node_modules/deprecated-react-native-listview/InternalListViewType.js -+++ b/node_modules/deprecated-react-native-listview/InternalListViewType.js -@@ -21,7 +21,7 @@ class InternalListViewType extends React.Component { - flashScrollIndicators() {} - getScrollResponder(): any {} - getScrollableNode(): any {} -- getMetrics(): Object {} -+ getMetrics(): any {} - scrollTo(...args: Array) {} - scrollToEnd(options?: ?{animated?: ?boolean}) {} - } -diff --git a/node_modules/deprecated-react-native-listview/ListViewDataSource.js b/node_modules/deprecated-react-native-listview/ListViewDataSource.js -index 7cf065a..64e1ccf 100644 ---- a/node_modules/deprecated-react-native-listview/ListViewDataSource.js -+++ b/node_modules/deprecated-react-native-listview/ListViewDataSource.js -@@ -10,7 +10,7 @@ - 'use strict'; - - const invariant = require('invariant'); --const isEmpty = require('react-native/Libraries/vendor/core/isEmpty'); -+const isEmpty = require('./isEmpty'); - /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error - * found when Flow v0.54 was deployed. To see the error delete this comment and - * run Flow. */ -diff --git a/node_modules/deprecated-react-native-listview/index.js b/node_modules/deprecated-react-native-listview/index.js -index 4654972..1cd5c13 100644 ---- a/node_modules/deprecated-react-native-listview/index.js -+++ b/node_modules/deprecated-react-native-listview/index.js -@@ -21,8 +21,8 @@ const StaticRenderer = require('./StaticRenderer'); - const View = ReactNative.View; - const cloneReferencedElement = require('react-clone-referenced-element'); - const createReactClass = require('create-react-class'); --const isEmpty = require('react-native/Libraries/vendor/core/isEmpty'); --const merge = require('react-native/Libraries/vendor/core/merge'); -+const isEmpty = require('./isEmpty'); -+const merge = require('./merge'); - - import type {Props as ScrollViewProps} from 'react-native/Libraries/Components/ScrollView/ScrollView'; - -diff --git a/node_modules/deprecated-react-native-listview/isEmpty.js b/node_modules/deprecated-react-native-listview/isEmpty.js -new file mode 100644 -index 0000000..78f8841 ---- /dev/null -+++ b/node_modules/deprecated-react-native-listview/isEmpty.js -@@ -0,0 +1,29 @@ -+/** -+ * Copyright (c) Facebook, Inc. and its affiliates. -+ * -+ * This source code is licensed under the MIT license found in the -+ * LICENSE file in the root directory of this source tree. -+ * -+ * @flow strict -+ * @format -+ */ -+ -+'use strict'; -+ -+/** -+ * Mimics empty from PHP. -+ */ -+function isEmpty(obj: mixed): boolean { -+ if (Array.isArray(obj)) { -+ return obj.length === 0; -+ } else if (typeof obj === 'object') { -+ for (const i in obj) { -+ return false; -+ } -+ return true; -+ } else { -+ return !obj; -+ } -+} -+ -+module.exports = isEmpty; -diff --git a/node_modules/deprecated-react-native-listview/merge.js b/node_modules/deprecated-react-native-listview/merge.js -new file mode 100644 -index 0000000..a294d4a ---- /dev/null -+++ b/node_modules/deprecated-react-native-listview/merge.js -@@ -0,0 +1,26 @@ -+/** -+ * Copyright (c) Facebook, Inc. and its affiliates. -+ * -+ * This source code is licensed under the MIT license found in the -+ * LICENSE file in the root directory of this source tree. -+ */ -+ -+"use strict"; -+ -+const mergeInto = require('./mergeInto'); -+ -+/** -+ * Shallow merges two structures into a return value, without mutating either. -+ * -+ * @param {?object} one Optional object with properties to merge from. -+ * @param {?object} two Optional object with properties to merge from. -+ * @return {object} The shallow extension of one by two. -+ */ -+const merge = function(one, two) { -+ const result = {}; -+ mergeInto(result, one); -+ mergeInto(result, two); -+ return result; -+}; -+ -+module.exports = merge; -diff --git a/node_modules/deprecated-react-native-listview/mergeHelpers.js b/node_modules/deprecated-react-native-listview/mergeHelpers.js -new file mode 100644 -index 0000000..92229e1 ---- /dev/null -+++ b/node_modules/deprecated-react-native-listview/mergeHelpers.js -@@ -0,0 +1,137 @@ -+/** -+ * Copyright (c) Facebook, Inc. and its affiliates. -+ * -+ * This source code is licensed under the MIT license found in the -+ * LICENSE file in the root directory of this source tree. -+ * -+ * -+ * requiresPolyfills: Array.isArray -+ * -+ * @format -+ */ -+ -+'use strict'; -+ -+const invariant = require('invariant'); -+ -+/** -+ * Maximum number of levels to traverse. Will catch circular structures. -+ * @const -+ */ -+const MAX_MERGE_DEPTH = 36; -+ -+/** -+ * We won't worry about edge cases like new String('x') or new Boolean(true). -+ * Functions and Dates are considered terminals, and arrays are not. -+ * @param {*} o The item/object/value to test. -+ * @return {boolean} true iff the argument is a terminal. -+ */ -+const isTerminal = function(o) { -+ return typeof o !== 'object' || o instanceof Date || o === null; -+}; -+ -+const mergeHelpers = { -+ MAX_MERGE_DEPTH: MAX_MERGE_DEPTH, -+ -+ isTerminal: isTerminal, -+ -+ /** -+ * Converts null/undefined values into empty object. -+ * -+ * @param {?Object=} arg Argument to be normalized (nullable optional) -+ * @return {!Object} -+ */ -+ normalizeMergeArg: function(arg) { -+ return arg === undefined || arg === null ? {} : arg; -+ }, -+ -+ /** -+ * If merging Arrays, a merge strategy *must* be supplied. If not, it is -+ * likely the caller's fault. If this function is ever called with anything -+ * but `one` and `two` being `Array`s, it is the fault of the merge utilities. -+ * -+ * @param {*} one Array to merge into. -+ * @param {*} two Array to merge from. -+ */ -+ checkMergeArrayArgs: function(one, two) { -+ invariant( -+ Array.isArray(one) && Array.isArray(two), -+ 'Tried to merge arrays, instead got %s and %s.', -+ one, -+ two, -+ ); -+ }, -+ -+ /** -+ * @param {*} one Object to merge into. -+ * @param {*} two Object to merge from. -+ */ -+ checkMergeObjectArgs: function(one, two) { -+ mergeHelpers.checkMergeObjectArg(one); -+ mergeHelpers.checkMergeObjectArg(two); -+ }, -+ -+ /** -+ * @param {*} arg -+ */ -+ checkMergeObjectArg: function(arg) { -+ invariant( -+ !isTerminal(arg) && !Array.isArray(arg), -+ 'Tried to merge an object, instead got %s.', -+ arg, -+ ); -+ }, -+ -+ /** -+ * @param {*} arg -+ */ -+ checkMergeIntoObjectArg: function(arg) { -+ invariant( -+ (!isTerminal(arg) || typeof arg === 'function') && !Array.isArray(arg), -+ 'Tried to merge into an object, instead got %s.', -+ arg, -+ ); -+ }, -+ -+ /** -+ * Checks that a merge was not given a circular object or an object that had -+ * too great of depth. -+ * -+ * @param {number} Level of recursion to validate against maximum. -+ */ -+ checkMergeLevel: function(level) { -+ invariant( -+ level < MAX_MERGE_DEPTH, -+ 'Maximum deep merge depth exceeded. You may be attempting to merge ' + -+ 'circular structures in an unsupported way.', -+ ); -+ }, -+ -+ /** -+ * Checks that the supplied merge strategy is valid. -+ * -+ * @param {string} Array merge strategy. -+ */ -+ checkArrayStrategy: function(strategy) { -+ invariant( -+ strategy === undefined || strategy in mergeHelpers.ArrayStrategies, -+ 'You must provide an array strategy to deep merge functions to ' + -+ 'instruct the deep merge how to resolve merging two arrays.', -+ ); -+ }, -+ -+ /** -+ * Set of possible behaviors of merge algorithms when encountering two Arrays -+ * that must be merged together. -+ * - `clobber`: The left `Array` is ignored. -+ * - `indexByIndex`: The result is achieved by recursively deep merging at -+ * each index. (not yet supported.) -+ */ -+ ArrayStrategies: { -+ Clobber: 'Clobber', -+ Concat: 'Concat', -+ IndexByIndex: 'IndexByIndex', -+ }, -+}; -+ -+module.exports = mergeHelpers; -diff --git a/node_modules/deprecated-react-native-listview/mergeInto.js b/node_modules/deprecated-react-native-listview/mergeInto.js -new file mode 100644 -index 0000000..877c827 ---- /dev/null -+++ b/node_modules/deprecated-react-native-listview/mergeInto.js -@@ -0,0 +1,34 @@ -+/** -+ * Copyright (c) Facebook, Inc. and its affiliates. -+ * -+ * This source code is licensed under the MIT license found in the -+ * LICENSE file in the root directory of this source tree. -+ */ -+ -+"use strict"; -+ -+var mergeHelpers = require('./mergeHelpers'); -+ -+var checkMergeObjectArg = mergeHelpers.checkMergeObjectArg; -+var checkMergeIntoObjectArg = mergeHelpers.checkMergeIntoObjectArg; -+ -+/** -+ * Shallow merges two structures by mutating the first parameter. -+ * -+ * @param {object|function} one Object to be merged into. -+ * @param {?object} two Optional object with properties to merge from. -+ */ -+function mergeInto(one, two) { -+ checkMergeIntoObjectArg(one); -+ if (two != null) { -+ checkMergeObjectArg(two); -+ for (var key in two) { -+ if (!Object.prototype.hasOwnProperty.call(two, key)) { -+ continue; -+ } -+ one[key] = two[key]; -+ } -+ } -+} -+ -+module.exports = mergeInto; diff --git a/yarn.lock b/yarn.lock index 7eee1e97d15..9b66fdd6856 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5044,10 +5044,10 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= -deprecated-react-native-listview@^0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/deprecated-react-native-listview/-/deprecated-react-native-listview-0.0.5.tgz#fc8a6dc45b0a8ba611e6014e13b38d6d763e763f" - integrity sha512-Cy7nDdd+KU+nR3tY1BSMuoZpsYC6OVSZyAiUSTDBop2lIgzCseDx7XI57x6h+NXer/8aor2yiQDQfeFcmBMwgQ== +deprecated-react-native-listview@0.0.7, deprecated-react-native-listview@^0.0.5: + version "0.0.7" + resolved "https://registry.yarnpkg.com/deprecated-react-native-listview/-/deprecated-react-native-listview-0.0.7.tgz#781c9e4f6b4c52d8887cc0328e5a1936ae0a0a21" + integrity sha512-l0lWjpU70MlHF0Sy/xi1I6vQkb5tatXKag5iSbXmEKh9g8ZqUbdlP9wGTy5g3GQc5qqaUYAf6mIY5CtkN5BStQ== dependencies: create-react-class "*" fbjs "*" From aadddc7a4347094560cf23502c137b4ca9cb99da Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 4 Feb 2022 13:11:06 -0800 Subject: [PATCH 34/50] Upgrade to edge-core-js v0.19.5 --- package.json | 2 +- yarn.lock | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 58643f3730e..9c6b8ae4a34 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "detect-bundler": "^1.0.0", "detox": "^18.10.0", "disklet": "^0.4.5", - "edge-core-js": "^0.19.4", + "edge-core-js": "^0.19.5", "edge-currency-accountbased": "^0.11.11", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", diff --git a/yarn.lock b/yarn.lock index 9b66fdd6856..ba4a52ba9d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5150,6 +5150,13 @@ disklet@^0.4.5: dependencies: rfc4648 "^1.3.0" +disklet@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/disklet/-/disklet-0.5.2.tgz#eb1b3bfc2840883cb432aaa16d2c78a345cdd778" + integrity sha512-Fx9LFHztHa47QVCHKaABvk+R/zInmi17HweWM+PQyO3bv55E709IPcJIMOH1WyuPNTPHAAM9GToN6NgpdLhUCQ== + dependencies: + rfc4648 "^1.3.0" + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -5320,17 +5327,17 @@ ed25519@0.0.4: bindings "^1.2.1" nan "^2.0.9" -edge-core-js@^0.19.4: - version "0.19.4" - resolved "https://registry.yarnpkg.com/edge-core-js/-/edge-core-js-0.19.4.tgz#550164ca94ba5270d6b3ad130aff08ffb52f3acc" - integrity sha512-PgB4uELyL0r6USF2bqipU1IrC7lQKWNh0XHW/dFz+a4zSSSz+wa3dST6hOh2G0sMHgCrKiXBddfF37xZbO0UyQ== +edge-core-js@^0.19.5: + version "0.19.5" + resolved "https://registry.yarnpkg.com/edge-core-js/-/edge-core-js-0.19.5.tgz#79bebec1444f3b1319121c84c2d11d00b55013f1" + integrity sha512-ekO0MSoHyA4cncXn00+PANUHszpFhQuc+a2p56d0BFjjkEP7+6aKCeFEU7m8GVpPt5e3iSfsRv5m22p/sAznkA== dependencies: aes-js "^3.1.0" base-x "^1.0.4" biggystring "^3.0.2" cleaners "^0.3.11" currency-codes "^1.1.2" - disklet "^0.4.5" + disklet "^0.5.2" edge-sync-client "^0.2.6" elliptic "^6.4.0" ethereumjs-tx "^1.3.7" From 582f9aaafd3fb17880fca4e91f11f905e9c8d441 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 4 Feb 2022 13:15:12 -0800 Subject: [PATCH 35/50] Upgrade to disklet v0.5.2 --- package.json | 2 +- yarn.lock | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/package.json b/package.json index 9c6b8ae4a34..80fbeba2248 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "dateformat": "^3.0.3", "detect-bundler": "^1.0.0", "detox": "^18.10.0", - "disklet": "^0.4.5", + "disklet": "^0.5.2", "edge-core-js": "^0.19.5", "edge-currency-accountbased": "^0.11.11", "edge-currency-bitcoin": "^4.9.20", diff --git a/yarn.lock b/yarn.lock index ba4a52ba9d9..d8e1000d318 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5143,13 +5143,6 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -disklet@^0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/disklet/-/disklet-0.4.5.tgz#f62546a94f939cca4dd20d9c3d5c5e43c9529441" - integrity sha512-ivPnHcgFOR5kXcAhR2pMrwtNfNAtoWW0SZ0laSFCr4vboU28PERUKLtUeCC0PWh/X3ykZ+3UFE5doALSOuthnQ== - dependencies: - rfc4648 "^1.3.0" - disklet@^0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/disklet/-/disklet-0.5.2.tgz#eb1b3bfc2840883cb432aaa16d2c78a345cdd778" From 90007845b47fe52c7f35f6d34da5a3d1934561df Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 1 Feb 2022 15:19:57 -0800 Subject: [PATCH 36/50] Add error translation infrastructure Also fix the way we log errors to the console, now that this is a separate code path. --- src/components/services/AirshipInstance.js | 39 ++++++++++--------- .../services/EdgeContextCallbackManager.js | 11 ++---- src/util/translateError.js | 26 +++++++++++++ 3 files changed, 50 insertions(+), 26 deletions(-) create mode 100644 src/util/translateError.js diff --git a/src/components/services/AirshipInstance.js b/src/components/services/AirshipInstance.js index d88a7de5b3b..bb6adf7a93d 100644 --- a/src/components/services/AirshipInstance.js +++ b/src/components/services/AirshipInstance.js @@ -3,7 +3,7 @@ import * as React from 'react' import { makeAirship } from 'react-native-airship' -import ENV from '../../../env.json' +import { makeErrorLog, translateError } from '../../util/translateError' import { AirshipToast } from '../common/AirshipToast.js' import { AlertDropdown } from '../navigation/AlertDropdown.js' export const Airship = makeAirship() @@ -13,7 +13,8 @@ export const Airship = makeAirship() * Used when some user-requested operation fails. */ export function showError(error: mixed): void { - showAlert(error, false) + console.log(redText('Showing error drop-down alert: ' + makeErrorLog(error))) + Airship.show(bridge => ) } /** @@ -21,30 +22,30 @@ export function showError(error: mixed): void { * Used when some user-requested operation succeeds but with a warning. */ export function showWarning(error: mixed): void { - showAlert(error, true) + console.log(yellowText('Showing warning drop-down alert: ' + makeErrorLog(error))) + Airship.show(bridge => ) } /** - * Shows an error or warning to the user. - * Used when some user-requested operation succeeds but with a warning. + * Shows a message to the user. + * Used when some user-requested operation succeeds. */ -function showAlert(error: mixed, isWarning: boolean): void { - // WIP: Run the errors through our translation infrastructure: - if (ENV.DEBUG_VERBOSE_ERRORS) { - // Show extended warning data - const logColoredText = isWarning ? '\x1b[34m\x1b[43mWarning:' : '\x1b[37m\x1b[41mError:' - console.log(logColoredText + `\n${JSON.stringify(error, null, 2)}` + '\x1b[0m') - } +export function showToast(message: string): void { + Airship.show(bridge => ) +} - // Short short warning data in the GUI - const message = error instanceof Error ? error.message : String(error) - Airship.show(bridge => ) +/** + * Makes text red in dev mode. + */ +export function redText(message: string): string { + if (!global.__DEV__) return message + return `\x1b[31m${message}\x1b[39m` } /** - * Shows a message to the user. - * Used when some user-requested operation succeeds. + * Makes text yellow in dev mode. */ -export function showToast(message: string): void { - Airship.show(bridge => ) +export function yellowText(message: string): string { + if (!global.__DEV__) return message + return `\x1b[33m${message}\x1b[39m` } diff --git a/src/components/services/EdgeContextCallbackManager.js b/src/components/services/EdgeContextCallbackManager.js index 5715eedb2c4..dece26050d0 100644 --- a/src/components/services/EdgeContextCallbackManager.js +++ b/src/components/services/EdgeContextCallbackManager.js @@ -5,8 +5,9 @@ import * as React from 'react' import { handleOtpError } from '../../actions/AccountActions.js' import { connect } from '../../types/reactRedux.js' +import { makeErrorLog, translateError } from '../../util/translateError.js' import { AlertDropdown } from '../navigation/AlertDropdown.js' -import { Airship } from './AirshipInstance.js' +import { Airship, yellowText } from './AirshipInstance.js' type StateProps = { context: EdgeContext @@ -53,12 +54,8 @@ class EdgeContextCallbackManagerComponent extends React.Component { * but asynchronous so we don't spam multiple pop-ups. */ showError(error: mixed): Promise { - console.error('Showing core drop-down alert:', error) - - // TODO: Run the errors through our translation infrastructure: - const message = error instanceof Error ? error.message : String(error) - - return Airship.show(bridge => ) + console.log(yellowText('Showing core drop-down alert: ' + makeErrorLog(error))) + return Airship.show(bridge => ) } render() { diff --git a/src/util/translateError.js b/src/util/translateError.js new file mode 100644 index 00000000000..57a243863f9 --- /dev/null +++ b/src/util/translateError.js @@ -0,0 +1,26 @@ +// @flow + +import ENV from '../../env.json' + +/** + * Something got thrown, so turn that into a dev-friendly string. + * @param {*} error Some value we got from `catch` + * @returns A string with (hopefully) enough information to debug the issue. + */ +export function makeErrorLog(error: mixed): string { + let message = String(error) + if (ENV.DEBUG_CORE || ENV.DEBUG_PLUGINS || ENV.DEBUG_VERBOSE_ERRORS) { + if (error instanceof Error) message += `\n${error.stack}` + message += `\n${JSON.stringify(error, null, 2)}` + } + return message +} + +/** + * Something got thrown, so turn that into a human-friendly string. + * @param {*} error Some value we got from `catch` + * @returns A translated, human-friendly string (in many cases). + */ +export function translateError(error: mixed): string { + return error instanceof Error ? error.message : String(error) +} From 54e167bb55d2c8a52fed01e34bbc1f973b904168 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 1 Feb 2022 14:40:47 -0800 Subject: [PATCH 37/50] Improve the `BitPayError` type safety & translation --- src/actions/BitPayActions.js | 18 +++--- src/components/themed/AddressTile.js | 4 +- src/types/BitPayError.js | 95 +++++++++++++++------------- src/util/translateError.js | 4 ++ 4 files changed, 65 insertions(+), 56 deletions(-) diff --git a/src/actions/BitPayActions.js b/src/actions/BitPayActions.js index b6d43264db2..6753320453c 100644 --- a/src/actions/BitPayActions.js +++ b/src/actions/BitPayActions.js @@ -9,7 +9,7 @@ import { WalletListModal } from '../components/modals/WalletListModal.js' import { Airship, showError } from '../components/services/AirshipInstance.js' import { SPECIAL_CURRENCY_INFO } from '../constants/WalletAndCurrencyConstants.js' import s from '../locales/strings.js' -import { BitPayError, BitPayErrorCode } from '../types/BitPayError.js' +import { BitPayError } from '../types/BitPayError.js' import { type BpInstructionOutput, type BpInvoiceInstruction, @@ -46,7 +46,7 @@ async function fetchBitPayJsonResponse(uri: string, init: Object): Promise paymentCurrencies.includes(currencyWallets[key].currencyInfo.currencyCode)) if (matchingWallets.length === 0) { - throw new BitPayError(BitPayErrorCode.NoPaymentOption, { text: paymentCurrencies.join(', ') }) + throw new BitPayError('NoPaymentOption', { text: paymentCurrencies.join(', ') }) } else { const walletListResult = await Airship.show(bridge => ( @@ -138,15 +138,15 @@ export async function launchBitPay( const invoiceResponse = asBpInvoiceResponse(responseJson) let errorData = { uri, initOpts, responseJson, invoiceResponse } if (invoiceResponse.instructions.length > 1) { - throw new BitPayError(BitPayErrorCode.MultiInstructionInvoice, { errorData }) + throw new BitPayError('MultiInstructionInvoice', { errorData }) } const invoiceInstruction = invoiceResponse.instructions[0] errorData = { ...errorData, invoiceInstruction } if (invoiceInstruction.outputs) { if (invoiceInstruction.outputs.length > 1) { - throw new BitPayError(BitPayErrorCode.MultiOutputInvoice, { errorData }) + throw new BitPayError('MultiOutputInvoice', { errorData }) } - } else throw new BitPayError(BitPayErrorCode.EmptyOutputInvoice, { errorData }) + } else throw new BitPayError('EmptyOutputInvoice', { errorData }) const instructionOutput = invoiceInstruction.outputs[0] // Make the spend to generate the tx hexes @@ -174,7 +174,7 @@ export async function launchBitPay( const signedHex = signedTx.signedTx ?? '' errorData = { ...errorData, spendInfo, walletId: selectedWallet.id, unsignedTx, signedTx } - if (unsignedHex === '' || signedHex === '') throw new BitPayError(BitPayErrorCode.EmptyVerificationHexReq, errorData) + if (unsignedHex === '' || signedHex === '') throw new BitPayError('EmptyVerificationHexReq', { errorData }) // Send the unsigned TX and signed weightedSize to BitPay for verification const verificationPaymentRequest = { @@ -196,7 +196,7 @@ export async function launchBitPay( if (verificationPaymentResponse.transactions.length !== 1 || unsignedHex !== verificationPaymentResponse.transactions[0].tx) { errorData = { ...errorData, verificationPaymentRequest, verificationPaymentResponse } errorData.responseJson = responseJson - throw new BitPayError(BitPayErrorCode.TxVerificationMismatch, errorData) + throw new BitPayError('TxVerificationMismatch', { errorData }) } // Pass spend info to the send scene for user to confirm tx. diff --git a/src/components/themed/AddressTile.js b/src/components/themed/AddressTile.js index 87968d960d5..356c8bfe032 100644 --- a/src/components/themed/AddressTile.js +++ b/src/components/themed/AddressTile.js @@ -12,7 +12,7 @@ import { addressWarnings } from '../../actions/ScanActions.js' import { CURRENCY_PLUGIN_NAMES } from '../../constants/WalletAndCurrencyConstants' import s from '../../locales/strings.js' import { checkPubAddress } from '../../modules/FioAddress/util' -import { BitPayError, BitPayErrorCode } from '../../types/BitPayError.js' +import { BitPayError } from '../../types/BitPayError.js' import { connect } from '../../types/reactRedux.js' import { type GuiMakeSpendInfo } from '../../types/types.js' import { parseDeepLink } from '../../util/DeepLinkParser.js' @@ -126,7 +126,7 @@ class AddressTileComponent extends React.PureComponent { const currencyInfo = coreWallet.currencyInfo const ercTokenStandard = currencyInfo.defaultSettings?.otherSettings?.ercTokenStandard ?? '' if (ercTokenStandard === 'ERC20' && parseDeepLink(address).type === 'bitPay') - showError(new BitPayError(BitPayErrorCode.CurrencyNotSupported, { text: currencyInfo.currencyCode })) + showError(new BitPayError('CurrencyNotSupported', { text: currencyInfo.currencyCode })) else showError(`${s.strings.scan_invalid_address_error_title} ${s.strings.scan_invalid_address_error_description}`) this.setState({ loading: false }) } diff --git a/src/types/BitPayError.js b/src/types/BitPayError.js index 66af2bf6f1a..3e4fd966abc 100644 --- a/src/types/BitPayError.js +++ b/src/types/BitPayError.js @@ -4,45 +4,26 @@ import { sprintf } from 'sprintf-js' import s from '../locales/strings.js' -/** Explains BitPay Error options */ -type BitPayErrorOptions = { +export type BitPayErrorCode = + | 'CurrencyNotSupported' + | 'EmptyOutputInvoice' + | 'EmptyVerificationHexReq' + | 'FetchFailed' + | 'InvalidPaymentOption' + | 'MultiOutputInvoice' + | 'MultiInstructionInvoice' + | 'NoPaymentOption' + | 'TxVerificationMismatch' + +/** + * Options passed to the BitPayError constructor. + */ +type BitPayErrorOptions = {| header?: string, statusCode?: string, text?: string, errorData?: Object -} - -/** Alias for BitPay error handler function */ -type BitPayErrorHandler = (error: BitPayErrorOptions) => string - -export const BitPayErrorCode = { - CurrencyNotSupported: 'CurrencyNotSupported', - EmptyOutputInvoice: 'EmptyOutputInvoice', - EmptyVerificationHexReq: 'EmptyVerificationHexReq', - FetchFailed: 'FetchFailed', - InvalidPaymentOption: 'InvalidPaymentOption', - MultiOutputInvoice: 'MultiOutputInvoice', - MultiInstructionInvoice: 'MultiInstructionInvoice', - NoPaymentOption: 'NoPaymentOption', - TxVerificationMismatch: 'TxVerificationMismatch' -} - -/** - * @internal - * Internal Mapping object from BitPayErrorCode to a BitPayErrorHandler - */ -const HandlersByCode = { - [BitPayErrorCode.CurrencyNotSupported]: (params: { text: string }) => sprintf(s.strings.error_bitpay_currency_not_supported, params.text), - [BitPayErrorCode.EmptyOutputInvoice]: () => s.strings.error_bitpay_empty_output_invoice, - [BitPayErrorCode.EmptyVerificationHexReq]: () => s.strings.error_bitpay_empty_verification_hex_req, - [BitPayErrorCode.FetchFailed]: (params: { header: string, statusCode: string, text?: string }) => - sprintf(s.strings.error_bitpay_fetch, params.header, params.statusCode, params.text ?? ''), - [BitPayErrorCode.InvalidPaymentOption]: (params: { text: string }) => sprintf(s.strings.error_bitpay_invalid_payment_option, params.text), - [BitPayErrorCode.MultiOutputInvoice]: () => s.strings.error_bitpay_multi_output_invoice, - [BitPayErrorCode.MultiInstructionInvoice]: () => s.strings.error_bitpay_multi_tx_invoice, - [BitPayErrorCode.NoPaymentOption]: (params: { text: string }) => sprintf(s.strings.error_bitpay_no_payment_option, params.text), - [BitPayErrorCode.TxVerificationMismatch]: () => sprintf(s.strings.error_bitpay_tx_verification_failed) -} +|} /** * BitPay Error class is designed to control every error being thrown by BitPay @@ -63,21 +44,45 @@ const HandlersByCode = { * @param errorData: Any other debug data of interest */ export class BitPayError extends Error { - code: string + code: BitPayErrorCode header: string statusCode: string text: string errorData: Object - constructor(code: string, options: BitPayErrorOptions) { - const bitPayErrorHandler: BitPayErrorHandler = HandlersByCode[code] - const { header, statusCode, text, errorData } = options - super(bitPayErrorHandler({ header, statusCode, text, errorData })) - this.code = code - this.header = header ?? '' - this.statusCode = statusCode ?? '' + constructor(code: BitPayErrorCode, options: BitPayErrorOptions) { + const { header = '', statusCode = '', text = '', errorData = {} } = options + super(code) this.name = 'BitPayError' - this.errorData = errorData ?? {} - Object.setPrototypeOf(this, BitPayError.prototype) + this.code = code + this.header = header + this.statusCode = statusCode + this.text = text + this.errorData = errorData + } +} + +export function translateBitPayError(error: BitPayError): string { + switch (error.code) { + case 'CurrencyNotSupported': + return sprintf(s.strings.error_bitpay_currency_not_supported, error.text) + case 'EmptyOutputInvoice': + return s.strings.error_bitpay_empty_output_invoice + case 'EmptyVerificationHexReq': + return s.strings.error_bitpay_empty_verification_hex_req + case 'FetchFailed': + return sprintf(s.strings.error_bitpay_fetch, error.header, error.statusCode, error.text) + case 'InvalidPaymentOption': + return sprintf(s.strings.error_bitpay_invalid_payment_option, error.text) + case 'MultiOutputInvoice': + return s.strings.error_bitpay_multi_output_invoice + case 'MultiInstructionInvoice': + return s.strings.error_bitpay_multi_tx_invoice + case 'NoPaymentOption': + return sprintf(s.strings.error_bitpay_no_payment_option, error.text) + case 'TxVerificationMismatch': + return sprintf(s.strings.error_bitpay_tx_verification_failed) + default: + return error.message } } diff --git a/src/util/translateError.js b/src/util/translateError.js index 57a243863f9..79669d1dcd4 100644 --- a/src/util/translateError.js +++ b/src/util/translateError.js @@ -1,6 +1,7 @@ // @flow import ENV from '../../env.json' +import { BitPayError, translateBitPayError } from '../types/BitPayError' /** * Something got thrown, so turn that into a dev-friendly string. @@ -22,5 +23,8 @@ export function makeErrorLog(error: mixed): string { * @returns A translated, human-friendly string (in many cases). */ export function translateError(error: mixed): string { + // GUI Error types: + if (error instanceof BitPayError) return translateBitPayError(error) + return error instanceof Error ? error.message : String(error) } From 654e49da775a76c61de30c059e04664ca40c0180 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 1 Feb 2022 14:40:47 -0800 Subject: [PATCH 38/50] Improve the `ResolutionError` type safety & translation --- src/components/modals/AddressModal.js | 8 +-- src/types/ResolutionError.js | 88 ++++++++++++++------------- src/util/translateError.js | 2 + 3 files changed, 52 insertions(+), 46 deletions(-) diff --git a/src/components/modals/AddressModal.js b/src/components/modals/AddressModal.js index 105bc73459e..b51e8bfa860 100644 --- a/src/components/modals/AddressModal.js +++ b/src/components/modals/AddressModal.js @@ -14,7 +14,7 @@ import s from '../../locales/strings.js' import { type FioAddresses, checkPubAddress, getFioAddressCache } from '../../modules/FioAddress/util.js' import { FormattedText as Text } from '../../modules/UI/components/FormattedText/FormattedText.ui.js' import { connect } from '../../types/reactRedux.js' -import { ResolutionError, ResolutionErrorCode } from '../../types/ResolutionError.js' +import { ResolutionError } from '../../types/ResolutionError.js' import type { FioAddress, FlatListItem } from '../../types/types.js' import { type Theme, type ThemeProps, cacheStyles, withTheme } from '../services/ThemeContext.js' import { MainButton } from '../themed/MainButton.js' @@ -149,18 +149,18 @@ class AddressModalComponent extends React.Component { fetchDomain = async (domain: string, currencyTicker: string): Promise => { domain = domain.trim().toLowerCase() if (!this.checkIfDomain(domain)) { - throw new ResolutionError(ResolutionErrorCode.UnsupportedDomain, { domain }) + throw new ResolutionError('UnsupportedDomain', { domain }) } const baseurl = `https://unstoppabledomains.com/api/v1` const url = this.checkIfEnsDomain(domain) ? `${baseurl}/${domain}/${currencyTicker}` : `${baseurl}/${domain}` const response = await global.fetch(url).then(res => res.json()) const { addresses, meta } = response if (!meta || !meta.owner) { - throw new ResolutionError(ResolutionErrorCode.UnregisteredDomain, { domain }) + throw new ResolutionError('UnregisteredDomain', { domain }) } const ticker = currencyTicker.toUpperCase() if (!addresses || !addresses[ticker]) { - throw new ResolutionError(ResolutionErrorCode.UnspecifiedCurrency, { domain, currencyTicker }) + throw new ResolutionError('UnspecifiedCurrency', { domain, currencyTicker }) } return addresses[ticker] } diff --git a/src/types/ResolutionError.js b/src/types/ResolutionError.js index 3e74569611f..4c654b97dc2 100644 --- a/src/types/ResolutionError.js +++ b/src/types/ResolutionError.js @@ -1,40 +1,24 @@ // @flow -/** Explains Resolution Error options */ -type ResolutionErrorOptions = { - domain: string, - method?: string, - currencyTicker?: string, - recordName?: string -} -/** Alias for Resolution error handler function */ -type ResolutionErrorHandler = (error: ResolutionErrorOptions) => string - -export const ResolutionErrorCode = { - UnregisteredDomain: 'UnregisteredDomain', - UnspecifiedResolver: 'UnspecifiedResolver', - UnsupportedDomain: 'UnsupportedDomain', - UnspecifiedCurrency: 'UnspecifiedCurrency', - NamingServiceDown: 'NamingServiceDown', - UnsupportedCurrency: 'UnsupportedCurrency', - IncorrectResolverInterface: 'IncorrectResolverInterface', - RecordNotFound: 'RecordNotFound' -} +export type ResolutionErrorCode = + | 'UnregisteredDomain' + | 'UnspecifiedResolver' + | 'UnsupportedDomain' + | 'UnspecifiedCurrency' + | 'NamingServiceDown' + | 'UnsupportedCurrency' + | 'IncorrectResolverInterface' + | 'RecordNotFound' /** - * @internal - * Internal Mapping object from ResolutionErrorCode to a ResolutionErrorHandler + * Options passed to the ResolutionError constructor */ -const HandlersByCode = { - [ResolutionErrorCode.UnregisteredDomain]: (params: { domain: string }) => `Domain ${params.domain} is not registered`, - [ResolutionErrorCode.UnspecifiedResolver]: (params: { domain: string }) => `Domain ${params.domain} is not configured`, - [ResolutionErrorCode.UnsupportedDomain]: (params: { domain: string }) => `Domain ${params.domain} is not supported`, - [ResolutionErrorCode.UnspecifiedCurrency]: (params: { domain: string, currencyTicker: string }) => - `Domain ${params.domain} has no ${params.currencyTicker} attached to it`, - [ResolutionErrorCode.NamingServiceDown]: (params: { method: string }) => `${params.method} naming service is down at the moment`, - [ResolutionErrorCode.UnsupportedCurrency]: (params: { currencyTicker: string }) => `${params.currencyTicker} is not supported`, - [ResolutionErrorCode.RecordNotFound]: (params: { recordName: string, domain: string }) => `No ${params.recordName} record found for ${params.domain}` -} +type ResolutionErrorOptions = {| + domain: string, + method?: string, + currencyTicker?: string, + recordName?: string +|} /** * Resolution Error class is designed to control every error being thrown by Resolution @@ -51,21 +35,41 @@ const HandlersByCode = { * @param method */ export class ResolutionError extends Error { - code: string - message: string + code: ResolutionErrorCode domain: string method: string currencyTicker: string + recordName: string - constructor(code: string, options: ResolutionErrorOptions = { domain: '' }) { - const resolutionErrorHandler: ResolutionErrorHandler = HandlersByCode[code] - const { domain, method, currencyTicker, recordName } = options - super(resolutionErrorHandler({ domain, method, currencyTicker, recordName })) + constructor(code: ResolutionErrorCode, options: ResolutionErrorOptions = { domain: '' }) { + const { domain = '', method = '', currencyTicker = '', recordName = '' } = options + super(code) + this.name = 'ResolutionError' this.code = code this.domain = domain - this.method = method || '' - this.currencyTicker = currencyTicker || '' - this.name = 'ResolutionError' - Object.setPrototypeOf(this, ResolutionError.prototype) + this.method = method + this.currencyTicker = currencyTicker + this.recordName = recordName + } +} + +export function translateResolutionError(error: ResolutionError): string { + switch (error.code) { + case 'UnregisteredDomain': + return `Domain ${error.domain} is not registered` + case 'UnspecifiedResolver': + return `Domain ${error.domain} is not configured` + case 'UnsupportedDomain': + return `Domain ${error.domain} is not supported` + case 'UnspecifiedCurrency': + return `Domain ${error.domain} has no ${error.currencyTicker} attached to it` + case 'NamingServiceDown': + return `${error.method} naming service is down at the moment` + case 'UnsupportedCurrency': + return `${error.currencyTicker} is not supported` + case 'RecordNotFound': + return `No ${error.recordName} record found for ${error.domain}` + default: + return error.message } } diff --git a/src/util/translateError.js b/src/util/translateError.js index 79669d1dcd4..2daecbbebf2 100644 --- a/src/util/translateError.js +++ b/src/util/translateError.js @@ -2,6 +2,7 @@ import ENV from '../../env.json' import { BitPayError, translateBitPayError } from '../types/BitPayError' +import { ResolutionError, translateResolutionError } from '../types/ResolutionError' /** * Something got thrown, so turn that into a dev-friendly string. @@ -25,6 +26,7 @@ export function makeErrorLog(error: mixed): string { export function translateError(error: mixed): string { // GUI Error types: if (error instanceof BitPayError) return translateBitPayError(error) + if (error instanceof ResolutionError) return translateResolutionError(error) return error instanceof Error ? error.message : String(error) } From 5d14e667212e70ea5855b27b839c50ec21df2d0a Mon Sep 17 00:00:00 2001 From: William Swanson Date: Fri, 4 Feb 2022 16:40:22 -0800 Subject: [PATCH 39/50] Run sort-package-json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 80fbeba2248..6bcf93509bc 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "codecov": "3.5.0", "core-js": "2.5.3", "create-hash": "1.2.0", + "deprecated-react-native-listview": "0.0.7", "elliptic": "6.4.1", "eosjs-api": "https://github.com/EdgeApp/eosjs-api.git#prepare-script", "hash-base": "3.0.4", @@ -71,7 +72,6 @@ "process-nextick-args": "2.0.0", "randombytes": "2.1.0", "react-native-material-textfield": "0.16.1", - "deprecated-react-native-listview": "0.0.7", "react-native-safe-area-view": "0.14.9", "readable-stream": "2.3.6", "regenerator-runtime": "0.13.2", From 5c48c573a3d297493c0508a582504df79302e3a5 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 1 Feb 2022 22:48:42 -0800 Subject: [PATCH 40/50] Remove extra parameters to `createCurrencyWallet` These are just adding obfuscation, since they are only used in one place each. Also, remove the redux spinner state, since we can handle this on a per-scene basis by waiting for the promise. With these changes, we can fix the hidden Flow issue of `createCurrencyWallet` sometimes returning `undefined` when it was supposed to return a wallet. --- .../__snapshots__/RootReducer.test.js.snap | 2 -- .../cryptoExchangeReducer.test.js.snap | 1 - src/__tests__/createWalletReducer.test.js | 1 - src/__tests__/scenesReducer.test.js | 1 - src/actions/CreateWalletActions.js | 22 ++------------ src/actions/FioAddressActions.js | 2 +- .../scenes/CreateWalletAccountSelectScene.js | 29 +++++++++---------- .../scenes/CreateWalletReviewScene.js | 14 +++++++-- src/components/scenes/CryptoExchangeScene.js | 3 -- src/components/themed/WalletListCreateRow.js | 10 ++++--- src/reducers/CryptoExchangeReducer.js | 16 ++-------- src/reducers/scenes/CreateWalletReducer.js | 21 -------------- src/types/reduxActions.js | 3 -- 13 files changed, 35 insertions(+), 90 deletions(-) diff --git a/src/__tests__/__snapshots__/RootReducer.test.js.snap b/src/__tests__/__snapshots__/RootReducer.test.js.snap index 8422bb4391d..704f988eb3a 100644 --- a/src/__tests__/__snapshots__/RootReducer.test.js.snap +++ b/src/__tests__/__snapshots__/RootReducer.test.js.snap @@ -32,7 +32,6 @@ Object { }, "cryptoExchange": Object { "calculatingMax": false, - "creatingWallet": false, "forceUpdateGuiCounter": 0, "fromBalanceMessage": "", "fromCurrencyCode": null, @@ -116,7 +115,6 @@ Object { }, "handleAvailableStatus": "", "isCheckingHandleAvailability": false, - "isCreatingWallet": false, "walletAccountActivationPaymentInfo": Object { "amount": "", "currencyCode": "", diff --git a/src/__tests__/__snapshots__/cryptoExchangeReducer.test.js.snap b/src/__tests__/__snapshots__/cryptoExchangeReducer.test.js.snap index e73eae74dc3..b8fd6739c6e 100644 --- a/src/__tests__/__snapshots__/cryptoExchangeReducer.test.js.snap +++ b/src/__tests__/__snapshots__/cryptoExchangeReducer.test.js.snap @@ -3,7 +3,6 @@ exports[`initialState 1`] = ` Object { "calculatingMax": false, - "creatingWallet": false, "forceUpdateGuiCounter": 0, "fromBalanceMessage": "", "fromCurrencyCode": null, diff --git a/src/__tests__/createWalletReducer.test.js b/src/__tests__/createWalletReducer.test.js index 8ee36f12b65..78d5c756cb0 100644 --- a/src/__tests__/createWalletReducer.test.js +++ b/src/__tests__/createWalletReducer.test.js @@ -8,7 +8,6 @@ const dummyAction = { type: 'DUMMY_ACTION_PLEASE_IGNORE' } test('initialState', () => { const expected = { - isCreatingWallet: false, walletAccountActivationPaymentInfo: { paymentAddress: '', amount: '', diff --git a/src/__tests__/scenesReducer.test.js b/src/__tests__/scenesReducer.test.js index f0b0d9c1b66..a1100668fb2 100644 --- a/src/__tests__/scenesReducer.test.js +++ b/src/__tests__/scenesReducer.test.js @@ -10,7 +10,6 @@ const dummyAction = { type: 'DUMMY_ACTION_PLEASE_IGNORE' } test('initialState', () => { const expected = { createWallet: { - isCreatingWallet: false, walletAccountActivationPaymentInfo: { paymentAddress: '', amount: '', diff --git a/src/actions/CreateWalletActions.js b/src/actions/CreateWalletActions.js index 65a99235874..5be5a411a13 100644 --- a/src/actions/CreateWalletActions.js +++ b/src/actions/CreateWalletActions.js @@ -15,22 +15,18 @@ import { getExchangeDenomination } from '../selectors/DenominationSelectors.js' import type { Dispatch, GetState } from '../types/reduxTypes.js' import { Actions } from '../types/routerTypes.js' import { logEvent } from '../util/tracking.js' -import { selectWallet as selectWalletAction } from './WalletActions.js' export const createCurrencyWallet = ( walletName: string, walletType: string, fiatCurrencyCode: string, - popScene: boolean = true, - selectWallet: boolean = false, importText?: string // for creating wallet from private seed / key ) => - async (dispatch: Dispatch, getState: GetState) => { + async (dispatch: Dispatch, getState: GetState): Promise => { const state = getState() const { account } = state.core - dispatch({ type: 'UI/WALLETS/CREATE_WALLET_START' }) // Try and get the new format param from the legacy walletType if it's mentioned const [type, format] = walletType.split('-') const opts = { @@ -39,21 +35,7 @@ export const createCurrencyWallet = keyOptions: format ? { format } : {}, importText } - return account - .createCurrencyWallet(type, opts) - .then(edgeWallet => { - const { currencyCode } = edgeWallet.currencyInfo - if (popScene) Actions.popTo(WALLET_LIST_SCENE) - dispatch({ type: 'UI/WALLETS/CREATE_WALLET_SUCCESS' }) - if (selectWallet) { - dispatch(selectWalletAction(edgeWallet.id, currencyCode)) - } - return edgeWallet - }) - .catch(error => { - showError(error) - dispatch({ type: 'UI/WALLETS/CREATE_WALLET_FAILURE' }) - }) + return await account.createCurrencyWallet(type, opts) } // can move to component in the future, just account and currencyConfig, etc to component through connector diff --git a/src/actions/FioAddressActions.js b/src/actions/FioAddressActions.js index c96c056139c..ea394fe4d62 100644 --- a/src/actions/FioAddressActions.js +++ b/src/actions/FioAddressActions.js @@ -12,7 +12,7 @@ export const createFioWallet = (dispatch: Dispatch, getState: GetState): Promise => { const state = getState() const fiatCurrencyCode = state.ui.settings.defaultIsoFiat - return dispatch(createCurrencyWallet(s.strings.fio_address_register_default_fio_wallet_name, FIO_WALLET_TYPE, fiatCurrencyCode, false, false)) + return dispatch(createCurrencyWallet(s.strings.fio_address_register_default_fio_wallet_name, FIO_WALLET_TYPE, fiatCurrencyCode)) } export const refreshAllFioAddresses = () => async (dispatch: Dispatch, getState: GetState) => { diff --git a/src/components/scenes/CreateWalletAccountSelectScene.js b/src/components/scenes/CreateWalletAccountSelectScene.js index 0d6c53f18f9..6c898b4546f 100644 --- a/src/components/scenes/CreateWalletAccountSelectScene.js +++ b/src/components/scenes/CreateWalletAccountSelectScene.js @@ -47,7 +47,6 @@ type StateProps = { amount: string, supportedCurrencies: { [currencyCode: string]: boolean }, activationCost: string, - isCreatingWallet: boolean, paymentDenominationSymbol: string, existingCoreWallet?: EdgeCurrencyWallet, walletAccountActivationQuoteError: string, @@ -55,13 +54,7 @@ type StateProps = { } type DispatchProps = { - createAccountBasedWallet: ( - walletName: string, - walletType: string, - fiatCurrencyCode: string, - popScene: boolean, - selectWallet: boolean - ) => Promise, + createAccountBasedWallet: (walletName: string, walletType: string, fiatCurrencyCode: string) => Promise, fetchAccountActivationInfo: (currencyCode: string) => void, createAccountTransaction: (createdWalletId: string, accountName: string, paymentWalletId: string) => void, fetchWalletAccountActivationPaymentInfo: (paymentInfo: AccountPaymentParams, createdCoreWallet: EdgeCurrencyWallet) => void, @@ -71,6 +64,7 @@ type DispatchProps = { type Props = OwnProps & DispatchProps & StateProps type State = { + isCreatingWallet: boolean, walletName: string, walletId: string, error: string, @@ -82,13 +76,17 @@ class CreateWalletAccountSelect extends React.Component { super(props) const { createAccountBasedWallet, route } = this.props const { selectedFiat, selectedWalletType, accountName } = route.params - let createdWallet + let createdWallet: Promise if (props.existingCoreWallet != null) { createdWallet = this.renameAndReturnWallet(props.existingCoreWallet) } else { - createdWallet = createAccountBasedWallet(accountName, selectedWalletType.walletType, fixFiatCurrencyCode(selectedFiat.value), false, false) + createdWallet = createAccountBasedWallet(accountName, selectedWalletType.walletType, fixFiatCurrencyCode(selectedFiat.value)).then(wallet => { + this.setState({ isCreatingWallet: false }) + return wallet + }) } this.state = { + isCreatingWallet: true, error: '', walletId: '', walletName: '', @@ -102,6 +100,7 @@ class CreateWalletAccountSelect extends React.Component { const { route } = this.props const { accountName } = route.params await wallet.renameWallet(accountName) + this.setState({ isCreatingWallet: false }) return wallet } @@ -185,8 +184,8 @@ class CreateWalletAccountSelect extends React.Component { } renderPaymentReview = () => { - const { wallets, paymentCurrencyCode, isCreatingWallet, amount, activationCost, paymentDenominationSymbol, route } = this.props - const { walletId, createdWallet } = this.state + const { wallets, paymentCurrencyCode, amount, activationCost, paymentDenominationSymbol, route } = this.props + const { walletId, createdWallet, isCreatingWallet } = this.state const { accountName, selectedWalletType, selectedFiat } = route.params const wallet = wallets[walletId] @@ -408,7 +407,6 @@ export const CreateWalletAccountSelectScene = connect { } async createWallet() { - const { createCurrencyWallet, route } = this.props + const { createCurrencyWallet, navigation, route } = this.props const { walletName, selectedWalletType, selectedFiat, cleanedPrivateKey } = route.params - const createdWallet = await createCurrencyWallet(walletName, selectedWalletType.walletType, fixFiatCurrencyCode(selectedFiat.value), cleanedPrivateKey) + const createdWallet: EdgeCurrencyWallet | void = await createCurrencyWallet( + walletName, + selectedWalletType.walletType, + fixFiatCurrencyCode(selectedFiat.value), + cleanedPrivateKey + ).catch(showError) + navigation.navigate('walletListScene') + // note that we will be using cleanedPrivateKey as a flag for an imported private key if (createdWallet && cleanedPrivateKey) { this.setState({ @@ -136,7 +144,7 @@ export const CreateWalletReviewScene = connect<{}, DispatchProps, OwnProps>( state => ({}), dispatch => ({ async createCurrencyWallet(walletName: string, walletType: string, fiatCurrencyCode: string, importText?: string) { - await dispatch(createCurrencyWallet(walletName, walletType, fiatCurrencyCode, true, false, importText)) + await dispatch(createCurrencyWallet(walletName, walletType, fiatCurrencyCode, importText)) } }) )(withTheme(CreateWalletReviewComponent)) diff --git a/src/components/scenes/CryptoExchangeScene.js b/src/components/scenes/CryptoExchangeScene.js index 72fb3d50a0a..091cd6ad156 100644 --- a/src/components/scenes/CryptoExchangeScene.js +++ b/src/components/scenes/CryptoExchangeScene.js @@ -54,7 +54,6 @@ type StateProps = { // Number of times To and From wallets were flipped forceUpdateGuiCounter: number, calculatingMax: boolean, - creatingWallet: boolean, // Determines if a coin can have Exchange Max option hasMaxSpend: boolean, @@ -324,7 +323,6 @@ class CryptoExchangeComponent extends React.Component { launchWalletSelector={this.launchToWalletSelector} onCryptoExchangeAmountChanged={this.toAmountChanged} isFocused={isToFocused} - isThinking={this.props.creatingWallet} focusMe={this.focusToWallet} onNext={this.getQuote} /> @@ -420,7 +418,6 @@ export const CryptoExchangeScene = connect( toCurrencyIcon: cryptoExchange.toCurrencyIcon ?? '', forceUpdateGuiCounter: cryptoExchange.forceUpdateGuiCounter, calculatingMax: cryptoExchange.calculatingMax, - creatingWallet: cryptoExchange.creatingWallet, insufficient: state.cryptoExchange.insufficientError, genericError: state.cryptoExchange.genericShapeShiftError } diff --git a/src/components/themed/WalletListCreateRow.js b/src/components/themed/WalletListCreateRow.js index 94ca9761d2f..dc886268974 100644 --- a/src/components/themed/WalletListCreateRow.js +++ b/src/components/themed/WalletListCreateRow.js @@ -8,7 +8,7 @@ import FastImage from 'react-native-fast-image' import { createCurrencyWallet } from '../../actions/CreateWalletActions' import { approveTokenTerms } from '../../actions/TokenTermsActions.js' -import { refreshWallet } from '../../actions/WalletActions.js' +import { refreshWallet, selectWallet } from '../../actions/WalletActions.js' import { DEFAULT_STARTER_WALLET_NAMES } from '../../constants/WalletAndCurrencyConstants.js' import s from '../../locales/strings.js' import { setEnabledTokens } from '../../modules/Core/Wallets/EnabledTokens.js' @@ -99,9 +99,9 @@ class WalletListCreateRowComponent extends React.PureComponent { if (this.props.createWalletType) { - this.createAndSelectWallet() + this.createAndSelectWallet().catch(showError) } else { - this.createAndSelectToken() + this.createAndSelectToken().catch(showError) } } @@ -177,7 +177,9 @@ export const WalletListCreateRow = connect( dispatch(refreshWallet(walletId)) }, async createWallet(walletName: string, walletType: string, fiatCurrencyCode: string) { - return dispatch(createCurrencyWallet(walletName, walletType, fiatCurrencyCode, false, true)) + const wallet = await dispatch(createCurrencyWallet(walletName, walletType, fiatCurrencyCode)) + dispatch(selectWallet(wallet.id, wallet.currencyInfo.currencyCode)) + return wallet } }) )(withTheme(WalletListCreateRowComponent)) diff --git a/src/reducers/CryptoExchangeReducer.js b/src/reducers/CryptoExchangeReducer.js index ec36c5350af..73536cef811 100644 --- a/src/reducers/CryptoExchangeReducer.js +++ b/src/reducers/CryptoExchangeReducer.js @@ -31,8 +31,7 @@ export type CryptoExchangeState = { // Activity flags: forceUpdateGuiCounter: number, shiftPendingTransaction: boolean, - calculatingMax: boolean, - creatingWallet: boolean + calculatingMax: boolean } const dummyCurrencyInfo: GuiCurrencyInfo = { @@ -71,23 +70,12 @@ const initialState: CryptoExchangeState = { genericShapeShiftError: null, forceUpdateGuiCounter: 0, shiftPendingTransaction: false, - calculatingMax: false, - creatingWallet: false + calculatingMax: false } function cryptoExchangeInner(state = initialState, action: Action): CryptoExchangeState { let forceUpdateGuiCounter switch (action.type) { - case 'UI/WALLETS/CREATE_WALLET_START': { - return { ...state, creatingWallet: true } - } - case 'UI/WALLETS/CREATE_WALLET_SUCCESS': { - return { ...state, creatingWallet: false } - } - case 'UI/WALLETS/CREATE_WALLET_FAILURE': { - return { ...state, creatingWallet: false } - } - case 'SELECT_FROM_WALLET_CRYPTO_EXCHANGE': { return { ...state, diff --git a/src/reducers/scenes/CreateWalletReducer.js b/src/reducers/scenes/CreateWalletReducer.js index c812f460f10..26dfff340ab 100644 --- a/src/reducers/scenes/CreateWalletReducer.js +++ b/src/reducers/scenes/CreateWalletReducer.js @@ -20,7 +20,6 @@ export type AccountActivationPaymentInfo = { } export type CreateWalletState = { - isCreatingWallet: boolean, isCheckingHandleAvailability: boolean, handleAvailableStatus: HandleAvailableStatus, handleActivationInfo: HandleActivationInfo, @@ -28,25 +27,6 @@ export type CreateWalletState = { walletAccountActivationQuoteError: string } -const isCreatingWallet = (state = false, action: Action): boolean => { - switch (action.type) { - case 'UI/WALLETS/CREATE_WALLET_START': { - return true - } - - case 'UI/WALLETS/CREATE_WALLET_SUCCESS': { - return false - } - - case 'UI/WALLETS/CREATE_WALLET_FAILURE': { - return false - } - - default: - return state - } -} - const isCheckingHandleAvailability: Reducer = (state = false, action: Action): boolean => { switch (action.type) { case 'IS_CHECKING_HANDLE_AVAILABILITY': { @@ -111,7 +91,6 @@ const walletAccountActivationQuoteError = (state: string = '', action: Action): } export const createWallet: Reducer = combineReducers({ - isCreatingWallet, isCheckingHandleAvailability, handleAvailableStatus, handleActivationInfo, diff --git a/src/types/reduxActions.js b/src/types/reduxActions.js index be14bfd06aa..aa4409ccdc8 100644 --- a/src/types/reduxActions.js +++ b/src/types/reduxActions.js @@ -70,9 +70,6 @@ type NoDataActionName = | 'TOGGLE_ENABLE_TORCH' | 'UI/SEND_CONFIRMATION/RESET' | 'UI/SEND_CONFIRMATION/TOGGLE_CRYPTO_ON_TOP' - | 'UI/WALLETS/CREATE_WALLET_FAILURE' - | 'UI/WALLETS/CREATE_WALLET_START' - | 'UI/WALLETS/CREATE_WALLET_SUCCESS' | 'USE_LEGACY_REQUEST_ADDRESS' | 'USE_REGULAR_REQUEST_ADDRESS' | 'FIO/EXPIRED_REMINDER_SHOWN' From d1bef0d7144528670578a61aa49a93cb2d678d17 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 1 Feb 2022 00:08:17 -0800 Subject: [PATCH 41/50] Fix improper permissions file error handling We might end up calling `JSON.parse(null)`, which Flow won't like. --- src/components/services/PermissionsManager.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/services/PermissionsManager.js b/src/components/services/PermissionsManager.js index 86397c22aa9..d4377842df0 100644 --- a/src/components/services/PermissionsManager.js +++ b/src/components/services/PermissionsManager.js @@ -114,8 +114,11 @@ export const checkIfDenied = (status: PermissionStatus) => status === RESULTS.BL // Returns true if denied, false if accepted export async function requestPermissionOnSettings(disklet: Disklet, data: Permission, name: string, mandatory: boolean): Promise { - const permissionLimits = await disklet.getText(SETTINGS_PERMISSION_LIMITS).catch(_ => null) // Ignore and don't throw error when file not found - const permissionLimit = permissionLimits != null && JSON.parse(permissionLimits)[data] != null ? JSON.parse(permissionLimits)[data] : 0 + const permissionLimits = await disklet + .getText(SETTINGS_PERMISSION_LIMITS) + .then(text => JSON.parse(text)) + .catch(() => ({})) // Ignore and don't throw error when file not found + const permissionLimit = permissionLimits[data] ?? 0 // Check to ignore the permission checks if not mandatory and already past the limit if (!mandatory && permissionLimit >= SETTINGS_PERMISSION_QUANTITY) return false @@ -144,7 +147,7 @@ export async function requestPermissionOnSettings(disklet: Disklet, data: Permis .setText( SETTINGS_PERMISSION_LIMITS, JSON.stringify({ - ...JSON.parse(permissionLimits), + ...permissionLimits, [data]: permissionLimit + 1 }) ) From 9f07e7415836461af3048331f81527cc905d958b Mon Sep 17 00:00:00 2001 From: William Swanson Date: Mon, 31 Jan 2022 23:58:36 -0800 Subject: [PATCH 42/50] Stop importing the React Native Flow globals These are messing with the `Promise` definition and allowing uncaught Flow errors to slip through. This is why promises have always acted weird in the GUI. --- .flowconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.flowconfig b/.flowconfig index 58e2cf536e6..fc38a9b091a 100644 --- a/.flowconfig +++ b/.flowconfig @@ -27,8 +27,8 @@ node_modules/react-native/Libraries/polyfills/.* [include] [libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow/ +# node_modules/react-native/Libraries/react-native/react-native-interface.js +# node_modules/react-native/flow/ [options] emoji=true From fa3caf70fb5d63495060b5944bcd7db6dc4bd580 Mon Sep 17 00:00:00 2001 From: eliran zach Date: Tue, 8 Feb 2022 01:11:58 -0800 Subject: [PATCH 43/50] Add missing Pods to the lock file --- ios/Podfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 91ff22db8c0..6333e799a73 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -15,10 +15,10 @@ PODS: - CNIOLinux (2.32.3) - CNIOWindows (2.32.3) - CocoaAsyncSocket (7.6.5) - - disklet (0.4.5): + - disklet (0.5.2): - React - DoubleConversion (1.1.6) - - edge-core-js (0.19.4): + - edge-core-js (0.19.5): - React - edge-login-ui-rn (0.9.29): - React @@ -984,9 +984,9 @@ SPEC CHECKSUMS: CNIOLinux: 5921dfefbc4bbe017380b34c510855622147ea41 CNIOWindows: f5aa9dfb401b440a7b4c9cd911e53e981a787193 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - disklet: 4f586f90b70fdb46f06614a5b7342eda5c90f253 + disklet: e7ed3e673ccad9d175a1675f9f3589ffbf69a5fd DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de - edge-core-js: fd0711a17c4f282d4b33898c9a66433ea48ce29f + edge-core-js: 351b78ee9c2839dea279c5addd96ec32013d0a97 edge-login-ui-rn: bb229d0087d664f76a03949df7627ed49fed4144 FBLazyVector: e686045572151edef46010a6f819ade377dfeb4b FBReactNativeSpec: 86d9e030dbb7af0ba0eb4e1b6d52e4af26c7f1f3 From 10171ac6dfcb4c72de8045c13f37c9f33ba8b301 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 8 Feb 2022 00:16:09 -0800 Subject: [PATCH 44/50] Add Solana --- package.json | 4 +- src/constants/WalletAndCurrencyConstants.js | 18 +- src/locales/en_US.js | 1 + src/locales/strings/enUS.json | 1 + src/util/corePlugins.js | 1 + yarn.lock | 259 +++++++++++++++++--- 6 files changed, 253 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 6bcf93509bc..83acc825010 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "safe-buffer": "5.1.2", "scrypt.js": "0.3.0", "sha.js": "2.4.11", + "tweetnacl": "^1.0.3", "uuid": "3.3.2" }, "dependencies": { @@ -105,7 +106,7 @@ "detox": "^18.10.0", "disklet": "^0.5.2", "edge-core-js": "^0.19.5", - "edge-currency-accountbased": "^0.11.11", + "edge-currency-accountbased": "^0.12.0", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.8", @@ -198,6 +199,7 @@ "rollup": "^1.1.2", "rollup-plugin-node-resolve": "4.0.0", "sucrase": "^3.20.0", + "tweetnacl": "^1.0.3", "updot": "^1.1.7", "webpack": "^4.46.0", "webpack-cli": "^4.9.1", diff --git a/src/constants/WalletAndCurrencyConstants.js b/src/constants/WalletAndCurrencyConstants.js index dc7c08d6831..e9e4a81404f 100644 --- a/src/constants/WalletAndCurrencyConstants.js +++ b/src/constants/WalletAndCurrencyConstants.js @@ -61,7 +61,8 @@ export const DEFAULT_STARTER_WALLET_NAMES = { XLM: s.strings.string_first_stellar_wallet_name, XMR: s.strings.string_first_monero_wallet_name, XRP: s.strings.string_first_ripple_wallet_name, - XTZ: s.strings.string_first_tezos_wallet_name + XTZ: s.strings.string_first_tezos_wallet_name, + SOL: s.strings.string_first_solana_wallet_name } /** @@ -103,6 +104,7 @@ export const WALLET_TYPE_ORDER = [ 'wallet:zcash', 'wallet:ethereumclassic', 'wallet:binance', + 'wallet:solana', 'wallet:bitcoinsv', 'wallet:litecoin', 'wallet:eos', @@ -159,6 +161,7 @@ export const CURRENCY_PLUGIN_NAMES = { RBTC: 'rsk', RVN: 'ravencoin', SMART: 'smartcash', + SOL: 'solana', TESTBTC: 'bitcointestnet', TLOS: 'telos', UFO: 'ufo', @@ -410,6 +413,19 @@ export const SPECIAL_CURRENCY_INFO: { }, dummyPublicAddress: 'bnb1rt449yu7us6hmk4pmyr8talc60ydkwp4qkvcl7' }, + SOL: { + isImportKeySupported: { + privateKeyLabel: s.strings.create_wallet_import_input_prompt, + privateKeyInstructions: s.strings.create_wallet_import_instructions + }, + dummyPublicAddress: 'DEd1rkRyr5bRkJHgaAKMSYjYC1KMz3Hc5bSs4Jiwt29x', + uniqueIdentifierInfo: { + addButtonText: s.strings.unique_identifier_dropdown_option_memo, + identifierName: s.strings.unique_identifier_memo, + keyboardType: 'default' + }, + noChangeMiningFee: true + }, FIO: { dummyPublicAddress: 'FIO4uX8tSuBZyHJmpPfc5Q6WrZ9eXd33wdgfWvfJ2fjGsg9yH4Dkd', noChangeMiningFee: true, diff --git a/src/locales/en_US.js b/src/locales/en_US.js index f6dcdd05d92..d6f45cb1b47 100644 --- a/src/locales/en_US.js +++ b/src/locales/en_US.js @@ -384,6 +384,7 @@ const strings = { string_first_rsk_wallet_name: 'My RSK', string_first_bnb_wallet_name: 'My BNB', string_first_eboost_wallet_name: 'My eBoost', + string_first_solana_wallet_name: 'My Solana', string_first_doge_wallet_name: 'My Doge', string_first_fantom_wallet_name: 'My Fantom', string_first_hedera_wallet_name: 'My Hedera', diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index adf72cf1f49..265499c6524 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -361,6 +361,7 @@ "string_first_rsk_wallet_name": "My RSK", "string_first_bnb_wallet_name": "My BNB", "string_first_eboost_wallet_name": "My eBoost", + "string_first_solana_wallet_name": "My Solana", "string_first_doge_wallet_name": "My Doge", "string_first_fantom_wallet_name": "My Fantom", "string_first_hedera_wallet_name": "My Hedera", diff --git a/src/util/corePlugins.js b/src/util/corePlugins.js index 2849aa16df0..cb0947ca92b 100644 --- a/src/util/corePlugins.js +++ b/src/util/corePlugins.js @@ -42,6 +42,7 @@ export const currencyPlugins = { rsk: true, stellar: true, tezos: true, + solana: true, // edge-currency-bitcoin: bitcoin: true, bitcoincash: true, diff --git a/yarn.lock b/yarn.lock index d8e1000d318..d1597c59b78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -991,6 +991,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.11.2": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.0.tgz#b8d142fc0f7664fb3d9b5833fd40dcbab89276c0" + integrity sha512-etcO/ohMNaNA2UBdaXBBSX/3aEzFMRrVfaPv8Ptc0k+cWpWW0QFiGZ2XnVqQZI1Cf734LbPGmqBKWESfW4x/dQ== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" @@ -1206,6 +1213,27 @@ "@ethereumjs/common" "^2.4.0" ethereumjs-util "^7.1.0" +"@ethersproject/bytes@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" + integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + dependencies: + "@ethersproject/logger" "^5.5.0" + +"@ethersproject/logger@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" + integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + +"@ethersproject/sha2@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" + integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== + dependencies: + "@ethersproject/bytes" "^5.5.0" + "@ethersproject/logger" "^5.5.0" + hash.js "1.1.7" + "@fioprotocol/fiojs@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@fioprotocol/fiojs/-/fiojs-1.0.1.tgz#81779437603741bc4ca1c76d119b64c4157a3874" @@ -1819,6 +1847,33 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@solana/buffer-layout@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" + integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== + dependencies: + buffer "~6.0.3" + +"@solana/web3.js@^1.32.0": + version "1.33.0" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.33.0.tgz#3b8c0b4cd259ffe8764937f1001f79958c5d9533" + integrity sha512-R53wvQQsUKCCJ9UmOfDlxCwC94jzjmpjr6wT/Xf1uFavZblSLAtzLaF4vbGIS465lk3mW6oJMtASd8cqSnr8Mw== + dependencies: + "@babel/runtime" "^7.12.5" + "@ethersproject/sha2" "^5.5.0" + "@solana/buffer-layout" "^3.0.0" + bn.js "^5.0.0" + borsh "^0.4.0" + bs58 "^4.0.1" + buffer "6.0.1" + cross-fetch "^3.1.4" + jayson "^3.4.4" + js-sha3 "^0.8.0" + rpc-websockets "^7.4.2" + secp256k1 "^4.0.2" + superstruct "^0.14.2" + tweetnacl "^1.0.0" + "@stablelib/base64@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/base64/-/base64-1.0.1.tgz#bdfc1c6d3a62d7a3b7bbc65b6cce1bb4561641be" @@ -1957,7 +2012,7 @@ dependencies: "@babel/types" "^7.3.0" -"@types/bn.js@^4.11.3": +"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.5": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== @@ -1994,7 +2049,7 @@ "@types/express-serve-static-core" "*" "@types/node" "*" -"@types/connect@*": +"@types/connect@*", "@types/connect@^3.4.33": version "3.4.35" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== @@ -2006,7 +2061,7 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" integrity sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg== -"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": +"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.9": version "4.17.28" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" integrity sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig== @@ -2096,6 +2151,11 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/lodash@^4.14.159": + version "4.14.178" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" + integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== + "@types/mime@^1": version "1.3.2" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" @@ -2121,6 +2181,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.3.tgz#7a8f2838603ea314d1d22bb3171d899e15c57bd5" integrity sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ== +"@types/node@^12.12.54": + version "12.20.43" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.43.tgz#6cf47894da4a4748c62fccf720ba269e1b1ff5a4" + integrity sha512-HCfJdaYqJX3BCzeihgZrD7b85Cu05OC/GVJ4kEYIflwUs4jbnUlLLWoq7hw1LBcdvUyehO+gr6P5JQ895/2ZfA== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -2226,6 +2291,13 @@ resolved "https://registry.yarnpkg.com/@types/text-encoding/-/text-encoding-0.0.35.tgz#6f14474e0b232bc70c59677aadc65dcc5a99c3a9" integrity sha512-jfo/A88XIiAweUa8np+1mPbm3h2w0s425YrI8t3wk5QxhH6UI7w517MboNVnGDeMSuoFwA8Rwmklno+FicvV4g== +"@types/ws@^7.4.4": + version "7.4.7" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" + integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== + dependencies: + "@types/node" "*" + "@types/ws@^8.2.2": version "8.2.2" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.2.tgz#7c5be4decb19500ae6b3d563043cd407bf366c21" @@ -2553,6 +2625,14 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + abab@^2.0.3, abab@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.5.tgz#c0b678fb32d60fc1219c784d6a826fe385aeb79a" @@ -3494,7 +3574,7 @@ bluebird@~3.4.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= -bn.js@4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.3, bn.js@^4.11.7, bn.js@^4.11.8, bn.js@^4.4.0, bn.js@^4.8.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: +bn.js@4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.3, bn.js@^4.11.7, bn.js@^4.11.8, bn.js@^4.4.0, bn.js@^4.8.0, bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -3548,6 +3628,16 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= +borsh@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" + integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== + dependencies: + "@types/bn.js" "^4.11.5" + bn.js "^5.0.0" + bs58 "^4.0.0" + text-encoding-utf-8 "^1.0.2" + boxen@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.0.1.tgz#657528bdd3f59a772b8279b831f27ec2c744664b" @@ -3796,6 +3886,14 @@ buffer-xor@^1.0.2, buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= +buffer@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" + integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + buffer@^4.3.0: version "4.9.2" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" @@ -3813,11 +3911,26 @@ buffer@^5.0.6, buffer@^5.0.8, buffer@^5.1.0, buffer@^5.2.1, buffer@^5.4.3: base64-js "^1.3.1" ieee754 "^1.1.13" +buffer@~6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + buffers@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s= +bufferutil@^4.0.1: + version "4.0.6" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.6.tgz#ebd6c67c7922a0e902f053e5d8be5ec850e48433" + integrity sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw== + dependencies: + node-gyp-build "^4.3.0" + builtin-modules@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" @@ -4133,6 +4246,11 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +circular-json@^0.5.9: + version "0.5.9" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" + integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== + cjs-module-lexer@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" @@ -4381,7 +4499,7 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== -commander@^2.19.0, commander@^2.20.0: +commander@^2.19.0, commander@^2.20.0, commander@^2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -5029,6 +5147,11 @@ del@^6.0.0: rimraf "^3.0.2" slash "^3.0.0" +delay@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" + integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -5347,16 +5470,17 @@ edge-core-js@^0.19.5: yaob "^0.3.7" yavent "^0.1.3" -edge-currency-accountbased@^0.11.11: - version "0.11.11" - resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.11.11.tgz#33974960371902999f2776e56428d47851a129db" - integrity sha512-ryKYyx9rdV3qrefY4/Nz1q/ZU19leesUjzCjKKLmgJPsnOh1SWDkN2zHgbLcdDksLQzcednIK1CmKcRAJ2dO+Q== +edge-currency-accountbased@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.12.0.tgz#0e5ef416ac54f0832c222a32d4862af14f46c4f5" + integrity sha512-3f8g/iBdGuUTDZCfsCdUopBAOT11OgV0MflSOm7+FlAUmW5lkU/6eaH/UAJ4G0fUtI3K8WVfaWyzepyrLZ3tlA== dependencies: "@binance-chain/javascript-sdk" "^2.14.4" "@ethereumjs/common" "^2.4.0" "@ethereumjs/tx" "^3.3.0" "@fioprotocol/fiosdk" "^1.5.0" "@hashgraph/sdk" "^1.1.9" + "@solana/web3.js" "^1.32.0" "@walletconnect/client" "1.6.6" biggystring "^3.0.0" bip39 "^3.0.2" @@ -5374,6 +5498,7 @@ edge-currency-accountbased@^0.11.11: rfc4648 "^1.5.0" stellar-sdk "^0.11.0" tezos-uri "^1.0.3" + tweetnacl "^1.0.3" uri-js "^3.0.2" url-parse "^1.4.1" xrpl "^2.1.1" @@ -5575,7 +5700,7 @@ envinfo@^7.7.2, envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -"eosjs-api@https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb", "eosjs-api@https://github.com/EdgeApp/eosjs-api.git#prepare-script": +"eosjs-api@git+https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb", "eosjs-api@https://github.com/EdgeApp/eosjs-api.git#prepare-script": version "7.0.4" resolved "https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb" dependencies: @@ -6105,9 +6230,9 @@ ethereumjs-util@^7.1.0: ethjs-util "0.1.6" rlp "^2.2.4" -"ethereumjs-wallet@https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef": +"ethereumjs-wallet@git+https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef": version "0.6.0" - resolved "https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef" + resolved "git+https://github.com/EdgeApp/ethereumjs-wallet.git#6157e11ea10a734fbe55f4c7ea542780975b60ef" dependencies: aes-js "^0.2.3" bs58check "^1.0.8" @@ -6140,7 +6265,7 @@ eventemitter3@^3.1.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" integrity sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA== -eventemitter3@^4.0.0: +eventemitter3@^4.0.0, eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== @@ -6396,9 +6521,14 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -"eztz.js@https://github.com/EdgeApp/eztz.git#edge-fixes": +eyes@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= + +"eztz.js@git+https://github.com/EdgeApp/eztz.git#edge-fixes": version "0.0.1" - resolved "https://github.com/EdgeApp/eztz.git#6937ce236912dae8da8409838518023a88eacf6c" + resolved "git+https://github.com/EdgeApp/eztz.git#6937ce236912dae8da8409838518023a88eacf6c" dependencies: bignumber.js "^7.2.1" bip39 "^3.0.2" @@ -7482,7 +7612,7 @@ iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@~0.4.13: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.13, ieee754@^1.1.4: +ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -8102,6 +8232,11 @@ isomorphic-fetch@^2.1.1, isomorphic-fetch@^2.2.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -8148,6 +8283,27 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jayson@^3.4.4: + version "3.6.6" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.6.tgz#189984f624e398f831bd2be8e8c80eb3abf764a1" + integrity sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ== + dependencies: + "@types/connect" "^3.4.33" + "@types/express-serve-static-core" "^4.17.9" + "@types/lodash" "^4.14.159" + "@types/node" "^12.12.54" + "@types/ws" "^7.4.4" + JSONStream "^1.3.5" + commander "^2.20.3" + delay "^5.0.0" + es6-promisify "^5.0.0" + eyes "^0.1.8" + isomorphic-ws "^4.0.1" + json-stringify-safe "^5.0.1" + lodash "^4.17.20" + uuid "^8.3.2" + ws "^7.4.5" + jest-changed-files@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" @@ -8741,6 +8897,11 @@ jsonify@~0.0.0: resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + jsonparse@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.2.0.tgz#5c0c5685107160e72fe7489bddea0b44c2bc67bd" @@ -9135,7 +9296,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@4.17.21, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.7.0: +lodash@4.17.21, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -9981,6 +10142,11 @@ node-gyp-build@^4.2.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== +node-gyp-build@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -12163,6 +12329,20 @@ rollup@^1.1.2: "@types/node" "*" acorn "^7.1.0" +rpc-websockets@^7.4.2: + version "7.4.17" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.17.tgz#f38845dd96db0442bff9e15fba9df781beb44cc0" + integrity sha512-eolVi/qlXS13viIUH9aqrde902wzSLAai0IjmOZSRefp5I3CSG/vCnD0c0fDSYCWuEyUoRL1BHQA8K1baEUyow== + dependencies: + "@babel/runtime" "^7.11.2" + circular-json "^0.5.9" + eventemitter3 "^4.0.7" + uuid "^8.3.0" + ws "^7.4.5" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + rsvp@^4.8.4: version "4.8.5" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" @@ -12359,6 +12539,15 @@ secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" +secp256k1@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + secure-random@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/secure-random/-/secure-random-1.1.2.tgz#ed103b460a851632d420d46448b2a900a41e7f7c" @@ -13247,6 +13436,11 @@ superagent@5.1.0: readable-stream "^3.4.0" semver "^6.1.1" +superstruct@^0.14.2: + version "0.14.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" + integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== + superstruct@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.6.2.tgz#c5eb034806a17ff98d036674169ef85e4c7f6a1c" @@ -13419,6 +13613,11 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" +text-encoding-utf-8@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" + integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + text-encoding@0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.7.0.tgz#f895e836e45990624086601798ea98e8f36ee643" @@ -13472,7 +13671,7 @@ through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@^2.0.3: readable-stream "~2.3.6" xtend "~4.0.1" -through@^2.3.6, through@^2.3.8: +"through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -13657,17 +13856,7 @@ tweetnacl-util@^0.15.0: resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -tweetnacl@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.0.tgz#713d8b818da42068740bf68386d0479e66fc8a7b" - integrity sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins= - -tweetnacl@^1.0.3: +tweetnacl@^0.14.3, tweetnacl@^1.0.0, tweetnacl@^1.0.3, tweetnacl@~0.14.0: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== @@ -13990,6 +14179,13 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +utf-8-validate@^5.0.2: + version "5.0.8" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.8.tgz#4a735a61661dbb1c59a0868c397d2fe263f14e58" + integrity sha512-k4dW/Qja1BYDl2qD4tOMB9PFVha/UJtxTc1cXYOe3WwA/2m0Yn4qB7wLMpJyLJ/7DR0XnTut3HsCSzDT4ZvKgA== + dependencies: + node-gyp-build "^4.3.0" + utf8-byte-length@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz#f45f150c4c66eee968186505ab93fcbb8ad6bf61" @@ -14533,6 +14729,11 @@ ws@^7, ws@^7.0.0, ws@^7.4.4: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1" integrity sha512-xzyu3hFvomRfXKH8vOFMU3OguG6oOvhXMo3xsGy3xWExqaM2dxBbVxuD99O7m3ZUFMvvscsZDqxfgMaRr/Nr1g== +ws@^7.4.5: + version "7.5.7" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" + integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== + ws@^8.1.0, ws@^8.2.2: version "8.4.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.4.0.tgz#f05e982a0a88c604080e8581576e2a063802bed6" From fee31466870fef8b3f0c5d72c09359d5a311edb8 Mon Sep 17 00:00:00 2001 From: William Swanson Date: Tue, 8 Feb 2022 11:11:23 -0800 Subject: [PATCH 45/50] Upgrade to react-native-mymonero-core v0.1.1 --- ios/Podfile.lock | 4 ++-- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6333e799a73..2042679e9cf 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -420,7 +420,7 @@ PODS: - React-Core - react-native-mail (6.1.1): - React-Core - - react-native-mymonero-core (0.1.0): + - react-native-mymonero-core (0.1.1): - React - react-native-netinfo (5.9.10): - React-Core @@ -1040,7 +1040,7 @@ SPEC CHECKSUMS: react-native-flipper: 8d0ada062fbc2c7460cc0d343aded6fc3f9c90dc react-native-image-picker: a6e56460d34905c849ada551db30897dc7f3d535 react-native-mail: 8fdcd3aef007c33a6877a18eb4cf7447a1d4ce4a - react-native-mymonero-core: c5e0e039b4977be65ed936a1d5301da3448edff7 + react-native-mymonero-core: 59aaed6e2aef48f8d0e12b564e1927d613076b86 react-native-netinfo: 30fb89fa913c342be82a887b56e96be6d71201dd react-native-safari-view: 955d7160d159241b8e9395d12d10ea0ef863dcdd react-native-smart-splash-screen: a961513689f11d63e8496684c2fa4be2d24fe23b diff --git a/package.json b/package.json index 83acc825010..affe9f89410 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "react-native-localize": "^2.0.2", "react-native-mail": "^6.1.1", "react-native-material-textfield": "^0.16.1", - "react-native-mymonero-core": "^0.1.0", + "react-native-mymonero-core": "^0.1.1", "react-native-patina": "^0.1.6", "react-native-permissions": "^3.0.0", "react-native-popup-menu": "0.13.3", diff --git a/yarn.lock b/yarn.lock index d1597c59b78..772bada6392 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11477,10 +11477,10 @@ react-native-material-textfield@0.16.1, react-native-material-textfield@^0.16.1, dependencies: prop-types "^15.5.9" -react-native-mymonero-core@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/react-native-mymonero-core/-/react-native-mymonero-core-0.1.0.tgz#57d160b076ae50c037cffa94760e4f2f3ca2de88" - integrity sha512-2NV+V1GFP/NaKp9enVDWrSrA9gMMDSmBXPnNW/K2eEXyGV9fC0DJqDo6ljlKr7ANak1X5ln/6yV2Z7jrl2Xgwg== +react-native-mymonero-core@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/react-native-mymonero-core/-/react-native-mymonero-core-0.1.1.tgz#17b8c1172f29ef2c4a52d6343d6158650936dabf" + integrity sha512-NMZNSEgkTPNismOJ4frieL1A7SHGureTBxuqIvhhQSLcdemtzcWCeFh907ugMUHPkZwUh0ujN/ZLwBIoCk3MMA== react-native-patina@^0.1.6: version "0.1.6" From 717525294761e37a72108233c304960db0907004 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 8 Feb 2022 11:14:21 -0800 Subject: [PATCH 46/50] v2.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index affe9f89410..f3799df193b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edge-react-gui", - "version": "2.10.0", + "version": "2.11.0", "private": true, "description": "Edge Wallet React GUI", "homepage": "https://edge.app", From 1c957a2614f6cf156fe6ddcc9d88489237cc547e Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 10 Feb 2022 15:42:55 -0800 Subject: [PATCH 47/50] Upgrade edge-currency-accountbased to v0.12.1 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f3799df193b..ac498018e4d 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "detox": "^18.10.0", "disklet": "^0.5.2", "edge-core-js": "^0.19.5", - "edge-currency-accountbased": "^0.12.0", + "edge-currency-accountbased": "^0.12.1", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.8", diff --git a/yarn.lock b/yarn.lock index 772bada6392..a77f4e19404 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5470,10 +5470,10 @@ edge-core-js@^0.19.5: yaob "^0.3.7" yavent "^0.1.3" -edge-currency-accountbased@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.12.0.tgz#0e5ef416ac54f0832c222a32d4862af14f46c4f5" - integrity sha512-3f8g/iBdGuUTDZCfsCdUopBAOT11OgV0MflSOm7+FlAUmW5lkU/6eaH/UAJ4G0fUtI3K8WVfaWyzepyrLZ3tlA== +edge-currency-accountbased@^0.12.1: + version "0.12.1" + resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.12.1.tgz#05c8addf422fc706fe1498f58cbd8c8ed487e2cb" + integrity sha512-m5qfHppiKxuNFw9FxlFLk0cmXRhnJHbkXt7vR7ID1Z1QoLydFuk1KtT2TJdfms1U2C22e9PoaRIoLi1aJU9a6Q== dependencies: "@binance-chain/javascript-sdk" "^2.14.4" "@ethereumjs/common" "^2.4.0" From 0773340c8fd85934595b1c2f1d277c0603e45b4b Mon Sep 17 00:00:00 2001 From: Samuel Holmes Date: Wed, 9 Feb 2022 12:33:45 -0800 Subject: [PATCH 48/50] Use the transaction's `unlockDate` from `makeSpend` in change scene --- src/components/scenes/StakingChangeScene.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/scenes/StakingChangeScene.js b/src/components/scenes/StakingChangeScene.js index dc825daeba5..74696a02898 100644 --- a/src/components/scenes/StakingChangeScene.js +++ b/src/components/scenes/StakingChangeScene.js @@ -257,12 +257,8 @@ export const StakingChangeSceneComponent = (props: Props) => { } const renderRemove = () => { - let unlockDate = '' - if (SPECIAL_CURRENCY_INFO[currencyCode].stakeLockPeriod != null) { - const DAY_INTERVAL = 1000 * 60 * 60 * 24 - const beginingOfGmtDay = Math.floor(Date.now() / DAY_INTERVAL) * DAY_INTERVAL - unlockDate = formatTimeDate(new Date(beginingOfGmtDay + SPECIAL_CURRENCY_INFO[currencyCode].stakeLockPeriod), true) - } + const unlockDate = tx?.otherParams?.ui.unlockDate + const unlockDateFormat = unlockDate ? formatTimeDate(unlockDate, true) : '' let estReward = '0' if (tx != null && tx.otherParams != null && tx.otherParams.ui != null && tx.otherParams.ui.estReward != null) { estReward = bns.add(convertNativeToDenomination(currencyDenomination.multiplier)(tx.otherParams.ui.estReward), '0') @@ -281,7 +277,7 @@ export const StakingChangeSceneComponent = (props: Props) => { )} - {unlockDate} + {unlockDateFormat} ) From 3bf60871171bf1c3d86f6163903dd7f58ab7a306 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 10 Feb 2022 16:16:59 -0800 Subject: [PATCH 49/50] Upgrade edge-currency-accountbased to v0.12.2 --- package.json | 2 +- yarn.lock | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ac498018e4d..4acf96365ef 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "detox": "^18.10.0", "disklet": "^0.5.2", "edge-core-js": "^0.19.5", - "edge-currency-accountbased": "^0.12.1", + "edge-currency-accountbased": "^0.12.2", "edge-currency-bitcoin": "^4.9.20", "edge-currency-monero": "^0.3.4", "edge-exchange-plugins": "^0.12.8", diff --git a/yarn.lock b/yarn.lock index a77f4e19404..3ff21e7aa43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4757,7 +4757,7 @@ create-hmac@1.1.6: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4, create-hmac@^1.1.7: +create-hmac@1.1.7, create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -5435,6 +5435,15 @@ ecurve@^1.0.6: bigi "^1.1.0" safe-buffer "^5.0.1" +ed25519-hd-key@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ed25519-hd-key/-/ed25519-hd-key-1.2.0.tgz#819d43c6a96477c9385bd121dccc94dbc6c6598c" + integrity sha512-pwES3tQ4Z8g3sfIBZEgtuTwFtHq5AlB9L8k9a48k7qPn74q2OmgrrgkdwyJ+P2GVTOBVCClAC7w21Wpksso3gw== + dependencies: + bip39 "3.0.2" + create-hmac "1.1.7" + tweetnacl "1.0.3" + ed25519@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/ed25519/-/ed25519-0.0.4.tgz#e56218ace2fc903d259593aef0b2a9639f475beb" @@ -5470,10 +5479,10 @@ edge-core-js@^0.19.5: yaob "^0.3.7" yavent "^0.1.3" -edge-currency-accountbased@^0.12.1: - version "0.12.1" - resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.12.1.tgz#05c8addf422fc706fe1498f58cbd8c8ed487e2cb" - integrity sha512-m5qfHppiKxuNFw9FxlFLk0cmXRhnJHbkXt7vR7ID1Z1QoLydFuk1KtT2TJdfms1U2C22e9PoaRIoLi1aJU9a6Q== +edge-currency-accountbased@^0.12.2: + version "0.12.2" + resolved "https://registry.yarnpkg.com/edge-currency-accountbased/-/edge-currency-accountbased-0.12.2.tgz#69d9415bbe9f8f60c2c66386558254c892db2916" + integrity sha512-Sk0IyYu1U4F4yXUJ4Nu8K73F9N4BBP2mU3bMmR7OWdu4dx3/RbIcLWaQ156SbLrnt5ieLGhYthMsXjhi/5aDvA== dependencies: "@binance-chain/javascript-sdk" "^2.14.4" "@ethereumjs/common" "^2.4.0" @@ -5485,6 +5494,7 @@ edge-currency-accountbased@^0.12.1: biggystring "^3.0.0" bip39 "^3.0.2" cleaners "^0.3.12" + ed25519-hd-key "^1.2.0" eosjs "^21.0.3" eosjs-api "https://github.com/EdgeApp/eosjs-api.git#3676348b6a7443389b28d21c98067760c51e02fb" eosjs-ecc "^4.0.7" @@ -13856,7 +13866,7 @@ tweetnacl-util@^0.15.0: resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== -tweetnacl@^0.14.3, tweetnacl@^1.0.0, tweetnacl@^1.0.3, tweetnacl@~0.14.0: +tweetnacl@1.0.3, tweetnacl@^0.14.3, tweetnacl@^1.0.0, tweetnacl@^1.0.3, tweetnacl@~0.14.0: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== From 720eb51c6480e4bf9f205a28127f50c8ea23484e Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 14 Feb 2022 14:24:03 -0800 Subject: [PATCH 50/50] v2.11.0 Changelog --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c83f76c7f..90b7f6e9582 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # edge-react-gui +## 2.11.0 (2022-02-14) + +- Add Solana (SOL) support +- Add error localization +- Fix staking end date display +- Fix Bitpay error for unsupported currencies +- Fix React Native Promise type-checking +- Log error stack traces in development mode +- Upgrade edge-core-js to v0.19.5 + - changed: Send the optional keyOptions parameter through the importKey methods. + - fixed: Remove JCenter from the Android build file. +- Upgrade edge-currency-accountbased to v0.12.2 + - Add Solana (SOL) + - FIO: Abstract unlockDate calculation into a getUnlockDate method + - SOL: Use industry standard derivation path + - SOL: Prevent sending empty memo + - SOL: Update explorer links + ## 2.10.0 (2022-02-03) - FIO: Add staking support