Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inbound Fee display fixes #2493

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 62 additions & 31 deletions components/FeeBreakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,37 +149,68 @@ export default class FeeBreakdown extends React.Component<
/>
{BackendUtils.supportInboundFees() && (
<>
<KeyValue
keyValue={localeString(
'views.Channel.inboundBaseFee'
)}
value={
<Amount
sats={
localPolicy.inbound_fee_base_msat
? Number(
localPolicy.inbound_fee_base_msat
) / 1000
: undefined
}
toggleable
sensitive
/>
}
/>
<KeyValue
keyValue={localeString(
'views.Channel.inboundFeeRate'
)}
value={`${
localPolicy.inbound_fee_rate_milli_msat
? Number(
localPolicy.inbound_fee_rate_milli_msat
) / 10000
: undefined
}%`}
sensitive
/>
{!!localPolicy.inbound_fee_base_msat && (
<KeyValue
keyValue={localeString(
'views.Channel.localInboundBaseFee'
)}
value={
<Amount
sats={
Number(
localPolicy.inbound_fee_base_msat
) / 1000
}
toggleable
sensitive
/>
}
/>
)}
{!!localPolicy.inbound_fee_rate_milli_msat && (
<KeyValue
keyValue={localeString(
'views.Channel.localInboundFeeRate'
)}
value={`${
Number(
localPolicy.inbound_fee_rate_milli_msat
) / 10000
}%`}
sensitive
/>
)}
{!!remotePolicy.inbound_fee_base_msat && (
<KeyValue
keyValue={localeString(
'views.Channel.remoteInboundBaseFee'
)}
value={
<Amount
sats={
Number(
remotePolicy.inbound_fee_base_msat
) / 1000
}
toggleable
sensitive
/>
}
/>
)}
{!!remotePolicy.inbound_fee_rate_milli_msat && (
<KeyValue
keyValue={localeString(
'views.Channel.remoteInboundFeeRate'
)}
value={`${
Number(
remotePolicy.inbound_fee_rate_milli_msat
) / 10000
}%`}
sensitive
/>
)}
</>
)}
</React.Fragment>
Expand Down
8 changes: 4 additions & 4 deletions components/SetFeesForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ export default class SetFeesForm extends React.Component<
}}
>
{`${localeString(
'components.SetFeesForm.baseFee'
)} ${localeString(
'views.Channel.inbound'
)} ${localeString(
'components.SetFeesForm.baseFee'
)} (${localeString('general.sats')})`}
</Text>
<TextInput
Expand All @@ -207,9 +207,9 @@ export default class SetFeesForm extends React.Component<
}}
>
{`${localeString(
'components.SetFeesForm.feeRate'
)} ${localeString(
'views.Channel.inbound'
)} ${localeString(
'components.SetFeesForm.feeRate'
)} (${localeString('general.percentage')})`}
</Text>
<TextInput
Expand Down
6 changes: 4 additions & 2 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@
"views.Channel.remoteFeeRate": "Remote Fee Rate",
"views.Channel.remoteBaseFee": "Remote Base Fee",
"views.Channel.inbound": "Inbound",
"views.Channel.inboundBaseFee": "Inbound Base Fee",
"views.Channel.inboundFeeRate": "Inbound Fee Rate",
"views.Channel.localInboundBaseFee": "Local Inbound Base Fee",
"views.Channel.localInboundFeeRate": "Local Inbound Fee Rate",
"views.Channel.remoteInboundBaseFee": "Remote Inbound Base Fee",
"views.Channel.remoteInboundFeeRate": "Remote Inbound Fee Rate",
"views.Channel.feeRate": "Fee Rate",
"views.Channel.channelPayments": "Channel Payments",
"views.Channel.localMin": "Local Min",
Expand Down
Loading