@cfxlabsinc/b2b-services
    Preparing search index...

    The (address, network) pairs a history backfill covers, and starting one. Starting publishes no balance event and busts no cache: a customer listing shows backfilled rows once its cache entry expires.

    Index
    instance: (...args: []) => WalletHistoryBackfillAdminService = ...

    The process default: the background namespace's client, testnets off prod as the vendor clients pick them.

    • The pairs after after, by address id then network, as watchedPairs lists them for this stage. next is the last pair read, to pass as after; null once no address is left. With withRuns, each pair carries its latest run from one Temporal visibility list per page; runsRead is false when that read failed, and every run is then null though a run may exist.

      Parameters

      • __namedParameters: {
            after?: Pair;
            covered?: boolean;
            ledgerAccountIds?: string[];
            maxBatches?: number;
            onProgress?: () => void;
            pageSize: number;
            walletAddressIds?: number[];
            withRuns?: boolean;
        }
        • Optionalafter?: Pair
        • Optionalcovered?: boolean
        • OptionalledgerAccountIds?: string[]

          The addresses of these ledger accounts' wallets (external ids).

        • OptionalmaxBatches?: number

          Stops after reading this many batches of ADDRESS_BATCH addresses.

        • OptionalonProgress?: () => void

          Called after each batch read.

        • pageSize: number
        • OptionalwalletAddressIds?: number[]
        • OptionalwithRuns?: boolean

          Reads each pair's latest run from Temporal.

      Returns Promise<
          {
              ok: true;
              value: {
                  hasNext: boolean;
                  items: WalletHistoryBackfillPair[];
                  next: Pair
                  | null;
                  runsRead: boolean;
              };
          },
      >

    • Starts the backfill of one pair on endpoints, by default every one, or joins the one running under its id. WALLET_HISTORY_PAIR_NOT_WATCHED when no such pair is watched here.

      Parameters

      Returns Promise<
          | { ok: true; value: { runId: string; workflowId: string } }
          | {
              error:
                  | ServiceError<"WORKFLOW_ALREADY_STARTED">
                  | ServiceError<"WALLET_HISTORY_PAIR_NOT_WATCHED">;
              ok: false;
          },
      >