{"templates":[{"id":"pre-buy","name":"Pre-buy check (Base)","description":"token-risk → sellability → swap-route on one Base token. If token-risk or sellability returns decision STOP, the later steps are not called and not charged.","inputs":[{"name":"address","label":"Token contract address","required":true,"placeholder":"0x… token"},{"name":"amountUsd","label":"Trade size in USD (optional)","placeholder":"1000"}],"steps":[{"service":"token-risk","params":{"address":"$input.address"}},{"service":"sellability","params":{"address":"$input.address","size":"$input.amountUsd"}},{"service":"swap-route","params":{"tokenOut":"$input.address","amountUsd":"$input.amountUsd"}}],"quote":{"totalUsd":0.14,"totalMills":140,"exact":true,"steps":[{"index":1,"service":"token-risk","price":"$0.03","priceUsd":0.03,"exact":true},{"index":2,"service":"sellability","price":"$0.08","priceUsd":0.08,"exact":true},{"index":3,"service":"swap-route","price":"$0.03","priceUsd":0.03,"exact":true}]}},{"id":"wallet-dd","name":"Wallet due diligence (Base)","description":"sanctions → address-trust → wallet-drain-watch on one address. A sanctions STOP ends the run before the other two are charged.","inputs":[{"name":"address","label":"Wallet address","required":true,"placeholder":"0x… wallet"}],"steps":[{"service":"sanctions","params":{"address":"$input.address"}},{"service":"address-trust","params":{"address":"$input.address"}},{"service":"wallet-drain-watch","params":{"wallet":"$input.address"}}],"quote":{"totalUsd":0.11,"totalMills":110,"exact":true,"steps":[{"index":1,"service":"sanctions","price":"$0.02","priceUsd":0.02,"exact":true},{"index":2,"service":"address-trust","price":"$0.03","priceUsd":0.03,"exact":true},{"index":3,"service":"wallet-drain-watch","price":"$0.06","priceUsd":0.06,"exact":true}]}},{"id":"near-pre-trade","name":"NEAR pre-trade","description":"near-pre-trade-gate (contract control + round-trip exit test) → near-swap-quote from USDC into the same token, at your size. The quote's `to` is taken from the gate's own answer ($1.data.token). A STOP from the gate skips the quote.","inputs":[{"name":"token","label":"NEAR token contract account","required":true,"placeholder":"usdt.tether-token.near"},{"name":"size","label":"Trade size in USD","required":true,"placeholder":"100"}],"steps":[{"service":"near-pre-trade-gate","params":{"token":"$input.token","size":"$input.size"}},{"service":"near-swap-quote","params":{"from":"USDC","to":"$1.data.token","amount":"$input.size"}}],"quote":{"totalUsd":0.06,"totalMills":60,"exact":true,"steps":[{"index":1,"service":"near-pre-trade-gate","price":"$0.05","priceUsd":0.05,"exact":true},{"index":2,"service":"near-swap-quote","price":"$0.01","priceUsd":0.01,"exact":true}]}}],"run":{"method":"POST","url":"/api/workflows/run","payment":"Send your prepaid credit token as the x-credit-token header. Each step is a call to /api/x402/<service> with that token and is debited exactly like a direct call: a step whose handler fails is refunded, and steps after a failure, an empty balance or (with stopOnStop) a STOP decision are not called and not charged.","body":{"template":"pre-buy","input":{"address":"0x…"},"stopOnStop":true,"dryRun":false},"custom":{"steps":[{"service":"token-risk","params":{"address":"0x…"}},{"service":"sellability","params":{"address":"$1.data.address"}}]},"maxSteps":5,"references":"A parameter may be \"$input.<name>\" (a workflow input) or \"$<N>.<path>\" (a string/number/boolean from step N's JSON response, e.g. \"$1.data.address\"). Paths follow own fields and array indexes only. Write \"$$\" for a literal \"$\"."}}