Skip to content

Commit

Permalink
Merge pull request #210 from ZeusLN/master
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
ZeusLN authored Jan 18, 2020
2 parents 2242122 + 71948ec commit a87b6e3
Show file tree
Hide file tree
Showing 77 changed files with 6,300 additions and 5,601 deletions.
1 change: 1 addition & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class App extends React.PureComponent {
UnitsStore={Stores.unitsStore}
PaymentsStore={Stores.paymentsStore}
FeeStore={Stores.feeStore}
LnurlPayStore={Stores.lnurlPayStore}
>
<View style={styles.container}>
<Navigation />
Expand Down
4 changes: 4 additions & 0 deletions Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createStackNavigator, createAppContainer } from 'react-navigation';
import Transaction from './views/Transaction';
import Wallet from './views/Wallet/Wallet';
import Send from './views/Send';
import LnurlPay from './views/LnurlPay/LnurlPay';
import Receive from './views/Receive';
import PaymentRequest from './views/PaymentRequest';
import AddressQRScanner from './views/AddressQRScanner';
Expand Down Expand Up @@ -57,6 +58,9 @@ const AppScenes = {
Send: {
screen: Send
},
LnurlPay: {
screen: LnurlPay
},
Receive: {
screen: Receive
},
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Zeus
A mobile Bitcoin app for Lightning Network Daemon (lnd) node operators ⚡️
A mobile Bitcoin app for lnd and c-lightning node operators ⚡️

*Notice*: If you are looking for Zeus Server, the Lightning-based Point-of-Sale solution (unrelated to this project), please visit [puzzle/zeus](https://github.com/puzzle/zeus).

Expand All @@ -21,15 +21,15 @@ Zeus is built on TypeScript and React-Native. It runs on both iOS and Android.
[Telegram](https://t.me/zeusLN)
* Keep up with us on
[Twitter](https://twitter.com/ZeusLN)
* Open a channel with
* Open a channel with
[our node](https://1ml.com/node/03e1210c8d4b236a53191bb172701d76ec06dfa869a1afffcfd8f4e07d9129d898)

## Connecting to your node

Currently, to use Zeus, you must have a Bitcoin Lightning node running
[Lightning Network Daemon (lnd)](https://github.com/LightningNetwork/lnd).
[Lightning Network Daemon (lnd)](https://github.com/LightningNetwork/lnd) or [c-lightning](https://github.com/ElementsProject/lightning) using the [c-lightning-REST](https://github.com/Ride-The-Lightning/c-lightning-REST/) REST API.

You must provide Zeus with your node's hostname, port number, and the lnd macaroon you choose to use in **hex format**. If you need help converting your macaroon to hex format we wrote up a Node.js script that can use
You must provide Zeus with your node's hostname, port number, and the macaroon you choose to use in **hex format**. If you need help converting your macaroon to hex format we wrote up a Node.js script that can use
[here](https://github.com/ZeusLN/lnd-hex-macaroon-generator/). Alternatively, if you're running a Unix-based operating system (eg. macOS, Linux) you can run `xxd -ps -u -c 1000 /path/to/admin.macaroon` to generate your macaroon in hex format.

If you would like to learn more about running your own guide we suggest checking out the following guides:
Expand Down
5 changes: 3 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ android {
applicationId "com.zeusln.zeus"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 12
versionName "0.1.2"
versionCode 14
versionName "0.2.0"
}
signingConfigs {
release {
Expand Down Expand Up @@ -145,6 +145,7 @@ android {
}

dependencies {
implementation project(':realm')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-keychain')
implementation project(':rncamerakit')
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/zeus/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import io.realm.react.RealmReactPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.oblador.keychain.KeychainPackage;
import com.facebook.react.modules.network.OkHttpClientProvider;
Expand Down Expand Up @@ -31,6 +32,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RealmReactPackage(),
new LinearGradientPackage(),
new KeychainPackage(),
new RNCameraKitPackage(),
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/drawable/splash_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
android:src="@mipmap/ic_launcher"/>
</item>

</layer-list>
</layer-list>
Binary file modified android/app/src/main/res/mipmap-hdpi/zeus.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/zeus_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/zeus.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/zeus_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/zeus.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/zeus_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/zeus.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/zeus_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/app/src/main/res/mipmap-xxxhdpi/zeus.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified android/app/src/main/res/mipmap-xxxhdpi/zeus_round.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'zeus'
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-keychain'
Expand Down
2 changes: 1 addition & 1 deletion components/FeeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class FeeTable extends React.Component<
reprIndex = (x: number) => x / 6 + 'h';

openTable = () => {
this.props.FeeStore.getFees();
this.props.FeeStore.getOnchainFees();

this.setState({
collapsed: false
Expand Down
197 changes: 197 additions & 0 deletions components/SetFeesForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
import * as React from 'react';
import { StyleSheet, Text, TextInput, View } from 'react-native';
import { Button } from 'react-native-elements';

import FeeStore from './../stores/FeeStore';
import SettingsStore from './../stores/SettingsStore';

interface SetFeesFormProps {
SettingsStore: SettingsStore;
FeeStore: FeeStore;
baseFeeMsat?: string;
feeRate?: string;
channelPoint?: string;
channelId?: string;
}

interface SetFeesFormState {
showNewFeesForm: boolean;
feesSubmitted: boolean;
newBaseFeeMsat: string;
newFeeRateMiliMsat: string;
}

export default class SetFeesForm extends React.Component<
SetFeesFormProps,
SetFeesFormState
> {
state = {
showNewFeesForm: false,
feesSubmitted: false,
newBaseFeeMsat: '1',
newFeeRateMiliMsat: '1000000'
};

render() {
const {
showNewFeesForm,
feesSubmitted,
newBaseFeeMsat,
newFeeRateMiliMsat
} = this.state;
const {
SettingsStore,
FeeStore,
baseFeeMsat,
feeRate,
channelPoint,
channelId
} = this.props;
const { settings } = SettingsStore;
const { theme } = settings;
const { setFees, loading, setFeesError, setFeesSuccess } = FeeStore;

return (
<React.Fragment>
<View style={styles.button}>
<Button
title={
showNewFeesForm
? 'Hide Set New Fees Form'
: 'Set New Fees'
}
onPress={() =>
this.setState({ showNewFeesForm: !showNewFeesForm })
}
buttonStyle={{
backgroundColor: showNewFeesForm
? 'black'
: 'green',
borderRadius: 30
}}
/>
</View>

{showNewFeesForm && (
<React.Fragment>
{loading && (
<Text
style={{
color: theme === 'dark' ? 'white' : 'black'
}}
>
Setting fees, please wait...
</Text>
)}
{feesSubmitted && setFeesSuccess && (
<Text
style={{
color: 'green'
}}
>
Succesfully set fees!
</Text>
)}
{feesSubmitted && setFeesError && (
<Text
style={{
color: 'red'
}}
>
Error setting fees
</Text>
)}

<Text
style={{
color: theme === 'dark' ? 'white' : 'black'
}}
>
Base Fee msat
</Text>
<TextInput
placeholder={baseFeeMsat || '1'}
placeholderTextColor="darkgray"
value={newBaseFeeMsat}
onChangeText={(text: string) =>
this.setState({
newBaseFeeMsat: text
})
}
numberOfLines={1}
autoCapitalize="none"
autoCorrect={false}
style={
theme === 'dark'
? styles.textInputDark
: styles.textInput
}
/>
<Text
style={{
color: theme === 'dark' ? 'white' : 'black'
}}
>
Fee Rate mili msat
</Text>
<TextInput
placeholder={feeRate || '1000000'}
placeholderTextColor="darkgray"
value={newFeeRateMiliMsat}
onChangeText={(text: string) =>
this.setState({
newFeeRateMiliMsat: text
})
}
numberOfLines={1}
autoCapitalize="none"
autoCorrect={false}
style={
theme === 'dark'
? styles.textInputDark
: styles.textInput
}
/>

<View style={styles.button}>
<Button
title={'Submit New Fees'}
onPress={() => {
setFees(
newBaseFeeMsat,
newFeeRateMiliMsat,
channelPoint,
channelId
);
this.setState({ feesSubmitted: true });
}}
buttonStyle={{
backgroundColor:
theme === 'dark'
? '#261339'
: 'rgba(92, 99,216, 1)',
borderRadius: 30
}}
/>
</View>
</React.Fragment>
)}
</React.Fragment>
);
}
}

const styles = StyleSheet.create({
textInput: {
fontSize: 20,
color: 'black'
},
textInputDark: {
fontSize: 20,
color: 'white'
},
button: {
paddingTop: 15,
paddingBottom: 10
}
});
Loading

0 comments on commit a87b6e3

Please sign in to comment.