Commit 919b0187 authored by Allan Juma's avatar Allan Juma

update

parent 08ec32a7
......@@ -15,6 +15,6 @@ include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
includeUnimodulesProjects()
rootProject.name = 'LightningApp'
rootProject.name = 'Bits'
include ':app', ':Lndmobile'
......@@ -65,12 +65,23 @@ class PoolRemoveLiqAction {
* @return {Promise<undefined>}
*/
async confirmRem() {
var amount = this._store.invoice.amount/this._store.selectedPool.quote *1000000;
this._nav.goWait();
var amount = this._store.invoice.amount/this._store.selectedPool.quote;
var res = await this._grpc.initPyface(['/data/lightning-bits/src/chains/algo/pools.py', 'swap', this._store.selectedPool.assetID , 0, parseInt(amount), this._store.settings.chains.algo.account.address, this._store.settings.chains.algo.account.mnemonic, 'remove' ]);
console.log(res);
if(res.includes('confirmed in round')){
console.log('INFO! swap completed by contract only! skiping lightning swap.');
this._nav.goPayPoolDone();
return true;
}else{
this._nav.goPaymentFailed();
return false;
}
return res;
}
......
......@@ -26,9 +26,10 @@ class PoolAction {
var nav = this._nav;
this.update().then(function(){
console.log('INFO! loaded pools');
nav.goPools();
//nav.goPools();
});
nav.goWait();
nav.goPools();
//nav.goWait();
}
/**
......@@ -69,12 +70,13 @@ var pDat = await addAsaQuote(grpc,store,pool.poolID.id, 0);
}catch(er){
throw pDat;
}
//TEMORARY HACK!!
pool.active = [true,false].sort(() => Math.random() - Math.random()).slice(0, 1)[0];
var ret = {
id: pool.id,
cat: 'micro',
type: 'algorand',
icon: pool.bannerPath,
//quote: await addAsaQuote(grpc,store,75685483, 0),
quote: pDat.q,
assetID: pool.poolID.id,
banner: pool.bannerPath,
......@@ -99,9 +101,8 @@ var ret = {
async getPools() {
try {
//const uri = 'https://dooca.bitsoko.org/getEnterprise/?servEntID=1';
const uri = 'https://dooca.bitsoko.org/getEnterprise/?servEntID=1';
const uri = 'http://10.0.255.253:1814/getEnterprise/?servEntID=1';
const response = checkHttpStatus(await fetch(uri));
const svs = await response.json();
var pools = svs.services;
......
......@@ -246,7 +246,8 @@ if action == "pooling":
if txn.sender == account['address']:
transaction_group.signed_transactions[i] = txn.sign(account['private_key'])
txid = client.algod.send_transactions(transaction_group.signed_transactions)
wait_for_confirmation(txid)
result = client.submit(transaction_group, wait=True)
#wait_for_confirmation(txid)
# Fetch our two assets of interest
ASA = client.fetch_asset(aID1)
......
......@@ -33,7 +33,7 @@ ChartJS.register(ArcElement, Tooltip, Legend);
*/
async function addToPool(grpc,store,pay,nav) {
nav.goWait();
const { settings } = store;
var amount = toSatoshis(store.payment.amount, settings);
if(parseFloat(store.settings.chains.algo.account.balance)*1000000 > (amount*1.01)){
......
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