Commit 0bd533ad authored by Allan Juma's avatar Allan Juma

v0.7.8

parent 0e714ba0
......@@ -13,7 +13,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:4.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......@@ -36,8 +36,7 @@ allprojects {
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
wrapper {
gradleVersion = '6.8'
distributionUrl = distributionUrl.replace("bin", "all")
}
......@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
......@@ -1602,9 +1602,9 @@
"integrity": "sha512-7MzElZPTyJ2fNvBkPxtFQ2fWIkVmuzw41+BZHSzpEq3ymB2MfeKp1+yXl/tS75xCx+WnyV+yb0kp+K1C3UNwmQ=="
},
"blueimp-md5": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.11.1.tgz",
"integrity": "sha512-4UiOAmql2XO0Sws07OVzYdCKK0K2Va5g6AVgYXoGhEQiKrdSOefjUCm1frPk6E+xiIOHRqaFg+TUGo7cClKg5g=="
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
},
"bn.js": {
"version": "4.11.8",
......@@ -1969,9 +1969,9 @@
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs="
},
"compare-versions": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.5.1.tgz",
"integrity": "sha512-9fGPIB7C6AyM18CJJBHt5EnCZDG3oiTJYy0NjfIAGjKpzv0tkxWko7TNQHF5ymqm7IH03tqmeuBxtvD+Izh6mg=="
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz",
"integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA=="
},
"component-emitter": {
"version": "1.3.0",
......@@ -2475,9 +2475,9 @@
},
"dependencies": {
"path-browserify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.0.tgz",
"integrity": "sha512-Hkavx/nY4/plImrZPHRk2CL9vpOymZLgEbMNX1U0bjcBL7QN9wODxyx0yaMZURSQaUtSEvDrfAvxa9oPb0at9g=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="
}
}
},
......@@ -5274,9 +5274,9 @@
"integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM="
},
"querystringify": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA=="
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
},
"randomatic": {
"version": "3.1.1",
......@@ -7016,9 +7016,9 @@
}
},
"url-parse": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz",
"integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==",
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
"requires": {
"querystringify": "^2.1.1",
"requires-port": "^1.0.0"
......
{
"name": "bits",
"version": "0.6.2-alpha",
"name": "BITS",
"version": "0.7.8-alpha",
"description": "bits shopping wallet",
"author": "Bitsoko services",
"author": "Bitsoko Services",
"homepage": "./",
"license": "GPL-3.0",
"private": true,
......@@ -80,7 +80,7 @@
"ajv": "^6.5.0",
"babel-plugin-react-native-web": "^0.11.2",
"concurrently": "^3.5.1",
"electron": "^10.4.2",
"electron": "^17.2.0",
"electron-builder": "20.39.0",
"electron-rebuild": "^3.2.7",
"eslint-config-google": "^0.12.0",
......
......@@ -116,7 +116,9 @@ module.exports.init = async function({
});
ipcMain.on('lndRequest', (event, { method, body = {} }) => {
const handleResponse = (err, response) => {
//console.log(err, response, method);
event.sender.send(`lndResponse_${method}`, { err, response });
};
lnd[method](body, handleResponse);
......
......@@ -87,7 +87,7 @@ module.exports.startLndProcess = async function({
];
// set development or production settings
if (isDev) {
//if (isDev) {
args = args.concat([
'--bitcoin.node=neutrino',
......@@ -105,11 +105,12 @@ module.exports.startLndProcess = async function({
]);
}
//}
// set default production settings if no custom flags
//if (!isDev && !lndArgs.length) {
/*
if (!isDev) {
args = args.concat([
'--bitcoin.node=bitcoind',
......@@ -121,6 +122,7 @@ module.exports.startLndProcess = async function({
]);
}
*/
args = args.concat(lndArgs);
return startChildProcess(processName, args, logger);
};
......
......@@ -192,6 +192,7 @@ class GrpcAction {
//
async _sendIpc(event, listen, method, body) {
//console.log(listen, method, body);
try {
listen = method ? `${listen}_${method}` : listen;
return await this._ipc.send(event, listen, { method, body });
......
......@@ -22,6 +22,7 @@ const ComputedWallet = store => {
get totalBalanceSatoshis() {
const {
confirmedBalanceSatoshis: onChainBalanceSatoshis,
confirmedContractSatoshis: onContractBalanceSatoshis,
channelBalancePendingSatoshis,
channelBalanceOpenSatoshis,
channelBalanceInactiveSatoshis,
......@@ -29,6 +30,7 @@ const ComputedWallet = store => {
} = store;
return (
onChainBalanceSatoshis +
onContractBalanceSatoshis +
channelBalancePendingSatoshis +
channelBalanceOpenSatoshis +
channelBalanceInactiveSatoshis +
......@@ -46,12 +48,56 @@ const ComputedWallet = store => {
const { settings } = store;
return !settings.displayFiat ? UNITS[settings.unit].display : null;
},
get contractPercentageLabel() {
const {
confirmedBalanceSatoshis: onChain,
channelBalancePendingSatoshis: onPending,
channelBalanceOpenSatoshis: onOpen,
channelBalanceInactiveSatoshis: onInactive,
channelBalanceClosingSatoshis: onClosing,
totalBalanceSatoshis: total,
} = store;
const percent = total
? ((total - onChain - (onPending + onOpen + onInactive + onClosing)) /
total) *
100
: 0;
return `${Math.round(percent)}% on Contracts`;
},
get offChainFundsLabel() {
const {
confirmedContractSatoshis: onContracts,
channelBalancePendingSatoshis: onPending,
channelBalanceOpenSatoshis: onOpen,
channelBalanceInactiveSatoshis: onInactive,
channelBalanceClosingSatoshis: onClosing,
totalBalanceSatoshis: total,
} = store;
const percent = total
? ((onContracts + (onPending + onOpen + onInactive + onClosing)) /
total) *
100
: 0;
const offChainLabel = toAmountLabel(
onContracts + (onPending + onOpen + onInactive + onClosing),
store.settings
);
return `${Math.round(percent)}% or ${offChainLabel}`;
},
get maximumFundsLabel() {
const { maxBalanceSatoshis: max, totalBalanceSatoshis: total } = store;
const percent = max ? (total / max) * 100 : 0;
return `${Math.round(percent)}% of ${max}`;
},
get channelPercentageLabel() {
const {
confirmedBalanceSatoshis: onChain,
confirmedContractSatoshis: onContracts,
totalBalanceSatoshis: total,
} = store;
const percent = total ? ((total - onChain) / total) * 100 : 0;
const percent = total
? ((total - onChain - onContracts) / total) * 100
: 0;
return `${Math.round(percent)}% on Lightning`;
},
get newPasswordCopy() {
......
......@@ -40,8 +40,11 @@ export class Store {
balanceSatoshis: 0,
confirmedBalanceSatoshis: 0,
unconfirmedBalanceSatoshis: 0,
confirmedContractSatoshis: 10000,
unconfirmedContractSatoshis: 2000,
pendingBalanceSatoshis: 0,
channelBalanceSatoshis: 0,
maxBalanceSatoshis: 1000000,
network: null,
pubKey: null,
walletAddress: null,
......
......@@ -66,7 +66,7 @@ const ChannelHeader = ({ goChannelCreate, goHome }) => (
<View style={headerStyles.btnWrapperLeft}>
<BackButton onPress={goHome} />
</View>
<Title title="Channels" />
<Title title="Off-Chain Funds" />
<View style={headerStyles.btnWrapperRight}>
<SmallButton border text="Add" onPress={goChannelCreate}>
<PlusIcon height={12} width={12} />
......@@ -171,42 +171,46 @@ const ChannelSummary = ({
unitLabel,
}) => (
<View style={summaryStyles.wrapper}>
<View style={summaryStyles.box}>
<Alert type="success" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Opened</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalanceOpenLabel} {unitLabel}
</Text>
</View>
<View style={summaryStyles.box}>
<Alert type="inactive" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Inactive</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalanceInactiveLabel} {unitLabel}
</Text>
</View>
<View style={summaryStyles.box}>
<Alert type="info" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Pending</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalancePendingLabel} {unitLabel}
</Text>
</View>
<View style={summaryStyles.box}>
<Alert type="error" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Closing</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalanceClosingLabel} {unitLabel}
</Text>
<View style={summaryStyles.wrapper}>
<View style={summaryStyles.box}>
<View style={summaryStyles.alert}>
<BitcoinIcon height={170 * 0.06} width={135 * 0.06} />
</View>
<Text style={summaryStyles.txt}>On-chain</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{balanceLabel} {unitLabel}
</Text>
</View>
<View style={summaryStyles.box}>
<Alert type="success" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Opened</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalanceOpenLabel} {unitLabel}
</Text>
</View>
</View>
<View style={summaryStyles.box}>
<View style={summaryStyles.alert}>
<BitcoinIcon height={170 * 0.06} width={135 * 0.06} />
<View style={summaryStyles.wrapper}>
<View style={summaryStyles.box}>
<Alert type="inactive" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Inactive</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalanceInactiveLabel} {unitLabel}
</Text>
</View>
<View style={summaryStyles.box}>
<Alert type="info" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Pending</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalancePendingLabel} {unitLabel}
</Text>
</View>
<View style={summaryStyles.box}>
<Alert type="error" style={summaryStyles.alert} />
<Text style={summaryStyles.txt}>Closing</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{channelBalanceClosingLabel} {unitLabel}
</Text>
</View>
<Text style={summaryStyles.txt}>On-chain</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
{balanceLabel} {unitLabel}
</Text>
</View>
</View>
);
......
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { StyleSheet } from 'react-native';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
import { CopyText } from '../component/text';
import { SplitBackground } from '../component/background';
import MainContent from '../component/main-content';
import { Header, Title } from '../component/header';
import { CopyButton, Button, ButtonText } from '../component/button';
import { CopyButton, CancelButton, ChannelButton } from '../component/button';
import { CopiedNotification } from '../component/notification';
import CopyDarkIcon from '../../src/asset/icon/copy-dark';
import QRCode from '../component/qrcode';
......@@ -87,7 +87,11 @@ const paxDepoLink = addr => {
const DepositView = ({ store, nav, invoice }) => (
<SplitBackground image="purple-gradient-bg" bottom={color.blackDark}>
<Header separator>
<ChannelButton
onPress={() => invoice.toClipboard({ text: store.pubKey })}
/>
<Title title="Deposit Funds" />
<CancelButton onPress={() => nav.goHome()} />
</Header>
<MainContent style={styles.content}>
<CopyText style={styles.copyTxt}>
......@@ -99,7 +103,7 @@ const DepositView = ({ store, nav, invoice }) => (
icon={<CopyDarkIcon height={17.5} width={14} />}
style={styles.copyBtn}
>
{store.walletAddress}
Address: {store.walletAddress}
</CopyButton>
<CopyText style={styles.copyTxtX}>
buy directly from an exchange below.
......@@ -116,11 +120,6 @@ const DepositView = ({ store, nav, invoice }) => (
>
Paxful
</CopyButton>
<View style={styles.btnWrapper}>
<Button onPress={() => nav.goHome()}>
<ButtonText style={styles.doneBtnText}>DONE</ButtonText>
</Button>
</View>
<CopiedNotification
display={store.displayCopied}
color={color.notifyLight}
......
......@@ -223,7 +223,8 @@ const BalanceDisplay = ({
<View style={{ flex: 1, padding: 10, marginTop: '-10px' }}>
<Alert type={contractStatus} style={balanceStyles.alert} />
<H4Text style={{ paddingTop: '5px' }}>
{contractPercentageLabel} on Contracts
{contractPercentageLabel}
{'\n'}
</H4Text>
</View>
</View>
......
......@@ -46,6 +46,7 @@ const styles = createStyles(
);
const SettingView = ({ store, nav, wallet, autopilot, auth }) => {
const { offChainFundsLabel, maximumFundsLabel } = store;
return (
<Background color={color.blackDark}>
<Header separator>
......@@ -83,6 +84,18 @@ const SettingView = ({ store, nav, wallet, autopilot, auth }) => {
}
arrow
/>
<SettingItem
name="Offchain Funds"
label={offChainFundsLabel}
onSelect={() => nav.goChannels()}
arrow
/>
<SettingItem
name="Cold Store Limit"
label={maximumFundsLabel}
onSelect={() => nav.goCold()}
arrow
/>
<SettingItem name="Enable Autopilot">
<Switch
value={store.settings.autopilot}
......@@ -106,6 +119,13 @@ const SettingView = ({ store, nav, wallet, autopilot, auth }) => {
<CountBubbleOrange>testnet</CountBubbleOrange>
</SettingItem>
<SettingHeader name="ADVANCED" style={styles.advanced} />
<SettingItem
name="Soko"
onSelect={() =>
nav.goURL('https://dooca.net/soko/?uid=' + store.pubKey)
}
arrow
/>
<SettingItem name="Logs" onSelect={() => nav.goCLI()} arrow />
</SettingContent>
</Background>
......@@ -115,6 +135,8 @@ const SettingView = ({ store, nav, wallet, autopilot, auth }) => {
SettingView.propTypes = {
store: PropTypes.object.isRequired,
nav: PropTypes.object.isRequired,
maximumFundsLabel: PropTypes.string.isRequired,
offChainFundsLabel: PropTypes.string.isRequired,
wallet: PropTypes.object,
autopilot: PropTypes.object.isRequired,
auth: PropTypes.object,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment