verification
use it
# add to stunt.yaml
services:
oneinch:
adapter: embedded:oneinch-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the 1inch Aggregation Protocol API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of 1inch Aggregation Protocol API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real 1inch Aggregation Protocol API v6.0 surface — the data is fake, the behavior is real.
api surface (5)
generated from the adapter manifest — exactly what boots, nothing more
5 routes
GET/v6.0/1/approve/spender
GET/v6.0/1/approve/calldata
GET/v6.0/1/tokens
GET/v6.0/1/quote
GET/v6.0/1/swap
VM-verified behaviors (14)
- ✓a quote returns token pairs, a decimal toAmount and a 100-point split
- ✓quotes are deterministic and address matching is case-insensitive
- ✓the toAmount scales linearly with the input amount
- ✓a same-token quote scales the amount by the pseudo-rate (as-is)
- ✓missing params and unknown tokens are 400 error envelopes
- ✓a swap returns router-addressed calldata with gas and gasPrice
- ✓the swap toAmount matches the quote for the same input
- ✓slippage is optional and ignored (as-is)
- ✓missing params and unknown tokens are 400s
- ✓the spender is the router contract address
- ✓approve calldata targets the token with the max allowance
- ✓a missing or unknown token is a 400
- ✓the token list is an address-keyed map of six tokens
- ✓every token in the list is quotable as a source
Not implemented (3)
- No Fusion+ order flow (order quotes, submission, status, events)
- No Limit Order Protocol endpoints (create, list, history)
- No raw transaction broadcast, status check, or chains list endpoints
Differs from the real API (4)
- Quotes deterministic from src/dst/amount; same input yields same toAmount and split
- Quote field is toAmount; real v6.0 returns dstAmount
- Same-token quotes return amount x pseudo-rate; real API rejects
- slippage is optional and ignored on swap; real v6.0 requires it
want more of the 1inch Aggregation Protocol API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.