Align Celo credit ingestion with idempotent funding, minimum USD thresholds, and outstanding credit handling#6
Align Celo credit ingestion with idempotent funding, minimum USD thresholds, and outstanding credit handling#6Copilot wants to merge 31 commits into
Conversation
|
@copilot
|
Addressed in b4d3938. I reviewed the issue checklist against this PR and fixed the reserve-price path to read GoodDollar reserve |
|
@copilot |
Addressed in
Validation run after changes: |
This updates credit issuance to match the new operator-vault flow: credits are recorded per deposit/stream event with stable IDs, funding is idempotent, and failures are tracked as outstanding balances instead of losing user credit intent. It also enforces$1-equivalent minimums in the Celo vault for first deposits and monthly stream rates using reserve-priced G$ valuation.
Backend funding path:
depositForWithId+ deterministic IDsdepositFortodepositForWithId.txHash:logIndexfor on-chain events, with controlled fallback IDs for manual/event edge paths.fundingStatus,fundingId,fundingTxHash,fundingError).Outstanding credit accounting + credit history completeness
New user-facing backend endpoints
GET /v1/accounts/:account/outstandingfor unpaid funding/outstanding balances.POST /v1/accounts/:account/withdrawwith principal-only withdrawal enforcement (bonus non-withdrawable).POST /v1/channels/closeto request channel close/unlock via operator integration.POST /v1/celo/events/recordto support either single-transaction ingestion (txHash) or wallet-scoped log scans (account+ block range).Stream bonus settlement lifecycle (monthly + on stop/update)
active,lastBonusPaidAt) and indexed tracked streams.* * * * *) with idempotent funding IDs (stream:<timestamp>:<account>).Operator contract: idempotent funding primitive
AntseedBuyerOperator.depositForWithId(...).usedDepositIds) and dedicated event for ID-based funding.Celo vault constraints for new economics
$1equivalent.$1equivalent.