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 => { walletName = wallet => {
if (wallet.type === 'local') { if (wallet.type === 'local') {
return wallet.alias || `Wallet #${wallet.id}` return wallet.name || `Wallet #${wallet.id}`
} }
return wallet.host.split(':')[0] return wallet.host.split(':')[0]
} }

2
app/components/Home/WalletUnlocker.js

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

2
app/components/Home/WalletsMenu.js

@ -6,7 +6,7 @@ import { Text, Truncate } from 'components/UI'
const walletName = wallet => { const walletName = wallet => {
if (wallet.type === 'local') { if (wallet.type === 'local') {
return wallet.alias || `Wallet #${wallet.id}` return wallet.name || `Wallet #${wallet.id}`
} }
return wallet.host.split(':')[0] 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 definition for for local connection settings.
type LndConfigSettingsLocalType = {| type LndConfigSettingsLocalType = {|
name?: string,
alias?: string, alias?: string,
autopilot?: boolean, autopilot?: boolean,
autopilotMaxchannels?: number, autopilotMaxchannels?: number,
@ -42,6 +43,7 @@ type LndConfigSettingsLocalType = {|
// Type definition for for custom connection settings. // Type definition for for custom connection settings.
type LndConfigSettingsCustomType = {| type LndConfigSettingsCustomType = {|
name?: string,
host: string, host: string,
cert: string, cert: string,
macaroon: string macaroon: string
@ -49,6 +51,7 @@ type LndConfigSettingsCustomType = {|
// Type definition for for BTCPay Server connection settings. // Type definition for for BTCPay Server connection settings.
type LndConfigSettingsBtcPayServerType = {| type LndConfigSettingsBtcPayServerType = {|
name?: string,
string: string, string: string,
host: string, host: string,
macaroon: string macaroon: string
@ -90,6 +93,7 @@ const safeUntildify = <T>(val: ?T): ?T => (typeof val === 'string' ? untildify(v
class LndConfig { class LndConfig {
static SETTINGS_PROPS = { static SETTINGS_PROPS = {
local: [ local: [
'name',
'alias', 'alias',
'autopilot', 'autopilot',
'autopilotMaxchannels', 'autopilotMaxchannels',
@ -99,11 +103,12 @@ class LndConfig {
'autopilotPrivate', 'autopilotPrivate',
'autopilotMinconfs' 'autopilotMinconfs'
], ],
custom: ['host', 'cert', 'macaroon'], custom: ['name', 'host', 'cert', 'macaroon'],
btcpayserver: ['host', 'macaroon', 'string'] btcpayserver: ['name', 'host', 'macaroon', 'string']
} }
static SETTINGS_DEFAULTS = { static SETTINGS_DEFAULTS = {
name: null,
autopilot: true, autopilot: true,
autopilotMaxchannels: 5, autopilotMaxchannels: 5,
autopilotMinchansize: 20000, autopilotMinchansize: 20000,
@ -124,6 +129,7 @@ class LndConfig {
cert: ?string cert: ?string
macaroon: ?string macaroon: ?string
string: ?string string: ?string
name: ?string
alias: ?string alias: ?string
autopilot: ?boolean autopilot: ?boolean
autopilotMaxchannels: ?number autopilotMaxchannels: ?number

Loading…
Cancel
Save