diff --git a/Gemfile b/Gemfile index 6a7d5c7..8d72c37 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -gem 'cocoapods', '~> 1.13' -gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' +# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper +# bound in the template on Cocoapods with next React Native release. +gem 'cocoapods', '>= 1.13', '< 1.15' +gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' diff --git a/android/app/build.gradle b/android/app/build.gradle index 2719a8b..f9a7bc2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -81,8 +81,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion resConfigs "en", "es" - versionCode 17 - versionName "1.5.2" + versionCode 18 + versionName "1.6.0" } signingConfigs { release { @@ -101,6 +101,7 @@ android { buildTypes { debug { signingConfig signingConfigs.debug + applicationIdSuffix '.debug' } release { // Caution! In production, you need to generate your own keystore file. diff --git a/package-lock.json b/package-lock.json index 80ca185..2e1641b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "rungecoin", - "version": "1.5.2", + "version": "1.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rungecoin", - "version": "1.5.2", + "version": "1.6.0", "hasInstallScript": true, "dependencies": { - "@ledgerhq/hw-app-eth": "^6.35.1", - "@ledgerhq/hw-app-trx": "^6.28.1", - "@ledgerhq/react-native-hid": "^6.31.1", - "@ledgerhq/react-native-hw-transport-ble": "^6.32.0", + "@ledgerhq/hw-app-eth": "^6.35.4", + "@ledgerhq/hw-app-trx": "^6.28.3", + "@ledgerhq/react-native-hid": "^6.31.3", + "@ledgerhq/react-native-hw-transport-ble": "^6.32.2", "@react-native-async-storage/async-storage": "^1.21.0", "@react-native-clipboard/clipboard": "^1.11.2", "@react-navigation/native": "^6.1.7", @@ -31,7 +31,7 @@ "react": "18.2.0", "react-content-loader": "^6.2.0", "react-i18next": "^12.1.5", - "react-native": "0.73.2", + "react-native": "0.73.4", "react-native-ble-manager": "^10.1.2", "react-native-ble-plx": "^2.0.3", "react-native-camera-kit": "^13.0.0", @@ -61,9 +61,9 @@ "@babel/plugin-transform-flow-strip-types": "^7.23.3", "@babel/preset-env": "^7.23.7", "@babel/runtime": "^7.23.7", - "@react-native/babel-preset": "0.73.19", + "@react-native/babel-preset": "0.73.21", "@react-native/eslint-config": "0.73.2", - "@react-native/metro-config": "0.73.3", + "@react-native/metro-config": "0.73.5", "@react-native/typescript-config": "0.73.1", "@tsconfig/react-native": "^3.0.2", "@types/jest": "^29.2.1", @@ -3798,9 +3798,9 @@ } }, "node_modules/@ledgerhq/cryptoassets": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-11.3.0.tgz", - "integrity": "sha512-FT3PQFkPDMRTOMGaLdBPs7xYq8arDkiJ13eAZ+LDbVX/DKqS2GGSRXPSeDAh4B2RQ3mb2cfmVpYdkG3EszsCdA==", + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/cryptoassets/-/cryptoassets-11.4.0.tgz", + "integrity": "sha512-1M0iNyZlmf4MbLGk6vl5CK3gyHAT0yeUzkMbQn+Eo3JL0Y8ng7bl39GGRVasD7X7d/ue2nrG1bX6peGhLcDL/Q==", "dependencies": { "axios": "^1.6.0", "bs58check": "^2.1.2", @@ -3849,13 +3849,13 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@ledgerhq/domain-service": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/@ledgerhq/domain-service/-/domain-service-1.1.16.tgz", - "integrity": "sha512-ovdYTrostrbQl5SnKoUw4BeYfLRfBSe7S0zEV9MHo3MlSHI0H4sfcpfM7g8CXybwOg/xHaP9uKm4Mlbg7JNxrg==", + "version": "1.1.17", + "resolved": "https://registry.npmjs.org/@ledgerhq/domain-service/-/domain-service-1.1.17.tgz", + "integrity": "sha512-EAnbuuuWJpFYHp1a4fMh8cNk5Lic+4Rwf4xGXAOHKcUUT90Q3/VYiom1+ZZwKA8PBgebbxE695UDKK1SzPvh8Q==", "dependencies": { "@ledgerhq/errors": "^6.16.1", "@ledgerhq/logs": "^6.12.0", - "@ledgerhq/types-live": "^6.43.1", + "@ledgerhq/types-live": "^6.44.0", "axios": "^1.3.4", "eip55": "^2.1.1", "react": "^18.2.0", @@ -3868,13 +3868,13 @@ "integrity": "sha512-4D4wKecGzQpIu7sx03Sg4uE1e8g1oZUndWgw9gw776H8h9ov9c5TxPaldTn2j6orPECAERViLf7LTO4L5pE2Cw==" }, "node_modules/@ledgerhq/evm-tools": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@ledgerhq/evm-tools/-/evm-tools-1.0.12.tgz", - "integrity": "sha512-tUT3m1nGoNRoThIP434JZvtPHZ19C+ldVPbqoD8sl0QX9FlbG5xyI/Rvj9XsOfiB1nGCJPcnwC5roaZNW3eAEg==", + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/@ledgerhq/evm-tools/-/evm-tools-1.0.14.tgz", + "integrity": "sha512-L1fj3mbcZPueCJ/ZwxKXQegpY561NkxGd8nljF/JVqwH/B1N+usdZb9HZswrsgWjQdxqeQykgz7ZZgYolU+vlg==", "dependencies": { - "@ledgerhq/cryptoassets": "^11.3.0", - "@ledgerhq/live-env": "^0.8.0", - "@ledgerhq/live-network": "^1.1.10", + "@ledgerhq/cryptoassets": "^11.4.0", + "@ledgerhq/live-env": "^0.9.0", + "@ledgerhq/live-network": "^1.1.11", "crypto-js": "4.2.0", "ethers": "5.7.2" } @@ -3927,44 +3927,36 @@ } }, "node_modules/@ledgerhq/hw-app-eth": { - "version": "6.35.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.35.1.tgz", - "integrity": "sha512-fgB8nsXLUohd+KUOlbfMkiVYVltz/IPPJxknthKMCbWpYanxZ+5QF732TOEY2dJSiVRJ2RRNTX+Hbb1mctczUw==", + "version": "6.35.4", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-eth/-/hw-app-eth-6.35.4.tgz", + "integrity": "sha512-afTaEr7AxDLoFI4ThyJTFEKSjCVTcYynQhg/WSH9nZoTEY4Qg9sF6iUvRIC7iyoEv5tjT7L+Ooz/9Q4sh201zQ==", "dependencies": { "@ethersproject/abi": "^5.5.0", "@ethersproject/rlp": "^5.5.0", - "@ledgerhq/cryptoassets": "^11.3.0", - "@ledgerhq/domain-service": "^1.1.16", + "@ledgerhq/cryptoassets": "^11.4.0", + "@ledgerhq/domain-service": "^1.1.17", "@ledgerhq/errors": "^6.16.1", - "@ledgerhq/evm-tools": "^1.0.12", - "@ledgerhq/hw-transport": "^6.30.1", - "@ledgerhq/hw-transport-mocker": "^6.28.1", + "@ledgerhq/evm-tools": "^1.0.14", + "@ledgerhq/hw-transport": "^6.30.3", + "@ledgerhq/hw-transport-mocker": "^6.28.3", "@ledgerhq/logs": "^6.12.0", - "@ledgerhq/types-live": "^6.43.1", + "@ledgerhq/types-live": "^6.44.0", "axios": "^1.3.4", "bignumber.js": "^9.1.2" } }, - "node_modules/@ledgerhq/hw-app-eth/node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, "node_modules/@ledgerhq/hw-app-trx": { - "version": "6.28.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-trx/-/hw-app-trx-6.28.1.tgz", - "integrity": "sha512-2qIWOAMQWkdwyOA4aynyWO6s1w3XCH12USlUf0mI8D5H+oDq09QJhHvxFxQcUdnGTQJ/LgsSe393hxMPTi6W3w==", + "version": "6.28.3", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-app-trx/-/hw-app-trx-6.28.3.tgz", + "integrity": "sha512-sQQ/5DMrqYVM476FbgxJ81IHu2f4Z1mo+ebavboDuAhzPqcmNWbVixaboxLjfnjupP2gMgJHsJqmRmCfAydf3Q==", "dependencies": { - "@ledgerhq/hw-transport": "^6.30.1" + "@ledgerhq/hw-transport": "^6.30.3" } }, "node_modules/@ledgerhq/hw-transport": { - "version": "6.30.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.1.tgz", - "integrity": "sha512-Xeeo4nt33g5Fsp3CdsPvcc2Uk7dwYeKRSlSFLWcYAAKprf/PmxgNekhke1eaNU/wLoeLOWhY2Cki8F8w9nLMdQ==", + "version": "6.30.3", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport/-/hw-transport-6.30.3.tgz", + "integrity": "sha512-eqtTCGy8wFCxl+hZSEpjVqn1EDjQhFCne/qUyY0aA36efhWUF6bCRAhkq1e5i7g2P6TbxcIM5P5PW67dILuqIQ==", "dependencies": { "@ledgerhq/devices": "^8.2.0", "@ledgerhq/errors": "^6.16.1", @@ -3973,31 +3965,31 @@ } }, "node_modules/@ledgerhq/hw-transport-mocker": { - "version": "6.28.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.1.tgz", - "integrity": "sha512-o2psew3qYp1O7Bh3qCdktGxm5HqVl3RHFl1zzxUOSr4i3nxvLhGvm0Ku/5tFLRjaxVwmSo6f7pBN9o+rOpcrNg==", + "version": "6.28.3", + "resolved": "https://registry.npmjs.org/@ledgerhq/hw-transport-mocker/-/hw-transport-mocker-6.28.3.tgz", + "integrity": "sha512-V5hf6oPytSgoBx+3eaCMoSZGFHXwEP+89g3somX1paGwJXwnzNX1+ADVr0a/xYQE+l7j3Os8TdVmEj0eF0U75A==", "dependencies": { - "@ledgerhq/hw-transport": "^6.30.1", + "@ledgerhq/hw-transport": "^6.30.3", "@ledgerhq/logs": "^6.12.0", "rxjs": "^7.8.1" } }, "node_modules/@ledgerhq/live-env": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/live-env/-/live-env-0.8.0.tgz", - "integrity": "sha512-RLMNkbdwX2W8Kaizq2S4S9Zg32NcQ+vUyhk3UOlcbr6bEByAUcLUfQjQ7bUJfGEtRZCMz9hXLwBqLCrE/L0YCw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/live-env/-/live-env-0.9.0.tgz", + "integrity": "sha512-IRRyYw17Bc5TepOY1c0E1fG9YaCD7Mjl8SCn6VGhGtH932nJkqaGwPqJnrFhFjHXDx4unMSYedmMRWoaR2j0+Q==", "dependencies": { "rxjs": "^7.8.1", "utility-types": "^3.10.0" } }, "node_modules/@ledgerhq/live-network": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/@ledgerhq/live-network/-/live-network-1.1.10.tgz", - "integrity": "sha512-kEwRRRk3228KDZicGelrbP64VjvA2aUYg3Q7GaemgE6/OT/i0pmurII3QUbkCSTlf/H9fGfy3Ztf/4MvcKb5VA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@ledgerhq/live-network/-/live-network-1.1.11.tgz", + "integrity": "sha512-TamiftFWGC8tPkDNv1xSWtPxEbpu5xCmTbmXo9QD+pjjCApWqukuaJeNrW7VkkRYWdY7K8HA4Jz/PgPllNKs5A==", "dependencies": { "@ledgerhq/errors": "^6.16.1", - "@ledgerhq/live-env": "^0.8.0", + "@ledgerhq/live-env": "^0.9.0", "@ledgerhq/live-promise": "^0.0.3", "@ledgerhq/logs": "^6.12.0", "axios": "0.26.1", @@ -4035,13 +4027,13 @@ "integrity": "sha512-ExDoj1QV5eC6TEbMdLUMMk9cfvNKhhv5gXol4SmULRVCx/3iyCPhJ74nsb3S0Vb+/f+XujBEj3vQn5+cwS0fNA==" }, "node_modules/@ledgerhq/react-native-hid": { - "version": "6.31.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/react-native-hid/-/react-native-hid-6.31.1.tgz", - "integrity": "sha512-SMaDuC9ybbEvz75TWZg3ubET6CAgPioHLUMA/xoU7fJYPATJBOtlxDn/I2yxW4e6GO+omB2QT6XrMFjXVHUXVQ==", + "version": "6.31.3", + "resolved": "https://registry.npmjs.org/@ledgerhq/react-native-hid/-/react-native-hid-6.31.3.tgz", + "integrity": "sha512-rEcqs6qURxwQYTVL3R4P9McMygX30h52ElewOR7TqkRRmIKURbaKWvIoWZZ//mStFQ2tDIAXwIkB3KZj8Thh4w==", "dependencies": { "@ledgerhq/devices": "^8.2.0", "@ledgerhq/errors": "^6.16.1", - "@ledgerhq/hw-transport": "^6.30.1", + "@ledgerhq/hw-transport": "^6.30.3", "@ledgerhq/logs": "^6.12.0", "rxjs": "^7.8.1" }, @@ -4050,13 +4042,13 @@ } }, "node_modules/@ledgerhq/react-native-hw-transport-ble": { - "version": "6.32.0", - "resolved": "https://registry.npmjs.org/@ledgerhq/react-native-hw-transport-ble/-/react-native-hw-transport-ble-6.32.0.tgz", - "integrity": "sha512-31QNoZBat9aFkJDTdPkCQdGkzUofGyUOUbwIUbqzaCBy3UCc2fXTfQV9Ve33lIMUigaoq1RjUM8AeygmbtO8fQ==", + "version": "6.32.2", + "resolved": "https://registry.npmjs.org/@ledgerhq/react-native-hw-transport-ble/-/react-native-hw-transport-ble-6.32.2.tgz", + "integrity": "sha512-CfgAB4LPD5bmGIcXt9IapJvW0tHa0D1XOs3GLQyeCrsuB1d/whXA00XJ2XH2zvkQRlUJS4NQ0bPn5YJGf7g+6g==", "dependencies": { "@ledgerhq/devices": "^8.2.0", "@ledgerhq/errors": "^6.16.1", - "@ledgerhq/hw-transport": "^6.30.1", + "@ledgerhq/hw-transport": "^6.30.3", "@ledgerhq/logs": "^6.12.0", "react-native-ble-plx": "2.0.3", "rxjs": "^7.8.1", @@ -4076,22 +4068,14 @@ } }, "node_modules/@ledgerhq/types-live": { - "version": "6.43.1", - "resolved": "https://registry.npmjs.org/@ledgerhq/types-live/-/types-live-6.43.1.tgz", - "integrity": "sha512-XaDACXAULFmY95scTmZNOaQMxiqmdj3kEhPRA3aDcB8VA8jzjK0+nrNx6qWNZbH3tgo1xj8gwz7bdmPoOgrqfg==", + "version": "6.44.0", + "resolved": "https://registry.npmjs.org/@ledgerhq/types-live/-/types-live-6.44.0.tgz", + "integrity": "sha512-WFXLHsgAm+rJ5oxCl5c+Cr0lNVsX0av0wctEQjLZUF2FSWFvAiqmGMLUd5B0NsLhJaQYFw+iFo7C178DRfoh3w==", "dependencies": { "bignumber.js": "^9.1.2", "rxjs": "^7.8.1" } }, - "node_modules/@ledgerhq/types-live/node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", @@ -4198,19 +4182,19 @@ } }, "node_modules/@react-native-community/cli": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-12.3.0.tgz", - "integrity": "sha512-XeQohi2E+S2+MMSz97QcEZ/bWpi8sfKiQg35XuYeJkc32Til2g0b97jRpn0/+fV0BInHoG1CQYWwHA7opMsrHg==", - "dependencies": { - "@react-native-community/cli-clean": "12.3.0", - "@react-native-community/cli-config": "12.3.0", - "@react-native-community/cli-debugger-ui": "12.3.0", - "@react-native-community/cli-doctor": "12.3.0", - "@react-native-community/cli-hermes": "12.3.0", - "@react-native-community/cli-plugin-metro": "12.3.0", - "@react-native-community/cli-server-api": "12.3.0", - "@react-native-community/cli-tools": "12.3.0", - "@react-native-community/cli-types": "12.3.0", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-12.3.2.tgz", + "integrity": "sha512-WgoUWwLDcf/G1Su2COUUVs3RzAwnV/vUTdISSpAUGgSc57mPabaAoUctKTnfYEhCnE3j02k3VtaVPwCAFRO3TQ==", + "dependencies": { + "@react-native-community/cli-clean": "12.3.2", + "@react-native-community/cli-config": "12.3.2", + "@react-native-community/cli-debugger-ui": "12.3.2", + "@react-native-community/cli-doctor": "12.3.2", + "@react-native-community/cli-hermes": "12.3.2", + "@react-native-community/cli-plugin-metro": "12.3.2", + "@react-native-community/cli-server-api": "12.3.2", + "@react-native-community/cli-tools": "12.3.2", + "@react-native-community/cli-types": "12.3.2", "chalk": "^4.1.2", "commander": "^9.4.1", "deepmerge": "^4.3.0", @@ -4229,11 +4213,11 @@ } }, "node_modules/@react-native-community/cli-clean": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-12.3.0.tgz", - "integrity": "sha512-iAgLCOWYRGh9ukr+eVQnhkV/OqN3V2EGd/in33Ggn/Mj4uO6+oUncXFwB+yjlyaUNz6FfjudhIz09yYGSF+9sg==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-12.3.2.tgz", + "integrity": "sha512-90k2hCX0ddSFPT7EN7h5SZj0XZPXP0+y/++v262hssoey3nhurwF57NGWN0XAR0o9BSW7+mBfeInfabzDraO6A==", "dependencies": { - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-tools": "12.3.2", "chalk": "^4.1.2", "execa": "^5.0.0" } @@ -4303,11 +4287,11 @@ } }, "node_modules/@react-native-community/cli-config": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-12.3.0.tgz", - "integrity": "sha512-BrTn5ndFD9uOxO8kxBQ32EpbtOvAsQExGPI7SokdI4Zlve70FziLtTq91LTlTUgMq1InVZn/jJb3VIDk6BTInQ==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-12.3.2.tgz", + "integrity": "sha512-UUCzDjQgvAVL/57rL7eOuFUhd+d+6qfM7V8uOegQFeFEmSmvUUDLYoXpBa5vAK9JgQtSqMBJ1Shmwao+/oElxQ==", "dependencies": { - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-tools": "12.3.2", "chalk": "^4.1.2", "cosmiconfig": "^5.1.0", "deepmerge": "^4.3.0", @@ -4380,22 +4364,22 @@ } }, "node_modules/@react-native-community/cli-debugger-ui": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-12.3.0.tgz", - "integrity": "sha512-w3b0iwjQlk47GhZWHaeTG8kKH09NCMUJO729xSdMBXE8rlbm4kHpKbxQY9qKb6NlfWSJN4noGY+FkNZS2rRwnQ==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-12.3.2.tgz", + "integrity": "sha512-nSWQUL+51J682DlfcC1bjkUbQbGvHCC25jpqTwHIjmmVjYCX1uHuhPSqQKgPNdvtfOkrkACxczd7kVMmetxY2Q==", "dependencies": { "serve-static": "^1.13.1" } }, "node_modules/@react-native-community/cli-doctor": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-12.3.0.tgz", - "integrity": "sha512-BPCwNNesoQMkKsxB08Ayy6URgGQ8Kndv6mMhIvJSNdST3J1+x3ehBHXzG9B9Vfi+DrTKRb8lmEl/b/7VkDlPkA==", - "dependencies": { - "@react-native-community/cli-config": "12.3.0", - "@react-native-community/cli-platform-android": "12.3.0", - "@react-native-community/cli-platform-ios": "12.3.0", - "@react-native-community/cli-tools": "12.3.0", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-12.3.2.tgz", + "integrity": "sha512-GrAabdY4qtBX49knHFvEAdLtCjkmndjTeqhYO6BhsbAeKOtspcLT/0WRgdLIaKODRa61ADNB3K5Zm4dU0QrZOg==", + "dependencies": { + "@react-native-community/cli-config": "12.3.2", + "@react-native-community/cli-platform-android": "12.3.2", + "@react-native-community/cli-platform-ios": "12.3.2", + "@react-native-community/cli-tools": "12.3.2", "chalk": "^4.1.2", "command-exists": "^1.2.8", "deepmerge": "^4.3.0", @@ -4533,12 +4517,12 @@ } }, "node_modules/@react-native-community/cli-hermes": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-12.3.0.tgz", - "integrity": "sha512-G6FxpeZBO4AimKZwtWR3dpXRqTvsmEqlIkkxgwthdzn3LbVjDVIXKpVYU9PkR5cnT+KuAUxO0WwthrJ6Nmrrlg==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-12.3.2.tgz", + "integrity": "sha512-SL6F9O8ghp4ESBFH2YAPLtIN39jdnvGBKnK4FGKpDCjtB3DnUmDsGFlH46S+GGt5M6VzfG2eeKEOKf3pZ6jUzA==", "dependencies": { - "@react-native-community/cli-platform-android": "12.3.0", - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-platform-android": "12.3.2", + "@react-native-community/cli-tools": "12.3.2", "chalk": "^4.1.2", "hermes-profile-transformer": "^0.0.6", "ip": "^1.1.5" @@ -4609,11 +4593,11 @@ } }, "node_modules/@react-native-community/cli-platform-android": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-12.3.0.tgz", - "integrity": "sha512-VU1NZw63+GLU2TnyQ919bEMThpHQ/oMFju9MCfrd3pyPJz4Sn+vc3NfnTDUVA5Z5yfLijFOkHIHr4vo/C9bjnw==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-12.3.2.tgz", + "integrity": "sha512-MZ5nO8yi/N+Fj2i9BJcJ9C/ez+9/Ir7lQt49DWRo9YDmzye66mYLr/P2l/qxsixllbbDi7BXrlLpxaEhMrDopg==", "dependencies": { - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-tools": "12.3.2", "chalk": "^4.1.2", "execa": "^5.0.0", "fast-xml-parser": "^4.2.4", @@ -4686,11 +4670,11 @@ } }, "node_modules/@react-native-community/cli-platform-ios": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-12.3.0.tgz", - "integrity": "sha512-H95Sgt3wT7L8V75V0syFJDtv4YgqK5zbu69ko4yrXGv8dv2EBi6qZP0VMmkqXDamoPm9/U7tDTdbcf26ctnLfg==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-12.3.2.tgz", + "integrity": "sha512-OcWEAbkev1IL6SUiQnM6DQdsvfsKZhRZtoBNSj9MfdmwotVZSOEZJ+IjZ1FR9ChvMWayO9ns/o8LgoQxr1ZXeg==", "dependencies": { - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-tools": "12.3.2", "chalk": "^4.1.2", "execa": "^5.0.0", "fast-xml-parser": "^4.0.12", @@ -4763,17 +4747,17 @@ } }, "node_modules/@react-native-community/cli-plugin-metro": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-12.3.0.tgz", - "integrity": "sha512-tYNHIYnNmxrBcsqbE2dAnLMzlKI3Cp1p1xUgTrNaOMsGPDN1epzNfa34n6Nps3iwKElSL7Js91CzYNqgTalucA==" + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-plugin-metro/-/cli-plugin-metro-12.3.2.tgz", + "integrity": "sha512-FpFBwu+d2E7KRhYPTkKvQsWb2/JKsJv+t1tcqgQkn+oByhp+qGyXBobFB8/R3yYvRRDCSDhS+atWTJzk9TjM8g==" }, "node_modules/@react-native-community/cli-server-api": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-12.3.0.tgz", - "integrity": "sha512-Rode8NrdyByC+lBKHHn+/W8Zu0c+DajJvLmOWbe2WY/ECvnwcd9MHHbu92hlT2EQaJ9LbLhGrSbQE3cQy9EOCw==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-12.3.2.tgz", + "integrity": "sha512-iwa7EO9XFA/OjI5pPLLpI/6mFVqv8L73kNck3CNOJIUCCveGXBKK0VMyOkXaf/BYnihgQrXh+x5cxbDbggr7+Q==", "dependencies": { - "@react-native-community/cli-debugger-ui": "12.3.0", - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-debugger-ui": "12.3.2", + "@react-native-community/cli-tools": "12.3.2", "compression": "^1.7.1", "connect": "^3.6.5", "errorhandler": "^1.5.1", @@ -4890,9 +4874,9 @@ } }, "node_modules/@react-native-community/cli-tools": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-12.3.0.tgz", - "integrity": "sha512-2GafnCr8D88VdClwnm9KZfkEb+lzVoFdr/7ybqhdeYM0Vnt/tr2N+fM1EQzwI1DpzXiBzTYemw8GjRq+Utcz2Q==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-tools/-/cli-tools-12.3.2.tgz", + "integrity": "sha512-nDH7vuEicHI2TI0jac/DjT3fr977iWXRdgVAqPZFFczlbs7A8GQvEdGnZ1G8dqRUmg+kptw0e4hwczAOG89JzQ==", "dependencies": { "appdirsjs": "^1.2.4", "chalk": "^4.1.2", @@ -5063,9 +5047,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/@react-native-community/cli-types": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-12.3.0.tgz", - "integrity": "sha512-MgOkmrXH4zsGxhte4YqKL7d+N8ZNEd3w1wo56MZlhu5WabwCJh87wYpU5T8vyfujFLYOFuFK5jjlcbs8F4/WDw==", + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-12.3.2.tgz", + "integrity": "sha512-9D0UEFqLW8JmS16mjHJxUJWX8E+zJddrHILSH8AJHZ0NNHv4u2DXKdb0wFLMobFxGNxPT+VSOjc60fGvXzWHog==", "dependencies": { "joi": "^17.2.1" } @@ -5202,20 +5186,20 @@ } }, "node_modules/@react-native/babel-plugin-codegen": { - "version": "0.73.2", - "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.73.2.tgz", - "integrity": "sha512-PadyFZWVaWXIBP7Q5dgEL7eAd7tnsgsLjoHJB1hIRZZuVUg1Zqe3nULwC7RFAqOtr5Qx7KXChkFFcKQ3WnZzGw==", + "version": "0.73.4", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.73.4.tgz", + "integrity": "sha512-XzRd8MJGo4Zc5KsphDHBYJzS1ryOHg8I2gOZDAUCGcwLFhdyGu1zBNDJYH2GFyDrInn9TzAbRIf3d4O+eltXQQ==", "dependencies": { - "@react-native/codegen": "0.73.2" + "@react-native/codegen": "0.73.3" }, "engines": { "node": ">=18" } }, "node_modules/@react-native/babel-preset": { - "version": "0.73.19", - "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.73.19.tgz", - "integrity": "sha512-ujon01uMOREZecIltQxPDmJ6xlVqAUFGI/JCSpeVYdxyXBoBH5dBb0ihj7h6LKH1q1jsnO9z4MxfddtypKkIbg==", + "version": "0.73.21", + "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.73.21.tgz", + "integrity": "sha512-WlFttNnySKQMeujN09fRmrdWqh46QyJluM5jdtDNrkl/2Hx6N4XeDUGhABvConeK95OidVO7sFFf7sNebVXogA==", "dependencies": { "@babel/core": "^7.20.0", "@babel/plugin-proposal-async-generator-functions": "^7.0.0", @@ -5256,7 +5240,7 @@ "@babel/plugin-transform-typescript": "^7.5.0", "@babel/plugin-transform-unicode-regex": "^7.0.0", "@babel/template": "^7.0.0", - "@react-native/babel-plugin-codegen": "0.73.2", + "@react-native/babel-plugin-codegen": "0.73.4", "babel-plugin-transform-flow-enums": "^0.0.2", "react-refresh": "^0.14.0" }, @@ -5276,9 +5260,9 @@ } }, "node_modules/@react-native/codegen": { - "version": "0.73.2", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.73.2.tgz", - "integrity": "sha512-lfy8S7umhE3QLQG5ViC4wg5N1Z+E6RnaeIw8w1voroQsXXGPB72IBozh8dAHR3+ceTxIU0KX3A8OpJI8e1+HpQ==", + "version": "0.73.3", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.73.3.tgz", + "integrity": "sha512-sxslCAAb8kM06vGy9Jyh4TtvjhcP36k/rvj2QE2Jdhdm61KvfafCATSIsOfc0QvnduWFcpXUPvAVyYwuv7PYDg==", "dependencies": { "@babel/parser": "^7.20.0", "flow-parser": "^0.206.0", @@ -5296,14 +5280,14 @@ } }, "node_modules/@react-native/community-cli-plugin": { - "version": "0.73.12", - "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.73.12.tgz", - "integrity": "sha512-xWU06OkC1cX++Duh/cD/Wv+oZ0oSY3yqbtxAqQA2H3Q+MQltNNJM6MqIHt1VOZSabRf/LVlR1JL6U9TXJirkaw==", + "version": "0.73.16", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.73.16.tgz", + "integrity": "sha512-eNH3v3qJJF6f0n/Dck90qfC9gVOR4coAXMTdYECO33GfgjTi+73vf/SBqlXw9HICH/RNZYGPM3wca4FRF7TYeQ==", "dependencies": { - "@react-native-community/cli-server-api": "12.3.0", - "@react-native-community/cli-tools": "12.3.0", + "@react-native-community/cli-server-api": "12.3.2", + "@react-native-community/cli-tools": "12.3.2", "@react-native/dev-middleware": "0.73.7", - "@react-native/metro-babel-transformer": "0.73.13", + "@react-native/metro-babel-transformer": "0.73.15", "chalk": "^4.0.0", "execa": "^5.1.1", "metro": "^0.80.3", @@ -5475,12 +5459,12 @@ } }, "node_modules/@react-native/metro-babel-transformer": { - "version": "0.73.13", - "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.73.13.tgz", - "integrity": "sha512-k9AQifogQfgUXPlqQSoMtX2KUhniw4XvJl+nZ4hphCH7qiMDAwuP8OmkJbz5E/N+Ro9OFuLE7ax4GlwxaTsAWg==", + "version": "0.73.15", + "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.73.15.tgz", + "integrity": "sha512-LlkSGaXCz+xdxc9819plmpsl4P4gZndoFtpjN3GMBIu6f7TBV0GVbyJAU4GE8fuAWPVSVL5ArOcdkWKSbI1klw==", "dependencies": { "@babel/core": "^7.20.0", - "@react-native/babel-preset": "0.73.19", + "@react-native/babel-preset": "0.73.21", "hermes-parser": "0.15.0", "nullthrows": "^1.1.1" }, @@ -5492,13 +5476,13 @@ } }, "node_modules/@react-native/metro-config": { - "version": "0.73.3", - "resolved": "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.73.3.tgz", - "integrity": "sha512-aIVh+lM52n7/RFDXLDiIp1vI21jc9thm2VxdkP7KwxMut7VvW+2tO38zKt74/2ker2ca0205tbf3pyCYBvV6Ww==", + "version": "0.73.5", + "resolved": "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.73.5.tgz", + "integrity": "sha512-3bNWoHzOzP/+qoLJtRhOVXrnxKmSY3i4y5PXyMQlIvvOI/GQbXulPpEZxK/yUrf1MmeXHLLFufFbQWlfDEDoxA==", "dev": true, "dependencies": { "@react-native/js-polyfills": "0.73.1", - "@react-native/metro-babel-transformer": "0.73.13", + "@react-native/metro-babel-transformer": "0.73.15", "metro-config": "^0.80.3", "metro-runtime": "^0.80.3" }, @@ -5637,9 +5621,9 @@ ] }, "node_modules/@sideway/address": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", - "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", + "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", "dependencies": { "@hapi/hoek": "^9.0.0" } @@ -7325,6 +7309,14 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "engines": { + "node": "*" + } + }, "node_modules/bip39": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", @@ -7343,29 +7335,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bl/node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, "node_modules/bn.js": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", @@ -7549,6 +7518,29 @@ "node-int64": "^0.4.0" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -8678,9 +8670,9 @@ } }, "node_modules/envinfo": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.11.0.tgz", - "integrity": "sha512-G9/6xF1FPbIw0TtalAMaVPpiq2aDEuKLXM314jPVAO9r2fo2a4BLqMNkmRS7O/xPPZ+COAhGIz3ETvHEV3eUcg==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.11.1.tgz", + "integrity": "sha512-8PiZgZNIB4q/Lw4AhOvAfB/ityHAd2bli3lESSWmWSzSsl5dKpy5N1d1Rfkd2teq/g9xN90lc6o98DOjMeYHpg==", "bin": { "envinfo": "dist/cli.js" }, @@ -9770,9 +9762,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.2.tgz", - "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.4.tgz", + "integrity": "sha512-utnwm92SyozgA3hhH2I8qldf2lBqm6qHOICawRNRFu1qMe3+oqr+GcXjGqTmXTMGE5T4eC03kr/rlh5C1IRdZA==", "funding": [ { "type": "github", @@ -12742,13 +12734,13 @@ } }, "node_modules/joi": { - "version": "17.11.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", - "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", + "version": "17.12.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.12.1.tgz", + "integrity": "sha512-vtxmq+Lsc5SlfqotnfVjlViWfOL9nt/avKNbKYizwf6gsCfq9NYY/ceYRMFD8XDdrjJ9abJyScWmhmIiy+XRtQ==", "dependencies": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", + "@hapi/hoek": "^9.3.0", + "@hapi/topo": "^5.1.0", + "@sideway/address": "^4.1.5", "@sideway/formula": "^3.0.1", "@sideway/pinpoint": "^2.0.0" } @@ -12972,9 +12964,9 @@ } }, "node_modules/keccak": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", - "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", "hasInstallScript": true, "dependencies": { "node-addon-api": "^2.0.0", @@ -15279,17 +15271,17 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, "node_modules/react-native": { - "version": "0.73.2", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.73.2.tgz", - "integrity": "sha512-7zj9tcUYpJUBdOdXY6cM8RcXYWkyql4kMyGZflW99E5EuFPoC7Ti+ZQSl7LP9ZPzGD0vMfslwyDW0I4tPWUCFw==", + "version": "0.73.4", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.73.4.tgz", + "integrity": "sha512-VtS+Yr6OOTIuJGDECIYWzNU8QpJjASQYvMtfa/Hvm/2/h5GdB6W9H9TOmh13x07Lj4AOhNMx3XSsz6TdrO4jIg==", "dependencies": { "@jest/create-cache-key-function": "^29.6.3", - "@react-native-community/cli": "12.3.0", - "@react-native-community/cli-platform-android": "12.3.0", - "@react-native-community/cli-platform-ios": "12.3.0", + "@react-native-community/cli": "12.3.2", + "@react-native-community/cli-platform-android": "12.3.2", + "@react-native-community/cli-platform-ios": "12.3.2", "@react-native/assets-registry": "0.73.1", - "@react-native/codegen": "0.73.2", - "@react-native/community-cli-plugin": "0.73.12", + "@react-native/codegen": "0.73.3", + "@react-native/community-cli-plugin": "0.73.16", "@react-native/gradle-plugin": "0.73.4", "@react-native/js-polyfills": "0.73.1", "@react-native/normalize-colors": "0.73.2", @@ -15298,6 +15290,7 @@ "anser": "^1.4.9", "ansi-regex": "^5.0.0", "base64-js": "^1.5.1", + "chalk": "^4.0.0", "deprecated-react-native-prop-types": "^5.0.0", "event-target-shim": "^5.0.1", "flow-enums-runtime": "^0.0.6", @@ -16937,14 +16930,6 @@ "follow-redirects": "^1.14.8" } }, - "node_modules/tronweb/node_modules/bignumber.js": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz", - "integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==", - "engines": { - "node": "*" - } - }, "node_modules/tronweb/node_modules/ethereum-cryptography": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz", @@ -17305,9 +17290,9 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/utility-types": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz", - "integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", + "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", "engines": { "node": ">= 4" } diff --git a/package.json b/package.json index 82d8f52..5be0e21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rungecoin", - "version": "1.5.2", + "version": "1.6.0", "private": true, "scripts": { "postinstall": "patch-package", @@ -18,10 +18,10 @@ "distribute-production-flow": "eval $(./scripts/parsedEnv.sh) && ./scripts/upload-build-production-flow.sh" }, "dependencies": { - "@ledgerhq/hw-app-eth": "^6.35.1", - "@ledgerhq/hw-app-trx": "^6.28.1", - "@ledgerhq/react-native-hid": "^6.31.1", - "@ledgerhq/react-native-hw-transport-ble": "^6.32.0", + "@ledgerhq/hw-app-eth": "^6.35.4", + "@ledgerhq/hw-app-trx": "^6.28.3", + "@ledgerhq/react-native-hid": "^6.31.3", + "@ledgerhq/react-native-hw-transport-ble": "^6.32.2", "@react-native-async-storage/async-storage": "^1.21.0", "@react-native-clipboard/clipboard": "^1.11.2", "@react-navigation/native": "^6.1.7", @@ -40,7 +40,7 @@ "react": "18.2.0", "react-content-loader": "^6.2.0", "react-i18next": "^12.1.5", - "react-native": "0.73.2", + "react-native": "0.73.4", "react-native-ble-manager": "^10.1.2", "react-native-ble-plx": "^2.0.3", "react-native-camera-kit": "^13.0.0", @@ -70,9 +70,9 @@ "@babel/plugin-transform-flow-strip-types": "^7.23.3", "@babel/preset-env": "^7.23.7", "@babel/runtime": "^7.23.7", - "@react-native/babel-preset": "0.73.19", + "@react-native/babel-preset": "0.73.21", "@react-native/eslint-config": "0.73.2", - "@react-native/metro-config": "0.73.3", + "@react-native/metro-config": "0.73.5", "@react-native/typescript-config": "0.73.1", "@tsconfig/react-native": "^3.0.2", "@types/jest": "^29.2.1", diff --git a/src/components/Bandwith.tsx b/src/components/Bandwith.tsx new file mode 100644 index 0000000..3eef176 --- /dev/null +++ b/src/components/Bandwith.tsx @@ -0,0 +1,217 @@ +import React, { useEffect } from 'react'; +import { ActivityIndicator, LayoutChangeEvent } from 'react-native'; + +import Animated, { + createAnimatedPropAdapter, + interpolateColor, + processColor, + useAnimatedProps, + useAnimatedStyle, + useSharedValue, + withTiming, +} from 'react-native-reanimated'; +import Svg, { Circle } from 'react-native-svg'; +import { useTheme } from 'styled-components'; +import styled from 'styled-components/native'; + +import Icon from './Icon'; + +const ANIMATION_DURATION = 1500; +const CIRCLE_WIDTH = 6; +const CIRCLE_SIZE = 60; +const SEMICIRCLE_DIVISOR = 2.5; +const LOADING_SIZE = 22; +const COMPONENT_HEIGHT = ((CIRCLE_SIZE - CIRCLE_WIDTH) / 2) * (1 + (SEMICIRCLE_DIVISOR / 4)); + +const BandwithWrapper = styled.View` + height: ${COMPONENT_HEIGHT}px; + width: ${CIRCLE_SIZE}px; +`; + +const StyledSvg = styled(Svg)` + transform: rotate(162deg); + height: ${CIRCLE_SIZE}px; + width: ${CIRCLE_SIZE}px; +`; + +const StyledIcon = styled(Icon)` + position: absolute; + top: 23px; + left: 6px; + font-size: 30px; + color: ${({ theme }) => theme.colors.disabled}; +`; + +const StyledLoading = styled(ActivityIndicator)` + position: absolute; + bottom: 0; + left: ${(CIRCLE_SIZE / 2) - (LOADING_SIZE / 2)}px; +`; + +const PERCENTAGE_THRESHOLD = { + min: 0.33, + max: 0.66, +}; + +const AnimatedCircle = Animated.createAnimatedComponent(Circle); + +const AnimatedArrow = Animated.createAnimatedComponent(StyledIcon); + + +type Point2D = { + x: number; + y: number; +}; + +type BandwithProps = { + percentage?: number; + isLoading?: boolean; +}; + +const Bandwith = ({ + percentage = 0, + isLoading = false, +}: BandwithProps) => { + const theme = useTheme(); + const bandwithPercentage = useSharedValue(1); + const arrowSize = useSharedValue(null); + const bandwithFromToColor = useSharedValue({ + range: [0, 0], + color: [ + theme.colors.background.primary, + theme.colors.background.primary, + ], + }); + + const circleSize = CIRCLE_SIZE / 2; + const circleRadius = (CIRCLE_SIZE - CIRCLE_WIDTH) / 2; + const circleLength = circleRadius * 2 * Math.PI; + const semiCircleLength = circleLength / SEMICIRCLE_DIVISOR; + + const getBandwithColor = (currentPercentage: number) => { + if (currentPercentage >= PERCENTAGE_THRESHOLD.max) { + return theme.colors.error; + } + + if (currentPercentage <= PERCENTAGE_THRESHOLD.min) { + return theme.colors.success; + } + + return theme.colors.warning; + }; + + useEffect(() => { + if (isLoading) return; + + const minPercentage = percentage < 0 ? 0 : percentage; + const finalPercentage = Math.abs(1 - (percentage > 1 ? 1 : minPercentage)); + + bandwithFromToColor.value = { + range: bandwithPercentage.value < finalPercentage + ? [bandwithPercentage.value, finalPercentage] + : [finalPercentage, bandwithPercentage.value], + color: [ + getBandwithColor(bandwithPercentage.value > finalPercentage ? finalPercentage : bandwithPercentage.value), + getBandwithColor(bandwithPercentage.value > finalPercentage ? bandwithPercentage.value : finalPercentage), + ], + }; + + bandwithPercentage.value = withTiming( + finalPercentage, + { duration: ANIMATION_DURATION }, + ); + + }, [percentage, isLoading]); + + const bandwithColorAdapter = createAnimatedPropAdapter( + (props) => { + if (Object.keys(props).includes('stroke')) { + props.stroke = { + type: 0, + payload: processColor(props.stroke), + }; + } + }, + ['stroke'], + ); + + const animatedCircleProps = useAnimatedProps(() => ({ + strokeDashoffset: semiCircleLength + ((circleLength - semiCircleLength) * bandwithPercentage.value), + stroke: interpolateColor( + bandwithPercentage.value, + bandwithFromToColor.value.range, + bandwithFromToColor.value.color, + ), + }), null, bandwithColorAdapter); + + const animatedArrowStyle = useAnimatedStyle(() => { + if (!arrowSize.value) return {}; + + const rotationMultiplicator = 180; + const center: Point2D = { + x: arrowSize.value.x / 2, + y: arrowSize.value.y / 2, + }; + const pivot: Point2D = { + x: arrowSize.value.x - 6, + y: arrowSize.value.y / 2, + }; + + + return { + transform: [ + { translateX: pivot.x - center.x }, + { translateY: pivot.y - center.y }, + { rotateZ: `${Math.abs(1 - bandwithPercentage.value) * rotationMultiplicator}deg` }, + { translateX: -(pivot.x - center.x) }, + { translateY: -(pivot.y - center.y) }, + ], + }; + }); + + const onArrowLayout = (event: LayoutChangeEvent) => { + arrowSize.value = { + x: event.nativeEvent.layout.width, + y: event.nativeEvent.layout.height, + }; + }; + + return ( + + + + + + {isLoading ? ( + + ) : ( + + )} + + + ); +}; + +export default Bandwith; diff --git a/src/components/Battery.tsx b/src/components/Battery.tsx new file mode 100644 index 0000000..39102c4 --- /dev/null +++ b/src/components/Battery.tsx @@ -0,0 +1,125 @@ +import React, { useEffect } from 'react'; +import { StyleProp, ViewStyle } from 'react-native'; + +import Animated, { interpolateColor, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated'; +import { useTheme } from 'styled-components'; +import styled from 'styled-components/native'; + +import Skeleton from './Skeleton'; +import LineLayout from './Skeleton/LineLayout'; + +const ANIMATION_TIME = 1500; + +const HEADER_HEIGHT = 12; +const HEADER_WIDTH = 8; +const BODY_HEIGHT = 36; +const BODY_PADDING = 7; + +const PERCENTAGE_THRESHOLD = { + min: 0.33, + max: 0.66, +}; + +const BatteryWrapper = styled.View` + flex-direction: row; + width: 100%; + align-items: center; +`; + +const BatteryHeader = styled.View` + width: ${HEADER_WIDTH}px; + height: ${HEADER_HEIGHT}px; + border: 1px solid ${({ theme }) => theme.colors.disabled}; + border-left-width: 0px; + border-radius: 1px; +`; + +const BatteryBody = styled.View` + height: ${BODY_HEIGHT}px; + width: 100%; + border: 1px solid ${({ theme }) => theme.colors.disabled}; + border-radius: ${({ theme }) => theme.spacing(1)}; + justify-content: center; + padding: ${BODY_PADDING}px; +`; + +const BatteryPercentage = styled(Animated.View)` + height: 100%; + border-radius: ${({ theme }) => theme.spacing(1)}; +`; + +type BatteryProps = { + percentage?: number; + isLoading?: boolean; + style?: StyleProp; +}; + +const Battery = ({ + percentage = 0, + isLoading = false, + style, +}: BatteryProps) => { + const theme = useTheme(); + const batteryPercentage = useSharedValue(0); + const batteryFromToColor = useSharedValue({ + range: [0, 0], + color: [ + theme.colors.background.primary, + theme.colors.background.primary, + ], + }); + + const getBatteryColor = (currentPercentage: number) => { + if (currentPercentage >= PERCENTAGE_THRESHOLD.max) { + return theme.colors.success; + } + if (currentPercentage <= PERCENTAGE_THRESHOLD.min) { + return theme.colors.error; + } + return theme.colors.warning; + }; + + useEffect(() => { + if (isLoading) return; + + const minPercentage = percentage < 0 ? 0 : percentage; + const finalPercentage = percentage > 1 ? 1 : minPercentage; + batteryFromToColor.value = { + range: batteryPercentage.value < finalPercentage + ? [batteryPercentage.value, finalPercentage] + : [finalPercentage, batteryPercentage.value], + color: [ + getBatteryColor(batteryPercentage.value < finalPercentage ? batteryPercentage.value : finalPercentage), + getBatteryColor(batteryPercentage.value < finalPercentage ? finalPercentage : batteryPercentage.value), + ], + }; + batteryPercentage.value = withTiming(finalPercentage, { duration: ANIMATION_TIME }); + }, [percentage, isLoading]); + + const batteryPercentageAnimatedStyle = useAnimatedStyle(() => ({ + width: `${batteryPercentage.value * 100}%`, + backgroundColor: interpolateColor( + batteryPercentage.value, + batteryFromToColor.value.range, + batteryFromToColor.value.color, + ), + })); + + return ( + + + + + + + + + ); +}; + +export default Battery; diff --git a/src/components/BlockchainExtraData/BlockchainExtraData.tsx b/src/components/BlockchainExtraData/BlockchainExtraData.tsx new file mode 100644 index 0000000..c940764 --- /dev/null +++ b/src/components/BlockchainExtraData/BlockchainExtraData.tsx @@ -0,0 +1,30 @@ +import React from 'react'; + +import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'; + +import TronFees from './TronFees'; +import useBlockchainData from '@hooks/useBlockchainData'; +import { erc20BlockchainsConfigurationPropagation } from '@utils/web3'; +import { Blockchains } from '@web3/constants'; + +const BLOCKCHAIN_EXTRA_DATA_CONFIG: { + [blockchain in Blockchains]: JSX.Element; +} = { + ...erc20BlockchainsConfigurationPropagation(<>), + [Blockchains.TRON]: ( + + + + ), +}; + +const BlockchainExtraData = () => { + const { blockchain } = useBlockchainData(); + + return BLOCKCHAIN_EXTRA_DATA_CONFIG[blockchain]; +}; + +export default BlockchainExtraData; diff --git a/src/components/BlockchainExtraData/TronFees.tsx b/src/components/BlockchainExtraData/TronFees.tsx new file mode 100644 index 0000000..9995691 --- /dev/null +++ b/src/components/BlockchainExtraData/TronFees.tsx @@ -0,0 +1,127 @@ +import React, { useEffect, useMemo } from 'react'; + +import styled, { useTheme } from 'styled-components/native'; + +import Bandwith from '@components/Bandwith'; +import Battery from '@components/Battery'; +import Card from '@components/Card'; +import Skeleton from '@components/Skeleton'; +import LineLayout from '@components/Skeleton/LineLayout'; +import { Spacer } from '@components/Spacer'; +import Text from '@components/Text'; +import useTronAccountResources from '@hooks/useTronAccountResources'; +import { localizeNumber } from '@utils/formatter'; + +const Wrapper = styled.View` + flex-direction: row; + margin-bottom: ${({ theme }) => theme.spacing(4)}; +`; + +const CardTitle = styled(Text)` + font-size: ${({ theme }) => theme.fonts.size[18]}; + margin-bottom: ${({ theme }) => theme.spacing(4)}; +`; + +const StyledCard = styled(Card)` + align-items: center; + justify-content: space-around; +`; + +const StyledBattery = styled(Battery)` + width: 50%; +`; + +const StyledSkeleton = styled(Skeleton)` + margin-top: ${({ theme }) => theme.spacing(1)}; + width: 80%; +`; + +const SKELETON_HEIGHT = 14; + +const TronFees = () => { + const theme = useTheme(); + + const { + refetchAccountResources, + accountResources, + accountResourcesLoading, + } = useTronAccountResources(); + + useEffect(() => { + if (!accountResources) refetchAccountResources(); + }, []); + + const { + accountBandwidth, + accountEnergy, + totalBandwidth, + totalEnergy, + energyPercentage, + bandwithPercentage, + } = useMemo(() => ({ + accountBandwidth: localizeNumber((accountResources?.accountBandwidth || 0).toString()), + accountEnergy: localizeNumber((accountResources?.accountEnergy || 0).toString()), + totalBandwidth: localizeNumber((accountResources?.totalBandwidth || 0).toString()), + totalEnergy: localizeNumber((accountResources?.totalEnergy || 0).toString()), + bandwithPercentage: accountResources?.totalBandwidth + ? (accountResources?.accountBandwidth || 0) / accountResources.totalBandwidth + : 0, + energyPercentage: accountResources?.totalEnergy + ? (accountResources?.accountEnergy || 0) / accountResources.totalEnergy + : 0, + }), [accountResources]); + + const isLoading = useMemo(() => ( + !accountResources && accountResourcesLoading + ), [accountResourcesLoading, accountResources]); + + const onPress = () => { }; + + return ( + + + + + + + + + + + + + + + + + + + + ); +}; + +export default TronFees; diff --git a/src/components/BlockchainExtraData/index.ts b/src/components/BlockchainExtraData/index.ts new file mode 100644 index 0000000..f3ef759 --- /dev/null +++ b/src/components/BlockchainExtraData/index.ts @@ -0,0 +1 @@ +export { default } from './BlockchainExtraData'; diff --git a/src/components/DoublePrivateKeyEncryptionMessage.tsx b/src/components/DoublePrivateKeyEncryptionMessage.tsx index c2551b6..39fac14 100644 --- a/src/components/DoublePrivateKeyEncryptionMessage.tsx +++ b/src/components/DoublePrivateKeyEncryptionMessage.tsx @@ -61,7 +61,7 @@ const DoublePrivateKeyEncryptionMessage = () => {
diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 21ea20d..65ee7b0 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { ForwardedRef } from 'react'; import { TouchableOpacity } from 'react-native'; import type { IconProps as IconPropsRN } from 'react-native-vector-icons/Icon'; @@ -14,13 +14,14 @@ const StyledIcon = styled(IconRN)` font-size: ${({ theme }) => theme.fonts.size[32]}; `; -const Icon = ({ +const Icon = React.forwardRef(({ onPress, disabled, style, hitSlop, ...props -}: IconProps) => { +}: IconProps, +ref: ForwardedRef) => { const theme = useTheme(); const disabledStyle = disabled ? { @@ -28,7 +29,12 @@ const Icon = ({ } : {}; const iconComponent = ( - + ); if (!onPress) return iconComponent; @@ -46,6 +52,6 @@ const Icon = ({ {iconComponent} ); -}; +}); export default Icon; diff --git a/src/components/Spacer.tsx b/src/components/Spacer.tsx index 153af61..0fc9174 100644 --- a/src/components/Spacer.tsx +++ b/src/components/Spacer.tsx @@ -4,15 +4,21 @@ import { View, StyleProp, ViewStyle, DimensionValue } from 'react-native'; type SpacerProps = { size?: DimensionValue; fill?: boolean; + horizontal?: boolean; }; export const Spacer = ({ size, fill, + horizontal, }: SpacerProps) => { const style: StyleProp = { flex: fill ? 1 : 0, - height: size, + ...(horizontal ? { + width: size, + } : { + height: size, + }), }; return ; }; diff --git a/src/components/Text.tsx b/src/components/Text.tsx index 3cd5e5f..804c4a8 100644 --- a/src/components/Text.tsx +++ b/src/components/Text.tsx @@ -109,6 +109,7 @@ const Text = ({ onPressOut={onPressOut} onPress={onPress} disabled={disabled} + maxFontSizeMultiplier={1} {...props} > {splittedText.map((currentText, index) => ( @@ -117,6 +118,7 @@ const Text = ({ onPressIn={onPressIn} onPressOut={onPressOut} onPress={onPress} + maxFontSizeMultiplier={1} style={[{ fontWeight: weightForIndex(index) }, style, getStyleForIndex(index), animatedStyle]} {...props} > @@ -142,4 +144,4 @@ const Text = ({ ); }; -export default Text; \ No newline at end of file +export default Text; diff --git a/src/hooks/useTronAccountResources.ts b/src/hooks/useTronAccountResources.ts new file mode 100644 index 0000000..9bc0d96 --- /dev/null +++ b/src/hooks/useTronAccountResources.ts @@ -0,0 +1,65 @@ +import { useQuery, UseQueryOptions } from '@tanstack/react-query'; + +import useNotifications from './useNotifications'; +import useWalletPublicValues from './useWalletPublicValues'; +import { ReactQueryKeys } from '@utils/constants'; +import { getAccountResources } from '@web3/tx/tron.tx'; +import { AccountResources } from '@web3/tx/types'; + +type UseTronAccountResourcesReturn = { + accountResources?: AccountResources | null; + accountResourcesLoading: boolean; + refetchAccountResources: () => Promise; +}; + +type QueryKey = [ReactQueryKeys]; +type QueryOptions = UseQueryOptions; +type UseTronAccountResourcesProps = { + options?: Omit; +}; + +const useTronAccountResources = ({ + options, +}: UseTronAccountResourcesProps = {}): UseTronAccountResourcesReturn => { + const { address } = useWalletPublicValues(); + const { dispatchNotification } = useNotifications(); + + const queryKey: QueryKey = [ReactQueryKeys.TRON_ACCOUNT_RESOURCES]; + + const fetchAccountResources = () => { + if (!address) return null; + + return getAccountResources(address); + }; + + const onError = () => dispatchNotification('error.accountResources', 'error'); + + const { + data: accountResources, + isLoading, + isRefetching, + refetch, + } = useQuery({ + queryKey, + queryFn: fetchAccountResources, + initialData: null, + retry:false, + refetchOnMount: false, + refetchOnReconnect: false, + refetchOnWindowFocus: false, + onError, + ...(options || {}), + }); + + const refetchAccountResources = async () => { + refetch(); + }; + + return { + accountResources, + accountResourcesLoading: isLoading || isRefetching, + refetchAccountResources, + }; +}; + +export default useTronAccountResources; diff --git a/src/locale/en.json b/src/locale/en.json index d2a04bd..7478996 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -103,7 +103,11 @@ "home": { "title": "My cryptos", "balance": "Total balance", - "noAddressAlert": "As we do not store your **secret words**, to activate the **{{blockchain}}** blockchain, you will need to **close your wallet** from settings and then reopen it using your **secret words**." + "noAddressAlert": "As we do not store your **secret words**, to activate the **{{blockchain}}** blockchain, you will need to **close your wallet** from settings and then reopen it using your **secret words**.", + "blockchainExtraData": { + "energy": "Energy", + "bandwith": "Bandwith" + } }, "receive": { "title": "Receive cryptos", @@ -211,6 +215,7 @@ "news": "Error loading news", "tokenConversions": "Error loading conversion data", "walletActivity": "Error loading activity token", + "accountResources": "Error loading wallet data", "miningPendingTxs": "Error loading mining pending transactions", "hwConnectionError": "Failed to connect to the ledger, please follow the steps and try again", "beDisabled": "Bluetooth disabled" diff --git a/src/locale/es.json b/src/locale/es.json index 20b2911..7fa95d0 100644 --- a/src/locale/es.json +++ b/src/locale/es.json @@ -103,7 +103,11 @@ "home": { "title": "Mis cryptos", "balance": "Balance total", - "noAddressAlert": "Como nosotros no almacenamos tus **palabras secretas**, para activar la red **{{blockchain}}**, deberás **cerrar tu billetera** desde configuración y luego volver a abrirla usando tus **palabras secretas**." + "noAddressAlert": "Como nosotros no almacenamos tus **palabras secretas**, para activar la red **{{blockchain}}**, deberás **cerrar tu billetera** desde configuración y luego volver a abrirla usando tus **palabras secretas**.", + "blockchainExtraData": { + "energy": "Energía", + "bandwith": "Ancho de banda" + } }, "receive": { "title": "Recibir cryptos", @@ -211,6 +215,7 @@ "news": "Error al cargar las noticias", "tokenConversions": "Error al cargar los datos de conversiónes", "walletActivity": "Error al cargar la actividad del token", + "accountResources": "Error al cargar datos de la billetera", "miningPendingTxs": "Error al cargar transacciones pendientes de minado", "hwConnectionError": "No se pudo conectar al Ledger, siga los pasos y reintente", "beDisabled": "Bluetooth desactivado" diff --git a/src/screens/main/HomeScreen.tsx b/src/screens/main/HomeScreen.tsx index 2371ac6..4f97a21 100644 --- a/src/screens/main/HomeScreen.tsx +++ b/src/screens/main/HomeScreen.tsx @@ -3,8 +3,9 @@ import React, { useEffect, useMemo, useState } from 'react'; import Clipboard from '@react-native-clipboard/clipboard'; import { NativeStackScreenProps } from '@react-navigation/native-stack'; import Animated, { FadeIn, FadeOut } from 'react-native-reanimated'; -import styled from 'styled-components/native'; +import styled, { useTheme } from 'styled-components/native'; +import BlockchainExtraData from '@components/BlockchainExtraData'; import Button from '@components/Button'; import DoublePrivateKeyEncryptionMessage from '@components/DoublePrivateKeyEncryptionMessage'; import ErrorWrapper from '@components/ErrorWrapper'; @@ -14,6 +15,7 @@ import Pill from '@components/Pill'; import Receive from '@components/Receive'; import ScreenLayout from '@components/ScreenLayout'; import Skeleton from '@components/Skeleton'; +import { Spacer } from '@components/Spacer'; import Text from '@components/Text'; import Title from '@components/Title'; import TokenBalances from '@components/TokenBalances'; @@ -52,7 +54,6 @@ const BalanceSkeleton = styled(Skeleton)` const ActionButton = styled(Button) <{ margin?: boolean }>` flex: 1; - ${({ margin, theme }) => (margin ? `margin-right: ${theme.spacing(2)};` : '')} `; const FullAnimatedView = styled(Animated.View)` @@ -62,6 +63,7 @@ const FullAnimatedView = styled(Animated.View)` type HomeScreenProps = NativeStackScreenProps; const HomeScreen = ({ navigation }: HomeScreenProps) => { + const theme = useTheme(); const [receiveBottomSheet, setReceiveBottomSheet] = useState(false); const [addressUpdated, setAddressUpdated] = useState(false); @@ -164,13 +166,14 @@ const HomeScreen = ({ navigation }: HomeScreenProps) => { entering={FadeIn} exiting={FadeOut} > + + { newsLoading, } = useNews({ token, - withResponse: false, + options: { + enabled: false, + }, }); const { diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 44bfd10..6ebc840 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -12,6 +12,7 @@ export enum ReactQueryKeys { MINING_PENDING_TXS = 'miningPendingTxs', CONSOLIDATED_CURRENCY = 'consolidatedCurrency', PRIVATE_KEY_CONFIG = 'privateKeyConfig', + TRON_ACCOUNT_RESOURCES = 'tronAccountResources', } export enum FiatCurrencies { diff --git a/src/web3/tx/tron.tx.ts b/src/web3/tx/tron.tx.ts index 9b2f43d..efe3405 100644 --- a/src/web3/tx/tron.tx.ts +++ b/src/web3/tx/tron.tx.ts @@ -1,7 +1,7 @@ import AppTrx from '@ledgerhq/hw-app-trx'; import { parseUnits } from 'ethers'; -import { EstimateFees, NO_TX_TO_SIGN_ERROR, ProcessTxToSave, SendTx, TronTxFees } from './types'; +import { AccountResources, EstimateFees, NO_TX_TO_SIGN_ERROR, ProcessTxToSave, SendTx, TronTxFees } from './types'; import { getTronTxConfirmations } from '@http/tx/tron.tx'; import { TronWalletTx } from '@http/tx/types'; import { isBigInt } from '@utils/number'; @@ -43,6 +43,25 @@ const estimateTrc20TokenTxEnergyRequired = async (token: TokenType, toAddress: s return contractConstants.energy_used; }; +export const getAccountResources = async (address: string): Promise => { + const accountResources = await tronProvider.trx.getAccountResources(address); + + if (!Object.keys(accountResources).length) return null; + + const totalEnergy = accountResources.EnergyLimit || 0; + const accountEnergy = totalEnergy - (accountResources.EnergyUsed || 0); + const totalBandwidth = (accountResources.freeNetLimit || 0) + (accountResources.NetLimit || 0); + const totalBandwidthUsed = (accountResources.NetUsed || 0) + (accountResources.freeNetUsed || 0); + const accountBandwidth = totalBandwidth - totalBandwidthUsed; + + return { + totalEnergy, + accountEnergy, + totalBandwidth, + accountBandwidth, + }; +}; + export const estimateTronFees: EstimateFees = async ( _, fromAddress, @@ -52,7 +71,7 @@ export const estimateTronFees: EstimateFees = async ( ) => { const isMainToken = token.address === BASE_TOKEN_ADDRESS; - const accountResources = await tronProvider.trx.getAccountResources(fromAddress); + const accountResources = await getAccountResources(fromAddress); const amount = isBigInt(quantity) ? quantity @@ -66,12 +85,12 @@ export const estimateTronFees: EstimateFees = async ( toResources, newUnsignedTx, ] = await Promise.all([ - tronProvider.trx.getAccountResources(toAddress), + getAccountResources(toAddress), tronProvider.transactionBuilder.sendTrx(toAddress, amount.toString(), fromAddress), ]); unsignedTx = newUnsignedTx; - const needsDestinationAccountActivation = !Object.keys(toResources).length; - if (needsDestinationAccountActivation) { + + if (!toResources) { activationFee = parseUnits((ACTIVATION_FEE).toString(), TOKENS_TRON.TRX?.decimals); } } else { @@ -98,19 +117,14 @@ export const estimateTronFees: EstimateFees = async ( energyNeeded = newEnergyNeeded; } - const accountEnergy = (accountResources.EnergyLimit || 0) - (accountResources.EnergyUsed || 0); - const totalBandwidth = (accountResources.freeNetLimit || 0) + (accountResources.NetLimit || 0); - const totalBandwidthUsed = (accountResources.NetUsed || 0) + (accountResources.freeNetUsed || 0); - const accountBandwidth = totalBandwidth - totalBandwidthUsed; - const bandwithNeeded = calculateTronTxBandwithNeeded(unsignedTx); - const bandwithMissing = accountBandwidth < bandwithNeeded + const bandwithMissing = (accountResources?.accountBandwidth || 0) < bandwithNeeded ? bandwithNeeded : 0; - const energyMissing = (accountEnergy - energyNeeded) < 0 - ? Math.abs(accountEnergy - energyNeeded) + const energyMissing = ((accountResources?.accountEnergy || 0) - energyNeeded) < 0 + ? Math.abs((accountResources?.accountEnergy || 0) - energyNeeded) : 0; const bandwithFee = parseUnits((bandwithMissing * BANDWITH_PRICE).toString(), 0); @@ -121,8 +135,8 @@ export const estimateTronFees: EstimateFees = async ( return { bandwithNeeded, energyNeeded, - accountEnergy, - accountBandwidth, + accountEnergy: accountResources?.accountEnergy || 0, + accountBandwidth: accountResources?.accountBandwidth || 0, bandwithPrice: BANDWITH_PRICE, energyPrice: ENERGY_PRICE, bandwithFee, diff --git a/src/web3/tx/types.ts b/src/web3/tx/types.ts index 3743b22..036d2ed 100644 --- a/src/web3/tx/types.ts +++ b/src/web3/tx/types.ts @@ -69,4 +69,11 @@ export type ProcessTxToSave = (config: { needsUpdate?: boolean; }) => Promise; +export type AccountResources = { + totalEnergy: number; + accountEnergy: number; + totalBandwidth: number; + accountBandwidth: number; +}; + export const NO_TX_TO_SIGN_ERROR = 'NO_TX_TO_SIGN';