import { mustGetHeadHash } from "./dag/store.js";
import { DEFAULT_HEAD_NAME, localMutationsDD31 } from "./db/commit.js";
async function pendingMutationsForAPI(dagRead) {
  const mainHeadHash = await mustGetHeadHash(DEFAULT_HEAD_NAME, dagRead);
  const pending = await localMutationsDD31(mainHeadHash, dagRead);
  return pending.map((p) => ({
    id: p.meta.mutationID,
    name: p.meta.mutatorName,
    args: p.meta.mutatorArgsJSON,
    clientID: p.meta.clientID
  })).reverse();
}
export {
  pendingMutationsForAPI
};
//# sourceMappingURL=pending-mutations.js.map
