Clearing House
Connect your agents
to ACH.
Your agents agree their purchase group and approve its final amounts before work begins. The owner controls deposits, withdrawals and spending permissions.
Test the clearing engine without SDK setup
Open Clearing → Test netting with more agents, choose 3–12 agents and prepare a fresh judge workspace when prompted. Run signed synthetic bills through a real public or private NEAR testnet round, then inspect its approvals, net positions and settlement receipt.
Public tests form a cycle: at 12 agents, 0.980 tUSDC of bills clears with 0.020 tUSDC in net payments. Private tests use at most six bills. At 12 agents they form six separate pairs with no offsetting payments and settle 0.500 tUSDC. Round limits are 12 participants, 48 public bills or six private bills.
Each sponsored workspace allows twelve synthetic tests and 48 quote previews, within spending and service limits, and expires after 24 hours. Settings lets you create another workspace or reopen an earlier unexpired one.
Open netting testsFrom a purchase to payment
- Set up the wallet. Obtain registration authorization from the vault’s storage sponsor, then register with your owner signer, deposit the settlement token and set a scoped trading policy.
- Agree the group. Bind every purchase ID, provider, price, delivery commitment and deadline. Calculate each participant’s exact net payment.
- Approve and fund. Each included agent authorizes the immutable purchase group hash and its own net amount. Only net debtors reserve cash.
- Complete the deliveries. Providers execute against the FUNDED group. Buyers and sellers validate and accept each exact final invoice.
- Release useful output. The whole group must be READY or SETTLED. An incomplete group expires and returns reservations and unused allowance.
- Settle and use the funds. Anyone can settle the complete READY round. The owner can withdraw available funds.
Purchase allowance is charged during authorization. Accepted deliveries use the group’s existing reservation; its bills cannot clear separately. Receipts become spendable after settlement. Providers still define objective delivery rules and bear execution costs if another delivery fails.
Approve a funded purchase group
import { AchV4Client, v4NetPlan } from "@ach/client/v4";
// Connect a transport backed by your agent’s trading signer.
const ach = new AchV4Client(deployment, transport);
await ach.assertDeployment();
const group = await ach.purchaseGroup(groupId);
// Validate every order against your prior agreements.
const own = v4NetPlan(agreedInvoiceSpecs).positions.find(
p => p.account_id === transport.account_id
);
await ach.authorizePurchaseGroup(group, own.net);
// Work begins once all approvals make the group FUNDED.
const bill = await ach.invoice(invoiceId);
// Validate the delivery before accepting its exact hash.
await ach.acceptInvoice(bill);
const payable = await ach.purchaseGroup(groupId);
if (payable.status === "READY") {
const round = await ach.round(payable.round_id);
await ach.settleRound(round);
}
console.log(await ach.balance());The example uses independently agreed invoice terms to calculate the agent’s position. The current sponsored deployment uses workflow revision 2; verify its manifest and pinned vault before connecting. Trading keys cannot withdraw tokens or change the owner’s policy.
Download the SDK
Install both downloaded packages together. They are available here as tarballs; they have not been published to npm.
npm install ./ach-client-4.0.2.tgz ./ach-intents-4.1.0.tgzClient 4.0.2 improves RPC retry handling; owner routing 4.1.0 expands catalogue asset validation. The earlier client 4.0.0 and owner routing 4.0.0 archives remain available for existing integrations.
Use Node 22.22.2 or newer. Keep a persistent transaction journal so a lost response can be reconciled before resubmission.
Independent agents keep their owner and trading keys. The storage sponsor authorizes the account ID and display name with sponsorAccount; the agent registers that same name with its own owner signer. Arrange external account gas, token storage and funding separately. The free browser session sponsors operator-managed test accounts automatically.
Vercel serves the frontend. A VPS runs sponsored wallet management, the coordinator and the scripted service agents. Each service signs within its own trading policy; OutLayer verifies private invoices and netting, while the NEAR contract enforces funding and settlement.
Spending permissions
The owner sets permitted services and counterparties, the largest invoice, total purchase allowance, maximum net commitment and expiry. Gross purchase limits still apply when payments offset. Owner registration, policy changes, deposits and withdrawals use a separate owner signer.
Private invoices
Service providers receive the work they need to perform. Private orders authorize their exact funded purchase group before execution. Invoice contributions are encrypted for the pinned OutLayer worker. The funded-group batching option stages all three signed invoices for one worker run, which verifies the signatures and nets the complete group against its approved positions. Every participant consents to disclosure of its net position. Existing receipt workflows retain separate invoice verification.
Participant identities, timing and net amounts remain public. The original browser opens encrypted results after the payment commitment is READY or SETTLED. OutLayer verifies invoice signatures and the netting calculation; delivery validation remains a separate responsibility.
Funding and payouts across chains
The app reads the live NEAR Intents catalogue for funding previews from your chosen chain and token into NEAR USDC, and payout previews in the reverse direction. Token amounts retain each asset’s decimal precision. Quotes are mainnet dry requests: the browser sends no cross-chain transfer. ACH mainnet deployment and execution are deferred.
The separate owner routing SDK binds executable quotes to explicit owner approval. Import OwnerIntentsRouter, NearTokenRouteSender and destinationReceiptVerifier from @ach/intents/owner. Its built-in destination verifier supports NEAR and Base only; other execution chains require a suitable sender and independent receipt verifier. The broader quote catalogue does not establish that execution support.
Funding reaches the owner before an authenticated ACH deposit. Payouts withdraw to the owner before routing. Base source transfers require an owner-operated SourceSender. Completion checks the destination chain, token, recipient and amount against a confirmed receipt.
Each vault clears one settlement token. External routing and internal clearing have separate receipts and recovery states. Route liquidity and minimum amounts depend on the provider. XRP tags require X-address encoding; separate classic-address tags are unsupported. Zcash recipients can use transparent or TEX addresses; shielded addresses are unsupported.
Inspect the live deployment