create = async (identity, id, payload, encryptPayloadFn, clock = null, next = [], refs = []) => {
  if (identity == null) throw new Error('Identity is required, cannot create entry')
  if (id == null) throw new Error('Entry requires an id')
  if (payload == null) throw new Error('Entry requires a payload')
  if (next == null || !Array.isArray(next)) throw new Error("'next' argument is not an array")

  clock = clock || Clock(identity.publicKey)

  let encryptedPayload

  if (encryptPayloadFn) {
    const { bytes: encodedPayloadBytes } = await Block.encode({ value: payload, codec, hasher })
    encryptedPayload = await encryptPayloadFn(encodedPayloadBytes)
  }

  const entry = {
    id, // For determining a unique chain
    payload: encryptedPayload || payload, // Can be any dag-cbor encodeable data
    next, // Array of strings of CIDs
    refs, // Array of strings of CIDs
    clock, // Clock
    v: 2 // To tag the version of this data structure
  }

  const { bytes } = await Block.encode({ value: entry, codec, hasher })
  const signature = await identity.sign(identity, bytes)

  entry.key = identity.publicKey
  entry.identity = identity.hash
  entry.sig = signature
  entry.payload = payload

  if (encryptPayloadFn) {
    entry._payload = encryptedPayload
  }

  return entry
}
Creates an Entry.
@param {module:Identities~Identity} identity The identity instance
@param {string} logId The unique identifier for this log
@param {*} data Data of the entry to be added. Can be any JSON.stringifyable
data.
@param {module:Log~Clock} [clock] The clock
@param {Array<string|Entry>} [next=[]] An array of CIDs as base58btc encoded
strings which point to the next entries in a chain of entries.
@param {Array<string|module:Log~Entry>} [refs=[]] An array of CIDs as
base58btc encoded strings pointing to various entries which come before
this entry.
@return {Promise<module:Log~Entry>} A promise which contains an instance of
Entry.
Entry consists of the following properties:

- id: A string linking multiple entries together,
- payload: An arbitrary chunk of data,
- next: One or more hashes pointing to the next entries in a chain of
entries,
- refs: One or more hashes which reference other entries in the chain,
- clock: A logical clock. See {@link module:Log~Clock},
- v: The version of the entry,
- key: The public key of the identity,
- identity: The identity of the entry's owner,
- sig: The signature of the entry signed by the owner.
@memberof module:Log~Entry
@example
const entry = await Entry.create(identity, 'log1', 'hello')
console.log(entry)
// { payload: "hello", next: [], ... }
@private