Skip to content

Commit 2a0788f

Browse files
authored
v0.1.2
* Shows balances for X, C & P chains * Implemented sending AVAX on C & X chains * Added onboarding
2 parents d9adbbb + c88a47f commit 2a0788f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2852
-1035
lines changed

App.js

Lines changed: 0 additions & 158 deletions
This file was deleted.

App.tsx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**
2+
* Avalanche Wallet App
3+
*
4+
* @format
5+
* @flow strict-local
6+
*/
7+
8+
import React, {Component} from 'react'
9+
import {Appearance, SafeAreaView, StatusBar,} from 'react-native'
10+
import AppViewModel, {SelectedView} from './src/AppViewModel'
11+
import CommonViewModel from './src/CommonViewModel'
12+
import Login from './src/login/Login'
13+
import MainView from './src/mainView/MainView'
14+
import Onboard from './src/onboarding/Onboard'
15+
import CreateWallet from './src/onboarding/CreateWallet'
16+
17+
type AppProps = {}
18+
type AppState = {
19+
backgroundStyle: any
20+
isDarkMode: boolean
21+
selectedView: SelectedView
22+
}
23+
24+
class App extends Component<AppProps, AppState> {
25+
viewModel: AppViewModel = new AppViewModel()
26+
commonViewModel: CommonViewModel = new CommonViewModel(Appearance.getColorScheme() as string)
27+
28+
constructor(props: AppProps | Readonly<AppProps>) {
29+
super(props)
30+
this.state = {
31+
backgroundStyle: {},
32+
isDarkMode: false,
33+
selectedView: SelectedView.Login,
34+
}
35+
}
36+
37+
componentWillUnmount() {
38+
}
39+
40+
componentDidMount() {
41+
this.commonViewModel.isDarkMode.subscribe(value => {
42+
this.setState({isDarkMode: value})
43+
})
44+
this.commonViewModel.backgroundStyle.subscribe(value => {
45+
this.setState({backgroundStyle: value})
46+
})
47+
48+
this.viewModel.onComponentMount()
49+
50+
this.viewModel.selectedView.subscribe(value => {
51+
this.setState({selectedView: value})
52+
})
53+
54+
}
55+
56+
onEnterWallet(mnemonic: string): void {
57+
this.viewModel.onEnterWallet(mnemonic)
58+
}
59+
60+
getSelectedView(): Element {
61+
switch (this.state.selectedView) {
62+
case SelectedView.CreateWallet:
63+
return <CreateWallet
64+
onSavedMyPhrase={mnemonic => this.onEnterWallet(mnemonic)}
65+
onClose={() => this.viewModel.setSelectedView(SelectedView.Onboard)}/>
66+
case SelectedView.Onboard:
67+
return <Onboard
68+
onAlreadyHaveWallet={() => this.viewModel.setSelectedView(SelectedView.Login)}
69+
onCreateWallet={() => this.viewModel.setSelectedView(SelectedView.CreateWallet)}/>
70+
case SelectedView.Login:
71+
return <Login
72+
onEnterWallet={mnemonic => this.onEnterWallet(mnemonic)}
73+
onClose={() => this.viewModel.setSelectedView(SelectedView.Onboard)}/>
74+
case SelectedView.Main:
75+
if (this.viewModel.wallet === null) throw Error("Wallet not defined")
76+
return <MainView wallet={this.viewModel.wallet} onLogout={() => this.viewModel.onLogout()}/>
77+
}
78+
}
79+
80+
render() {
81+
return (
82+
<SafeAreaView style={this.state.backgroundStyle}>
83+
<StatusBar
84+
barStyle={this.state.isDarkMode ? "light-content" : "dark-content"}
85+
/>
86+
{this.getSelectedView()}
87+
</SafeAreaView>
88+
)
89+
}
90+
}
91+
92+
export default App

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,12 @@ You can run the test suite with
5252
```zsh
5353
yarn test
5454
```
55+
56+
## iOS & Android versioning
57+
58+
To update version of apps set new version in package.json and run
59+
```zsh
60+
yarn postversion
61+
```
62+
This will set versionName (bundle version string) to one set in package.json and increment versionCode (bundle version)
63+
by one.

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ android {
134134
applicationId "com.avaxwallet"
135135
minSdkVersion rootProject.ext.minSdkVersion
136136
targetSdkVersion rootProject.ext.targetSdkVersion
137-
versionCode 1
138-
versionName "1.0"
137+
versionCode 3
138+
versionName "0.1.2"
139139
}
140140
splits {
141141
abi {

ios/AvaxWallet.xcodeproj/project.pbxproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
49D759DDE6DA7811CD099B69 /* Pods-AvaxWallet-AvaxWalletTests.debug.xcconfig */,
146146
768AB2F6A941B6D6A6F508D4 /* Pods-AvaxWallet-AvaxWalletTests.release.xcconfig */,
147147
);
148-
name = Pods;
149148
path = Pods;
150149
sourceTree = "<group>";
151150
};
@@ -448,7 +447,10 @@
448447
buildSettings = {
449448
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
450449
CLANG_ENABLE_MODULES = YES;
450+
CODE_SIGN_IDENTITY = "Apple Development";
451+
CODE_SIGN_STYLE = Automatic;
451452
CURRENT_PROJECT_VERSION = 1;
453+
DEVELOPMENT_TEAM = U57DXD258P;
452454
ENABLE_BITCODE = NO;
453455
INFOPLIST_FILE = AvaxWallet/Info.plist;
454456
LD_RUNPATH_SEARCH_PATHS = (
@@ -460,8 +462,9 @@
460462
"-ObjC",
461463
"-lc++",
462464
);
463-
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
465+
PRODUCT_BUNDLE_IDENTIFIER = org.avalabs.avaxwallet;
464466
PRODUCT_NAME = AvaxWallet;
467+
PROVISIONING_PROFILE_SPECIFIER = "";
465468
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
466469
SWIFT_VERSION = 5.0;
467470
VERSIONING_SYSTEM = "apple-generic";
@@ -474,7 +477,9 @@
474477
buildSettings = {
475478
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
476479
CLANG_ENABLE_MODULES = YES;
480+
CODE_SIGN_STYLE = Manual;
477481
CURRENT_PROJECT_VERSION = 1;
482+
DEVELOPMENT_TEAM = U57DXD258P;
478483
INFOPLIST_FILE = AvaxWallet/Info.plist;
479484
LD_RUNPATH_SEARCH_PATHS = (
480485
"$(inherited)",
@@ -485,8 +490,9 @@
485490
"-ObjC",
486491
"-lc++",
487492
);
488-
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
493+
PRODUCT_BUNDLE_IDENTIFIER = org.avalabs.avaxwallet;
489494
PRODUCT_NAME = AvaxWallet;
495+
PROVISIONING_PROFILE_SPECIFIER = "App distribution provisioning profile";
490496
SWIFT_VERSION = 5.0;
491497
VERSIONING_SYSTEM = "apple-generic";
492498
};
@@ -586,7 +592,7 @@
586592
CLANG_WARN_SUSPICIOUS_MOVE = YES;
587593
CLANG_WARN_UNREACHABLE_CODE = YES;
588594
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
589-
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
595+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
590596
COPY_PHASE_STRIP = YES;
591597
ENABLE_NS_ASSERTIONS = NO;
592598
ENABLE_STRICT_OBJC_MSGSEND = YES;

ios/AvaxWallet.xcodeproj/xcshareddata/xcschemes/AvaxWallet.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</Testables>
4242
</TestAction>
4343
<LaunchAction
44-
buildConfiguration = "Debug"
44+
buildConfiguration = "Release"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4747
launchStyle = "0"

0 commit comments

Comments
 (0)