Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
lightning-bits
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitsoko services
lightning-bits
Commits
919b0187
Commit
919b0187
authored
Mar 26, 2022
by
Allan Juma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
08ec32a7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
10 deletions
+23
-10
settings.gradle
mobile/android/settings.gradle
+1
-1
pool-remove-liquid.js
src/action/pool-remove-liquid.js
+13
-2
pool.js
src/action/pool.js
+6
-5
pools.py
src/chains/algo/pools.py
+2
-1
pay-pool-confirm.js
src/view/pay-pool-confirm.js
+1
-1
No files found.
mobile/android/settings.gradle
View file @
919b0187
...
...
@@ -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'
src/action/pool-remove-liquid.js
View file @
919b0187
...
...
@@ -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
;
}
...
...
src/action/pool.js
View file @
919b0187
...
...
@@ -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
;
...
...
src/chains/algo/pools.py
View file @
919b0187
...
...
@@ -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
)
...
...
src/view/pay-pool-confirm.js
View file @
919b0187
...
...
@@ -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
)){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment