Restrict a USDC deposit to one buyer wallet in code.
Private OTC turns a public deposit into a one-buyer route. It is the right tool when your product already knows the counterparty: a payroll-style payout, a negotiated trade, or a known-buyer settlement.
Create a restricted deposit
- 1Call offramp(walletClient, { amount, platform, currency, identifier, otcTaker }).
- 2The SDK creates the deposit, then attaches a whitelist hook for the otcTaker wallet.
- 3Read otcLink from the result and send it to the approved buyer.
- 4Any wallet other than otcTaker is rejected onchain before it can start a fill.
Manage restriction on existing deposits
| Helper | What it does |
|---|---|
| enableOtc(walletClient, depositId, taker) | Restrict an existing deposit to one buyer wallet |
| disableOtc(walletClient, depositId) | Remove the restriction and return the deposit to public |
| getOtcLink(depositId) | Build the shareable buyer link for a restricted deposit |
Why it takes more than one transaction
EscrowV2's createDeposit does not take a whitelist parameter, so the SDK attaches the hook in a follow-up transaction after the deposit exists. The restriction is enforced by the Base contract, not by the UI or the link, which is why a non-approved wallet is rejected onchain even if it has the link.
The whitelist hook gates the deposit, not the link.
The OTC link is a convenience. The actual protection is the pre-intent hook attached to the Base deposit.
createDeposit takes no whitelist parameter, so the hook is attached in a follow-up transaction.
Keep exploring
Common questions
How do I make a deposit private in code?
Pass otcTaker to offramp() when creating the deposit, or call enableOtc on an existing deposit. The SDK attaches an onchain whitelist hook so only that buyer wallet can fill, and returns an otcLink to share.
Can the approved buyer be changed later?
Yes. Use disableOtc to remove the restriction or re-run enableOtc with a new taker. Each change is an onchain update, and the new buyer must use the resulting deposit link.
Does private OTC remove payment-app risk?
No. It restricts who can fill the deposit. The fiat leg still happens through the chosen payment app, with that app's limits, reviews, and reversal behavior.