Commit ab6298e5 authored by Allan Juma's avatar Allan Juma

update

parent 5a16f934
This diff is collapsed.
......@@ -2,6 +2,7 @@
# dependencies
/node_modules
/node_modules*
# testing
/coverage
......
......@@ -22,7 +22,7 @@
"preelectron-pack": "npm run build",
"prettier": "prettier --write --single-quote --trailing-comma es5 \"src/**/*.js\" public/electron.js",
"preinstall": "npx npm-force-resolutions",
"postinstall": "npm install -g @grpc/proto-loader @grpc/grpc-js react-dom faker --runtime=electron && npm run protobuf",
"postinstall": "pip3 install git+https://git.bitsoko.org/bitsoko/tinyman-py-sdk.git && npm install -g @grpc/proto-loader @grpc/grpc-js react-dom faker --runtime=electron && npm run protobuf",
"storybook": "start-storybook -p 9009 -s public",
"build-storybook": "build-storybook -s public",
"build-icon": "svgr --native --icon --filename-case kebab -d src/asset/icon src/asset/icon",
......
......@@ -8,7 +8,7 @@ import { PREFIX_URI } from '../config';
import { when } from 'mobx';
import { Clipboard } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { nap, checkHttpStatus, toSatoshis } from '../helper';
import { nap, checkHttpStatus, toSatoshis, signMessage } from '../helper';
import store from '../store';
import AppStorage from './app-storage';
import IpcAction from './ipc';
......@@ -200,7 +200,8 @@ when(
store.settings.chains.algo.account.address
);
console.log('algo account! ' + accountInfo);
await signMessage('habari kwa dunia', grpc, notify);
/*
//var poolStats = await grpc.initPyface(['/data/lightning-bits/src/chains/algo/pools.py', 'bootstrap', 70232824, 0, '289:BITS', 'ALGO', 'TTNTINGI6AKN6JBHCAOXVFZN72BAMDNBTHZ3ZRQC3ILAMWONKN7XRRQ6GM' ]);
var poolStats = await grpc.initPyface([
'/data/lightning-bits/src/chains/algo/pools.py',
......@@ -214,7 +215,7 @@ when(
console.log(poolStats);
store.settings.chains.algo.account.balance =
JSON.parse(poolStats).amount / 1000000 + ' ALGOS';
/*
if(!store.chains.sol.account){
var solAccount = await Solana.createWallet();
......@@ -284,7 +285,7 @@ when(
if (store.settings.soko.enabled) {
// invoice generation interval and count for multiple paypoints
// every hour
const webInvInt = 3600000;
const webInvInt = 600000;
const webInvCount = 2;
const sokoInt = setInterval(async function() {
if (!store.settings.soko.enabled) {
......
......@@ -137,12 +137,12 @@ class PoolAddAction {
* is either in btc or fiat depending on user settings.
* @param {string} options.amount The string formatted number
*/
async setAmount({ amo }) {
this._store.payment.amount = amo;
async setAmount({ amount }) {
this._store.payment.amount = amount;
this._store.payment.sendAll = false;
this.setAddress({ address: '' });
const { settings } = this._store;
var amount = toSatoshis(amo, settings);
amount = toSatoshis(amount, settings);
//check if contract has enough balance first
console.log(
......
......@@ -141,6 +141,18 @@ export const toAmountLabel = (satoshis, settings) => {
: formatNumber(toAmount(satoshis, settings));
};
export const signMessage = async (msg, grpc, notify) => {
try {
const response = await grpc.sendCommand('signMessage', {
msg: msg,
});
console.log(response);
//return res;
} catch (err) {
notify.display({ msg: 'Creating web invoice failed!', err });
}
};
export const addAsaQuote = async (grpc, store, aID1, aID2) => {
// var quote = await grpc.initPyface(['/data/lightning-bits/src/chains/algo/pools.py', 'addLiq', aID1, aID2 , store.settings.chains.algo.account.address, store.settings.chains.algo.account.mnemonic, 1]);
//var poolStats = await grpc.initPyface(['/data/lightning-bits/src/chains/algo/pools.py', 'bootstrap', aID1, aID2, store.settings.chains.algo.account.address, store.settings.chains.algo.account.mnemonic ]);
......
......@@ -66,7 +66,7 @@ const PromotionDetailView = ({ store, nav }) => (
{store.selectedPromotion.preimage}
</DetailField>
) : null}
<SendReceiveButton nav={() => nav} />
<SendReceiveButton nav={nav} />
</Modal>
</MainContent>
</Background>
......@@ -114,14 +114,19 @@ const SendReceiveButton = ({ nav }) => (
Transfer
</GlasButton>
<View style={bigBtnStyles.boltWrapper}></View>
<GlasButton onPress={nav} style={bigBtnStyles.rightBtn}>
<GlasButton
onPress={nav.goURL(
'https://dooca.bitsoko.org/bits/index-28.html#promoid=13'
)}
style={bigBtnStyles.rightBtn}
>
Redeem
</GlasButton>
</View>
);
SendReceiveButton.propTypes = {
nav: PropTypes.func.isRequired,
nav: PropTypes.object.isRequired,
};
export default observer(PromotionDetailView);
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