From 701bb8091045f210b0fab54d396889b831bd7d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hampus=20Sj=C3=B6berg?= Date: Tue, 11 Oct 2022 14:21:11 +0200 Subject: [PATCH] Fixes --- android/app/build.gradle | 10 +- index.js | 9 +- ios/BlixtWallet.xcodeproj/project.pbxproj | 134 ++++++++++--------- locales/en.json | 3 +- src/components/ChannelCard.tsx | 15 +++ src/components/PendingChannelCard.tsx | 4 +- src/components/Pincode.tsx | 2 +- src/lndmobile/channel.ts | 1 + src/lndmobile/index.ts | 41 ++++++ src/windows/Help.tsx | 8 +- src/windows/Keysend/Experiment.tsx | 47 +------ src/windows/LNURL/PayRequest/PaymentCard.tsx | 2 +- src/windows/LightningInfo/OpenChannel.tsx | 40 +++++- src/windows/Loading.tsx | 29 ++-- src/windows/Overview.tsx | 4 +- src/windows/Settings/Settings.tsx | 2 +- 16 files changed, 207 insertions(+), 144 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4332167c9..394c665cd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -21,7 +21,7 @@ import com.android.build.OutputFile * // default. Can be overridden with ENTRY_FILE environment variable. * entryFile: "index.android.js", * - * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format + * // https://reactnative.dev/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // whether to bundle JS and assets in debug mode @@ -80,7 +80,9 @@ import com.android.build.OutputFile project.ext.react = [ entryFile: "index.js", - enableHermes: true, // clean and rebuild if changing + bundleAssetName: "index.android.bundle", + enableHermes: true, // clean and rebuild if changing, + jsBundleDirRelease: "$buildDir/intermediates/assets/release", ] apply from: "../../node_modules/react-native/react.gradle" @@ -141,8 +143,8 @@ android { applicationId MYAPP_APP_ID minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 102 - versionName "0.5.1" + versionCode 112 + versionName "0.6.0" missingDimensionStrategy 'react-native-camera', 'general' multiDexEnabled true manifestPlaceholders = [appName: "Blixt Wallet"] diff --git a/index.js b/index.js index 9f41daf3d..ab41e3153 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,14 @@ LogBox.ignoreLogs([ // We are putting functions in navigation route props "Non-serializable values were found in the navigation state", // Native-base doesn't have useNativeDriver for every animation - "Animated: `useNativeDriver` was not specified" + "Animated: `useNativeDriver` was not specified", + // Ignore react-native-tor warning + "Module Tor requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.", + // Ignore intentional require cycle + "Require cycle: node_modules/protobufjs/src/enum.js -> node_modules/protobufjs/src/namespace.js -> node_modules/protobufjs/src/field.js -> node_modules/protobufjs/src/enum.js", + "Require cycle: src/storage/app.ts -> src/migration/app-migration.ts -> src/storage/app.ts", + // Ignore i18next warning about missing Intl API + "i18next::pluralResolver: Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.", ]); if ( diff --git a/ios/BlixtWallet.xcodeproj/project.pbxproj b/ios/BlixtWallet.xcodeproj/project.pbxproj index 9f66948d2..b7ec8b204 100644 --- a/ios/BlixtWallet.xcodeproj/project.pbxproj +++ b/ios/BlixtWallet.xcodeproj/project.pbxproj @@ -116,6 +116,7 @@ CC3F68522591683B000F11AA /* Lnd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lnd.swift; sourceTree = ""; }; CC6139F12579B66E0077D27B /* LndMobile.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LndMobile.m; sourceTree = ""; }; CC85FC242576522B00C376A9 /* BlixtWallet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = BlixtWallet.entitlements; path = BlixtWallet/BlixtWallet.entitlements; sourceTree = ""; }; + CC8A9EB628D8D44E00415019 /* hermes.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = hermes.xcframework; path = "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework"; sourceTree = ""; }; CC9DE6062733465900B72A38 /* lightning.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = lightning.pb.swift; sourceTree = ""; }; CCB51AE9259C2F74002637A2 /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; }; CCDBCBB325864296003E8BA8 /* BlixtWallet-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "BlixtWallet-Bridging-Header.h"; sourceTree = ""; }; @@ -188,6 +189,7 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( + CC8A9EB628D8D44E00415019 /* hermes.xcframework */, CC23C04A27E497F200BE3D10 /* Lndmobile_macos.xcframework */, CCDE5A1F270E84D4004EE251 /* Lndmobile.xcframework */, CCB51AE9259C2F74002637A2 /* CloudKit.framework */, @@ -340,8 +342,8 @@ 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - DC4D94AB1FFBF40CC519A9D3 /* [CP] Embed Pods Frameworks */, 0AE135E89297FA32B75AAF49 /* [CP] Copy Pods Resources */, + 2C47B87755FFBE636B73E5FB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -363,8 +365,8 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - B36B8BAB7FC20F5C036EF604 /* [CP] Embed Pods Frameworks */, 9C878BEA7459400FC363EA70 /* [CP] Copy Pods Resources */, + 971B9F3BF5B0A8967D7B7CFD /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -520,6 +522,42 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlixtWallet-BlixtWalletTests/Pods-BlixtWallet-BlixtWalletTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 2C47B87755FFBE636B73E5FB /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-BlixtWallet-BlixtWalletTests/Pods-BlixtWallet-BlixtWalletTests-frameworks.sh", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework/hermes", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlixtWallet-BlixtWalletTests/Pods-BlixtWallet-BlixtWalletTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 971B9F3BF5B0A8967D7B7CFD /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-BlixtWallet/Pods-BlixtWallet-frameworks.sh", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework/hermes", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlixtWallet/Pods-BlixtWallet-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 9C878BEA7459400FC363EA70 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -570,24 +608,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlixtWallet/Pods-BlixtWallet-resources.sh\"\n"; showEnvVarsInLog = 0; }; - B36B8BAB7FC20F5C036EF604 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-BlixtWallet/Pods-BlixtWallet-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework/hermes", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlixtWallet/Pods-BlixtWallet-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; BE62DC8E9828659C88295F56 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -610,24 +630,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - DC4D94AB1FFBF40CC519A9D3 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-BlixtWallet-BlixtWalletTests/Pods-BlixtWallet-BlixtWalletTests-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework/hermes", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-BlixtWallet-BlixtWalletTests/Pods-BlixtWallet-BlixtWalletTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -759,7 +761,7 @@ CHAIN = mainnet; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = true; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -775,7 +777,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -801,7 +803,7 @@ CHAIN = mainnet; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = false; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -817,7 +819,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -839,7 +841,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -896,6 +898,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; name = Debug; @@ -905,7 +908,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -955,6 +958,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -965,7 +969,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1022,6 +1026,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; name = DebugTestnet; @@ -1034,7 +1039,7 @@ CHAIN = testnet; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = true; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -1050,7 +1055,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1101,7 +1106,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1151,6 +1156,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -1164,7 +1170,7 @@ CHAIN = testnet; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = false; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -1180,7 +1186,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1227,7 +1233,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1284,6 +1290,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; name = DebugRegtest; @@ -1296,7 +1303,7 @@ CHAIN = regtest; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = true; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -1312,7 +1319,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1363,7 +1370,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1413,6 +1420,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -1426,7 +1434,7 @@ CHAIN = regtest; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = false; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -1442,7 +1450,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1489,7 +1497,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1546,6 +1554,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; }; name = DebugFakelnd; @@ -1558,7 +1567,7 @@ CHAIN = mainnet; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = true; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -1574,7 +1583,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -1625,7 +1634,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1675,6 +1684,7 @@ MACOSX_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; + REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -1688,7 +1698,7 @@ CHAIN = mainnet; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = BlixtWallet/BlixtWallet.entitlements; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 55; DEBUG = false; DEVELOPMENT_TEAM = AT26Z24V2Q; EXCLUDED_ARCHS = "i386 x86_64"; @@ -1704,7 +1714,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.5.1; + MARKETING_VERSION = 0.6.0; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/locales/en.json b/locales/en.json index f41c0b0c2..2142c19a8 100644 --- a/locales/en.json +++ b/locales/en.json @@ -95,7 +95,8 @@ "newChannelBeingOpened": { "info": "A new channel is in the process of being opened...", "view": "View" - } + }, + "noTransactionsYet": "No transactions yet" }, "help": { "title": "Help", diff --git a/src/components/ChannelCard.tsx b/src/components/ChannelCard.tsx index 69bec8d8f..582ed6b50 100644 --- a/src/components/ChannelCard.tsx +++ b/src/components/ChannelCard.tsx @@ -335,6 +335,21 @@ export function ChannelCard({ channel, alias }: IChannelCardProps) { } + {channel.zeroConf && + + + 0conf channel + + + } + {(channel.aliasScids?.length! > 0) && + + + Alias scid + + + + } diff --git a/src/lndmobile/channel.ts b/src/lndmobile/channel.ts index 70bff5cb8..e6689ef62 100644 --- a/src/lndmobile/channel.ts +++ b/src/lndmobile/channel.ts @@ -17,6 +17,7 @@ export const openChannel = async (pubkey: string, amount: number, privateChannel targetConf: feeRateSat ? undefined : 2, private: privateChannel, satPerByte: feeRateSat ? Long.fromValue(feeRateSat) : undefined, + scidAlias: true, }, }); return response; diff --git a/src/lndmobile/index.ts b/src/lndmobile/index.ts index 5a1ed8550..76cf301b0 100644 --- a/src/lndmobile/index.ts +++ b/src/lndmobile/index.ts @@ -7,6 +7,7 @@ import { stringToUint8Array, hexToUint8Array, unicodeStringToUint8Array } from " import { TLV_KEYSEND, TLV_RECORD_NAME, TLV_WHATSAT_MESSAGE } from "../utils/constants"; import { checkLndStreamErrorResponse } from "../utils/lndmobile"; import { LndMobileEventEmitter } from "../utils/event-listener"; +import { getChanInfo, listPrivateChannels } from "./channel"; const { LndMobile, LndMobileTools } = NativeModules; /** @@ -384,6 +385,46 @@ export const addInvoice = async (amount: number, memo: string, expiry: number = return response; }; +export const getRouteHints = async (max: number = 5): Promise => { + const routeHints: lnrpc.IRouteHint[] = []; + const channels = await listPrivateChannels(); + + // Follows the code in `addInvoice()` of the lnd project + for (const channel of channels.channels) { + const chanInfo = await getChanInfo(channel.chanId!); + const remotePubkey = channel.remotePubkey; + + // TODO check if node is publicly + // advertised in the network graph + // https://github.com/lightningnetwork/lnd/blob/38b521d87d3fd9cff628e5dc09b764aeabaf011a/channeldb/graph.go#L2141 + + let policy: lnrpc.IRoutingPolicy; + if (remotePubkey === chanInfo.node1Pub) { + policy = chanInfo.node1Policy!; + } + else { + policy = chanInfo.node2Policy!; + } + + if (!policy) { + continue; + } + + routeHints.push(lnrpc.RouteHint.create({ + hopHints: [{ + nodeId: remotePubkey, + chanId: chanInfo.channelId, + feeBaseMsat: policy.feeBaseMsat ? policy.feeBaseMsat.toNumber() : undefined, + feeProportionalMillionths: policy.feeRateMilliMsat ? policy.feeRateMilliMsat.toNumber() : undefined, + cltvExpiryDelta: policy.timeLockDelta, + }] + })); + } + + console.log("our hints", routeHints); + return routeHints; +} + export interface IAddInvoiceBlixtLspArgs { amount: number; memo: string; diff --git a/src/windows/Help.tsx b/src/windows/Help.tsx index 42e77dd1b..0a7012c87 100644 --- a/src/windows/Help.tsx +++ b/src/windows/Help.tsx @@ -1,8 +1,6 @@ import React from "react"; import { StyleSheet, Linking } from "react-native"; -import Clipboard from "@react-native-community/clipboard"; import { Body, Card, Text, CardItem, H1, Toast, View, Button } from "native-base"; -import { useStoreState } from "../state/store"; import Blurmodal from "../components/BlurModal"; import { GITHUB_REPO_URL, HAMPUS_EMAIL, TELEGRAM, FAQ } from "../utils/constants"; @@ -74,7 +72,6 @@ const style = StyleSheet.create({ card: { padding: 5, width: "100%", - minHeight: "45%", }, header: { fontWeight: "bold", @@ -82,10 +79,11 @@ const style = StyleSheet.create({ }, actionBar: { width: "100%", + marginTop: 10, flexGrow: 1, - alignItems:"flex-end", + alignItems: "flex-end", flexDirection: "row-reverse", - flexWrap: "wrap", + flexWrap: "wrap-reverse", }, actionBarButton: { marginLeft: 10, diff --git a/src/windows/Keysend/Experiment.tsx b/src/windows/Keysend/Experiment.tsx index f279eff87..89a650ae1 100644 --- a/src/windows/Keysend/Experiment.tsx +++ b/src/windows/Keysend/Experiment.tsx @@ -4,13 +4,12 @@ import { View } from "react-native"; import Clipboard from "@react-native-community/clipboard"; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' -import { sendKeysendPaymentV2 } from "../../lndmobile/index"; +import { getRouteHints, sendKeysendPaymentV2 } from "../../lndmobile/index"; import Long from "long"; import { toast, hexToUint8Array } from "../../utils"; import { useStoreState, useStoreActions } from "../../state/store"; import { generateSecureRandom } from "react-native-securerandom"; import { lnrpc } from "../../../proto/lightning"; -import { getChanInfo, listPrivateChannels } from "../../lndmobile/channel"; import QrCode from "../../components/QrCode"; import BlixtForm from "../../components/Form"; import { NavigationButton } from "../../components/NavigationButton"; @@ -45,7 +44,9 @@ export default function KeysendTest({ navigation }: ILightningInfoProps) { useEffect(() => { (async () => { - await getRouteHints(); + setRoutehints( + JSON.stringify(await getRouteHints()) + ); })(); }, []); @@ -141,46 +142,6 @@ export default function KeysendTest({ navigation }: ILightningInfoProps) { setSending(false); }; - const getRouteHints = async () => { - const routeHints: lnrpc.IRouteHint[] = []; - const channels = await listPrivateChannels(); - - // Follows the code in `addInvoice()` of the lnd project - for (const channel of channels.channels) { - const chanInfo = await getChanInfo(channel.chanId!); - const remotePubkey = channel.remotePubkey; - console.log("chanInfo", chanInfo); - - // TODO check if node is publicly - // advertised in the network graph - // https://github.com/lightningnetwork/lnd/blob/38b521d87d3fd9cff628e5dc09b764aeabaf011a/channeldb/graph.go#L2141 - - let policy: lnrpc.IRoutingPolicy; - if (remotePubkey === chanInfo.node1Pub) { - policy = chanInfo.node1Policy!; - } - else { - policy = chanInfo.node2Policy!; - } - - if (!policy) { - continue; - } - - routeHints.push(lnrpc.RouteHint.create({ - hopHints: [{ - nodeId: remotePubkey, - chanId: chanInfo.channelId, - feeBaseMsat: policy.feeBaseMsat ? policy.feeBaseMsat.toNumber() : undefined, - feeProportionalMillionths: policy.feeRateMilliMsat ? policy.feeRateMilliMsat.toNumber() : undefined, - cltvExpiryDelta: policy.timeLockDelta, - }] - })); - } - - setRoutehints(JSON.stringify(routeHints)); - }; - const onPressQr = () => { Clipboard.setString(JSON.stringify(routehints)); toast(t("qr.alert")); diff --git a/src/windows/LNURL/PayRequest/PaymentCard.tsx b/src/windows/LNURL/PayRequest/PaymentCard.tsx index e1537a6fa..f35071363 100644 --- a/src/windows/LNURL/PayRequest/PaymentCard.tsx +++ b/src/windows/LNURL/PayRequest/PaymentCard.tsx @@ -255,7 +255,7 @@ export default function PaymentCard({ onPaid, lnUrlObject, callback }: IPaymentC justifyContent: "center", }} onLayout={(event) => { - if (!sendButtonWidth) { + if (!sendButtonWidth && lightningReadyToSend) { setSendButtonWidth(event.nativeEvent.layout.width); } }} diff --git a/src/windows/LightningInfo/OpenChannel.tsx b/src/windows/LightningInfo/OpenChannel.tsx index 0c3d3b6e4..8e3069d27 100644 --- a/src/windows/LightningInfo/OpenChannel.tsx +++ b/src/windows/LightningInfo/OpenChannel.tsx @@ -1,16 +1,16 @@ import React, { useState, useLayoutEffect, useRef } from "react"; -import { StyleSheet, TextInput, View } from "react-native"; +import { NativeModules, StyleSheet, TextInput, View } from "react-native"; import { Text, Container, Button, Icon, Spinner } from "native-base"; import { StackNavigationProp } from "@react-navigation/stack"; import Slider from "@react-native-community/slider"; import Long from "long"; +import { RouteProp } from "@react-navigation/native"; import { LightningInfoStackParamList } from "./index"; import { useStoreActions, useStoreState } from "../../state/store"; import BlixtForm from "../../components/Form"; import { blixtTheme } from "../../native-base-theme/variables/commonColor"; import useBalance from "../../hooks/useBalance"; -import { RouteProp } from "@react-navigation/native"; import { toast } from "../../utils"; import useFormatBitcoinValue from "../../hooks/useFormatBitcoinValue"; import { PLATFORM } from "../../utils/constants"; @@ -18,6 +18,7 @@ import Input from "../../components/Input"; import { useTranslation } from "react-i18next"; import { namespaces } from "../../i18n/i18n.constants"; +import { Alert } from "../../utils/alert"; export interface IOpenChannelProps { navigation: StackNavigationProp; @@ -43,6 +44,8 @@ export default function OpenChannel({ navigation, route }: IOpenChannelProps) { bitcoinUnit, fiatUnit, } = useBalance(); + const torEnabled = useStoreState((store) => store.settings.torEnabled); + const changeTorEnabled = useStoreActions((store) => store.settings.changeTorEnabled); useLayoutEffect(() => { navigation.setOptions({ @@ -61,9 +64,38 @@ export default function OpenChannel({ navigation, route }: IOpenChannelProps) { }); await getChannels(undefined); navigation.pop(); - } catch (e) { - toast(`Error: ${e.message}`, 12000, "danger", "Okay"); + } catch (error) { + toast(`Error: ${error.message}`, 12000, "danger", "Okay"); setOpening(false); + + // Special case if the error is likely related to Tor + if (torEnabled && error.message?.includes(".onion: no such host") || error.message?.includes(".onion: No address associated with hostname")) { + await Alert.alert( + t("torPrompt.title"), t("torPrompt.text1") + "\n\n" + t("torPrompt.text2"), + [{ + text: "Cancel", + }, { + text: "Activate Tor", + async onPress(value?) { + await changeTorEnabled(!torEnabled); + if (PLATFORM === "android") { + try { + await NativeModules.LndMobile.stopLnd(); + await NativeModules.LndMobileTools.killLnd(); + } catch(e) { + console.log(e); + } + NativeModules.LndMobileTools.restartApp(); + } else { + Alert.alert( + t("bitcoinNetwork.restartDialog.title", { ns: namespaces.settings.settings }), + t("bitcoinNetwork.restartDialog.msg", { ns: namespaces.settings.settings }), + ); + } + }, + }] + ); + } } }; diff --git a/src/windows/Loading.tsx b/src/windows/Loading.tsx index 56e00dc4f..321578b1d 100644 --- a/src/windows/Loading.tsx +++ b/src/windows/Loading.tsx @@ -15,30 +15,25 @@ export interface ILoadingProps { } export default function Loading({ navigation }: ILoadingProps) { const checkDeeplink = useStoreActions((store) => store.deeplinkManager.checkDeeplink); - const ready = useStoreState((store) => store.lightning.ready); useEffect(() => { // tslint:disable-next-line (async () => { let cb = await checkDeeplink(); - requestAnimationFrame(() => { - navigation.dispatch( - CommonActions.reset({ - index: 0, - routes: [{ name: "Overview" }], - }) - ); - if (cb) { - setTimeout(() => { - cb(navigation); - }, 100); - } else if (PLATFORM === "web" && window.BLIXT_WEB_DEMO) { - navigation.navigate("WebInfo"); - } - }); + navigation.dispatch( + CommonActions.reset({ + index: 0, + routes: [{ name: "Overview" }], + }) + ); + if (cb) { + cb(navigation); + } else if (PLATFORM === "web" && window.BLIXT_WEB_DEMO) { + navigation.navigate("WebInfo"); + } })(); - }, [ready]); + }, []); return ( diff --git a/src/windows/Overview.tsx b/src/windows/Overview.tsx index fb51f5d70..8c65e4877 100644 --- a/src/windows/Overview.tsx +++ b/src/windows/Overview.tsx @@ -172,7 +172,7 @@ function Overview({ navigation }: IOverviewProps) { return ( navigation.navigate("TransactionDetails", { rHash })} />); }); } - return (No transactions yet); + return ({t("noTransactionsYet")}); }, [transactions, contentExpand, bitcoinUnit, hideExpiredInvoices]); const onPressBalanceHeader = async () => { @@ -371,7 +371,7 @@ const DoBackup = () => { }; const onPressBackupWallet = () => { - navigation.navigate("Welcome", { screen: "Seed "}); + navigation.navigate("Welcome", { screen: "Seed" }); }; return ( diff --git a/src/windows/Settings/Settings.tsx b/src/windows/Settings/Settings.tsx index 677d8b4a9..e22aec56a 100644 --- a/src/windows/Settings/Settings.tsx +++ b/src/windows/Settings/Settings.tsx @@ -1460,7 +1460,7 @@ ${t("experimental.tor.disabled.msg2")}`; } - setupDemo({ changeDb: false })}> + setupDemo({ changeDb: true })} onLongPress={() => { setupDemo({ changeDb: true }); toast("DB written") }}> {t("debug.demoMode.title")}