// Generated by bynkc — do not edit by hand.
// context ids.gen

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "../runtime.js";

import * as bynk from "../bynk.js";

export const stamp = {
  async call(deps: { Clock: bynk.Clock; Secrets: bynk.Secrets }): Promise<number> {
    const salt = await deps.Secrets.get("STAMP_SALT");
    const now = await deps.Clock.now();
    switch (salt.tag) {
      case "Some": {
        return now + 1;
      }
      case "None": {
        return now;
      }
    }
    throw new Error("non-exhaustive match");
  },
};

export interface IdsGenDeps {
  readonly Clock: bynk.Clock;
  readonly Secrets: bynk.Secrets;
}

export function makeSurface(deps: IdsGenDeps) {
  return {
    async stamp(): Promise<number> {
      return stamp.call(deps);
    },
  };
}

