Skip to content

Commit

Permalink
Merge pull request #330 from ZeusLN/master
Browse files Browse the repository at this point in the history
Release: v0.3.1
  • Loading branch information
ZeusLN authored Aug 16, 2020
2 parents 0967324 + a35b419 commit 44df6f6
Show file tree
Hide file tree
Showing 26 changed files with 864 additions and 250 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Zeus is built on TypeScript and React-Native. It runs on both iOS and Android.
### App Store links
* [Google Play](https://play.google.com/store/apps/details?id=app.zeusln.zeus)
* [Apple TestFlight](https://testflight.apple.com/join/gpVFzEHN)
* [F-Droid](https://f-droid.org/packages/app.zeusln.zeus/)
* [F-Droid](https://f-droid.org/packages/com.zeusln.zeus/)

### Get in touch with us
* Come chat with us on
Expand Down Expand Up @@ -79,6 +79,13 @@ Zeus is proud to be integrated on the following platforms:
3. `cd ios && pod install`
4. open `ios/zeus.xcodeproj` in Xcode and hit Run

## Google Play Releases

Google Play releases aren't fully featured due to Google policies. To get the fully featured version of Zeus on Android you must download the APK from the [Zeus website](https://zeusln.app), GitHub, or F-Droid. Google Play releases are managed on the `play-releases` branch. Commits used for Google Play builds will be marked in the release notes.

#### Current features not included on Google Play releases
* Keysend donation button

## Contributing

Please be sure to run `tsc` to check for type errors, `npm run test` to run all tests, and `npm run prettier` to run the prettier
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ android {
applicationId "app.zeusln.zeus"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 17
versionName "0.3.0"
versionCode 19
versionName "0.3.1"
multiDexEnabled true
}
signingConfigs {
Expand Down
22 changes: 22 additions & 0 deletions docs/Bounties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Bounties

The Zeus team is putting up the tasks listed below for bounty. Working code must be merged for a user to collect the bounty. To inquire about status of a bounty, to contribute to a bounty, or to proprose a new bounty please email zeusln (at) tutanota (dot) com. Thank you.

## Tor on Android
Payout: 21,000,000 sats (0.21 BTC)

Currently, Zeus on Android requires Orbot to connect to your node over the Tor network. We'd like for users to be able to connect to their node over Tor without the use of Orbot, similar to Samourai Wallet. The user should be able to start and stop the Tor process and get a new identity if possible.

Additional bounty patrons: [Capitalist Dog](https://github.com/capitalistdog)

## Tor on iOS
Payout: 21,850,000 sats (0.2185 BTC)

Currently, Zeus on iOS cannot connect over Tor. Users looking to connect remotely need a VPN configuration. We'd like for users to be able to connect their node over Tor without the use of another app. The user should be able to start and stop the Tor process and get a new identity if possible.

Additional bounty patrons: [Ben Prentice](https://twitter.com/mrcoolbp), [Capitalist Dog](https://github.com/capitalistdog)

## Eclair support
Payout: 1,500,000 sats (0.015 BTC)

Currently, Zeus supports remote connections to lnd, c-lightning (through c-lightning-REST and Spark), and lndhub. We'd like for users to connect to Eclair nodes using the [Eclair REST interface](https://acinq.github.io/eclair/).
16 changes: 8 additions & 8 deletions ios/zeus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = (
Expand All @@ -1313,7 +1313,7 @@
INFOPLIST_FILE = zeus/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.3.0;
MARKETING_VERSION = 0.3.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
Expand All @@ -1333,10 +1333,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 7222UU8F2H;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-permissions/ios/**",
Expand All @@ -1345,7 +1345,7 @@
INFOPLIST_FILE = zeus/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.3.0;
MARKETING_VERSION = 0.3.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"$(inherited)",
Expand All @@ -1354,7 +1354,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.zeusln.zeus;
PRODUCT_NAME = zeus;
PROVISIONING_PROFILE_SPECIFIER = "Zeus Distribution";
PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
Expand Down
28 changes: 10 additions & 18 deletions ios/zeus/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,16 @@
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPSLoads</key>
<false/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPSLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>NSAppleMusicUsageDescription</key>
<string>Not Used</string>
Expand Down
16 changes: 16 additions & 0 deletions models/ForwardEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import BaseModel from './BaseModel';
import DateTimeUtils from './../utils/DateTimeUtils';
import { computed } from 'mobx';

export default class ForwardEvent extends BaseModel {
amt_out: string;
amt_in: string;
chan_id_out: string;
chan_id_in: string;
fee: string;
timestamp: string;

@computed public get getTime(): string {
return DateTimeUtils.listFormattedDate(this.timestamp || 0);
}
}
4 changes: 3 additions & 1 deletion models/Payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default class Payment extends BaseModel {

this.htlcs &&
this.htlcs.forEach((htlc: any) => {
const route: any[] = [];
if (htlc.status === 'SUCCEEDED') {
htlc.route.hops &&
htlc.route.hops.forEach((hop: any) => {
Expand All @@ -88,9 +89,10 @@ export default class Payment extends BaseModel {
}, Fee: ${
hop.fee_msat ? Number(hop.fee_msat) / 1000 : 0
}]`;
enhancedPath.push(enhancedHop);
route.push(enhancedHop);
});
}
enhancedPath.push(route);
});

return enhancedPath;
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "zeus",
"version": "0.3.0",
"version": "0.3.1",
"private": true,
"playStore": false,
"scripts": {
"start": "react-native start",
"postinstall": "rn-nodeify --install --hack; npx jetify",
Expand Down Expand Up @@ -32,7 +33,7 @@
"js-lnurl": "^0.2.2",
"js-sha256": "^0.9.0",
"jsc-android": "^241213.1.0",
"lodash": "4.17.15",
"lodash": "4.17.19",
"mobx": "^5.15.3",
"mobx-react": "^6.1.4",
"object-hash": "1.3.1",
Expand Down
3 changes: 3 additions & 0 deletions stores/ChannelsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class ChannelsStore {
@observable public errorMsgChannel: string | null;
@observable public errorMsgPeer: string | null;
@observable public nodes: any = {};
@observable public aliasesById: any = {};
@observable public channels: Array<Channel> = [];
@observable public output_index: number | null;
@observable public funding_txid_str: string | null;
Expand Down Expand Up @@ -61,6 +62,8 @@ export default class ChannelsStore {
this.nodes[
channel.remote_pubkey
] = nodeInfo;
this.aliasesById[channel.chan_id] =
nodeInfo.alias;
}
);
}
Expand Down
28 changes: 27 additions & 1 deletion stores/FeeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { action, observable } from 'mobx';
import RNFetchBlob from 'rn-fetch-blob';
import RESTUtils from './../utils/RESTUtils';
import Base64Utils from './../utils/Base64Utils';
import ForwardEvent from './../models/ForwardEvent';
import SettingsStore from './SettingsStore';

export default class FeeStore {
Expand All @@ -18,6 +19,10 @@ export default class FeeStore {
@observable public monthEarned: string | number;
@observable public totalEarned: string | number;

@observable public forwardingEvents: Array<any> = [];
@observable public lastOffsetIndex: number;
@observable public forwardingHistoryError: boolean = false;

getOnchainFeesToken: any;

settingsStore: SettingsStore;
Expand Down Expand Up @@ -71,7 +76,7 @@ export default class FeeStore {
this.dayEarned = data.day_fee_sum || 0;
this.weekEarned = data.week_fee_sum || 0;
this.monthEarned = data.month_fee_sum || 0;
this.totalEarned = data.total_fee_sum || 0;
// this.totalEarned = data.total_fee_sum || 0; DEPRECATED

this.loading = false;
})
Expand Down Expand Up @@ -123,4 +128,25 @@ export default class FeeStore {
this.feesError();
});
};

forwardingError = () => {
this.loading = false;
this.forwardingHistoryError = true;
};

@action
public getForwardingHistory = params => {
this.loading = true;
RESTUtils.getForwardingHistory(params)
.then((data: any) => {
this.forwardingEvents = data.forwarding_events
.map((event: any) => new ForwardEvent(event))
.reverse();
this.lastOffsetIndex = data.last_offset_index;
this.loading = false;
})
.catch(() => {
this.forwardingError();
});
};
}
39 changes: 29 additions & 10 deletions stores/TransactionsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ export default class TransactionsStore {
sendPayment = (
payment_request?: string | null,
amount?: string,
pubkey?: string
pubkey?: string,
max_parts?: string,
timeout_seconds?: string,
fee_limit_sat?: string
) => {
this.loading = true;
this.error_msg = null;
Expand Down Expand Up @@ -133,22 +136,38 @@ export default class TransactionsStore {
}
}

RESTUtils.payLightningInvoice(data)
// multi-path payments
if (max_parts) {
data.max_parts = max_parts;
data.timeout_seconds = timeout_seconds;
data.fee_limit_sat = Number(fee_limit_sat);
}

const payFunc = max_parts
? RESTUtils.payLightningInvoiceV2
: RESTUtils.payLightningInvoice;

payFunc(data)
.then((data: any) => {
const result = data.result || data;
this.loading = false;
this.payment_route = data.payment_route;
this.payment_preimage = data.payment_preimage;
this.payment_hash = data.payment_hash;
if (data.payment_error !== '') {
this.payment_route = result.payment_route;
this.payment_preimage = result.payment_preimage;
this.payment_hash = result.payment_hash;
if (
data.payment_error !== '' &&
result.status !== 'SUCCEEDED'
) {
this.error = true;
this.payment_error = data.payment_error;
this.payment_error =
result.payment_error || result.failure_reason;
}
// lndhub
if (data.error) {
if (result.error) {
this.error = true;
this.error_msg = data.message;
this.error_msg = result.message;
} else {
this.status = data.status || 'complete';
this.status = result.status || 'complete';
}
})
.catch((err: Error) => {
Expand Down
Loading

0 comments on commit 44df6f6

Please sign in to comment.