Skip to content

Commit

Permalink
Merge branch 'ZeusLN:master' into macos-m1-without-rosetta
Browse files Browse the repository at this point in the history
  • Loading branch information
joegesualdo authored Mar 5, 2023
2 parents 3c11280 + 0f419e0 commit 48c2c81
Show file tree
Hide file tree
Showing 97 changed files with 3,885 additions and 1,375 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ body:
label: Zeus version
description: What version of Zeus were you running when the bug occurred?
options:
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
Expand Down
8 changes: 8 additions & 0 deletions Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import Olympians from './views/Settings/Olympians';
import Gods from './views/Settings/Gods';
import Mortals from './views/Settings/Mortals';
import PointOfSale from './views/Settings/PointOfSale';
import PointOfSaleRecon from './views/Settings/PointOfSaleRecon';
import PointOfSaleReconExport from './views/Settings/PointOfSaleReconExport';
import PaymentsSettings from './views/Settings/PaymentsSettings';

// Routing
Expand Down Expand Up @@ -251,6 +253,12 @@ const AppScenes = {
PointOfSaleSettings: {
screen: PointOfSale
},
PointOfSaleRecon: {
screen: PointOfSaleRecon
},
PointOfSaleReconExport: {
screen: PointOfSaleReconExport
},
PaymentsSettings: {
screen: PaymentsSettings
}
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Read more on our [documentation site](https://docs.zeusln.app/).
[developer Slack](https://zeusln.slack.com/join/shared_invite/zt-qw205nqa-o4VJJC0zPI7HiSfToZGoVw#/)
* Keep up with us on
[Twitter](https://twitter.com/ZeusLN)
and
[Nostr](https://iris.to/#/profile/npub1xnf02f60r9v0e5kty33a404dm79zr7z2eepyrk5gsq3m7pwvsz2sazlpr5)
* Open a channel with
[our node](https://amboss.space/node/031b301307574bbe9b9ac7b79cbe1700e31e544513eae0b5d7497483083f99e581)

Expand Down Expand Up @@ -111,17 +113,15 @@ Zeus is proud to be integrated on the following platforms:
[enable Developer mode and USB Debugging](https://developer.android.com/studio/debug/dev-options)
, then make sure it is connected to your computer by running `adb devices`
3. install node dependencies with `yarn`
4. install Lightning Node Connect's libraries with `yarn run install-lnc`
5. open up your Android simulator or connect your phone and run `npx react-native start`
6. open a new tab and run `npx react-native run-android`
4. open up your Android simulator or connect your phone and run `npx react-native start`
5. open a new tab and run `npx react-native run-android`

### iOS
1. install and setup react-native and its related dependencies under **"Building Projects with Native Code"** on
[react-native's Getting Started page](https://reactnative.dev/docs/environment-setup)
2. install node dependencies with `yarn`
3. install Lightning Node Connect's libraries with `yarn run install-lnc`
4. `cd ios && pod install`
5. open `ios/zeus.xcworkspace` in Xcode and hit Run. NOTE: if you're using an M1 mac, you may need to right click Xcode > get info > check `Open using Rosetta` before opening `zeus.xcworkspace`.
3. `cd ios && pod install`
4. open `ios/zeus.xcworkspace` in Xcode and hit Run. NOTE: if you're using an M1 mac, you may need to right click Xcode > get info > check `Open using Rosetta` before opening `zeus.xcworkspace`.

## Reproducible builds

Expand All @@ -131,7 +131,7 @@ Reproducible builds are available for Android only right now. You'll need Docker
You can also remove the `--branch v0.7.0` parameter to build APKs for `master`.
2. Change to the zeus directory: `cd zeus`
3. Execute the build script: `./build.sh`
4. If everything goes well, the script will print a list of all the generated APK files and MD5 for each one of them: armv7, armv8, x86, x86_64, universal. The equivalent to the one provided in the web page is the one ending in 'universal'. You can compare MD5s with the ones provided on the [GitHub releases page](https://github.com/ZeusLN/zeus/releases)
4. If everything goes well, the script will print a list of all the generated APK files and SHA256 hashes for each one of them: armv7, armv8, x86, x86_64, universal. The equivalent to the one provided in the web page is the one ending in 'universal'. You can compare SHA256 hashes with the ones provided on the [GitHub releases page](https://github.com/ZeusLN/zeus/releases)
5. Download the oficial apk from [GitHub releases page](https://github.com/ZeusLN/zeus/releases) or from the [Zeus homepage](https://zeusln.app/): `wget https://zeusln.app/zeus-v0.7.0.apk`
6. Compare both APKs with a suitable utility like `diffoscope`, `apksigcopier` or by running `diff --brief --recursive ./unpacked_oficial_apk ./unpacked_built_apk`. You should only get differences for the certificates used to sign the official APK

Expand Down Expand Up @@ -168,7 +168,7 @@ All releases and all maintainer commits as of October 20, 2021 are signed by key

## Donations

If you'd like to help us with the cost of running Zeus project (iOS developer account, Google Play developer account, hosting) you can send a payment to us via our [BTCPayServer portal](https://pay.zeusln.app/), via Lightning Address (tips@pay.zeusln.app), or via PayNym ([+holymorning7d1](http://my.paynym.is/+holymorning7d1)). You can also become a [community sponsor](https://zeusln.app/about#communitySponsors) and have your Twitter avatar displayed on our website and in-app.
If you'd like to help us with the cost of running Zeus project (iOS developer account, Google Play developer account, hosting) you can send a payment to us via our [BTCPayServer portal](https://pay.zeusln.app/), via Lightning Address (tips@pay.zeusln.app), or via PayNym ([+holymorning7d1](http://my.paynym.is/+holymorning7d1)). You can also become a [community sponsor](https://zeusln.app/about#communitySponsors) and have your Twitter or Nostr avatar displayed on our website and in-app.

Thank you.

Expand Down
12 changes: 7 additions & 5 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 58
versionName "0.7.2"
versionCode 62
versionName "0.7.3"
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'general'
}
Expand Down Expand Up @@ -200,13 +200,15 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:support-v13:+'
implementation project(':react-native-randombytes')
implementation "androidx.core:core:1.1.0"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation "com.facebook.react:react-native:0.70.6!!" // From node_modules
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
implementation files("../../node_modules/react-native-tor/android/libs/sifir_android.aar")
implementation project(':react-native-restart')
implementation project(':react-native-qrcode-local-image')
// gif
implementation 'com.facebook.fresco:fresco:2.6.0'
implementation 'com.facebook.fresco:animated-gif:2.6.0'
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 @@ -14,6 +14,7 @@
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.remobile.qrcodeLocalImage.RCTQRCodeLocalImagePackage;
import android.content.Context;

import com.facebook.soloader.SoLoader;
Expand All @@ -33,6 +34,7 @@ public boolean getUseDeveloperSupport() {
}
@Override
protected List<ReactPackage> getPackages() {
new RCTQRCodeLocalImagePackage();
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new MobileToolsPackage());
Expand Down
3 changes: 2 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ project(':react-native-randombytes').projectDir = new File(rootProject.projectDi
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':react-native-restart'
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')

include ':react-native-qrcode-local-image'
project(':react-native-qrcode-local-image').projectDir = new File(rootProject.projectDir, '../node_modules/@remobile/react-native-qrcode-local-image/android')
include ':app'
1 change: 1 addition & 0 deletions assets/images/Lottie/lightning1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/images/Lottie/lightning2.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/images/Lottie/lightning3.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/images/Lottie/loader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":"4.8.0","meta":{"g":"LottieFiles AE 1.1.0","a":"","k":"","d":"","tc":""},"fr":60,"ip":0,"op":180,"w":512,"h":512,"nm":"Main","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[343.698,169.635,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-87.698,86.866],[87.698,86.866],[87.698,-86.866],[-52.618,-86.866],[-52.618,20.055],[17.551,20.055],[17.551,-12.933]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.121568627451,0.141176470588,0.176470588235,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":34,"ix":5},"lc":3,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.861],"y":[1]},"o":{"x":[0.664],"y":[0]},"t":90,"s":[0]},{"t":150,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.25],"y":[1]},"o":{"x":[0.33],"y":[0]},"t":0,"s":[0]},{"t":60,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":242,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Layer 3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[343.698,343.367,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-87.698,-86.866],[87.698,-86.866],[87.698,86.866],[-52.618,86.866],[-52.618,-20.055],[17.551,-20.055],[17.551,12.933]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.121568627451,0.141176470588,0.176470588235,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":34,"ix":5},"lc":3,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.861],"y":[1]},"o":{"x":[0.664],"y":[0]},"t":90,"s":[0]},{"t":150,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.25],"y":[1]},"o":{"x":[0.33],"y":[0]},"t":0,"s":[0]},{"t":60,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":242,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168.3,169.635,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[87.698,86.866],[-87.698,86.866],[-87.698,-86.866],[52.618,-86.866],[52.618,20.055],[-17.551,20.055],[-17.551,-12.933]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.121568627451,0.141176470588,0.176470588235,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":34,"ix":5},"lc":3,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.861],"y":[1]},"o":{"x":[0.664],"y":[0]},"t":90,"s":[0]},{"t":150,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.25],"y":[1]},"o":{"x":[0.33],"y":[0]},"t":0,"s":[0]},{"t":60,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":242,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[168.3,343.367,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[87.698,-86.866],[-87.698,-86.866],[-87.698,86.866],[52.618,86.866],[52.618,-20.055],[-17.551,-20.055],[-17.551,12.933]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.121568627451,0.141176470588,0.176470588235,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":34,"ix":5},"lc":3,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.861],"y":[1]},"o":{"x":[0.664],"y":[0]},"t":90,"s":[0]},{"t":150,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.25],"y":[1]},"o":{"x":[0.33],"y":[0]},"t":0,"s":[0]},{"t":60,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":242,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"Comp 2","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":45,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2},"a":{"a":0,"k":[256,256,0],"ix":1},"s":{"a":0,"k":[90,90,100],"ix":6}},"ao":0,"w":512,"h":512,"ip":0,"op":180,"st":0,"bm":0}],"markers":[]}
3 changes: 3 additions & 0 deletions assets/images/SVG/Export.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/SVG/Gallery.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 55 additions & 2 deletions backends/CLightningREST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import LND from './LND';
import TransactionRequest from './../models/TransactionRequest';
import OpenChannelRequest from './../models/OpenChannelRequest';
import VersionUtils from './../utils/VersionUtils';
import Base64Utils from './../utils/Base64Utils';
import { Hash as sha256Hash } from 'fast-sha256';

export default class CLightningREST extends LND {
getHeaders = (macaroonHex: string): any => {
Expand Down Expand Up @@ -34,8 +36,51 @@ export default class CLightningREST extends LND {
transactions: data.outputs
}));
getChannels = () =>
this.getRequest('/v1/channel/listChannels').then((data: any) => ({
this.getRequest('/v1/peer/listPeers').then((data: any) => ({
channels: data
.filter((peer: any) => peer.channels.length)
.map((peer: any) => {
const channel =
peer.channels.find(
(c: any) =>
c.state !== 'ONCHAIN' && c.state !== 'CLOSED'
) || peer.channels[0];

return {
active: peer.connected,
remote_pubkey: peer.id,
channel_point: channel.funding_txid,
chan_id: channel.channel_id,
alias: peer.alias,
capacity: Number(
channel.msatoshi_total / 1000
).toString(),
local_balance: Number(
channel.msatoshi_to_us / 1000
).toString(),
remote_balance: Number(
(channel.msatoshi_total - channel.msatoshi_to_us) /
1000
).toString(),
total_satoshis_sent: Number(
channel.out_msatoshi_fulfilled / 1000
).toString(),
total_satoshis_received: Number(
channel.in_msatoshi_fulfilled / 1000
).toString(),
num_updates: (
channel.in_payments_offered +
channel.out_payments_offered
).toString(),
csv_delay: channel.our_to_self_delay,
private: channel.private,
local_chan_reserve_sat:
channel.our_channel_reserve_satoshis.toString(),
remote_chan_reserve_sat:
channel.their_channel_reserve_satoshis.toString(),
close_address: channel.close_to_addr
};
})
}));
getBlockchainBalance = () =>
this.getRequest('/v1/getBalance').then(
Expand Down Expand Up @@ -150,14 +195,22 @@ export default class CLightningREST extends LND {
this.getRequest(
`/v1/utility/checkMessage/${data.msg}/${data.signature}`
);
lnurlAuth = (message: string) => this.signMessage(message);
lnurlAuth = async (r_hash: string) => {
const signed = await this.signMessage(r_hash);
return {
signature: new sha256Hash()
.update(Base64Utils.stringToUint8Array(signed.signature))
.digest()
};
};

supportsMessageSigning = () => true;
supportsLnurlAuth = () => true;
supportsOnchainSends = () => true;
supportsOnchainReceiving = () => true;
supportsKeysend = () => true;
supportsChannelManagement = () => true;
supportsPendingChannels = () => false;
supportsMPP = () => false;
supportsAMP = () => false;
supportsCoinControl = () => this.supports('v0.8.2', undefined, 'v0.4.0');
Expand Down
Loading

0 comments on commit 48c2c81

Please sign in to comment.