How rakhargo/cova works
Cova is stablecoin authorization-and-capture infrastructure: customers deposit USDG, authorize a maximum, and merchants capture the final amount or release the remainder. The primary user workflow runs through the Next.js playground and wallet controller into the CovaVault contract; the contract holds customer funds and settles captures directly to merchants. The repo also includes a reusable SDK for contract reads, writes, signed authorizations, and event history. Edges reflect excerpts or README statements; implementation details not sampled are left at the documented subsystem level.
Main entry points: use-cova.ts Cova Controller · CovaVault.sol CovaVault · cova-playground.tsx Payment Playground · client.ts SDK Client
Components 21
Playground
- App Entry
app/page.tsx - Payment Playground
components/cova-playground.tsx - Hold Actions
components/hold-card.tsx - Signed Authorization UI
components/signed-authorizations.tsx
Wallet Integration
- Cova Controller
lib/use-cova.ts - Deployment and State Reads
lib/chain.ts - Input Validation
lib/validation.ts - Receipt Confirmation
lib/transactions.ts - Demo State
lib/demo.ts
Onchain Protocol
- USDG Token
- CovaVault
contracts/src/CovaVault.sol
Reusable SDK
- SDK Client
sdk/src/client.ts - Authorization Encoding
sdk/src/authorization.ts - Event History Reader
sdk/src/history.ts - Vault ABI
sdk/src/abi.ts
History and Metadata
- Local Hold Metadata
lib/history.ts
Other components
- Customer
- Merchant
- Expiry Caller
- Wallet
- Arbitrum Network
Connections 28
- Customer → Payment Playground: uses
README.md - Merchant → Payment Playground: uses
README.md - Expiry Caller → CovaVault: releases expired
README.md - App Entry → Payment Playground: renders
app/page.tsx - Payment Playground → Cova Controller: reads and acts
components/cova-playground.tsx - Payment Playground → Hold Actions: renders
components/cova-playground.tsx - Payment Playground → Signed Authorization UI: renders
components/cova-playground.tsx - Hold Actions → Cova Controller: invokes actions
- Signed Authorization UI → Cova Controller: invokes signing
components/signed-authorizations.tsx - Cova Controller → Input Validation: validates inputs
lib/use-cova.ts - Cova Controller → Deployment and State Reads: verifies and reads
lib/use-cova.ts - Cova Controller → Receipt Confirmation: confirms receipts
lib/use-cova.ts - Cova Controller → Local Hold Metadata: merges history
lib/use-cova.ts - Cova Controller → Demo State: simulates demo
lib/use-cova.ts - Cova Controller → Wallet: requests signatures
- Deployment and State Reads → CovaVault: reads state
lib/chain.ts - Deployment and State Reads → SDK Client: checks version
lib/chain.ts - CovaVault → USDG Token: transfers funds
README.md - Wallet → CovaVault: submits transactions
README.md - CovaVault → Arbitrum Network: runs on
README.md - SDK Client → CovaVault: reads and writes
sdk/src/client.ts - SDK Client → Authorization Encoding: validates signatures
sdk/src/client.ts - SDK Client → Event History Reader: reads event history
sdk/src/client.ts - SDK Client → Vault ABI: uses bindings
sdk/src/client.ts - Cova Controller → Event History Reader: scans events
lib/use-cova.ts - Merchant → CovaVault: captures or releases
README.md - Customer → CovaVault: deposits and authorizes
README.md - CovaVault → Customer: withdraws or releases
README.md