Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Whirlpool
whirlpool-gui
Commits
98a5635d
Commit
98a5635d
authored
Jan 02, 2021
by
zeroleak
Browse files
cleanup
parent
813ec0f6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
70 deletions
+5
-70
app/components/Modals/Tx0Modal.js
app/components/Modals/Tx0Modal.js
+2
-2
app/components/Utxo/UtxoPoolSelector.js
app/components/Utxo/UtxoPoolSelector.js
+0
-44
app/components/Utxo/UtxosTable.js
app/components/Utxo/UtxosTable.js
+2
-3
app/containers/InitPage.js
app/containers/InitPage.js
+1
-1
app/css/samourai.css
app/css/samourai.css
+0
-4
app/services/backendService.js
app/services/backendService.js
+0
-7
app/services/mixService.js
app/services/mixService.js
+0
-9
No files found.
app/components/Modals/Tx0Modal.js
View file @
98a5635d
...
...
@@ -101,7 +101,7 @@ export default function Tx0Modal(props) {
<
div
className
=
'
row
'
>
<
div
className
=
'
col-sm-6
'
>
Tx0
miner
fee
:
{
tx0Preview
&&
<
strong
>
{
utils
.
toBtc
(
tx0Preview
.
tx0MinerFee
)}
btc
<
/strong>
}
Tx0
miner
fee
:
{
tx0Preview
&&
<
span
>
<
strong
>
{
utils
.
toBtc
(
tx0Preview
.
tx0MinerFee
)}
btc
<
/strong>
<small className='text-muted'> · {tx0Preview.tx0MinerFeePrice} sats/
b
<
/small></
span
>
}
<
select
className
=
"
form-control
"
onChange
=
{
e
=>
setTx0FeeTarget
(
e
.
target
.
value
)}
defaultValue
=
{
tx0FeeTarget
}
>
{
Object
.
keys
(
TX0_FEE_TARGET
).
map
(
feeTargetKey
=>
{
const
feeTargetItem
=
TX0_FEE_TARGET
[
feeTargetKey
]
...
...
@@ -112,7 +112,7 @@ export default function Tx0Modal(props) {
<
/div
>
<
div
className
=
'
col-sm-6
'
>
Mix
miner
fee
contribution
:
{
tx0Preview
&&
<
strong
>
{
tx0Preview
.
nbPremix
}
x
{
utils
.
toBtc
(
tx0Preview
.
premixMinerFee
)}
btc
=
{
utils
.
toBtc
(
tx0Preview
.
mixMinerFee
)}
btc
<
/strong>
}
Mix
miner
fee
contribution
:
{
tx0Preview
&&
<
span
>
<
strong
>
{
tx0Preview
.
nbPremix
}
x
{
utils
.
toBtc
(
tx0Preview
.
premixMinerFee
)}
btc
=
{
utils
.
toBtc
(
tx0Preview
.
mixMinerFee
)}
btc
<
/strong>
<small className='text-muted'> · {tx0Preview.mixMinerFeePrice} sats/
b
<
/small></
span
>
}
<
select
className
=
"
form-control
"
onChange
=
{
e
=>
setMixFeeTarget
(
e
.
target
.
value
)}
defaultValue
=
{
mixFeeTarget
}
>
{
Object
.
keys
(
TX0_FEE_TARGET
).
map
(
feeTargetKey
=>
{
const
feeTargetItem
=
TX0_FEE_TARGET
[
feeTargetKey
]
...
...
app/components/Utxo/UtxoPoolSelector.js
deleted
100644 → 0
View file @
813ec0f6
/**
*
* Status
*
*/
import
React
from
'
react
'
;
import
mixService
from
'
../../services/mixService
'
;
import
{
WHIRLPOOL_ACCOUNTS
}
from
'
../../services/utils
'
;
import
{
Dropdown
,
DropdownButton
}
from
'
react-bootstrap
'
;
/* eslint-disable react/prefer-stateless-function */
class
UtxoPoolSelector
extends
React
.
PureComponent
{
computePoolLabel
(
poolId
)
{
return
poolId
?
poolId
:
'
none
'
}
render
()
{
const
utxo
=
this
.
props
.
utxo
const
pools
=
mixService
.
getPoolsForUtxo
(
utxo
);
if
(
pools
.
length
==
0
)
{
// no pool
return
<
span
className
=
'
text-muted
'
>-<
/span
>
}
const
activeLabel
=
this
.
computePoolLabel
(
utxo
.
poolId
)
if
(
pools
.
length
<
2
&&
(
!
this
.
props
.
noPool
||
!
utxo
.
poolId
))
{
// single choice available
return
<
span
>
{
activeLabel
}
<
/span
>
}
return
(
<
DropdownButton
size
=
'
sm
'
variant
=
"
default
"
title
=
{
activeLabel
}
className
=
'
utxoPoolSelector
'
>
{
pools
.
map
((
pool
,
i
)
=>
{
const
poolLabel
=
this
.
computePoolLabel
(
pool
.
poolId
)
return
<
Dropdown
.
Item
key
=
{
i
}
active
=
{
utxo
.
poolId
===
pool
.
poolId
}
onClick
=
{()
=>
mixService
.
setPoolId
(
utxo
,
pool
.
poolId
)}
>
{
poolLabel
}
<
/Dropdown.Item
>
})}
{(
this
.
props
.
noPool
||
!
utxo
.
poolId
)
&&
<
Dropdown
.
Divider
/>
}
{(
this
.
props
.
noPool
||
!
utxo
.
poolId
)
&&
<
Dropdown
.
Item
active
=
{
!
utxo
.
poolId
}
onClick
=
{()
=>
mixService
.
setPoolId
(
utxo
,
undefined
)}
>
{
this
.
computePoolLabel
(
undefined
)}
<
/Dropdown.Item>
}
<
/DropdownButton
>
)
}
}
export
default
UtxoPoolSelector
app/components/Utxo/UtxosTable.js
View file @
98a5635d
...
...
@@ -9,10 +9,9 @@ import mixService from '../../services/mixService';
import
*
as
Icon
from
'
react-feather
'
;
import
utils
,
{
MIXABLE_STATUS
,
UTXO_STATUS
,
WHIRLPOOL_ACCOUNTS
}
from
'
../../services/utils
'
;
import
LinkExternal
from
'
../Utils/LinkExternal
'
;
import
UtxoPoolSelector
from
'
./UtxoPoolSelector
'
;
import
modalService
from
'
../../services/modalService
'
;
import
*
as
Icons
from
'
@fortawesome/free-solid-svg-icons
'
;
import
{
FormCheck
}
from
'
react-bootstrap
'
;
import
{
FormCheck
}
from
'
react-bootstrap
'
;
import
{
FontAwesomeIcon
}
from
'
@fortawesome/react-fontawesome
'
;
import
TableGeneric
from
'
../TableGeneric/TableGeneric
'
;
...
...
@@ -80,7 +79,7 @@ const UtxosTable = ({ controls, pool, mixs, account, utxos, tableKey }) => {
<
Icon
.
Clipboard
className
=
'
clipboard-icon
'
size
=
{
18
}
onClick
=
{()
=>
copyToClipboard
(
utxo
.
address
)}
onClick
=
{()
=>
utils
.
copyToClipboard
(
utxo
.
address
)}
/
>
<
/span
>
<
/small
>
...
...
app/containers/InitPage.js
View file @
98a5635d
...
...
@@ -116,7 +116,7 @@ class InitPage extends Component<Props> {
<
p
>
This
will
connect
Whirlpool
to
Samourai
Wallet
.
<
/p
>
{
this
.
state
.
cliUrl
&&
<
div
><
FontAwesomeIcon
icon
=
{
Icons
.
faCheck
}
color
=
'
green
'
/>
Connected
to
whirlpool
-
cli
:
<
strong
>
{
this
.
state
.
cliLocal
?
'
standalone
'
:
this
.
state
.
cliUrl
}
<
/strong></
div
>
}
{
this
.
state
.
hasPairingPayload
&&
<
div
><
FontAwesomeIcon
icon
=
{
Icons
.
faCheck
}
color
=
'
green
'
/>
Ready
to
pair
with
Samourai
Wallet
<
/div>
}
{
this
.
state
.
hasPairingPayload
&&
<
div
><
FontAwesomeIcon
icon
=
{
Icons
.
faCheck
}
color
=
'
green
'
/>
Pairing
with
Samourai
Wallet
<
/div>
}
{
this
.
state
.
step
===
STEP_LAST
&&
<
div
><
FontAwesomeIcon
icon
=
{
Icons
.
faCheck
}
color
=
'
green
'
/>
Configuration
saved
<
/div>
}
<
br
/>
...
...
app/css/samourai.css
View file @
98a5635d
...
...
@@ -157,10 +157,6 @@ code {
width
:
100%
;
}
.utxoPoolSelector
.dropdown-item
{
padding
:
0
0.4em
;
}
.table-utxos
.dropdown
.btn
{
padding
:
0
;
}
...
...
app/services/backendService.js
View file @
98a5635d
...
...
@@ -180,13 +180,6 @@ class BackendService {
};
utxo
=
{
configure
:
(
hash
,
index
,
poolId
)
=>
{
return
this
.
withStatus
(
'
Utxo
'
,
'
Configure utxo
'
,
()
=>
this
.
fetchBackendAsJson
(
'
/rest/utxos/
'
+
hash
+
'
:
'
+
index
,
'
POST
'
,
{
poolId
:
poolId
})
)
},
startMix
:
(
hash
,
index
)
=>
{
return
this
.
withStatus
(
'
Utxo
'
,
'
Start mixing
'
,
()
=>
this
.
fetchBackend
(
'
/rest/utxos/
'
+
hash
+
'
:
'
+
index
+
'
/startMix
'
,
'
POST
'
)
...
...
app/services/mixService.js
View file @
98a5635d
...
...
@@ -70,15 +70,6 @@ class MixService {
&&
this
.
getPoolsForTx0
(
utxo
).
length
>
0
}
setPoolId
(
utxo
,
poolId
)
{
utxo
.
poolId
=
poolId
return
this
.
configure
(
utxo
)
}
configure
(
utxo
)
{
return
backendService
.
utxo
.
configure
(
utxo
.
hash
,
utxo
.
index
,
utxo
.
poolId
).
then
(()
=>
walletService
.
fetchState
())
}
tx0
(
utxos
,
tx0FeeTarget
,
mixFeeTarget
,
poolId
)
{
return
backendService
.
tx0
.
tx0
(
utxos
,
tx0FeeTarget
,
mixFeeTarget
,
poolId
).
then
(()
=>
walletService
.
fetchState
())
}
...
...
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