gatelineAPI reference

A repository's own ledgers, as its engine read them on its last tick.

interface SpendReport {
    closed: {
        at: null | string;
        costUsd: number;
        key?: string;
        kind?: "dispatch" | "sweep";
    }[];
    open: {
        at: null
        | string;
        estimateUsd: number;
        key: string;
        kind: "dispatch" | "sweep";
        lost?: boolean;
    }[];
    sweepsRead?: boolean;
}

Properties

closed: {
    at: null | string;
    costUsd: number;
    key?: string;
    kind?: "dispatch" | "sweep";
}[]

Closed ledger entries and closed sweep markers: when they opened and what they cost. key and at together name the dispatch, so the governor can see that a settlement it still holds, or a live reservation whose close has landed but not yet been released, is already in this list.

open: {
    at: null | string;
    estimateUsd: number;
    key: string;
    kind: "dispatch" | "sweep";
    lost?: boolean;
}[]

Entries still open, keyed like a reservation, at their estimate. An open run ledger entry counts whenever it opened (as it always has); an open sweep marker counts only while it opened inside the window, because nothing ever closes the marker of a sweep whose process died.

Type declaration

  • at: null | string
  • estimateUsd: number
  • key: string
  • kind: "dispatch" | "sweep"
  • Optionallost?: boolean

    The process that opened it is gone from this machine (#502): the entry still counts toward spend at its estimate, but it holds no slot, so a startup hold under this key is cleared. Used for sweep markers, which nothing closes when their process dies. Default false.

sweepsRead?: boolean

False when the sweep markers could not be read this time. The governor then keeps the sweep entries of the previous report and the sweep settlements it holds, rather than dropping them for a tick. Default true.