Commit a0860616 authored by Allan Juma's avatar Allan Juma

update

parent ab6298e5
const { contextBridge, ipcRenderer, app, BrowserWindow, ipcMain, dialog, Menu } = require('electron');
const { contextBridge, ipcRenderer, app, BrowserWindow, ipcMain, dialog, Menu, session } = require('electron');
const { autoUpdater } = require('electron-updater');
const os = require('os');
const path = require('path');
......@@ -135,6 +135,21 @@ console.log(path.join(__dirname, 'preload.js'));
// when you should delete the corresponding element.
win = null;
});
//set permissions
session.fromPartition("default").setPermissionRequestHandler((webContents, permission, callback) => {
let allowedPermissions = ["audioCapture","geolocation"]; // Full list here: https://developer.chrome.com/extensions/declare_permissions#manifest
if (allowedPermissions.includes(permission)) {
callback(true); // Approve permission request
} else {
console.error(
`The application tried to request permission for '${permission}'. This permission was not whitelisted and has been blocked.`
);
callback(false); // Deny
}
});
grcpClient.init({
ipcMain,
......
import React from 'react';
import Svg, { Path } from '../../component/svg';
const Algorand = props => (
<Svg viewBox="0 0 512 512" width="1em" height="1em" {...props}>
<Path
d="M267.3 16.7c8.7.2 22.7.2 31 0 8.4-.1 1.3-.3-15.8-.3-17 0-23.9.2-15.2.3z"
fill="#FFF"
fill-opacity=".5"
/>
<Path
d="M206.5 94.7c-24.7 42.8-71.5 123.9-104 180.3-32.5 56.4-65 112.7-72.3 125.2L17.1 423h70.4l8.4-14.8c4.7-8.1 32.2-55.6 61.1-105.7 29-50.1 63.4-109.7 76.5-132.5 31.1-54.3 38.6-67 39.3-67 .4 0 5.6 18.4 11.5 40.9 9.5 35.7 10.7 41.2 9.6 43.2-.6 1.3-17.5 30.5-37.4 64.9-19.9 34.4-49.4 85.4-65.5 113.5-16.1 28-30.1 52.5-31.2 54.2l-2 3.3h35.4l35.3-.1 44.4-77c24.4-42.3 44.5-76.9 44.6-76.7.4.4 13.5 48.9 29 106.8 6.4 23.9 11.8 44.3 12.1 45.2.5 1.7 2.9 1.8 32 1.8 17.3 0 31.4-.2 31.4-.4 0-.4-34.2-128-50.6-189.1-5.8-21.4-10.3-39.6-10.1-40.5.2-.8 9.9-17.9 21.5-38l21.1-36.5-31.8-.3-31.8-.2-13.4-50.3-13.4-50.2-31-.3-31.1-.2-44.9 77.7z"
fill="#FFF"
/>
<Path
d="M356.8 117.7c9 .2 23.4.2 32 0 8.6-.1 1.3-.3-16.3-.3s-24.7.2-15.7.3z"
fill="#FFF"
fill-opacity=".05"
/>
</Svg>
);
export default Algorand;
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 438 444"><path d="M267.3 16.7c8.7.2 22.7.2 31 0 8.4-.1 1.3-.3-15.8-.3-17 0-23.9.2-15.2.3z" fill="#FFF" fill-opacity=".5"/><path d="M206.5 94.7c-24.7 42.8-71.5 123.9-104 180.3-32.5 56.4-65 112.7-72.3 125.2L17.1 423h70.4l8.4-14.8c4.7-8.1 32.2-55.6 61.1-105.7 29-50.1 63.4-109.7 76.5-132.5 31.1-54.3 38.6-67 39.3-67 .4 0 5.6 18.4 11.5 40.9 9.5 35.7 10.7 41.2 9.6 43.2-.6 1.3-17.5 30.5-37.4 64.9-19.9 34.4-49.4 85.4-65.5 113.5-16.1 28-30.1 52.5-31.2 54.2l-2 3.3h35.4l35.3-.1 44.4-77c24.4-42.3 44.5-76.9 44.6-76.7.4.4 13.5 48.9 29 106.8 6.4 23.9 11.8 44.3 12.1 45.2.5 1.7 2.9 1.8 32 1.8 17.3 0 31.4-.2 31.4-.4 0-.4-34.2-128-50.6-189.1-5.8-21.4-10.3-39.6-10.1-40.5.2-.8 9.9-17.9 21.5-38l21.1-36.5-31.8-.3-31.8-.2-13.4-50.3-13.4-50.2-31-.3-31.1-.2-44.9 77.7z" fill="#FFF"/><path d="M356.8 117.7c9 .2 23.4.2 32 0 8.6-.1 1.3-.3-16.3-.3s-24.7.2-15.7.3z" fill="#FFF" fill-opacity=".05"/></svg>
\ No newline at end of file
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M252.2 10.2c-.5 1.8-4.4 17.6-8.8 35.1l-7.9 31.8-3-.7c-1.6-.3-20.9-5-42.7-10.5-21.8-5.4-40.1-9.9-40.6-9.9-1 0-12.5 46-11.7 46.8.2.2 8.3 2.4 18 4.8 19.6 4.8 25.1 7.3 29.2 13.5 5.2 7.9 5.7 5.2-20.6 111.4-18.1 72.5-24.7 97.9-26.5 100.6-2.4 3.6-7.8 6.9-11.3 6.9-1.1 0-10-2-19.7-4.4l-17.8-4.4-1.3 3.2c-.7 1.7-5.6 13-10.9 25.1-5.2 12.1-9.4 22-9.3 22.2.1.1 19.4 5 42.7 10.8 23.4 5.8 42.8 10.9 43.2 11.3.4.4-3.3 16.6-8.2 36-5.9 23.9-8.4 35.5-7.6 35.7 2 .8 41.5 10.5 42.3 10.5.5 0 4.7-15.3 9.3-34.1 4.7-18.7 8.8-34.6 9.2-35.2.4-.7 5.8.3 16.3 3.1 8.7 2.2 16 4.3 16.2 4.6.3.3-3.3 16.1-8.1 35.2s-8.5 34.8-8.4 35c.8.7 41.3 10.5 42.6 10.2 1.2-.2 3.8-9.3 10.3-35.1 4.8-19.2 8.8-35 9-35.1.2-.2 6.9.7 14.9 2 18.2 3 46.7 4.2 59.5 2.5 34.9-4.6 56.7-19.4 71.3-48.6 15.1-30.3 17.5-63.2 6.2-84.3-6.5-12.2-18.8-24.5-32-31.9-2.7-1.5-5-3-5-3.4 0-.3 3-1.5 6.8-2.7 28.2-9.1 46.2-37.4 46.4-72.7.1-13.8-1.4-21.2-6.8-32-9.7-19.8-31.5-36.6-64.7-50.1-7.3-3-13.7-5.4-14.3-5.4-.7 0 2.2-13.6 7.7-35.3 4.8-19.3 8.5-35.5 8.1-35.8-.9-.8-43.2-11.3-43.5-10.8-.2.2-4 15.7-8.7 34.4l-8.4 34.1-16.5-3.9c-9.1-2.1-16.7-4-16.8-4.1-.1-.1 3.6-15.2 8.2-33.6 4.7-18.4 8.5-34 8.5-34.6 0-1-38.7-11.4-42.4-11.4-.8 0-1.9 1.5-2.4 3.2zm55.4 189.9c-5.7 26.6-10.4 48.5-10.3 48.6.1 0 14.5 3.2 31.9 7 17.5 3.7 31.8 7.1 31.8 7.5 0 .4-27 25.7-60 56.3-33 30.5-60 54.9-60 54.2 0-.8 4.5-22.2 10-47.7 5.5-25.4 10-46.9 10-47.8 0-1.4-5.4-2.8-30.3-8.1-16.6-3.6-31-6.7-32-7.1-1.5-.5 10.8-12.3 58.3-56.4 33.1-30.6 60.4-55.5 60.6-55.3.3.2-4.3 22.2-10 48.8z" fill="#FFF"/></svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
import React from 'react';
import Svg, { G, Circle, Rect, Path } from '../../component/svg';
const Settings = props => (
<Svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="#fff"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<Circle cx="12" cy="12" r="3" />
<Path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />
</Svg>
);
export default Settings;
......@@ -49,6 +49,41 @@ const styles = StyleSheet.create({
},
});
const paxApiKey = 'MLA7UOgFxckNLrQcsdvuEUdI26u87iw1igraTm54ZiFl4lVs'; // specify
const paxApiSecret = 'TQJxD9dmC8mZ8HQbNGOcKN0ztQadgOMRuiAfVXbQgYdsilPr'; // specify
const paxKiosk = '9MywAoXynRz';
const qs = require('querystring');
const crypto = require('crypto');
function sign_with_hmac(apiKey, apiSecret, payload = {}) {
payload = qs.encode({
apikey: apiKey,
nonce: Date.now(),
...payload,
});
const apiSeal = crypto
.createHmac('sha256', apiSecret)
.update(payload)
.digest('hex');
const signedPayload = `${payload}&apiseal=${apiSeal}`;
return signedPayload;
}
const paxDepoLink = addr => {
var queryString = sign_with_hmac(paxApiKey, paxApiSecret, {
kiosk: paxKiosk,
ext_crypto_address: addr,
payment_method_group: 'online-transfers',
fiat_currency: 'KES',
});
var link = `https://paxful.com/roots/buy-bitcoin?${queryString}`;
return link;
};
const DepositView = ({ store, nav, invoice }) => (
<SplitBackground image="purple-gradient-bg" bottom={color.blackDark}>
<Header separator>
......@@ -59,33 +94,29 @@ const DepositView = ({ store, nav, invoice }) => (
Scan the QR code to send from another wallet.
</CopyText>
<QRCode size={180}>{store.walletAddressUri}</QRCode>
<CopyButton
onPress={() => invoice.toClipboard({ text: store.walletAddress })}
icon={<CopyDarkIcon height={17.5} width={14} />}
style={styles.copyBtn}
>
{store.walletAddress}
</CopyButton>
<CopyText style={styles.copyTxtX}>
buy directly from an exchange below.
</CopyText>
<CopyButton
onPress={() => nav.goURL(paxDepoLink(store.walletAddress))}
icon={
<Icon
image={require('../asset/icon/paxful.png')}
style={styles.smlIcon}
/>
}
style={styles.copyBtn}
>
Paxful
</CopyButton>
<View style={styles.btnWrapper}>
<CopyText style={styles.copyTxtX}>
or copy address and buy directly from an exchange below.
</CopyText>
<CopyButton
onPress={() => invoice.toClipboard({ text: store.walletAddress })}
icon={<CopyDarkIcon height={17.5} width={14} />}
style={styles.copyBtn}
>
{store.walletAddress}
</CopyButton>
<CopyButton
onPress={() =>
nav.goURL(
'https://localcryptos.com/Bitcoin/Buy?top_rated=1&online=1'
)
}
icon={
<Icon
image={require('../asset/icon/localcryptos.png')}
style={styles.smlIcon}
/>
}
style={styles.copyBtn}
>
LocalCryptos
</CopyButton>
<Button onPress={() => nav.goHome()}>
<ButtonText style={styles.doneBtnText}>DONE</ButtonText>
</Button>
......
......@@ -8,8 +8,10 @@ import { Header, Title } from '../component/header';
import { Alert } from '../component/notification';
import { color } from '../component/style';
import { H4Text } from '../component/text';
import Icon from '../component/icon';
//import Icon from '../component/icon';
import QrIcon from '../asset/icon/qr';
import SettingIcon from '../asset/icon/settings';
import BitsIcon from '../asset/icon/bits';
//import LightningBoltOrangeIcon from '../asset/icon/lightning-bolt-orange';
import {
BalanceLabel,
......@@ -163,7 +165,6 @@ const BalanceDisplay = ({
contractStatus,
contractPercentageLabel,
toggleDisplayFiat,
goChannels,
}) => (
<View style={balanceStyles.wrapper}>
{unitLabel ? (
......@@ -194,7 +195,7 @@ const BalanceDisplay = ({
</BalanceLabel>
</Button>
)}
<Button onPress={goChannels} style={balanceStyles.percentBtn}>
<Button onPress={toggleDisplayFiat} style={balanceStyles.percentBtn}>
<View
style={{
flex: 2,
......@@ -238,7 +239,6 @@ BalanceDisplay.propTypes = {
contractStatus: PropTypes.string.isRequired,
contractPercentageLabel: PropTypes.string.isRequired,
toggleDisplayFiat: PropTypes.func.isRequired,
goChannels: PropTypes.func.isRequired,
};
//
......@@ -273,10 +273,7 @@ const SendReceiveButton = ({ goPay, goRequest }) => (
Request
</GlasButton>
<View style={bigBtnStyles.boltWrapper}>
<Icon
image={require('../asset/icon/bitsIcon.png')}
style={styles.mainIcon}
/>
<BitsIcon height={40} width={40} />
</View>
<GlasButton onPress={goPay} style={bigBtnStyles.rightBtn}>
Pay
......@@ -324,10 +321,7 @@ const HomeHeader = ({ isTestnet, goDeposit, goSettings, goGovern }) => (
</View>
</Button>
<Button onPress={goSettings} style={headerStyles.settingsBtn}>
<Icon
image={require('../asset/icon/settings.png')}
style={headerStyles.settingsIcon}
/>
<SettingIcon height={40 * 0.6} width={39 * 0.6} />
</Button>
</Header>
);
......
......@@ -12,6 +12,7 @@ import BitcoinIcon from '../../src/asset/icon/bitcoin';
//import LightningBoltIcon from '../../src/asset/icon/lightning-bolt';
import { color, font } from '../component/style';
import { Button } from '../component/button';
import PoolIcon from '../../src/asset/icon/pool';
//import PlusIcon from '../../src/asset/icon/plus';
import Icon from '../component/icon';
......@@ -68,6 +69,7 @@ const PoolSummary = ({
<Text style={[summaryStyles.txt, summaryStyles.total]}>
// {poolBalanceClosingLabel} {unitLabel}
0.00 {unitLabel}
import BitsIcon from '../asset/icon/bits';
</Text>
</View>
</View>
......@@ -180,10 +182,7 @@ const PoolView = ({ store, nav, pool }) => {
<CancelButton onPress={() => nav.goHome()} />
</Header>
<Button style={poolStyles.topBtn}>
<Icon
image={require('../asset/icon/bits-invest.png')}
style={poolStyles.topIcon}
/>
<PoolIcon height={120} width={120} />
<PoolBalances
style={poolStyles.btnWrapper}
poolBalanceLabel={poolBalanceLabel}
......@@ -300,7 +299,6 @@ const PoolListItem = ({ tx, onSelect }) => (
</View>
<Text style={[iStyles.m, iStyles.txt]}>{tx.amount}</Text>
<Text style={[iStyles.m, iStyles.txt]}>{tx.quoteLabel}</Text>
<Text style={[iStyles.s, iStyles.txt]}>{tx.raised}</Text>
</ListItem>
);
......@@ -331,7 +329,6 @@ const PoolListHeader = () => (
<Text style={[iStyles.l, hStyles.txt]}>MERCHANT</Text>
<Text style={[iStyles.l, hStyles.txt]}>SHARE</Text>
<Text style={[iStyles.m, hStyles.txt]}>PRICE</Text>
<Text style={[iStyles.s, hStyles.txt]}>% CHANGE</Text>
</ListHeader>
);
......
......@@ -115,9 +115,9 @@ const SendReceiveButton = ({ nav }) => (
</GlasButton>
<View style={bigBtnStyles.boltWrapper}></View>
<GlasButton
onPress={nav.goURL(
'https://dooca.bitsoko.org/bits/index-28.html#promoid=13'
)}
onPress={() =>
nav.goURL('https://dooca.bitsoko.org/bits/index-28.html#promoid=13')
}
style={bigBtnStyles.rightBtn}
>
Redeem
......
......@@ -19,7 +19,8 @@ import LightningBoltIcon from '../../src/asset/icon/lightning-bolt';
import CopyDarkIcon from '../../src/asset/icon/copy-dark';
import BitcoinIcon from '../../src/asset/icon/bitcoin';
import BitsIcon from '../../src/asset/icon/bits';
import Icon from '../component/icon';
import AlgorandIcon from '../../src/asset/icon/algorand';
//import Icon from '../component/icon';
//import ChartApp from './chart';
......@@ -59,7 +60,7 @@ const summaryStyles = StyleSheet.create({
paddingTop: 50,
},
topPad: {
paddingTop: 50,
paddingTop: 40,
},
listIcon: {
height: 22,
......@@ -107,8 +108,8 @@ const ContractSummary = ({ unitLabel }) => (
<View style={summaryStyles.alert}>
<BitcoinIcon />
</View>
<Text style={summaryStyles.txt}>ID</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>1942776</Text>
<Text style={summaryStyles.txt}>goBTC</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>386192725</Text>
</View>
</View>
);
......@@ -145,19 +146,14 @@ const SetContractView = ({ store, nav, setting, invoice }) => {
<Background color={color.blackDark}>
<Header separator>
<BackButton onPress={() => nav.goSettings()} />
<Title title="Contract Settings" />
<Title title="Algorand Settings" />
<Button disabled onPress={() => {}} />
</Header>
<Button style={summaryStyles.topBtn}>
<Title
style={(summaryStyles.poolInfo, summaryStyles.topPad)}
title="Algorand"
/>
<Icon
image={require('../asset/icon/algorand.png')}
style={summaryStyles.topIcon}
title="https://algorand.com"
/>
<Title style={summaryStyles.poolInfo} title="https://algorand.com" />
<CopyText style={summaryStyles.copyTxtX}>
A world where everyone creates and exchanges value efficiently,
transparently, and securely.
......@@ -165,7 +161,7 @@ const SetContractView = ({ store, nav, setting, invoice }) => {
<View style={summaryStyles.wrapper}>
<View style={summaryStyles.box}>
<View style={summaryStyles.alert}>
<Alert type="success" style={summaryStyles.alert} />
<AlgorandIcon />
</View>
<Text style={summaryStyles.txt}> Balance</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
......@@ -192,13 +188,11 @@ const SetContractView = ({ store, nav, setting, invoice }) => {
<View style={summaryStyles.alert}>
<BitcoinIcon />
</View>
<Text style={summaryStyles.txt}> Balance</Text>
<Text style={summaryStyles.txt}> {store.settings.unit}</Text>
<Text style={[summaryStyles.txt, summaryStyles.total]}>
0.00001
</Text>
</View>
</View>
<View style={summaryStyles.wrapper}>
<View style={summaryStyles.box}>
<View style={summaryStyles.alert}>
<BitsIcon />
......
......@@ -44,7 +44,7 @@ const WelcomeView = () => (
<Background image="textured-bg" style={styles.background}>
<View style={styles.boltWrapper}>
<Icon
image={require('../asset/icon/bitsIcon.png')}
image={'../asset/icon/bitsIcon.png'}
style={welcomeStyles.mainIcon}
/>
</View>
......
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