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

update

parent 55944831
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
This diff is collapsed.
This diff is collapsed.
......@@ -209,6 +209,23 @@ ipcMain.on('pyFace', async function(event, args) {
});
ipcMain.on('openUrl', async function(event, args) {
console.log(args.body);
// args.body[1] = inter
var url = args.body[2];
/*
const { BrowserWindow } = require('electron');
const win = new BrowserWindow({ width: 800, height: 1500 });
win.loadURL(url);
const contents = win.webContents;
console.log(contents);
*/
var shell = require('electron').shell;
shell.openExternal(url);
shell.beep();
event.sender.send(ranID, {});
});
const startLnd = async () => {
try {
......
......@@ -6,7 +6,7 @@ var { contextBridge, ipcRenderer } = require("electron");
const filter = event => {
if (
!/^(lnd)|(unlock)|(pyFace)|(log)|(locale)|(open-url)[a-zA-Z_-]{0,20}$/.test(event)
!/^(lnd)|(unlock)|(pyFace)|(openUrl)|(log)|(locale)|(open-url)[a-zA-Z_-]{0,20}$/.test(event)
) {
throw new Error(`Invalid IPC: ${event}`);
}
......
File mode changed from 100644 to 100755
......@@ -14,17 +14,34 @@ class GrpcAction {
}
//
// WalletUnlocker grpc client
// open external
//
/**
* The first GRPC api that is called to initialize the wallet unlocker.
* Once `unlockerReady` is set to true on the store GRPC calls can be
* made to the client.
* open external url.
* @return {Promise<undefined>}
*/
async initUrl(body) {
try {
var ranID =
'openUrl:' + JSON.stringify(Math.floor(Math.random() * 10000));
body = [ranID].concat(body);
var res = await this._ipc.send('openUrl', ranID, { body });
return res;
} catch (err) {
console.log(err);
}
}
//
// run python interface
//
/**
* run python interface.
* @return {Promise<undefined>}
*/
async initPyface(body) {
log.info('python starting');
try {
var ranID = 'pyFace:' + JSON.stringify(Math.floor(Math.random() * 10000));
body = [ranID].concat(body);
......
......@@ -45,8 +45,8 @@ store.init(); // initialize computed values
export const ipc = new IpcAction(window.electron.ipcRenderer);
export const db = new AppStorage(store, AsyncStorage);
export const log = new LogAction(store, ipc);
export const nav = new NavAction(store);
export const grpc = new GrpcAction(store, ipc);
export const nav = new NavAction(store, grpc);
export const notify = new NotificationAction(store, nav);
export const wallet = new WalletAction(store, grpc, db, nav, notify);
export const info = new InfoAction(store, grpc, nav, notify);
......
......@@ -4,9 +4,11 @@
* route to be rendered in the user interface.
*/
import { openExternal } from '../helper';
class NavAction {
constructor(store) {
constructor(store, grpc) {
this._store = store;
this._grpc = grpc;
}
goLoader() {
......@@ -160,8 +162,12 @@ class NavAction {
}
goURL(url) {
// this._store.route = 'Transactions';
window.open(url, '_blank');
openExternal(url, this._grpc);
//window.open(
// url,
// '_blank',
// 'height=900,width=480,top=200,left=500,frame=false,nodeIntegration=no,location=yes,'
//);
}
goPromotions() {
......
......@@ -72,7 +72,7 @@ class PoolAction {
var grpc = hii._grpc;
var store = hii._store;
try {
var pDat = await addAsaQuote(grpc, store, pool.poolID.id, 0);
var pDat = await addAsaQuote(grpc, store, pool.poolID.id, 386192725);
} catch (er) {
throw pDat;
}
......
......@@ -91,6 +91,8 @@ class PromotionAction {
amount: promo.reward,
title: promo.title,
fee: promo.redeem,
reward: promo.reward,
price: promo.price,
rewarded: promo.count,
hodl: promo.hodl,
date: parseDate(promo.ends),
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
from tinyman.v1.client import TinymanTestnetClient
from tinyman.v1.client import TinymanTestnetClient, TinymanMainnetClient
from algosdk import account, encoding , mnemonic
from bootstrap import prepare_bootstrap_transactions
from algosdk.v2client import algod
......@@ -113,7 +113,7 @@ if action == "bootstrap":
'address': pooler_address,
'private_key': priv_key,
}
client = TinymanTestnetClient(user_address=account['address'])
client = TinymanMainnetClient(user_address=account['address'])
if(not client.is_opted_in(account['address'])):
print('Account not opted into app, opting in now..')
transaction_group = client.prepare_app_optin_transactions(account['address'])
......@@ -192,7 +192,7 @@ if action == "swap":
if action == "quote":
client = TinymanTestnetClient()
client = TinymanMainnetClient()
aID1 = int(sys.argv[2])
aID2 = int(sys.argv[3])
......@@ -237,7 +237,7 @@ if action == "pooling":
'private_key': priv_key,
}
client = TinymanTestnetClient(user_address=account['address'])
client = TinymanMainnetClient(user_address=account['address'])
# By default all subsequent operations are on behalf of user_address
if(not client.is_opted_in(account['address'])):
print('Account not opted into app, opting in now..')
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -26,6 +26,9 @@ const ComputedPromotion = store => {
if (Number.isInteger(t.rewarded)) {
t.rewardedLabel = t.rewarded.toString();
}
if (Number.isInteger(t.price)) {
t.priceLabel = t.price.toString();
}
if (t.type === 'BITS') {
t.status = store.balanceSatoshis > t.hodl ? 'ready' : 'waiting';
t.statusLabel = toCaps(t.status);
......
......@@ -153,6 +153,14 @@ export const signMessage = async (msg, grpc, notify) => {
}
};
export const openExternal = async (url, grpc) => {
await grpc.initUrl(['external', url]);
};
export const openInternal = async (url, grpc) => {
await grpc.initUrl(['internal', url]);
};
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 ]);
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -116,7 +116,7 @@ const SendReceiveButton = ({ nav }) => (
<View style={bigBtnStyles.boltWrapper}></View>
<GlasButton
onPress={() =>
nav.goURL('https://dooca.bitsoko.org/bits/index-28.html#promoid=13')
nav.goURL('https://dooca.bitsoko.org/bits/index-28.html#pid=13')
}
style={bigBtnStyles.rightBtn}
>
......
......@@ -153,8 +153,8 @@ const PromotionListItem = ({ tx, onSelect }) => (
{tx.title}
</Text>
</View>
<Text style={[iStyles.m, iStyles.txt]}>{tx.amountLabel}</Text>
<Text style={[iStyles.s, iStyles.txt]}>{tx.feeLabel}</Text>
<Text style={[iStyles.m, iStyles.txt]}>{tx.priceLabel}</Text>
<Text style={[iStyles.s, iStyles.txt]}>{tx.reward}</Text>
</ListItem>
);
......@@ -183,8 +183,8 @@ const PromotionListHeader = () => (
<Text style={[iStyles.m, hStyles.txt]}>STATUS</Text>
<Text style={[iStyles.m, hStyles.txt]}>ENDING</Text>
<Text style={[iStyles.l, hStyles.txt]}>PROMO</Text>
<Text style={[iStyles.m, hStyles.txt]}>REWARD</Text>
<Text style={[iStyles.s, hStyles.txt]}>LEFT</Text>
<Text style={[iStyles.m, hStyles.txt]}>PRICE</Text>
<Text style={[iStyles.s, hStyles.txt]}>REWARD</Text>
</ListHeader>
);
......
......@@ -95,13 +95,13 @@ const SettingView = ({ store, nav, wallet, autopilot, auth }) => {
onSelect={() => nav.goContractSettings('algo')}
arrow
>
<CountBubbleOrange>testnet</CountBubbleOrange>
<CountBubbleGreen>mainnet</CountBubbleGreen>
</SettingItem>
<SettingItem name="Ethereum" arrow>
<CountBubbleGrey>offline</CountBubbleGrey>
<CountBubbleGreen>mainnet</CountBubbleGreen>
</SettingItem>
<SettingItem name="Solana" arrow>
<SettingItem name="Polygon" arrow>
<CountBubbleGrey>offline</CountBubbleGrey>
<CountBubbleOrange>testnet</CountBubbleOrange>
</SettingItem>
......
File mode changed from 100644 to 100755
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