Overview
The Swap Send endpoint allows you to broadcast a signed transaction to the blockchain network. This endpoint should be used after obtaining a quote from the Swap Quoting endpoint and signing the transaction with your wallet.Request Body
The request body must be a JSON object with the following fields:chainId(required) — The blockchain identifier (e.g.,evm:1,solana,ethereum)signedTransaction(required) — Base64 encoded signed transaction
Usage Examples
Send Solana Swap
Send EVM Swap
Send with Specific Chain ID
Response Format
Response Fields
Data Object
success(boolean) — Indicates if the transaction was successfully broadcasttransactionHash(string, optional) — Transaction hash/signature on the blockchainrequestId(string) — Unique identifier for the request
Error Field
error(string, optional) — Error message if the transaction failed to broadcast
Example Responses
Successful Transaction
Successful Solana Transaction
Failed Transaction
Invalid Signature
Transaction Flow
- Get Quote: Call the Swap Quoting endpoint to get a serialized transaction
- Sign Transaction: Use your wallet to sign the transaction
- For Solana: Use
@solana/web3.jsor similar - For EVM: Use
ethers.js,web3.js, or similar
- For Solana: Use
- Encode to Base64: Convert the signed transaction to base64
- Broadcast: Send the encoded transaction using this endpoint
- Track: Use the returned transaction hash to track on blockchain explorers
Important Notes
- Transaction Validity: Transactions may expire if not sent within a certain timeframe
- Gas/Priority Fees: The transaction includes estimated fees from the quoting phase
- Slippage: If market conditions change significantly, the transaction may fail
- Idempotency: Sending the same transaction multiple times may result in errors
- Transaction Hash: Use this to track the transaction on blockchain explorers
Error Handling
Common error scenarios:- Insufficient Funds: Wallet doesn’t have enough balance to cover the swap + fees
- Slippage Exceeded: Market moved beyond acceptable slippage tolerance
- Invalid Signature: Transaction was not properly signed
- Expired Transaction: Transaction validity period has passed
- Network Congestion: Blockchain network is experiencing high load
Next Steps
After broadcasting:- Monitor the transaction using the returned hash
- Wait for blockchain confirmation
- Verify the swap completed successfully on a blockchain explorer
Use Cases
- Automated Trading: Execute swaps programmatically
- Multi-Wallet Management: Broadcast transactions from multiple wallets
- Trading Bots: Implement automated trading strategies
- DeFi Integration: Complete swap flows in your application
Body
application/json