code: func getUntilFirstUnusedAddress(
  	isAddressUsed isAddressUsedFunc,
  	seed Trytes, index uint64, security SecurityLevel,
  	returnAll bool,
  ) (Hashes, error) {
  	addresses := Hashes{}
  
  	for ; ; index++ {
  		nextAddress, err := address.GenerateAddress(seed, index, security, true)
  		if err != nil {
  			return nil, err
  		}
  
  		if returnAll {
  			addresses = append(addresses, nextAddress)
  		}
  
  		used, err := isAddressUsed(nextAddress)
  		if err != nil {
  			return nil, err
  		}
  
  		if used {
  			continue
  		}
  
  		if !returnAll {
  			addresses = append(addresses, nextAddress)
  		}
  
  		return addresses, nil
  	}
  }
docs: // computes after a best effort method the first unused addresses