app/scripts/keyring-controller.js
// Takes an address, and assigns it an incremented nickname, persisting it.
Takes an address, and assigns it an incremented nickname, persisting it.
Takes an address and assigns it an incremented nickname persisting it .
createNickname (address) {
    const hexAddress = normalizeAddress(address)
    const identities = this.memStore.getState().identities
    const currentIdentityCount = Object.keys(identities).length + 1
    const nicknames = this.store.getState().walletNicknames || {}
    const existingNickname = nicknames[hexAddress]
    const name = existingNickname || `Account ${currentIdentityCount}`
    identities[hexAddress] = {
      address: hexAddress,
      name,
    }
    this.memStore.updateState({ identities })
    return this.saveAccountLabel(hexAddress, name)
  }
createNickname ( address ) { const hexAddress = normalizeAddress ( address ) const identities = this . memStore . getState ( ) . identities const currentIdentityCount = Object . keys ( identities ) . length + 1 const nicknames = this . store . getState ( ) . walletNicknames || { } const existingNickname = nicknames [ hexAddress ] const name = existingNickname || ` ${ currentIdentityCount } ` identities [ hexAddress ] = { address : hexAddress , name , } this . memStore . updateState ( { identities } ) return this . saveAccountLabel ( hexAddress , name ) }
Takes an address, and assigns it an incremented nickname, persisting it.
Takes an address and assigns it an incremented nickname persisting it .