Overview
Use this cookbook when you want 1tx to handle:- instrument discovery,
- quote generation,
- source-chain selection,
- calldata generation,
- and cross-chain relay tracking.
Prerequisites
- an API key for discovery and monitoring endpoints,
- a bearer token for transaction-building endpoints,
- a wallet connection in your frontend,
- a way to send EVM transactions, such as
viemorwagmi.
Recipe 1: Build and Execute a Same-Chain Buy
Step 1: Fetch the instrument
Step 2: Build the transaction bundle
Step 3: Execute the returned transactions in order
Recipe 2: Build and Monitor a Cross-Chain Buy
For cross-chain buys, the source-chain router transaction is still built throughPOST /transactions/buy, but completion is tracked through the CCTP API.
Step 1: Build the bundle
Step 2: Execute the source-chain transactions
buy() transaction. Use that hash as the source transaction hash to monitor.
Step 3: Poll relay status by source tx hash
Step 4: Show destination completion
A brief
404 Job not found immediately after source-chain confirmation is expected. The relay job is created asynchronously when the bridge event webhook is ingested.Recipe 3: Estimate CCTP Fees Before Building
If you want to display cross-chain transfer mode estimates before submitting a buy, use the CCTP fee endpoint.GET /cctp/config to map chain IDs to Circle domains.
Common Pitfalls
- Missing bearer auth on
POST /transactions/buyorPOST /transactions/sell - Sending transactions out of order
- Treating an early
404from/cctp/relay/tx/:sourceTxHashas a permanent failure - Reusing an expired bundle after
expiresAt - Formatting human-readable amounts incorrectly before calling the API
Next Steps
Transactions API
Full request and response shapes for transaction bundles
CCTP API
Relay monitoring and fee estimation endpoints