Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Expose payment settings in wallet preferences #3523

Merged
merged 4 commits into from May 19, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions config/default.js
Expand Up @@ -106,11 +106,9 @@ module.exports = {
},

payments: {
timeout: 30, // Upper limit on the amount of time (s) we should spend when attempting to probe a payment
feeLimit: 5000, // Upper limit on the routing fees we should accept when sending payment without a limit
probeTimeout: 30, // Upper limit on the amount of time (s) we should spend when attempting to send a payment
probeFeeLimit: 5000, // Upper limit on the routing fees we want to consider in payment probes,
maxParts: 10, // The maximum number of partial payments that may be use to complete the full amount.
timeout: 30, // Upper limit on the amount of time (s) we should spend when attempting to send a payment.
feeLimit: 5000, // Upper limit on the routing fees we should accept when sending payment without a limit.
maxParts: 10, // The maximum number of partial payments that may be used to send a payment.
},

autopay: {
Expand Down
18 changes: 18 additions & 0 deletions renderer/components/Settings/SettingsFieldsWallet.js
Expand Up @@ -73,6 +73,8 @@ const SettingsFieldsWallet = ({ currentConfig, intl }) => {
}
/>

<Bar variant="light" />

<DataRow
left={<FieldLabel itemKey="blockExplorer" />}
right={
Expand All @@ -84,7 +86,9 @@ const SettingsFieldsWallet = ({ currentConfig, intl }) => {
/>
}
/>

<Bar variant="light" />

<DataRow
left={<FieldLabel itemKey="rateProvider" />}
right={
Expand All @@ -107,6 +111,7 @@ const SettingsFieldsWallet = ({ currentConfig, intl }) => {
/>
}
/>

<Bar variant="light" />

{renderNumberDataRow('lndTargetConfirmations.fast')}
Expand All @@ -120,6 +125,7 @@ const SettingsFieldsWallet = ({ currentConfig, intl }) => {
{renderNumberDataRow('lndTargetConfirmations.slow')}

<Bar variant="light" />

<DataRow
left={<FieldLabel itemKey="invoices.expire" />}
right={
Expand All @@ -131,6 +137,18 @@ const SettingsFieldsWallet = ({ currentConfig, intl }) => {
/>
}
/>

<Bar variant="light" />

{renderNumberDataRow('payments.timeout')}

<Bar variant="light" />

{renderNumberDataRow('payments.feeLimit')}

<Bar variant="light" />

{renderNumberDataRow('payments.maxParts')}
</>
)
}
Expand Down
8 changes: 8 additions & 0 deletions renderer/components/Settings/messages.js
Expand Up @@ -55,4 +55,12 @@ export default defineMessages({
rateProvider_description: 'Your preferred rate provider.',
lnurl_withdrawal_label: 'Require confirmation to process lnurl withdrawal links',
lnurl_withdrawal_description: 'Show prompt that allows you confirm or decline lnurl withdrawal.',
payments_timeout_label: 'Payment timeout',
payments_timeout_description:
'Maximum amount of time to spend attempting to send a payment (seconds).',
payments_feeLimit_label: 'Payment fee limit',
payments_feeLimit_description: 'Upper limit on routing fees when sending payment (satoshis).',
payments_maxParts_label: 'Payment parts',
payments_maxParts_description:
'Maximum number of partial payments that may be used to send a payment.',
})
10 changes: 1 addition & 9 deletions services/grpc/router.methods.js
Expand Up @@ -9,17 +9,9 @@ import { logGrpcCmd } from './helpers'
const PAYMENT_TIMEOUT = config.payments.timeout
const PAYMENT_FEE_LIMIT = config.payments.feeLimit
const PAYMENT_MAX_PARTS = config.payments.maxParts
const PAYMENT_PROBE_TIMEOUT = config.payments.probeTimeout
const PAYMENT_PROBE_FEE_LIMIT = config.payments.probeFeeLimit

export const KEYSEND_PREIMAGE_TYPE = '5482373484'

const defaultProbeOptions = {
timeoutSeconds: PAYMENT_PROBE_TIMEOUT,
feeLimitSat: PAYMENT_PROBE_FEE_LIMIT,
allowSelfPayment: true,
}

const defaultPaymentOptions = {
timeoutSeconds: PAYMENT_TIMEOUT,
feeLimitSat: PAYMENT_FEE_LIMIT,
Expand All @@ -44,7 +36,7 @@ const defaultPaymentOptionsV2 = {
async function probePayment(options) {
// Use a payload that has the payment hash set to some random bytes.
// This will cause the payment to fail at the final destination.
const payload = defaults(omitBy(options, isNil), defaultProbeOptions)
const payload = defaults(omitBy(options, isNil), defaultPaymentOptions)

// Use a payload that has the payment hash set to some random bytes.
// This will cause the payment to fail at the final destination.
Expand Down
6 changes: 6 additions & 0 deletions translations/af-ZA.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/ar-SA.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/bg-BG.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "Парола на приложението",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "Трябва да бъде поне 6 символа.",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "Оценете доставчика",
"components.Settings.save": "Запазване",
Expand Down
6 changes: 6 additions & 0 deletions translations/ca-ES.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/cs-CZ.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "Heslo aplikace",
"components.Settings.password_tooltip": "Heslo pro celou aplikaci. Bude použito k odemknutí aplikace při spuštění. Je oddělený od přístupové fráze vašeho seedu.",
"components.Settings.password_value_description": "Musí mít alespoň 6 znaků.",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "Váš preferovaný poskytovatel kurzů.",
"components.Settings.rateProvider_label": "Poskytovatel kurzů",
"components.Settings.save": "Uložit",
Expand Down
6 changes: 6 additions & 0 deletions translations/da-DK.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/de-DE.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "Anwendungspasswort",
"components.Settings.password_tooltip": "Anwendungsweites Passwort. Wird verwendet, um die App beim Start freizuschalten. Es ist getrennt von deiner Seed-Passphrase.",
"components.Settings.password_value_description": "Mindestens 6 Zeichen.",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "Dein bevorzugter Tarifanbieter.",
"components.Settings.rateProvider_label": "Wechselkurs-Anbieter",
"components.Settings.save": "Speichern",
Expand Down
6 changes: 6 additions & 0 deletions translations/el-GR.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/en.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "Application password",
"components.Settings.password_tooltip": "Application-wide password. Will be used to unlock the app on startup. It is separate from your seed passphrase.",
"components.Settings.password_value_description": "Must be at least 6 characters.",
"components.Settings.payments_feeLimit_description": "Upper limit on routing fees when sending payment (satoshis).",
"components.Settings.payments_feeLimit_label": "Payment fee limit",
"components.Settings.payments_maxParts_description": "Maximum number of partial payments that may be used to send a payment.",
"components.Settings.payments_maxParts_label": "Payment parts",
"components.Settings.payments_timeout_description": "Maximum amount of time to spend attempting to send a payment (seconds).",
"components.Settings.payments_timeout_label": "Payment timeout",
"components.Settings.rateProvider_description": "Your preferred rate provider.",
"components.Settings.rateProvider_label": "Rate provider",
"components.Settings.save": "Save",
Expand Down
6 changes: 6 additions & 0 deletions translations/es-ES.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "Contraseña de la aplicación",
"components.Settings.password_tooltip": "Contraseña para toda la aplicación. Se utilizará para desbloquear la aplicación al iniciar. Es diferente a tu contraseña de semilla.",
"components.Settings.password_value_description": "Debe tener al menos 6 caracteres.",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "Su proveedor de tarifas preferido.",
"components.Settings.rateProvider_label": "Proveedor de tarifas",
"components.Settings.save": "Guardar",
Expand Down
6 changes: 6 additions & 0 deletions translations/fi-FI.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/fr-FR.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "Mot de passe de l'application",
"components.Settings.password_tooltip": "Mot de passe utilisé pour déverrouiller l'application au démarrage. Il est différent de la clé de chiffrement de votre phrase de restauration.",
"components.Settings.password_value_description": "Doit contenir au moins 6 caractères.",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "Votre référence des taux de change préférée.",
"components.Settings.rateProvider_label": "Référence des taux",
"components.Settings.save": "Enregistrer",
Expand Down
6 changes: 6 additions & 0 deletions translations/ga-IE.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/he-IL.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/hi-IN.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/hr-HR.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/hu-HU.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/it-IT.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/ja-JP.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/ko-KR.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "",
Expand Down
6 changes: 6 additions & 0 deletions translations/nl-NL.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "Bewaren",
Expand Down
6 changes: 6 additions & 0 deletions translations/no-NO.json
Expand Up @@ -609,6 +609,12 @@
"components.Settings.password_active_label": "",
"components.Settings.password_tooltip": "",
"components.Settings.password_value_description": "",
"components.Settings.payments_feeLimit_description": "",
"components.Settings.payments_feeLimit_label": "",
"components.Settings.payments_maxParts_description": "",
"components.Settings.payments_maxParts_label": "",
"components.Settings.payments_timeout_description": "",
"components.Settings.payments_timeout_label": "",
"components.Settings.rateProvider_description": "",
"components.Settings.rateProvider_label": "",
"components.Settings.save": "Lagre",
Expand Down