Skip to content

Commit

Permalink
Merge pull request #94 from ZeusLN/master
Browse files Browse the repository at this point in the history
v0.1.0-beta
  • Loading branch information
ZeusLN authored Jun 3, 2019
2 parents 6f73673 + aa1c6c4 commit 0145f1e
Show file tree
Hide file tree
Showing 34 changed files with 2,373 additions and 314 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: kaloudis
bitcoin: https://blockstream.info/address/3Lbz4vdt15Fsa4wVD3Yk8uGf6ugKKY4zSc
1 change: 1 addition & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class App extends React.PureComponent {
SettingsStore={Stores.settingsStore}
UnitsStore={Stores.unitsStore}
PaymentsStore={Stores.paymentsStore}
FeeStore={Stores.feeStore}
>
<View style={styles.container}>
<Navigation />
Expand Down
12 changes: 11 additions & 1 deletion Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createStackNavigator, createAppContainer } from 'react-navigation';

// Views
import Transaction from './views/Transaction';
import Settings from './views/Settings';
import Wallet from './views/Wallet/Wallet';
import Send from './views/Send';
import Receive from './views/Receive';
Expand All @@ -18,8 +17,16 @@ import Invoice from './views/Invoice';
import BTCPayConfigQRScanner from './views/BTCPayConfigQRScanner';
import LNDConnectConfigQRScanner from './views/LNDConnectConfigQRScanner';
import NodeInfo from './views/NodeInfo';
import Lockscreen from './views/Lockscreen';

// Settings views
import Settings from './views/Settings';
import AddEditNode from './views/Settings/AddEditNode';

const AppScenes = {
Lockscreen: {
screen: Lockscreen
},
Wallet: {
screen: Wallet
},
Expand All @@ -32,6 +39,9 @@ const AppScenes = {
Settings: {
screen: Settings
},
AddEditNode: {
screen: AddEditNode
},
Transaction: {
screen: Transaction
},
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Zeus
A mobile Bitcoin app for Lightning Network Daemon (lnd) node operators ⚡️

<p align="center"><img src="https://user-images.githubusercontent.com/47701173/53062398-b8af3000-348e-11e9-8630-2e07c1b28bf5.png"></p>
*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).

<p align="center"><img src="https://user-images.githubusercontent.com/47701173/55770407-2e2c8b00-5a52-11e9-933f-2819eb138c7d.png"></p>



Expand All @@ -10,6 +12,7 @@ Zeus is built on TypeScript and React-Native. It runs on both iOS and Android.
*Disclaimer*: Zeus and Lightning in general are software projects in their early development stages. Please be wary when using Lightning and do not fund your node with more money than you are willing to lose.

### App Store links
* [F-Droid](https://f-droid.org/packages/com.zeusln.zeus/)
* [Google Play](https://play.google.com/store/apps/details?id=com.zeusln.zeus)
* [Apple TestFlight](https://testflight.apple.com/join/gpVFzEHN)

Expand All @@ -21,7 +24,6 @@ Zeus is built on TypeScript and React-Native. It runs on both iOS and Android.
* Open a channel with
[our node](https://1ml.com/node/03b053229a315d4071520d7466f50b91be0edad375122c15932ba3334539a72a6c)


## Connecting to your node

Currently, to use Zeus, you must have a Bitcoin Lightning node running
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-minimal
4 changes: 2 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 8
versionName "0.0.8"
versionCode 10
versionName "0.1.0"
}
signingConfigs {
release {
Expand Down
143 changes: 143 additions & 0 deletions components/FeeTable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Original FeeTable code by Felix Weis - WhatTheFee.io
* https://whatthefee.io/static/js/FeeTable.js
*
* Converted to ReactNative + TypeScript by Evan Kaloudis for Zeus
*/
import * as React from 'react';
import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native';
import { Button } from 'react-native-elements';
import FeeUtils from './../utils/FeeUtils';
import { Cell, Header, Row } from 'react-native-data-table';
import { isEmpty } from 'lodash';
import { inject, observer } from 'mobx-react';

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

interface FeeTableProps {
SettingsStore: SettingsStore;
FeeStore: FeeStore;
setFee: (value: string) => void;
}

interface FeeTableState {
collapsed: boolean;
}

@inject('SettingsStore', 'FeeStore')
@observer
export default class FeeTable extends React.Component<FeeTableProps, FeeTableState> {
state = {
collapsed: true
}

styler(x: number|string) {
if(x == null || typeof x === 'string') {
return {
"backgroundColor": "white",
"alignItems": "center",
"height": 53,
"width": 53
}
};

const c: any = FeeUtils.gcolor(x/800);

return {
"backgroundColor": `hsl(${c[0]}, ${c[1]*100}%, ${c[2]*100}%)`,
"alignItems": "center",
"height": 53,
"width": 53
};
}

repr = (x: number) => Math.exp(x / 100).toFixed(1);

reprColumn = (x: number) => (x * 100).toFixed(0) + '%';

reprIndex = (x: number) => x / 6 + 'h';

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

this.setState({
collapsed: false
});
}

closeTable = () => {
this.setState({
collapsed: true
});
}

render() {
const { collapsed } = this.state;
const { FeeStore, SettingsStore, setFee } = this.props;
const { dataFrame, loading } = FeeStore;
const { settings } = SettingsStore;
const { theme } = settings;

const df = dataFrame;
let headers: any;
let rows: any;

if (!isEmpty(df) && !loading) {
headers = df.columns && df.columns.map((columnName: number, index: number) =>
<Cell style={{ backgroundColor: theme === 'dark' ? 'black' : 'white', minWidth: 53, height: 53 }} textStyle={{ color: theme === 'dark' ? 'white' : 'black' }} key={`item-${index}`}>{this.reprColumn(columnName)}</Cell>
);

rows = df.index.map((index: number, i: number) => {
const cells = df.data[i].map((cell: any, k: number) => {
const value = this.repr(cell);
return (
<TouchableOpacity key={`cell-${k}`} onPress={() => setFee(value)}><Cell style={this.styler(cell)}><Text style={{ color: 'white' }}>{value}</Text></Cell></TouchableOpacity>
);
});

const indexText = this.reprIndex(index);

return (
<Row key={`row-${i}`}>
<Cell style={this.styler(indexText)}><Text style={{ backgroundColor: theme === 'dark' ? 'black' : 'white', color: theme === 'dark' ? 'white' : 'black', width: 100 }}>{indexText}</Text></Cell>
{cells}
</Row>
);
});
}

return (
<View style={{ flex: 1 }}>
<Button
title={collapsed ? "What the Fee?" : "Hide Fee Table"}
icon={{
name: "view-module",
size: 25,
color: theme === 'dark' ? 'black' : 'white'
}}
containerStyle={{
marginBottom: 20,
width: 200,
alignSelf: "center"
}}
buttonStyle={{
backgroundColor: theme === 'dark' ? 'white' : 'black',
borderRadius: 30
}}
titleStyle={{
color: theme === 'dark' ? 'black' : 'white'
}}
onPress={() => collapsed ? this.openTable() : this.closeTable()}
/>
{!collapsed && loading && <ActivityIndicator size="large" color="#0000ff" />}
{!collapsed && !loading && headers && <View style={{ left: 25 }}>
<Header style={{ backgroundColor: 'white', left: 15 }} textStyle={{ alignItems: 'center' }}>
{headers}
</Header>
{rows}
</View>}
</View>
);
}
}
2 changes: 1 addition & 1 deletion ios/zeus/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.8</string>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Loading

0 comments on commit 0145f1e

Please sign in to comment.