diff --git a/android/app/build.gradle b/android/app/build.gradle
index 435597e..a280edc 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -95,8 +95,8 @@ android {
applicationId "com.minibits_wallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 58028
- versionName "0.2.0"
+ versionCode 58029
+ versionName "0.2.1"
}
splits {
diff --git a/android/app/src/main/res/drawable/nostr.png b/android/app/src/main/res/drawable/nostr.png
new file mode 100644
index 0000000..8274604
Binary files /dev/null and b/android/app/src/main/res/drawable/nostr.png differ
diff --git a/android/link-assets-manifest.json b/android/link-assets-manifest.json
new file mode 100644
index 0000000..20fd8ca
--- /dev/null
+++ b/android/link-assets-manifest.json
@@ -0,0 +1,13 @@
+{
+ "migIndex": 1,
+ "data": [
+ {
+ "path": "assets/fonts/Gluten-Regular.ttf",
+ "sha1": "96270757924e60e26763e8814aaa2000f470d352"
+ },
+ {
+ "path": "assets/icons/nostr.png",
+ "sha1": "c4558cc304ea0d6e908c7f43d8c7026041daaf3e"
+ }
+ ]
+}
diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist
deleted file mode 100644
index 273c4df..0000000
--- a/ios/GoogleService-Info.plist
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- API_KEY
- AIzaSyDSKDNb5MSVhfZmGYQzBaQj49h11m-VXeI
- GCM_SENDER_ID
- 869445547578
- PLIST_VERSION
- 1
- BUNDLE_ID
- com.ios.minibits-wallet
- PROJECT_ID
- minibits-prod
- STORAGE_BUCKET
- minibits-prod.firebasestorage.app
- IS_ADS_ENABLED
-
- IS_ANALYTICS_ENABLED
-
- IS_APPINVITE_ENABLED
-
- IS_GCM_ENABLED
-
- IS_SIGNIN_ENABLED
-
- GOOGLE_APP_ID
- 1:869445547578:ios:63fd5c3b7fc113072ae703
-
-
\ No newline at end of file
diff --git a/ios/link-assets-manifest.json b/ios/link-assets-manifest.json
new file mode 100644
index 0000000..20fd8ca
--- /dev/null
+++ b/ios/link-assets-manifest.json
@@ -0,0 +1,13 @@
+{
+ "migIndex": 1,
+ "data": [
+ {
+ "path": "assets/fonts/Gluten-Regular.ttf",
+ "sha1": "96270757924e60e26763e8814aaa2000f470d352"
+ },
+ {
+ "path": "assets/icons/nostr.png",
+ "sha1": "c4558cc304ea0d6e908c7f43d8c7026041daaf3e"
+ }
+ ]
+}
diff --git a/ios/minibits_wallet.xcodeproj/project.pbxproj b/ios/minibits_wallet.xcodeproj/project.pbxproj
index a45c852..0d887ba 100644
--- a/ios/minibits_wallet.xcodeproj/project.pbxproj
+++ b/ios/minibits_wallet.xcodeproj/project.pbxproj
@@ -11,7 +11,9 @@
761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
902F38392D92C792005DB998 /* OpenSSL.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 902F38382D92C792005DB998 /* OpenSSL.xcframework */; };
- 90C59D872D9195980061E3E1 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 90C59D862D9195980061E3E1 /* GoogleService-Info.plist */; };
+ 9044DC252D95937D00F918A6 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9044DC242D95937D00F918A6 /* GoogleService-Info.plist */; };
+ A1B9A6F7058C4F12AB677FD4 /* nostr.png in Resources */ = {isa = PBXBuildFile; fileRef = AB8A46AD84194C2583FF9193 /* nostr.png */; };
+ C3AB98FDBCF446F99A4EA648 /* Gluten-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6DA8A3418B7A4B348B67B9E7 /* Gluten-Regular.ttf */; };
CD7DC745CFA9F47C2D6FFA1D /* Pods_minibits_wallet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4ACC08249CA13DFDBBBD7A8B /* Pods_minibits_wallet.framework */; };
D610B97F2318E8AB9D0962D2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };
/* End PBXBuildFile section */
@@ -24,10 +26,13 @@
3B4392A12AC88292D35C810B /* Pods-minibits_wallet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-minibits_wallet.debug.xcconfig"; path = "Target Support Files/Pods-minibits_wallet/Pods-minibits_wallet.debug.xcconfig"; sourceTree = ""; };
4ACC08249CA13DFDBBBD7A8B /* Pods_minibits_wallet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_minibits_wallet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5709B34CF0A7D63546082F79 /* Pods-minibits_wallet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-minibits_wallet.release.xcconfig"; path = "Target Support Files/Pods-minibits_wallet/Pods-minibits_wallet.release.xcconfig"; sourceTree = ""; };
+ 6DA8A3418B7A4B348B67B9E7 /* Gluten-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Gluten-Regular.ttf"; path = "../assets/fonts/Gluten-Regular.ttf"; sourceTree = ""; };
761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = minibits_wallet/AppDelegate.swift; sourceTree = ""; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = minibits_wallet/LaunchScreen.storyboard; sourceTree = ""; };
902F38382D92C792005DB998 /* OpenSSL.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:67RAULRX93:Marcin Krzyzanowski"; lastKnownFileType = wrapper.xcframework; name = OpenSSL.xcframework; path = "Pods/OpenSSL-Universal/OpenSSL.xcframework"; sourceTree = ""; };
- 90C59D862D9195980061E3E1 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; };
+ 9044DC232D9556F600F918A6 /* minibits_wallet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = minibits_wallet.entitlements; path = minibits_wallet/minibits_wallet.entitlements; sourceTree = ""; };
+ 9044DC242D95937D00F918A6 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "minibits_wallet/GoogleService-Info.plist"; sourceTree = ""; };
+ AB8A46AD84194C2583FF9193 /* nostr.png */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = nostr.png; path = ../assets/icons/nostr.png; sourceTree = ""; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -47,6 +52,7 @@
13B07FAE1A68108700A75B9A /* minibits_wallet */ = {
isa = PBXGroup;
children = (
+ 9044DC232D9556F600F918A6 /* minibits_wallet.entitlements */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
761780EC2CA45674006654EE /* AppDelegate.swift */,
13B07FB61A68108700A75B9A /* Info.plist */,
@@ -66,6 +72,15 @@
name = Frameworks;
sourceTree = "";
};
+ 4B24E47762034A51AEE63594 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 6DA8A3418B7A4B348B67B9E7 /* Gluten-Regular.ttf */,
+ AB8A46AD84194C2583FF9193 /* nostr.png */,
+ );
+ name = Resources;
+ sourceTree = "";
+ };
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
@@ -76,12 +91,13 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
- 90C59D862D9195980061E3E1 /* GoogleService-Info.plist */,
+ 9044DC242D95937D00F918A6 /* GoogleService-Info.plist */,
13B07FAE1A68108700A75B9A /* minibits_wallet */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
BBD78D7AC51CEA395F1C20DB /* Pods */,
+ 4B24E47762034A51AEE63594 /* Resources */,
);
indentWidth = 2;
sourceTree = "";
@@ -168,9 +184,11 @@
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
- 90C59D872D9195980061E3E1 /* GoogleService-Info.plist in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
D610B97F2318E8AB9D0962D2 /* PrivacyInfo.xcprivacy in Resources */,
+ C3AB98FDBCF446F99A4EA648 /* Gluten-Regular.ttf in Resources */,
+ A1B9A6F7058C4F12AB677FD4 /* nostr.png in Resources */,
+ 9044DC252D95937D00F918A6 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -282,6 +300,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = minibits_wallet/minibits_wallet.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = GR2ZKMCLAM;
ENABLE_BITCODE = NO;
@@ -297,7 +316,7 @@
"-ObjC",
"-lc++",
);
- PRODUCT_BUNDLE_IDENTIFIER = "com.ios.minibits-wallet";
+ PRODUCT_BUNDLE_IDENTIFIER = cash.minibits.wallet;
PRODUCT_NAME = minibits_wallet;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -311,6 +330,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
+ CODE_SIGN_ENTITLEMENTS = minibits_wallet/minibits_wallet.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = GR2ZKMCLAM;
INFOPLIST_FILE = minibits_wallet/Info.plist;
@@ -325,7 +345,7 @@
"-ObjC",
"-lc++",
);
- PRODUCT_BUNDLE_IDENTIFIER = "com.ios.minibits-wallet";
+ PRODUCT_BUNDLE_IDENTIFIER = cash.minibits.wallet;
PRODUCT_NAME = minibits_wallet;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
@@ -413,10 +433,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
- OTHER_LDFLAGS = (
- "$(inherited)",
- " ",
- );
+ OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
@@ -497,10 +514,7 @@
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
- OTHER_LDFLAGS = (
- "$(inherited)",
- " ",
- );
+ OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
diff --git a/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/1024.png b/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/1024.png
new file mode 100644
index 0000000..032e960
Binary files /dev/null and b/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/1024.png differ
diff --git a/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/Contents.json
index 8121323..cff1680 100644
--- a/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/ios/minibits_wallet/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -1,48 +1,9 @@
{
"images" : [
{
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "20x20"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "20x20"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "29x29"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "29x29"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "40x40"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "40x40"
- },
- {
- "idiom" : "iphone",
- "scale" : "2x",
- "size" : "60x60"
- },
- {
- "idiom" : "iphone",
- "scale" : "3x",
- "size" : "60x60"
- },
- {
- "idiom" : "ios-marketing",
- "scale" : "1x",
+ "filename" : "1024.png",
+ "idiom" : "universal",
+ "platform" : "ios",
"size" : "1024x1024"
}
],
diff --git a/ios/minibits_wallet/Info.plist b/ios/minibits_wallet/Info.plist
index ce13e9b..58b7504 100644
--- a/ios/minibits_wallet/Info.plist
+++ b/ios/minibits_wallet/Info.plist
@@ -5,7 +5,7 @@
CFBundleDevelopmentRegion
en
CFBundleDisplayName
- minibits_wallet
+ Minibits
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -26,14 +26,26 @@
NSAppTransportSecurity
-
NSAllowsArbitraryLoads
NSAllowsLocalNetworking
+ NSCameraUsageDescription
+ This app requires access to the camera to scan QR codes.
NSLocationWhenInUseUsageDescription
+ NSUserNotificationUsageDescription
+ This app uses notifications to keep you updated with incoming transactions.
+ UIAppFonts
+
+ Gluten-Regular.ttf
+
+ UIBackgroundModes
+
+ fetch
+ remote-notification
+
UILaunchStoryboardName
LaunchScreen
UIRequiredDeviceCapabilities
diff --git a/ios/minibits_wallet/Resources/Fonts/Gluten-Regular.ttf b/ios/minibits_wallet/Resources/Fonts/Gluten-Regular.ttf
new file mode 100644
index 0000000..ae2e3c2
Binary files /dev/null and b/ios/minibits_wallet/Resources/Fonts/Gluten-Regular.ttf differ
diff --git a/ios/minibits_wallet/minibits_wallet.entitlements b/ios/minibits_wallet/minibits_wallet.entitlements
new file mode 100644
index 0000000..903def2
--- /dev/null
+++ b/ios/minibits_wallet/minibits_wallet.entitlements
@@ -0,0 +1,8 @@
+
+
+
+
+ aps-environment
+ development
+
+
diff --git a/patches/react-native+0.77.0.patch b/patches/react-native+0.77.0.patch
new file mode 100644
index 0000000..a5235da
--- /dev/null
+++ b/patches/react-native+0.77.0.patch
@@ -0,0 +1,22 @@
+diff --git a/node_modules/react-native/ReactCommon/react/renderer/animations/utils.h b/node_modules/react-native/ReactCommon/react/renderer/animations/utils.h
+index 41b9be9..7ffc2f4 100644
+--- a/node_modules/react-native/ReactCommon/react/renderer/animations/utils.h
++++ b/node_modules/react-native/ReactCommon/react/renderer/animations/utils.h
+@@ -105,15 +105,11 @@ static inline bool shouldFirstComeBeforeSecondMutation(
+ // must come first.
+ if (lhs.type == ShadowViewMutation::Type::Remove &&
+ lhs.parentShadowView.tag == rhs.parentShadowView.tag) {
+- if (lhs.index > rhs.index) {
+- return true;
+- } else {
+- return false;
+- }
++ return lhs.index > rhs.index;
+ }
+ }
+
+- return false;
++ return &lhs < &rhs;
+ }
+
+ std::pair calculateAnimationProgress(
diff --git a/src/App.tsx b/src/App.tsx
index 189699a..1d4b7e5 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -4,8 +4,6 @@ import {
APP_ENV,
SENTRY_DSN,
JS_BUNDLE_VERSION,
- CODEPUSH_STAGING_DEPLOYMENT_KEY,
- CODEPUSH_PRODUCTION_DEPLOYMENT_KEY,
ANDROID_VERSION_NAME,
} from '@env'
// import codePush from 'react-native-code-push'
@@ -26,7 +24,7 @@ import Config from './config'
import {log} from './services'
import {Env} from './utils/envtypes'
import AppError from './utils/AppError'
-import { Image, TextStyle, View } from 'react-native'
+import { Image, TextStyle, View, Platform, UIManager } from 'react-native'
import { spacing, typography } from './theme'
import { displayName } from '../app.json'
import { Text } from './components/Text'
@@ -52,6 +50,11 @@ if (!__DEV__) {
})
}
+if (Platform.OS === 'android' &&
+ UIManager.setLayoutAnimationEnabledExperimental) {
+ UIManager.setLayoutAnimationEnabledExperimental(true)
+}
+
function App() {
const {userSettingsStore, relaysStore} = useStores()
diff --git a/src/components/CollapsibleText.tsx b/src/components/CollapsibleText.tsx
index 4aa3f5d..58d488d 100644
--- a/src/components/CollapsibleText.tsx
+++ b/src/components/CollapsibleText.tsx
@@ -19,7 +19,7 @@ const maxLines = 50
export const CollapsibleText = (props: CollapsibleProps) => {
const [collapsed, setCollapsed] = useState(props?.collapsed ?? false)
const toggleCollapse = () => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setCollapsed(!collapsed)
}
const textDim = useThemeColor('textDim')
diff --git a/src/components/ErrorModal.tsx b/src/components/ErrorModal.tsx
index 72cdc7a..097c96b 100644
--- a/src/components/ErrorModal.tsx
+++ b/src/components/ErrorModal.tsx
@@ -7,11 +7,6 @@ import { isObj } from '@cashu/cashu-ts/src/utils'
import JSONTree from 'react-native-json-tree'
import Clipboard from '@react-native-clipboard/clipboard'
-if (Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
type ErrorModalProps = {
error: AppError
}
@@ -28,7 +23,7 @@ export const ErrorModal: FC = function ({ error }) {
}, [error])
const toggleParams = () => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsParamsVisible(previousState => !previousState)
}
diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx
index f092c11..ec58c26 100644
--- a/src/components/ListItem.tsx
+++ b/src/components/ListItem.tsx
@@ -292,19 +292,20 @@ const $separatorBottom: ViewStyle = {
}
const $textStyle: TextStyle = {
- // alignSelf: 'flex-start',
- paddingVertical: spacing.extraSmall,
- // alignSelf: "center",
+ alignSelf: 'flex-start',
+ // paddingVertical: spacing.extraSmall,
textAlignVertical: 'center',
- flexGrow: 1,
- flexShrink: 1,
+ // borderColor: 'red',
+ // borderWidth: 1,
}
const $subTextContainer: ViewStyle = {
- flex: 1,
- flexDirection: 'column',
- // borderColor: 'red',
+ flex: 1,
+ flexDirection: 'column',
+ justifyContent: 'center',
+ // borderColor: 'green',
// borderWidth: 1,
+ alignSelf: 'stretch',
}
const $subTextStyle: TextStyle = {
@@ -315,7 +316,7 @@ const $subTextStyle: TextStyle = {
const $touchableStyle: ViewStyle = {
flexDirection: "row",
- alignItems: "flex-start",
+ alignItems: "flex-start",
}
const $componentContainer: ViewStyle = {
diff --git a/src/models/MintsStore.ts b/src/models/MintsStore.ts
index c557fb9..a25e9c1 100644
--- a/src/models/MintsStore.ts
+++ b/src/models/MintsStore.ts
@@ -105,6 +105,10 @@ export const MintsStoreModel = types
}))
.actions(self => ({
addMint: flow(function* addMint(mintUrl: string) {
+ if(!mintUrl) {
+ throw new AppError(Err.VALIDATION_ERROR, 'Mint URL is required.')
+ }
+
if(!mintUrl.includes('.onion') && !mintUrl.startsWith('https')) {
throw new AppError(Err.VALIDATION_ERROR, 'Mint URL needs to start with https.')
}
diff --git a/src/models/helpers/setupRootStore.ts b/src/models/helpers/setupRootStore.ts
index e7f31ef..00de325 100644
--- a/src/models/helpers/setupRootStore.ts
+++ b/src/models/helpers/setupRootStore.ts
@@ -17,13 +17,12 @@ import {
import { debounce } from "lodash"
import * as Sentry from '@sentry/react-native'
import type {RootStore} from '../RootStore'
-import {KeyChain, MinibitsClient, MMKVStorage} from '../../services'
+import {KeyChain, MMKVStorage} from '../../services'
import {Database} from '../../services'
import { log } from '../../services/logService'
import { rootStoreModelVersion } from '../RootStore'
import AppError, { Err } from '../../utils/AppError'
import { LogLevel } from '../../services/log/logTypes'
-import { MintStatus } from '../Mint'
import { CurrencyCode } from '../../services/wallet/currency'
import { ThemeCode } from '../../theme'
@@ -79,14 +78,15 @@ export async function setupRootStore(rootStore: RootStore) {
}
// track changes & save snapshot to the storage not more then once per second
- const saveSnapshot = debounce((snapshot) => {
+ /* const saveSnapshot = debounce((snapshot) => {
MMKVStorage.save(ROOT_STORAGE_KEY, snapshot)
- }, 1000)
+ }, 1000)*/
_disposer = onSnapshot(rootStore, snapshot => {
// log.trace('[setupRootStore] onSnapshot *** MMKV SHOULD SAVE ***')
- saveSnapshot(snapshot)
- // log.trace('[setupRootStore] saved', {walletStore: snapshot.walletStore})
+ // saveSnapshot(snapshot)
+ // log.trace('[setupRootStore] saved', {walletStore: snapshot.walletStore})
+ MMKVStorage.save(ROOT_STORAGE_KEY, snapshot)
})
// run migrations if needed, needs to be after onSnapshot to be persisted
diff --git a/src/screens/Contacts/PublicContacts.tsx b/src/screens/Contacts/PublicContacts.tsx
index a97c301..8284783 100644
--- a/src/screens/Contacts/PublicContacts.tsx
+++ b/src/screens/Contacts/PublicContacts.tsx
@@ -24,11 +24,6 @@ import { toJS } from 'mobx'
const defaultPublicNpub = 'npub1kvaln6tm0re4d99q9e4ma788wpvnw0jzkz595cljtfgwhldd75xsj9tkzv'
const maxContactsToLoad = 20
-if (Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
export const PublicContacts = observer(function (props: {
paymentOption: ReceiveOption | SendOption | undefined}
) {
@@ -418,13 +413,13 @@ export const PublicContacts = observer(function (props: {
const collapseProfile = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsOwnProfileVisible(false)
}
const expandProfile = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsOwnProfileVisible(true)
}
diff --git a/src/screens/ImportBackupScreen.tsx b/src/screens/ImportBackupScreen.tsx
index f430aa7..7999ba4 100644
--- a/src/screens/ImportBackupScreen.tsx
+++ b/src/screens/ImportBackupScreen.tsx
@@ -37,11 +37,6 @@ import { ContactsStoreSnapshot } from '../models/ContactsStore'
import { CashuMint, MintActiveKeys } from '@cashu/cashu-ts'
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
-
-if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
type Props = StaticScreenProps
export const ImportBackupScreen = observer(function ImportBackupScreen({ route }: Props) {
@@ -111,7 +106,7 @@ export const ImportBackupScreen = observer(function ImportBackupScreen({ route }
throw new AppError(Err.VALIDATION_ERROR, translate('backupScreen.missingMnemonicError'))
}
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
if (!validateMnemonic(mnemonic, wordlist)) {
throw new AppError(Err.VALIDATION_ERROR, translate("recoveryInvalidMnemonicError"))
@@ -203,7 +198,7 @@ export const ImportBackupScreen = observer(function ImportBackupScreen({ route }
throw new AppError(Err.VALIDATION_ERROR, 'Missing backup.')
}
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
const snapshot = getWalletSnapshot() // throws
diff --git a/src/screens/MintInfoScreen.tsx b/src/screens/MintInfoScreen.tsx
index 0e1cdff..199a200 100644
--- a/src/screens/MintInfoScreen.tsx
+++ b/src/screens/MintInfoScreen.tsx
@@ -36,11 +36,6 @@ import { CurrencyCode, formatCurrency } from '../services/wallet/currency'
import { QRShareModal } from '../components/QRShareModal'
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
-
-if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
interface DetailedNutInfo {
methods: Array;
disabled: boolean;
@@ -133,7 +128,7 @@ export const MintInfoScreen = observer(function MintInfoScreen({ route }: Props)
}, [])
const toggleLocalInfo = () => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsLocalInfoVisible(!isLocalInfoVisible)
}
diff --git a/src/screens/Mints/MintBalanceSelector.tsx b/src/screens/Mints/MintBalanceSelector.tsx
index 18fe911..16ab5a3 100644
--- a/src/screens/Mints/MintBalanceSelector.tsx
+++ b/src/screens/Mints/MintBalanceSelector.tsx
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react"
-import { FlatList, Keyboard, LayoutAnimation, View, ViewStyle } from "react-native"
+import { FlatList, Keyboard, LayoutAnimation, Platform, View, ViewStyle } from "react-native"
import { observer } from "mobx-react-lite"
import { Button, Card} from "../../components"
import { spacing } from "../../theme"
@@ -32,14 +32,18 @@ export const MintBalanceSelector = observer(function (props: {
const keyboardDidShowListener = Keyboard.addListener(
'keyboardDidShow',
() => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ if(Platform.OS === 'android') {
+ LayoutAnimation.easeInEaseOut()
+ }
setIsKeyboardVisible(true);
}
);
const keyboardDidHideListener = Keyboard.addListener(
'keyboardDidHide',
() => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ if(Platform.OS === 'android') {
+ LayoutAnimation.easeInEaseOut()
+ }
setIsKeyboardVisible(false);
}
);
@@ -53,13 +57,13 @@ export const MintBalanceSelector = observer(function (props: {
useEffect(() => {
if(!props.selectedMintBalance) {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setAllVisible(true)
}
}, [])
const toggleAllVisible = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setAllVisible(!allVisible)
}
diff --git a/src/screens/OwnKeysScreen.tsx b/src/screens/OwnKeysScreen.tsx
index 2482f03..8191435 100644
--- a/src/screens/OwnKeysScreen.tsx
+++ b/src/screens/OwnKeysScreen.tsx
@@ -17,11 +17,6 @@ import { translate } from '../i18n'
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
-if (Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
type Props = StaticScreenProps<{}>
export const OwnKeysScreen = observer(function OwnKeysScreen({ route }: Props) {
@@ -141,7 +136,7 @@ export const OwnKeysScreen = observer(function OwnKeysScreen({ route }: Props) {
profile.name = nip05Name as string
}
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
log.trace('Got valid profile', profile)
setOwnProfile(profile)
diff --git a/src/screens/RecoverWalletAddressScreen.tsx b/src/screens/RecoverWalletAddressScreen.tsx
index 45dbd1a..f287f9e 100644
--- a/src/screens/RecoverWalletAddressScreen.tsx
+++ b/src/screens/RecoverWalletAddressScreen.tsx
@@ -18,10 +18,6 @@ import { WalletProfileRecord } from '../models/WalletProfileStore'
import { translate } from '../i18n'
import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'
-if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
type Props = StaticScreenProps
export const RecoverWalletAddressScreen = observer(function RecoverWalletAddressScreen({ route }: Props) {
@@ -52,7 +48,7 @@ export const RecoverWalletAddressScreen = observer(function RecoverWalletAddress
throw new AppError(Err.VALIDATION_ERROR, translate('backupScreen.missingMnemonicError'))
}
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
if (!validateMnemonic(mnemonic, wordlist)) {
throw new AppError(Err.VALIDATION_ERROR, translate("recoveryInvalidMnemonicError"))
diff --git a/src/screens/SeedRecoveryScreen.tsx b/src/screens/SeedRecoveryScreen.tsx
index 97f2181..74f3706 100644
--- a/src/screens/SeedRecoveryScreen.tsx
+++ b/src/screens/SeedRecoveryScreen.tsx
@@ -43,10 +43,6 @@ import { WalletProfileRecord } from '../models/WalletProfileStore'
import { MnemonicInput } from './Recovery/MnemonicInput'
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
-if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
const RESTORE_INDEX_INTERVAL = 50
type Props = StaticScreenProps
@@ -143,7 +139,7 @@ export const SeedRecoveryScreen = observer(function SeedRecoveryScreen({ route }
throw new AppError(Err.VALIDATION_ERROR, translate('backupScreen.missingMnemonicError'))
}
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
if (!validateMnemonic(mnemonic, wordlist)) {
throw new AppError(Err.VALIDATION_ERROR, translate("recoveryInvalidMnemonicError"))
diff --git a/src/screens/SendScreen.tsx b/src/screens/SendScreen.tsx
index a5f2b74..b587481 100644
--- a/src/screens/SendScreen.tsx
+++ b/src/screens/SendScreen.tsx
@@ -71,11 +71,6 @@ export enum SendOption {
// DONATION = 'DONATION',
}
-if (Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
type Props = StaticScreenProps<{
unit: MintUnit,
paymentOption?: SendOption,
@@ -549,7 +544,7 @@ export const SendScreen = observer(function SendScreen({ route }: Props) {
return
}
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setAmountToSend(`${numbro(amountToSend).format({thousandSeparated: true, mantissa: getCurrency(unitRef.current).mantissa})}`)
setAvailableMintBalances(availableBalances)
@@ -568,7 +563,7 @@ export const SendScreen = observer(function SendScreen({ route }: Props) {
const onMemoEndEditing = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
// Show mint selector
if (availableMintBalances.length > 0) {
diff --git a/src/screens/TopupScreen.tsx b/src/screens/TopupScreen.tsx
index b07b66d..701c6fb 100644
--- a/src/screens/TopupScreen.tsx
+++ b/src/screens/TopupScreen.tsx
@@ -64,13 +64,6 @@ import {TranItem} from './TranDetailScreen'
import {translate} from '../i18n'
import { TOPUP_TASK } from '../services/wallet/topupTask'
-if (
- Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental
-) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
-
type Props = StaticScreenProps<{
unit: MintUnit,
paymentOption?: ReceiveOption,
@@ -426,7 +419,7 @@ export const TopupScreen = observer(function TopupScreen({ route }: Props) {
}
setIsAmountEndEditing(true)
// We do not make memo focus mandatory
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
// Show mint selector
setIsMintSelectorVisible(true)
} catch (e: any) {
@@ -435,7 +428,7 @@ export const TopupScreen = observer(function TopupScreen({ route }: Props) {
}
const onMemoEndEditing = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
// Show mint selector
if (availableMintBalances.length > 0) {
@@ -679,6 +672,7 @@ export const TopupScreen = observer(function TopupScreen({ route }: Props) {
editable={
transactionStatus === TransactionStatus.PENDING ? false : true
}
+ returnKeyType={'done'}
/>
(false)
const toggleAuditTrail = () => {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsAuditTrailVisible(!isAuditTrailVisible)
}
diff --git a/src/screens/TranHistoryScreen.tsx b/src/screens/TranHistoryScreen.tsx
index d7b49bb..806461e 100644
--- a/src/screens/TranHistoryScreen.tsx
+++ b/src/screens/TranHistoryScreen.tsx
@@ -34,10 +34,6 @@ import { translate } from '../i18n'
import { maxTransactionsInHistory } from '../models/TransactionsStore'
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
-if (Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
// Number of transactions held in TransactionsStore model
const limit = maxTransactionsInHistory
@@ -181,13 +177,13 @@ export const TranHistoryScreen = observer(function TranHistoryScreen({ route }:
const collapseHeader = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsHeaderVisible(false)
}
const expandHeader = function () {
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
+ LayoutAnimation.easeInEaseOut()
setIsHeaderVisible(true)
}
diff --git a/src/screens/TransferScreen.tsx b/src/screens/TransferScreen.tsx
index b03a5a4..edff58c 100644
--- a/src/screens/TransferScreen.tsx
+++ b/src/screens/TransferScreen.tsx
@@ -50,15 +50,6 @@ import useIsInternetReachable from '../utils/useIsInternetReachable'
import { translate } from '../i18n'
import { MemoInputCard } from '../components/MemoInputCard'
import { TRANSFER_TASK } from '../services/wallet/transferTask'
-import { LNURLWithdrawParams } from 'js-lnurl'
-
-
-if (
- Platform.OS === 'android' &&
- UIManager.setLayoutAnimationEnabledExperimental
-) {
- UIManager.setLayoutAnimationEnabledExperimental(true)
-}
type Props = StaticScreenProps<{
unit: MintUnit,
diff --git a/src/screens/WalletScreen.tsx b/src/screens/WalletScreen.tsx
index eb164a4..d58d4bf 100644
--- a/src/screens/WalletScreen.tsx
+++ b/src/screens/WalletScreen.tsx
@@ -13,7 +13,8 @@ import {
Pressable,
Linking,
LayoutAnimation,
- AppStateStatus,
+ AppStateStatus,
+ Platform,
} from 'react-native'
// import codePush, { RemotePackage } from 'react-native-code-push'
import {moderateScale, verticalScale} from '@gocodingnow/rn-size-matters'
@@ -46,14 +47,9 @@ import {TransactionListItem} from './Transactions/TransactionListItem'
import {WalletTask} from '../services'
import {translate} from '../i18n'
import AppError, { Err } from '../utils/AppError'
-import {
- APP_ENV,
- CODEPUSH_STAGING_DEPLOYMENT_KEY,
- CODEPUSH_PRODUCTION_DEPLOYMENT_KEY,
- MINIBITS_MINT_URL,
- ANDROID_VERSION_NAME
+import {
+ MINIBITS_MINT_URL,
} from '@env'
-import { round } from '../utils/number'
import { IncomingParser } from '../services/incomingParser'
import useIsInternetReachable from '../utils/useIsInternetReachable'
import { CurrencySign } from './Wallet/CurrencySign'
@@ -62,7 +58,7 @@ import { CurrencyAmount } from './Wallet/CurrencyAmount'
import { LeftProfileHeader } from './ContactsScreen'
import { getUnixTime } from 'date-fns/getUnixTime'
-const deploymentKey = APP_ENV === Env.PROD ? CODEPUSH_PRODUCTION_DEPLOYMENT_KEY : CODEPUSH_STAGING_DEPLOYMENT_KEY
+
const MINT_CHECK_INTERVAL = 60
type Props = StaticScreenProps<{
@@ -913,12 +909,16 @@ const MintsByUnitList = observer(function (props: {
const onSelectedMint = function (mintUrl: string) {
if (selectedMintUrl && selectedMintUrl === mintUrl) {
- LayoutAnimation.easeInEaseOut()
+ if(Platform.OS === 'android') {
+ LayoutAnimation.easeInEaseOut()
+ }
setSelectedMintUrl(undefined)
return
}
- LayoutAnimation.easeInEaseOut()
+ if(Platform.OS === 'android') {
+ LayoutAnimation.easeInEaseOut()
+ }
setSelectedMintUrl(mintUrl)
}
@@ -962,7 +962,7 @@ const MintsByUnitList = observer(function (props: {
//topSeparator={true}
style={$item}
onPress={() => onSelectedMint(mint.mintUrl)}
- topSeparator={index !== 0 ?? true}
+ topSeparator={index > 0 ? true : false}
/>
{selectedMintUrl === mint.mintUrl && (
diff --git a/src/services/minibitsService.ts b/src/services/minibitsService.ts
index a10f637..afda915 100644
--- a/src/services/minibitsService.ts
+++ b/src/services/minibitsService.ts
@@ -7,7 +7,7 @@ import {
} from '@env'
import { WalletProfile, WalletProfileRecord } from "../models/WalletProfileStore"
import { CurrencyCode } from "./wallet/currency"
-
+ // refresh // refresh
type MinibitsRequestArgs = {
method: 'POST' | 'PUT' | 'DELETE' | 'GET'
@@ -292,8 +292,8 @@ const fetchApi = async (url: string, options: MinibitsRequestOptions, timeout =
if (!response) {
controller.abort()
throw new AppError(Err.NETWORK_TIMEOUT, 'Timeout: API takes too long to respond.', {caller: 'fetchApi', url})
- }
-
+ }
+
const responseJson = await response.json()
if(responseJson && responseJson.error) {
diff --git a/src/services/nostrService.ts b/src/services/nostrService.ts
index e311633..b931438 100644
--- a/src/services/nostrService.ts
+++ b/src/services/nostrService.ts
@@ -12,9 +12,9 @@ import { neventEncode as nostrNeventEncode, npubEncode, decode as nip19Decode }
import {SimplePool} from 'nostr-tools/pool'
import { hexToBytes } from '@noble/hashes/utils'
import { PrivateDirectMessage, Metadata } from 'nostr-tools/kinds'
-import {
+/*import {
MINIBITS_RELAY_URL,
-} from '@env'
+} from '@env'*/
import {NostrKeyPair} from './keyChain'
import {log} from './logService'
import AppError, { Err } from '../utils/AppError'
@@ -22,6 +22,7 @@ import { MinibitsClient } from './minibitsService'
import { rootStoreInstance } from '../models'
import { WalletTask } from './walletService'
+// refresh
export {
NostrEvent,
@@ -49,9 +50,10 @@ export type Nip05VerificationRecord = {
}
// TODO cleanup all this shit, move to RelayStore model
+// refresh
const _defaultPublicRelays: string[] = ['wss://relay.primal.net', 'wss://relay.damus.io']
-const _minibitsRelays: string[] = [MINIBITS_RELAY_URL]
+const _minibitsRelays: string[] = ['wss://relay.minibits.cash']
let _pool: any = undefined
diff --git a/src/utils/envtypes/env.d.tsx b/src/utils/envtypes/env.d.tsx
index 5058043..cb9c5b8 100644
--- a/src/utils/envtypes/env.d.tsx
+++ b/src/utils/envtypes/env.d.tsx
@@ -1,16 +1,14 @@
declare module '@env' {
export const APP_ENV: string
- export const SENTRY_DSN: string
- export const CODEPUSH_PRODUCTION_DEPLOYMENT_KEY: string
- export const CODEPUSH_STAGING_DEPLOYMENT_KEY: string
- export const ANDROID_VERSION_NAME: string
- export const ANDROID_VERSION_CODE: string
+ export const SENTRY_DSN: string
export const MINIBITS_SERVER_API_KEY: string
export const MINIBITS_SERVER_API_HOST: string
export const MINIBIT_SERVER_NOSTR_PUBKEY: string
export const MINIBITS_NIP05_DOMAIN: string
export const MINIBITS_RELAY_URL: string
export const MINIBITS_MINT_URL: string
+ export const ANDROID_VERSION_NAME: string
+ export const ANDROID_VERSION_CODE: string
export const JS_BUNDLE_VERSION: string
export const COMMIT: string
}