@pwngh/economy-lab
    Preparing search index...

    Interface Saga

    The stored state of one in-flight payout.

    interface Saga {
        attempts: number;
        dueAt: number;
        id: string;
        payoutUsd: Amount | null;
        providerRef: string | null;
        rateId: string;
        reason: string | null;
        reserve: Amount;
        state: "SUBMITTED" | "SETTLED" | "FAILED" | "REQUESTED" | "RESERVED";
        txnId: string;
        updatedAt: number;
        userId: string;
    }
    Index
    attempts: number

    How many times the worker has tried to advance this saga.

    dueAt: number

    When the worker next acts on it.

    id: string
    payoutUsd: Amount | null

    The gross USD this payout disburses, priced once by requestPayout at the locked rate; the worker submits it to the rail and settlePayout posts it out of trust unchanged. Null only on rows opened before pricing-at-request, which convert at the current rate instead.

    providerRef: string | null

    The payment provider's reference once submitted, null before then.

    rateId: string

    Names the exact CREDIT-to-USD rate this payout is locked to.

    reason: string | null

    Why the worker gave up on this payout, set when it reaches FAILED; null otherwise.

    reserve: Amount

    The seller's earned credits, held in the payout-reserve account while this is in flight.

    state: "SUBMITTED" | "SETTLED" | "FAILED" | "REQUESTED" | "RESERVED"
    txnId: string

    The reserve posting this saga opened with — the anchor every money-moving step re-proves before trusting a byte of this row: the posting's hashed metadata seals the saga id, rate, and USD quote, and its earned-debit leg seals the reserve. Required, because the saga row is unhashed and drives real USD out of the platform.

    updatedAt: number
    userId: string