Browse Source

feat(wallets): add support for wallet names

next
Tom Kirkpatrick 6 years ago
parent
commit
82482dcc77
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 2
      app/components/Home/WalletLauncher.js
  2. 2
      app/components/Home/WalletUnlocker.js
  3. 2
      app/components/Home/WalletsMenu.js
  4. 10
      app/lib/lnd/config.js

2
app/components/Home/WalletLauncher.js

@ -46,7 +46,7 @@ class WalletLauncher extends React.Component {
walletName = wallet => {
if (wallet.type === 'local') {
return wallet.alias || `Wallet #${wallet.id}`
return wallet.name || `Wallet #${wallet.id}`
}
return wallet.host.split(':')[0]
}

2
app/components/Home/WalletUnlocker.js

@ -76,7 +76,7 @@ class WalletUnlocker extends React.Component {
walletName = wallet => {
if (wallet.type === 'local') {
return wallet.alias || `Wallet #${wallet.id}`
return wallet.name || `Wallet #${wallet.id}`
}
return wallet.host.split(':')[0]
}

2
app/components/Home/WalletsMenu.js

@ -6,7 +6,7 @@ import { Text, Truncate } from 'components/UI'
const walletName = wallet => {
if (wallet.type === 'local') {
return wallet.alias || `Wallet #${wallet.id}`
return wallet.name || `Wallet #${wallet.id}`
}
return wallet.host.split(':')[0]
}

10
app/lib/lnd/config.js

@ -30,6 +30,7 @@ export const networks = {
// Type definition for for local connection settings.
type LndConfigSettingsLocalType = {|
name?: string,
alias?: string,
autopilot?: boolean,
autopilotMaxchannels?: number,
@ -42,6 +43,7 @@ type LndConfigSettingsLocalType = {|
// Type definition for for custom connection settings.
type LndConfigSettingsCustomType = {|
name?: string,
host: string,
cert: string,
macaroon: string
@ -49,6 +51,7 @@ type LndConfigSettingsCustomType = {|
// Type definition for for BTCPay Server connection settings.
type LndConfigSettingsBtcPayServerType = {|
name?: string,
string: string,
host: string,
macaroon: string
@ -90,6 +93,7 @@ const safeUntildify = <T>(val: ?T): ?T => (typeof val === 'string' ? untildify(v
class LndConfig {
static SETTINGS_PROPS = {
local: [
'name',
'alias',
'autopilot',
'autopilotMaxchannels',
@ -99,11 +103,12 @@ class LndConfig {
'autopilotPrivate',
'autopilotMinconfs'
],
custom: ['host', 'cert', 'macaroon'],
btcpayserver: ['host', 'macaroon', 'string']
custom: ['name', 'host', 'cert', 'macaroon'],
btcpayserver: ['name', 'host', 'macaroon', 'string']
}
static SETTINGS_DEFAULTS = {
name: null,
autopilot: true,
autopilotMaxchannels: 5,
autopilotMinchansize: 20000,
@ -124,6 +129,7 @@ class LndConfig {
cert: ?string
macaroon: ?string
string: ?string
name: ?string
alias: ?string
autopilot: ?boolean
autopilotMaxchannels: ?number

Loading…
Cancel
Save