Test rail
Run the full payment lifecycle locally with no wallet, network, or account.
Pre-release · planned API
import { createTollstile, memoryLedger, testRail } from "tollstile";
export const toll = createTollstile({ rails: [testRail()], ledger: memoryLedger() });Send Payment: test to pay a fixed price, or pay against the quote from the 402:
Payment: test quote=<token> proof=p1 payer=agent_1 amount=$0.01 limit=$1.00| Parameter | Effect |
|---|---|
quote | The quote token from the 402. Required on dynamic routes. |
proof | Stable proof id. Without it, every request is a fresh payment. |
payer | Payer id, used by limit() and payers(). |
amount | Must equal the price, otherwise the proof is invalid. |
limit | Capacity of a reusable authorization. |
Use testRail({ authorization: "reusable" }) to behave like an L402 credential or a KYAPay token. Over MCP, send the same string in _meta["tollstile/test-payment"].
See Test payment failures for rail.simulate() and rail.effects.
Never alongside live rails
createTollstile() refuses a test rail configured together with a live rail.