Email login
Circle creates or restores the user, then returns a PIN challenge and wallet session.
Developer docs
Arc Drift helps freelancers, creators, companies, and agencies run milestone and time-based escrow payments with Circle wallets and Arc Testnet USDC. This page maps the app flow, V2 routes, env setup, and recovery behavior.
Quick start
npm install
npm run dev
# deploy contract
npx hardhat run scripts/deploy.js --network arcTestnetCircle creates or restores the user, then returns a PIN challenge and wallet session.
The app copies the Arc wallet and opens Circle Faucet for Arc Testnet USDC.
The user chooses amount, recipient, timing, and transfer type.
Circle signs an approval transaction for the USDC amount.
Circle signs the contract call that stores the stream rule on Arc Testnet.
Reconnect loads contract events so progress and tx links survive refresh or device changes.
Environment
CIRCLE_API_KEYServer-side Circle API key used by the app routes.
NEXT_PUBLIC_CIRCLE_APP_IDCircle app id used by the PIN challenge SDK.
NEXT_PUBLIC_ARC_DRIFT_CONTRACT_ADDRESSArc Drift Core contract on Arc Testnet.
NEXT_PUBLIC_USDC_ADDRESSArc Testnet USDC address.
ARC_RPC_URLArc Testnet RPC endpoint for reads, balances, and event history.
ADMIN_DASHBOARD_PASSWORDPassword gate for the private /admin dashboard.
ADMIN_ALLOWED_WALLETSComma-separated Arc wallet allowlist for /admin access.
NEXT_PUBLIC_APP_URLBase URL used when generating public payment links.
RESEND_API_KEYOptional email provider key for outbound V2 notifications.
NOTIFICATION_FROM_EMAILOptional verified sender address for notification emails.
PRIVATE_KEYOptional deployer key for Hardhat contract deployment.
API routes
POST /api/circle-authCreates or restores a Circle user, then ensures an Arc Testnet SCA wallet exists.
POST /api/get-walletPolls Circle for the connected wallet address and available blockchains.
POST /api/usdc-balanceReads USDC balance from Arc Testnet for the connected wallet.
POST /api/approve-usdc-challengeCreates the Circle challenge for USDC allowance approval.
POST /api/create-drift-challengeCreates the Circle challenge that calls createDrift on Arc Drift Core.
POST /api/transaction-proofPolls Circle transaction history for tx hash proof after a challenge completes.
POST /api/stream-historyReads Arc Drift contract events and restores stream progress plus tx links.
POST /api/execute-drift-challengeCreates a Circle challenge to claim unlocked stream funds.
POST /api/cancel-drift-challengeCreates a Circle challenge to cancel cancellable escrows.
POST /api/admin/summaryPassword and wallet-protected admin snapshot rebuilt from on-chain events.
POST /api/payment-linkCreates a database-free encoded public payment request link.
POST /api/notificationsQueues stream lifecycle emails when an email provider is configured.
V2 surfaces
/dashboardWallet owners can view active, completed, cancelled, and recurring streams, then claim or cancel eligible escrows.
/adminCircle wallet and password-gated operator view for wallets, USDC volume, stream counts, and transaction hashes without a database.
/pay/[request]Encoded links let clients and creators share a requested recipient, amount, timeframe, and memo.
/docsDocuments routes, contract events, payment links, notification hooks, and the Arc Drift escrow workflow.
Contract
createDrift(
address recipient,
uint256 amount,
uint256 startTime,
uint256 endTime,
uint256 interval,
RuleType ruleType
)DriftCreatedPrimary event used to restore stream metadata and creation tx hash.
DriftExecutedShows withdrawal/execution transactions in the history panel.
DriftCanceledShows cancelled streams and refund transactions.
Stream rules
Linear unlock between start and end time.
Full amount unlocks only after the deadline.
Sender can cancel before the deadline and recover unclaimed funds.
Unlocks in fixed installments based on the interval.