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
300cbb1b
Commit
300cbb1b
authored
Aug 29, 2019
by
Tankred Hase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup fee estimate payment actions
parent
55b18bce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
25 deletions
+21
-25
payment.js
src/action/payment.js
+10
-18
payment.js
src/computed/payment.js
+9
-0
pay-bitcoin-confirm-mobile.js
src/view/pay-bitcoin-confirm-mobile.js
+2
-7
No files found.
src/action/payment.js
View file @
300cbb1b
...
...
@@ -11,14 +11,7 @@ import {
MED_TARGET_CONF
,
HIGH_TARGET_CONF
,
}
from
'../config'
;
import
{
toSatoshis
,
toAmount
,
toAmountLabel
,
isLnUri
,
isAddress
,
nap
,
}
from
'../helper'
;
import
{
toSatoshis
,
toAmount
,
isLnUri
,
isAddress
,
nap
}
from
'../helper'
;
import
*
as
log
from
'./log'
;
class
PaymentAction
{
...
...
@@ -245,22 +238,21 @@ class PaymentAction {
const
{
payment
,
settings
}
=
this
.
_store
;
const
AddrToAmount
=
{};
AddrToAmount
[
payment
.
address
]
=
toSatoshis
(
payment
.
amount
,
settings
);
const
{
feeSat
,
feerateSatPerByte
}
=
await
this
.
_grpc
.
sendCommand
(
'estimateFee'
,
{
AddrToAmount
,
targetConf
,
}
);
const
{
feeSat
}
=
await
this
.
_grpc
.
sendCommand
(
'estimateFee'
,
{
AddrToAmount
,
targetConf
,
});
payment
.
feeEstimates
.
push
({
fee
:
toAmount
(
feeSat
,
settings
),
targetConf
,
prio
,
satPerByte
:
feerateSatPerByte
,
fee
:
toAmount
(
feeSat
,
settings
),
feeLabel
:
toAmountLabel
(
feeSat
,
settings
),
});
}
/**
* Set the target_conf for the on-chain send operation and set a fee.
* @param {number} options.targetConf The number blocks to target
*/
setTargetConf
({
targetConf
})
{
const
{
payment
}
=
this
.
_store
;
payment
.
targetConf
=
targetConf
;
...
...
src/computed/payment.js
View file @
300cbb1b
...
...
@@ -10,6 +10,15 @@ const ComputedPayment = store => {
get
paymentAmountLabel
()
{
return
toLabel
(
store
.
payment
.
amount
,
store
.
settings
);
},
get
paymentFeeEstimateItems
()
{
return
store
.
payment
.
feeEstimates
.
map
(
e
=>
{
const
feeLabel
=
toLabel
(
e
.
fee
,
store
.
settings
);
return
{
label
:
`
${
e
.
prio
}
${
feeLabel
}
${
store
.
unitLabel
||
''
}
`
.
trim
(),
value
:
e
.
targetConf
,
};
});
},
get
paymentFeeLabel
()
{
return
toLabel
(
store
.
payment
.
fee
,
store
.
settings
);
},
...
...
src/view/pay-bitcoin-confirm-mobile.js
View file @
300cbb1b
...
...
@@ -69,14 +69,9 @@ const PayBitcoinConfirmView = ({ store, nav, payment }) => (
<
/BalanceLabel
>
<
NamedFieldSelect
name
=
"Fee"
items
=
{
store
.
payment
.
feeEstimates
.
map
(
e
=>
({
label
:
`
${
e
.
prio
}
${
e
.
feeLabel
}
${
store
.
unitLabel
||
''
}
`
,
value
:
e
.
targetConf
,
}))}
items
=
{
store
.
paymentFeeEstimateItems
}
value
=
{
store
.
payment
.
targetConf
}
onValueChange
=
{
value
=>
payment
.
setTargetConf
({
targetConf
:
value
})
}
onValueChange
=
{
targetConf
=>
payment
.
setTargetConf
({
targetConf
})}
/
>
<
NamedField
name
=
"Total"
style
=
{
styles
.
totalLbl
}
>
{
store
.
paymentTotalLabel
}
{
store
.
unitLabel
}
...
...
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