You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Add batch payment support for settling multiple invoices in a single transaction #1729
Currently, paying multiple Request Network invoices requires executing a separate on-chain transaction for each invoice. For businesses processing 10-50+ invoices per month, this means:
N separate approve + transfer calls
N× gas costs
Manual wallet interaction per invoice
Extended settlement time
Proposal
Add batch payment support that allows users to settle multiple USDC invoices in a single on-chain transaction using multi-recipient batch transfer contracts.
How it works:
Fetch pending invoices from Request Network (filtered by payer address + currency)
Validate all recipients and amounts
Execute a single batchTransfer(token, recipients[], amounts[]) call
All payments are atomic — either all succeed or all revert
I've built an integration module (spraay-request-network) that bridges Request Network's @requestnetwork/request-client.js with Spraay Protocol's batch transfer contracts deployed across Base, Ethereum, Arbitrum, Polygon, BNB Chain, and Avalanche.
The module provides:
SpraayBatchPayer.payInvoices() — pay specific invoices by ID
SpraayBatchPayer.payPendingInvoices() — auto-discover and batch-pay all pending USDC invoices
batchPayViaGateway() — server-side / AI agent batch payments via API
I'd like to submit a PR adding a batch payment example to the monorepo and a reference to this integration in the documentation.
Use Cases
Accounts payable automation — Settle a month's vendor invoices in one click
Payroll — Pay all contractor invoices in a single batch
DAO treasury — Batch-process approved grant payments
AI agents — Programmatic invoice settlement via x402 micropayments
Happy to discuss the approach and adjust based on your feedback. Would love to align this with the existing @requestnetwork/payment-processor patterns.
Activity