{ "openapi": "3.0.3", "info": { "title": "0x Cross-Chain API", "description": "This is the official API reference for the 0x Cross-Chain API (v1).", "version": "v1" }, "servers": [ { "url": "https://api.0x.org" } ], "paths": { "/cross-chain/quotes": { "get": { "operationId": "crossChain::getQuotes", "summary": "getQuotes", "description": "Get the quotes for a cross chain swap", "tags": ["Cross-Chain"], "parameters": [ { "description": "Visit dashboard.0x.org to get your API Key", "in": "header", "name": "0x-api-key", "required": true, "schema": { "type": "string" } }, { "name": "originChain", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The source chain from which the cross-chain swap will originate. Can be specified as chain ID or name. See [here](https://0x-docs.gitbook.io/0x-cross-chain-api-beta/developer-resources/supported-chains-and-providers) for the list of supported chains", "example": 8453 }, { "name": "destinationChain", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The destination chain where tokens will be received after the cross-chain swap. Can be specified as chain ID or name. See [here](https://0x-docs.gitbook.io/0x-cross-chain-api-beta/developer-resources/supported-chains-and-providers) for the list of supported chains", "example": 42161 }, { "name": "sellToken", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The contract address of the token to sell on the origin chain. Format varies by chain type (EVM address for EVM/HyperCore chains, token mint address for Solana, base58check address for Tron)", "example": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" }, { "name": "buyToken", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The contract address of the token to buy on the destination chain. Format varies by chain type (EVM address for EVM/HyperCore chains, token mint address for Solana, base58check address for Tron)", "example": "0xaf88d065e77c8cc2239327c5edb3a432268e5831" }, { "name": "sellAmount", "in": "query", "required": true, "schema": { "type": "string", "pattern": "^-?(0|[1-9]\\d*)$" }, "description": "The amount of `sellToken` (in `sellToken`'s base units) to sell on the origin chain", "example": "2570" }, { "name": "originAddress", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The wallet address on the origin chain that holds the sellToken balance and will initiate the cross-chain transaction", "example": "0x56EB0aD2dC746540Fab5C02478B31e2AA9DdC38C" }, { "name": "destinationAddress", "in": "query", "required": false, "schema": { "type": "string" }, "description": "The wallet address on the destination chain that will receive the buyToken. If not specified, defaults to originAddress on the destination chain", "example": "0x56EB0aD2dC746540Fab5C02478B31e2AA9DdC38C" }, { "name": "gasPayer", "in": "query", "required": false, "schema": { "type": "string" }, "description": "The Solana address that will pay for transaction fees when the origin chain is Solana. Only applicable for Solana origin chains" }, { "name": "slippageBps", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "maximum": 10000, "default": 100 }, "description": "The maximum acceptable slippage for each swap or bridge step of the cross-chain swap in basis points (100 = 1%)" }, { "name": "excludedBridges", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated list of bridge providers to exclude from routing" }, { "name": "includedBridges", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated list of bridge providers to include in routing. Mutually exclusive with excludedBridges" }, { "name": "excludedSwapSources", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated list of DEX sources to exclude from routing on both chains" }, { "name": "feeBps", "in": "query", "required": false, "schema": { "type": "string", "default": "" }, "description": "The trading fee amounts in basis points to charge on the origin chain (supports single or comma-separated values). Must be used together with feeRecipient. When multiple values are provided, must match the length of feeRecipient. Note: integrator fee collection is not yet supported for Tron-originated routes." }, { "name": "feeRecipient", "in": "query", "required": false, "schema": { "type": "string", "default": "" }, "description": "The wallet addresses to receive trading fees on the origin chain (supports single or comma-separated values). Must be used together with feeBps. When multiple values are provided, must match the length of feeBps. Note: integrator fee collection is not yet supported for Tron-originated routes." }, { "name": "feeToken", "in": "query", "required": false, "schema": { "type": "string", "default": "" }, "description": "The token addresses for fee collection on the origin chain (supports single or comma-separated values). Must be the same as sellToken. When multiple values are provided, must match the length of feeBps. If omitted, defaults to sellToken. Note: integrator fee collection is not yet supported for Tron-originated routes." }, { "name": "sortQuotesBy", "in": "query", "required": true, "schema": { "type": "string", "enum": ["speed", "price"] }, "description": "How to sort the returned quotes - either by speed (fastest execution time) or price (best exchange rate)", "example": "speed" }, { "name": "maxNumQuotes", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 10, "default": 3 }, "description": "The maximum number of cross-chain quotes to return, between 1 and 10. Each quote represents a different combination of bridges and DEXs" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "properties": { "liquidityAvailable": { "type": "boolean", "enum": [true], "description": "Whether sufficient liquidity exists across bridges and DEXs to execute the cross-chain swap" }, "allowanceTarget": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "nullable": true, "description": "The contract address to set the allowance on, if necessary" }, "originChainId": { "type": "number", "description": "The numeric chain ID of the origin chain where the swap begins" }, "originChain": { "type": "string", "description": "The name of the origin chain where the swap begins" }, "destinationChainId": { "type": "number", "description": "The numeric chain ID of the destination chain where tokens will be received" }, "destinationChain": { "type": "string", "description": "The name of the destination chain where tokens will be received" }, "sellToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the token being sold on the origin chain" }, "buyToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the token being bought on the destination chain" }, "issues": { "type": "object", "properties": { "allowance": { "type": "object", "properties": { "actual": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The `originAddress`'s current allowance of the `spender`" }, "spender": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The address to set the allowance on" } }, "required": ["actual", "spender"], "additionalProperties": false, "description": "The allowances that the `originAddress` must set in order to execute the swap successfully. Null if no allowance is required", "nullable": true }, "balance": { "type": "object", "properties": { "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the `sellToken`" }, "actual": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The current balance of the `sellToken` in the `originAddress` address" }, "expected": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The balance of `sellToken` required for the swap to execute successfully" } }, "required": ["token", "actual", "expected"], "additionalProperties": false, "description": "The balance of `sellToken` that the `originAddress` must hold. Null if the `originAddress` has sufficient balance", "nullable": true }, "simulationIncomplete": { "type": "boolean", "description": "This is set to `true` when 0x cannot validate the transaction. This happens when the `originAddress` has an insufficient balance of `sellToken` and 0x is unable to perform enhanced quote validation with such low balance. Note that this does not necessarily mean that the trade will revert" }, "invalidSwapSourcesPassed": { "type": "array", "items": { "type": "string" }, "description": "List of invalid swap sources specified in the `excludedSwapSources` parameter" }, "invalidBridgesPassed": { "type": "array", "items": { "type": "string" }, "description": "List of invalid bridge providers specified in the `excludedBridges` or `includedBridges` parameter" } }, "required": [ "allowance", "balance", "simulationIncomplete", "invalidSwapSourcesPassed", "invalidBridgesPassed" ], "additionalProperties": false }, "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" }, "quotes": { "type": "array", "items": { "type": "object", "properties": { "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of sellToken (in sellToken base units) required on the origin chain" }, "buyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The estimated amount of `buyToken` (in `buyToken`'s base units) to be received on the destination chain" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum amount of buyToken guaranteed across the entire cross-chain quote. This price is influenced by the `slippageBps` parameter" }, "fees": { "type": "object", "properties": { "integratorFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of the integrator fee in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which the integrator collected a fee" }, "type": { "type": "string", "enum": ["volume"], "description": "The fee type indicating it is calculated as a percentage of trade volume" }, "chainId": { "type": "number", "description": "The chain ID where this fee will be collected" } }, "required": ["amount", "token", "type"], "additionalProperties": false, "nullable": true, "description": "The details about the first fee collected by the integrator" }, "integratorFees": { "type": "array", "items": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of the integrator fee in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which the integrator collected a fee" }, "type": { "type": "string", "enum": ["volume"], "description": "The fee type indicating it is calculated as a percentage of trade volume" }, "chainId": { "type": "number", "description": "The chain ID where this fee will be collected" } }, "required": ["amount", "token", "type"], "additionalProperties": false }, "nullable": true, "description": "The details about the fees collected by the integrator" }, "zeroExFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The 0x fee in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which 0x collected a fee" }, "type": { "type": "string", "enum": ["volume"], "description": "The fee type indicating it is calculated as a percentage of trade volume" } }, "required": ["amount", "token", "type"], "additionalProperties": false, "nullable": true, "description": "The details about the fee collected by 0x" }, "bridgeNativeFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The bridge fee amount in token's base units that will be added to the transaction value" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the token in which the bridge fee is collected" }, "type": { "type": "string", "enum": ["native"], "description": "The fee type indicating it is a native bridge fee" } }, "required": ["amount", "token", "type"], "additionalProperties": false, "nullable": true, "description": "Native fee required by the bridge provider for cross-chain message passing that will be added to the transaction value" }, "reimbursementFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The reimbursement fee amount in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which the reimbursement fee is collected" }, "recipient": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The wallet address that receives the reimbursement fee" } }, "required": ["amount", "token", "recipient"], "additionalProperties": false } }, "required": [ "integratorFee", "integratorFees", "zeroExFee", "bridgeNativeFee" ], "additionalProperties": false, "description": "All fees associated with this cross-chain quote, including integrator fees, 0x protocol fees, and bridge native fees" }, "gasCosts": { "anyOf": [ { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["evm"], "description": "The blockchain type for Ethereum-compatible chains" }, "gasPrice": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The gas price in wei used for cost estimation" }, "gasLimit": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The estimated gas limit required for successful execution" }, "totalNetworkFee": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The estimated total network cost of the swap. On chains where there is no L1 data cost, it is calculated as `gas` * `gasPrice`. On chains where there is an L1 data cost, it is calculated as `gas` * `gasPrice + L1 data`" } }, "required": [ "chainType", "gasPrice", "gasLimit", "totalNetworkFee" ], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["svm"], "description": "The blockchain type for Solana Virtual Machine" }, "base": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The base transaction fee in lamports for Solana" }, "priority": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The priority fee in lamports for faster transaction processing" }, "total": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The total fee in lamports (base + priority)" } }, "required": [ "chainType", "base", "priority", "total" ], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["tvm"], "description": "The blockchain type for Tron Virtual Machine" }, "energyFee": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The energy fee in sun for the Tron transaction" }, "bandwidthFee": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The bandwidth fee in sun for the Tron transaction" }, "total": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The total network fee in sun (energyFee + bandwidthFee)" } }, "required": [ "chainType", "energyFee", "bandwidthFee", "total" ], "additionalProperties": false } ], "description": "Estimated gas costs for executing the transaction on the origin chain, formatted by chain type" }, "steps": { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this step will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this step" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this step" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens for this step in token base units" }, "type": { "type": "string", "enum": ["wrap"] } }, "required": [ "chainId", "sellToken", "buyToken", "amount", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this step will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this step" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this step" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens for this step in token base units" }, "type": { "type": "string", "enum": ["unwrap"] } }, "required": [ "chainId", "sellToken", "buyToken", "amount", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "enum": ["swap"] }, "chainId": { "type": "number", "description": "The chain ID where this swap will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this swap" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this swap" }, "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The input amount for this swap in token base units" }, "buyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The output amount for this swap in token base units" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum output amount for this swap in token base units" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this swap step to complete" } }, "required": [ "type", "chainId", "sellToken", "buyToken", "sellAmount", "buyAmount", "minBuyAmount", "estimatedTimeSeconds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "enum": ["bridge"] }, "originChainId": { "type": "number", "description": "The chain ID where tokens will be sent from" }, "destinationChainId": { "type": "number", "description": "The chain ID where tokens will be received" }, "sellToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The token address on the origin chain" }, "buyToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The token address on the destination chain" }, "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens to bridge from the origin chain in token base units" }, "buyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens to be received on the destination chain in token base units" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum amount of tokens guaranteed on the destination chain in token base units" }, "provider": { "type": "string", "description": "The bridge provider name handling this cross-chain transfer" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this bridge step to complete" } }, "required": [ "type", "originChainId", "destinationChainId", "sellToken", "buyToken", "sellAmount", "buyAmount", "minBuyAmount", "provider", "estimatedTimeSeconds" ], "additionalProperties": false } ] }, "description": "Sequential steps required to complete the cross-chain swap, including wrapping, swaps, and bridge operations" }, "transaction": { "anyOf": [ { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["evm"], "description": "The blockchain type for Ethereum-compatible chains" }, "details": { "type": "object", "properties": { "to": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The contract address to send the transaction to on the EVM chain" }, "data": { "type": "string", "description": "The calldata containing execution details for the EVM transaction" }, "gas": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The estimated gas limit required for successful transaction execution" }, "gasPrice": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The gas price in wei for the EVM transaction" }, "value": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of native currency in wei to send with the transaction" } }, "required": [ "to", "data", "gas", "gasPrice", "value" ], "additionalProperties": false } }, "required": ["chainType", "details"], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["svm"], "description": "The blockchain type for Solana Virtual Machine" }, "details": { "type": "object", "properties": { "serializedTransaction": { "type": "string", "description": "The base64-encoded serialized Solana transaction" } }, "required": ["serializedTransaction"], "additionalProperties": false } }, "required": ["chainType", "details"], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["tvm"], "description": "The blockchain type for Tron Virtual Machine" }, "details": { "type": "object", "properties": { "to": { "type": "string", "description": "The Tron contract address to interact with" }, "data": { "type": "string", "description": "The calldata for the Tron smart contract call" }, "value": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of TRX in sun to send with the transaction" }, "ownerAddress": { "type": "string", "description": "The Tron address of the transaction sender" }, "memo": { "type": "string", "description": "Optional memo attached to the Tron transaction" } }, "required": [ "to", "data", "value", "ownerAddress" ], "additionalProperties": false } }, "required": ["chainType", "details"], "additionalProperties": false } ], "description": "The transaction details to execute on the origin chain to initiate the cross-chain swap" }, "estimatedTimeSeconds": { "type": "number", "minimum": 0, "nullable": true, "description": "Estimated total time in seconds for the cross-chain swap to complete, including bridge confirmation time" }, "issues": { "type": "object", "properties": { "allowance": { "type": "object", "properties": { "actual": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The `originAddress`'s current allowance of the `spender`" }, "spender": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The address to set the allowance on" } }, "required": ["actual", "spender"], "additionalProperties": false, "description": "The allowances that the `originAddress` must set in order to execute the swap successfully. Null if no allowance is required", "nullable": true }, "balance": { "type": "object", "properties": { "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the `sellToken`" }, "actual": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The current balance of `sellToken` in the `originAddress` address" }, "expected": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The balance of `sellToken` required for the swap to execute successfully" } }, "required": ["token", "actual", "expected"], "additionalProperties": false, "description": "The balance of `sellToken` that the `originAddress` must hold. Null if the `originAddress` has sufficient balance", "nullable": true }, "simulationIncomplete": { "type": "boolean", "description": "This is set to `true` when 0x cannot validate the transaction. This happens when the `originAddress` has an insufficient balance of `sellToken` and 0x is unable to perform enhanced quote validation with such low balance. Note that this does not necessarily mean that the trade will revert" } }, "required": [ "allowance", "balance", "simulationIncomplete" ], "additionalProperties": false }, "quoteId": { "type": "string", "description": "The unique ID for this cross-chain quote" } }, "required": [ "sellAmount", "buyAmount", "minBuyAmount", "fees", "gasCosts", "steps", "transaction", "estimatedTimeSeconds", "issues", "quoteId" ], "additionalProperties": false }, "minItems": 1, "description": "Array of available cross-chain quotes, each representing a different combination of bridges and DEXs" } }, "required": [ "liquidityAvailable", "allowanceTarget", "originChainId", "originChain", "destinationChainId", "destinationChain", "sellToken", "buyToken", "issues", "zid", "quotes" ], "additionalProperties": false }, { "type": "object", "properties": { "liquidityAvailable": { "type": "boolean", "enum": [false], "description": "Whether sufficient liquidity exists across bridges and DEXs to execute the cross-chain swap" }, "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" } }, "required": ["liquidityAvailable", "zid"], "additionalProperties": false } ] }, "example": { "liquidityAvailable": true, "originChainId": 8453, "originChain": "base", "destinationChainId": 42161, "destinationChain": "arbitrum", "sellToken": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "buyToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", "issues": { "allowance": null, "balance": { "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "actual": "0", "expected": "2570" }, "simulationIncomplete": false, "invalidSwapSourcesPassed": [], "invalidBridgesPassed": [] }, "zid": "0xbed7b45844099af94219ba8c", "quotes": [ { "sellAmount": "2570", "buyAmount": "2972100", "minBuyAmount": "2942339", "fees": { "integratorFee": null, "zeroExFee": { "amount": "6", "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "type": "volume" }, "bridgeNativeFee": null }, "gasCosts": { "chainType": "evm", "gasPrice": "11550962", "gasLimit": "672945", "totalNetworkFee": "7790577030769" }, "steps": [ { "type": "swap", "chainId": 8453, "sellToken": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "buyToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "sellAmount": "2564", "buyAmount": "2979865", "minBuyAmount": "2950101", "estimatedTimeSeconds": 0 }, { "type": "bridge", "originChainId": 8453, "destinationChainId": 42161, "sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "buyToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", "sellAmount": "2979865", "buyAmount": "2972100", "minBuyAmount": "2942339", "provider": "across_v3", "estimatedTimeSeconds": 3 } ], "transaction": { "chainType": "evm", "details": { "to": "0x0000000000001ff3684f28c67538d4d072c22734", "data": "0x2213bc0b...", "gas": "672945", "gasPrice": "0", "value": "0" } }, "estimatedTimeSeconds": 3, "issues": { "allowance": null, "balance": { "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "actual": "0", "expected": "2570" }, "simulationIncomplete": false }, "quoteId": "0xbed7b45844099af94219ba8c00000001" } ] } } } }, "400": { "description": "400 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INPUT_INVALID" } ] } } } }, "500": { "description": "500 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INTERNAL_SERVER_ERROR" }, { "$ref": "#/components/schemas/UNCATEGORIZED" } ] } } } } } } }, "/cross-chain/status": { "get": { "operationId": "crossChain::getStatus", "summary": "getStatus", "description": "Get the status of a cross chain transaction", "tags": ["Cross-Chain"], "parameters": [ { "description": "Visit dashboard.0x.org to get your API Key", "in": "header", "name": "0x-api-key", "required": true, "schema": { "type": "string" } }, { "name": "originChain", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The origin chain where the cross-chain transaction was initiated", "example": 8453 }, { "name": "originTxHash", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The transaction hash on the origin chain to track. Format varies by chain type (32-byte hex for EVM/HyperCore, base58 signature for Solana, 64-char hex for Tron)", "example": "0xe347e66b1d9793a11a962c1483f9eef03272c362c41dc1f21c87577ef5ec1a7c" }, { "name": "quoteId", "in": "query", "required": false, "schema": { "type": "string" }, "description": "The quote ID associated with the cross-chain transaction" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "origin_tx_pending", "origin_tx_succeeded", "origin_tx_confirmed", "origin_tx_reverted", "bridge_pending", "bridge_filled", "bridge_failed", "unknown" ], "description": "The current status of the cross-chain transaction" }, "bridge": { "type": "string", "description": "The bridge provider handling the cross-chain transfer" }, "steps": { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this step will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this step" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this step" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens for this step in token base units" }, "transactions": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this transaction occurred" }, "chain": { "type": "string", "description": "The name of the chain where this transaction occurred" }, "txHash": { "type": "string", "nullable": true, "description": "The transaction hash on this specific chain" }, "timestamp": { "type": "integer", "exclusiveMinimum": true, "minimum": 0, "description": "Unix timestamp when this transaction was confirmed on-chain" } }, "required": [ "chainId", "chain", "txHash", "timestamp" ], "additionalProperties": false }, "description": "The transactions involved in this step" }, "type": { "type": "string", "enum": ["wrap"] } }, "required": [ "chainId", "sellToken", "buyToken", "amount", "transactions", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this step will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this step" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this step" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens for this step in token base units" }, "transactions": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this transaction occurred" }, "chain": { "type": "string", "description": "The name of the chain where this transaction occurred" }, "txHash": { "type": "string", "nullable": true, "description": "The transaction hash on this specific chain" }, "timestamp": { "type": "integer", "exclusiveMinimum": true, "minimum": 0, "description": "Unix timestamp when this transaction was confirmed on-chain" } }, "required": [ "chainId", "chain", "txHash", "timestamp" ], "additionalProperties": false }, "description": "The transactions involved in this step" }, "type": { "type": "string", "enum": ["unwrap"] } }, "required": [ "chainId", "sellToken", "buyToken", "amount", "transactions", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this swap will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this swap" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this swap" }, "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The input amount for this swap in token base units" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum output amount for this swap in token base units" }, "quotedBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The quoted output amount for this swap in token base units" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this swap step to complete" }, "transactions": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this transaction occurred" }, "chain": { "type": "string", "description": "The name of the chain where this transaction occurred" }, "txHash": { "type": "string", "nullable": true, "description": "The transaction hash on this specific chain" }, "timestamp": { "type": "integer", "exclusiveMinimum": true, "minimum": 0, "description": "Unix timestamp when this transaction was confirmed on-chain" } }, "required": [ "chainId", "chain", "txHash", "timestamp" ], "additionalProperties": false }, "description": "The transactions involved in this step" }, "type": { "type": "string", "enum": ["swap"] } }, "required": [ "chainId", "sellToken", "buyToken", "sellAmount", "minBuyAmount", "quotedBuyAmount", "estimatedTimeSeconds", "transactions", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "bridge": { "type": "string", "description": "The bridge provider" }, "originChainId": { "type": "number", "description": "The origin chain ID" }, "destinationChainId": { "type": "number", "description": "The destination chain ID" }, "sellToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The input token address for this bridge" }, "buyToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The output token address for this bridge" }, "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The input amount for this bridge in token base units" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum output amount for this bridge in token base units" }, "quotedBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The quoted output amount for this bridge in token base units" }, "settledBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The settled output amount for this bridge in token base units" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this bridge step to complete" }, "transactions": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this transaction occurred" }, "chain": { "type": "string", "description": "The name of the chain where this transaction occurred" }, "txHash": { "type": "string", "nullable": true, "description": "The transaction hash on this specific chain" }, "timestamp": { "type": "integer", "exclusiveMinimum": true, "minimum": 0, "description": "Unix timestamp when this transaction was confirmed on-chain" } }, "required": [ "chainId", "chain", "txHash", "timestamp" ], "additionalProperties": false }, "description": "The transactions involved in this step" }, "type": { "type": "string", "enum": ["bridge"] } }, "required": [ "bridge", "originChainId", "destinationChainId", "sellToken", "buyToken", "sellAmount", "minBuyAmount", "quotedBuyAmount", "settledBuyAmount", "estimatedTimeSeconds", "transactions", "type" ], "additionalProperties": false } ] }, "description": "The steps involved in the cross-chain transaction" }, "failure": { "type": "object", "properties": { "reason": { "type": "string", "description": "The reason for the failure" }, "status": { "type": "string", "enum": [ "refund_pending", "refund_succeeded", "manual_action_required", "no_actions_required", "failed" ], "description": "The status of the failure" }, "transactions": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this transaction occurred" }, "chain": { "type": "string", "description": "The name of the chain where this transaction occurred" }, "txHash": { "type": "string", "nullable": true, "description": "The transaction hash on this specific chain" }, "timestamp": { "type": "integer", "exclusiveMinimum": true, "minimum": 0, "description": "Unix timestamp when this transaction was confirmed on-chain" } }, "required": ["chainId", "chain", "txHash", "timestamp"], "additionalProperties": false }, "description": "The transactions involved in the failure" }, "recovery": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this recovery step will be executed" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The token address of the funds to be recovered" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens to be recovered in token base units" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this recovery step to finish, measured from when the recovery process begins" }, "deadline": { "type": "integer", "minimum": 0, "nullable": true, "description": "The deadline timestamp of which the funds are available for recovery, if applicable. Not initiating the recovery process within this deadline may result in funds being forever lost" }, "manualTransaction": { "anyOf": [ { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["evm"], "description": "The blockchain type for Ethereum-compatible chains" }, "details": { "type": "object", "properties": { "to": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The contract address to send the transaction to on the EVM chain" }, "data": { "type": "string", "description": "The calldata containing execution details for the EVM transaction" }, "gas": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The estimated gas limit required for successful transaction execution" }, "gasPrice": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The gas price in wei for the EVM transaction" }, "value": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of native currency in wei to send with the transaction" } }, "required": [ "to", "data", "gas", "gasPrice", "value" ], "additionalProperties": false } }, "required": ["chainType", "details"], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["svm"], "description": "The blockchain type for Solana Virtual Machine" }, "details": { "type": "object", "properties": { "serializedTransaction": { "type": "string", "description": "The base64-encoded serialized Solana transaction" } }, "required": ["serializedTransaction"], "additionalProperties": false } }, "required": ["chainType", "details"], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["tvm"], "description": "The blockchain type for Tron Virtual Machine" }, "details": { "type": "object", "properties": { "to": { "type": "string", "description": "The Tron contract address to interact with" }, "data": { "type": "string", "description": "The calldata for the Tron smart contract call" }, "value": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of TRX in sun to send with the transaction" }, "ownerAddress": { "type": "string", "description": "The Tron address of the transaction sender" }, "memo": { "type": "string", "description": "Optional memo attached to the Tron transaction" } }, "required": [ "to", "data", "value", "ownerAddress" ], "additionalProperties": false } }, "required": ["chainType", "details"], "additionalProperties": false } ], "nullable": true, "description": "The manual transaction for submission, if applicable. This transaction may be submitted by anyone to initiate the recovery process" }, "settledAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The actual settled refund amount in token base units" } }, "required": [ "chainId", "token", "amount", "estimatedTimeSeconds", "deadline", "manualTransaction", "settledAmount" ], "additionalProperties": false, "nullable": true, "description": "The recovery step for the failure" } }, "required": ["reason", "status", "transactions", "recovery"], "additionalProperties": false, "nullable": true, "description": "The failure context for the cross-chain transaction" }, "transactions": { "type": "array", "items": { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this transaction occurred" }, "chain": { "type": "string", "description": "The name of the chain where this transaction occurred" }, "txHash": { "type": "string", "nullable": true, "description": "The transaction hash on this specific chain" }, "timestamp": { "type": "integer", "exclusiveMinimum": true, "minimum": 0, "description": "Unix timestamp when this transaction was confirmed on-chain" } }, "required": ["chainId", "chain", "txHash", "timestamp"], "additionalProperties": false }, "description": "List of all blockchain transactions involved in this cross-chain swap, across multiple chains" }, "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" } }, "required": ["status", "steps", "failure", "transactions", "zid"], "additionalProperties": false }, "example": { "status": "bridge_filled", "bridge": "stargate", "steps": [ { "type": "swap", "chainId": 8453, "sellToken": "0x4200000000000000000000000000000000000006", "buyToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "minBuyAmount": "3676900", "quotedBuyAmount": "3676946", "estimatedTimeSeconds": 0, "transactions": [ { "chainId": 8453, "txHash": "0xe347e66b1d9793a11a962c1483f9eef03272c362c41dc1f21c87577ef5ec1a7c", "timestamp": 1754335333 } ] }, { "type": "bridge", "bridge": "stargate", "originChainId": 8453, "destinationChainId": 42161, "sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "buyToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", "minBuyAmount": "3671000", "quotedBuyAmount": "3671430", "estimatedTimeSeconds": 15, "transactions": [ { "chainId": 8453, "chain": "base", "txHash": "0xe347e66b1d9793a11a962c1483f9eef03272c362c41dc1f21c87577ef5ec1a7c", "timestamp": 1754335333 }, { "chainId": 42161, "chain": "arbitrum", "txHash": "0xb8f4da7b2f3244d1d3174687cea1b8403e263f86ead168a841caf142b491ed5b", "timestamp": 1754335360 } ] } ], "failure": null, "transactions": [ { "chainId": 8453, "chain": "base", "txHash": "0xe347e66b1d9793a11a962c1483f9eef03272c362c41dc1f21c87577ef5ec1a7c", "timestamp": 1754335333 }, { "chainId": 42161, "chain": "arbitrum", "txHash": "0xb8f4da7b2f3244d1d3174687cea1b8403e263f86ead168a841caf142b491ed5b", "timestamp": 1754335360 } ], "zid": "0x1e452d8e6b4ce52de314dcb4" } } } }, "400": { "description": "400 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INPUT_INVALID" } ] } } } }, "404": { "description": "404 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/BRIDGE_UNKNOWN" }, { "$ref": "#/components/schemas/TRANSACTION_NOT_FOUND" } ] } } } }, "500": { "description": "500 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/BRIDGE_PROVIDER_ERROR" }, { "$ref": "#/components/schemas/INTERNAL_SERVER_ERROR" }, { "$ref": "#/components/schemas/UNCATEGORIZED" } ] } } } } } } }, "/cross-chain/sources": { "get": { "operationId": "crossChain::listSources", "summary": "listSources", "description": "List available swap and bridge sources for a cross chain swap", "tags": ["Cross-Chain"], "parameters": [ { "description": "Visit dashboard.0x.org to get your API Key", "in": "header", "name": "0x-api-key", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "bridges": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the bridge provider" }, "chainPairs": { "type": "array", "items": { "type": "object", "properties": { "originChainId": { "type": "number", "description": "The numeric chain ID of the origin chain" }, "destinationChainId": { "type": "number", "description": "The numeric chain ID of the destination chain" } }, "required": ["originChainId", "destinationChainId"], "additionalProperties": false }, "description": "Origin-destination chain pairs supported by the bridge provider" } }, "required": ["name", "chainPairs"], "additionalProperties": false }, "description": "The array of bridge providers and their supported chain pairs" }, "swapSources": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the liquidity sources aggregated by 0x" }, "chainIds": { "type": "array", "items": { "type": "number" }, "description": "The numeric chain IDs of the chains supported by the liquidity source" } }, "required": ["name", "chainIds"], "additionalProperties": false }, "description": "The array of liquidity sources and their supported chains" }, "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" } }, "required": ["bridges", "swapSources", "zid"], "additionalProperties": false } } } }, "400": { "description": "400 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INPUT_INVALID" } ] } } } }, "500": { "description": "500 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INTERNAL_SERVER_ERROR" }, { "$ref": "#/components/schemas/UNCATEGORIZED" } ] } } } } } } }, "/cross-chain/tx-history-beta": { "get": { "operationId": "crossChain::getTxHistory", "summary": "getTxHistory", "description": "Get cross-chain transaction history for a user wallet address. Note: this endpoint is in beta and still a work in progress — please reach out to the 0x team if you or your users run into any issues.", "tags": ["Cross-Chain"], "parameters": [ { "description": "Visit dashboard.0x.org to get your API Key", "in": "header", "name": "0x-api-key", "required": true, "schema": { "type": "string" } }, { "name": "user", "in": "query", "required": true, "schema": { "anyOf": [ { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string" } ] }, "description": "The wallet address of the user to get transaction history for. Accepts EVM (0x...), Solana, and Tron addresses" }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }, "description": "Maximum number of transactions to return" }, { "name": "cursor", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "transactions": { "type": "array", "items": { "type": "object", "properties": { "originChain": { "type": "number", "description": "The origin chain ID" }, "originTx": { "type": "string", "description": "The transaction hash on the origin chain" }, "destinationChain": { "type": "number", "nullable": true, "description": "The destination chain ID" }, "destinationTx": { "type": "string", "nullable": true, "description": "The transaction hash on the destination chain" }, "status": { "type": "string", "description": "The current status of the transaction" }, "bridge": { "type": "string", "nullable": true, "description": "The bridge provider used" } }, "required": [ "originChain", "originTx", "destinationChain", "destinationTx", "status", "bridge" ], "additionalProperties": false }, "description": "List of transaction history records" }, "pagination": { "type": "object", "properties": { "limit": { "type": "number", "description": "The limit used for this query" }, "nextCursor": { "type": "string", "nullable": true, "description": "Cursor for next page. Null if no more results" }, "hasMore": { "type": "boolean", "description": "Whether there are more transactions available" } }, "required": ["limit", "nextCursor", "hasMore"], "additionalProperties": false, "description": "Pagination information" }, "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" } }, "required": ["transactions", "pagination", "zid"], "additionalProperties": false } } } }, "400": { "description": "400 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INPUT_INVALID" } ] } } } }, "404": { "description": "404 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/TRANSACTION_NOT_FOUND" } ] } } } }, "500": { "description": "500 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INTERNAL_SERVER_ERROR" }, { "$ref": "#/components/schemas/UNCATEGORIZED" } ] } } } } } } }, "/cross-chain/quotes/stream": { "get": { "operationId": "crossChain::streamQuotes", "summary": "streamQuotes", "description": "Stream cross-chain quotes as they become available", "tags": ["Cross-Chain"], "parameters": [ { "description": "Visit dashboard.0x.org to get your API Key", "in": "header", "name": "0x-api-key", "required": true, "schema": { "type": "string" } }, { "name": "originChain", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The source chain from which the cross-chain swap will originate. Can be specified as chain ID or name. See [here](https://0x-docs.gitbook.io/0x-cross-chain-api-beta/developer-resources/supported-chains-and-providers) for the list of supported chains", "example": 8453 }, { "name": "destinationChain", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The destination chain where tokens will be received after the cross-chain swap. Can be specified as chain ID or name. See [here](https://0x-docs.gitbook.io/0x-cross-chain-api-beta/developer-resources/supported-chains-and-providers) for the list of supported chains", "example": 42161 }, { "name": "sellToken", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The contract address of the token to sell on the origin chain. Format varies by chain type (EVM address for EVM/HyperCore chains, token mint address for Solana, base58check address for Tron)", "example": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf" }, { "name": "buyToken", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The contract address of the token to buy on the destination chain. Format varies by chain type (EVM address for EVM/HyperCore chains, token mint address for Solana, base58check address for Tron)", "example": "0xaf88d065e77c8cc2239327c5edb3a432268e5831" }, { "name": "sellAmount", "in": "query", "required": true, "schema": { "type": "string", "pattern": "^-?(0|[1-9]\\d*)$" }, "description": "The amount of `sellToken` (in `sellToken`'s base units) to sell on the origin chain", "example": "2570" }, { "name": "originAddress", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The wallet address on the origin chain that holds the sellToken balance and will initiate the cross-chain transaction", "example": "0x56EB0aD2dC746540Fab5C02478B31e2AA9DdC38C" }, { "name": "destinationAddress", "in": "query", "required": false, "schema": { "type": "string" }, "description": "The wallet address on the destination chain that will receive the buyToken. If not specified, defaults to originAddress on the destination chain", "example": "0x56EB0aD2dC746540Fab5C02478B31e2AA9DdC38C" }, { "name": "gasPayer", "in": "query", "required": false, "schema": { "type": "string" }, "description": "The Solana address that will pay for transaction fees when the origin chain is Solana. Only applicable for Solana origin chains" }, { "name": "slippageBps", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "maximum": 10000, "default": 100 }, "description": "The maximum acceptable slippage for each swap or bridge step of the cross-chain swap in basis points (100 = 1%)" }, { "name": "excludedBridges", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated list of bridge providers to exclude from routing" }, { "name": "includedBridges", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated list of bridge providers to include in routing. Mutually exclusive with excludedBridges" }, { "name": "excludedSwapSources", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Comma-separated list of DEX sources to exclude from routing on both chains" }, { "name": "feeBps", "in": "query", "required": false, "schema": { "type": "string", "default": "" }, "description": "The trading fee amounts in basis points to charge on the origin chain (supports single or comma-separated values). Must be used together with feeRecipient. When multiple values are provided, must match the length of feeRecipient. Note: integrator fee collection is not yet supported for Tron-originated routes." }, { "name": "feeRecipient", "in": "query", "required": false, "schema": { "type": "string", "default": "" }, "description": "The wallet addresses to receive trading fees on the origin chain (supports single or comma-separated values). Must be used together with feeBps. When multiple values are provided, must match the length of feeBps. Note: integrator fee collection is not yet supported for Tron-originated routes." }, { "name": "feeToken", "in": "query", "required": false, "schema": { "type": "string", "default": "" }, "description": "The token addresses for fee collection on the origin chain (supports single or comma-separated values). Must be the same as sellToken. When multiple values are provided, must match the length of feeBps. If omitted, defaults to sellToken. Note: integrator fee collection is not yet supported for Tron-originated routes." }, { "name": "maxNumQuotes", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 10, "default": 5 }, "description": "The maximum number of cross-chain quotes to return, between 1 and 10. Each quote represents a different combination of bridges and DEXs" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" }, "event": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": ["quote"], "description": "Event type indicating a new quote has been found" }, "data": { "type": "object", "properties": { "quote": { "type": "object", "properties": { "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of sellToken (in sellToken base units) required on the origin chain" }, "buyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The estimated amount of `buyToken` (in `buyToken`'s base units) to be received on the destination chain" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum amount of buyToken guaranteed across the entire cross-chain quote. This price is influenced by the `slippageBps` parameter" }, "fees": { "type": "object", "properties": { "integratorFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of the integrator fee in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which the integrator collected a fee" }, "type": { "type": "string", "enum": ["volume"], "description": "The fee type indicating it is calculated as a percentage of trade volume" }, "chainId": { "type": "number", "description": "The chain ID where this fee will be collected" } }, "required": [ "amount", "token", "type" ], "additionalProperties": false, "nullable": true, "description": "The details about the first fee collected by the integrator" }, "integratorFees": { "type": "array", "items": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of the integrator fee in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which the integrator collected a fee" }, "type": { "type": "string", "enum": ["volume"], "description": "The fee type indicating it is calculated as a percentage of trade volume" }, "chainId": { "type": "number", "description": "The chain ID where this fee will be collected" } }, "required": [ "amount", "token", "type" ], "additionalProperties": false }, "nullable": true, "description": "The details about the fees collected by the integrator" }, "zeroExFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The 0x fee in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which 0x collected a fee" }, "type": { "type": "string", "enum": ["volume"], "description": "The fee type indicating it is calculated as a percentage of trade volume" } }, "required": [ "amount", "token", "type" ], "additionalProperties": false, "nullable": true, "description": "The details about the fee collected by 0x" }, "bridgeNativeFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The bridge fee amount in token's base units that will be added to the transaction value" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the token in which the bridge fee is collected" }, "type": { "type": "string", "enum": ["native"], "description": "The fee type indicating it is a native bridge fee" } }, "required": [ "amount", "token", "type" ], "additionalProperties": false, "nullable": true, "description": "Native fee required by the bridge provider for cross-chain message passing that will be added to the transaction value" }, "reimbursementFee": { "type": "object", "properties": { "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The reimbursement fee amount in token's base units" }, "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" } ], "description": "The contract address of the token in which the reimbursement fee is collected" }, "recipient": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The wallet address that receives the reimbursement fee" } }, "required": [ "amount", "token", "recipient" ], "additionalProperties": false } }, "required": [ "integratorFee", "integratorFees", "zeroExFee", "bridgeNativeFee" ], "additionalProperties": false, "description": "All fees associated with this cross-chain quote, including integrator fees, 0x protocol fees, and bridge native fees" }, "gasCosts": { "anyOf": [ { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["evm"], "description": "The blockchain type for Ethereum-compatible chains" }, "gasPrice": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The gas price in wei used for cost estimation" }, "gasLimit": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The estimated gas limit required for successful execution" }, "totalNetworkFee": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The estimated total network cost of the swap. On chains where there is no L1 data cost, it is calculated as `gas` * `gasPrice`. On chains where there is an L1 data cost, it is calculated as `gas` * `gasPrice + L1 data`" } }, "required": [ "chainType", "gasPrice", "gasLimit", "totalNetworkFee" ], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["svm"], "description": "The blockchain type for Solana Virtual Machine" }, "base": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The base transaction fee in lamports for Solana" }, "priority": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The priority fee in lamports for faster transaction processing" }, "total": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The total fee in lamports (base + priority)" } }, "required": [ "chainType", "base", "priority", "total" ], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["tvm"], "description": "The blockchain type for Tron Virtual Machine" }, "energyFee": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The energy fee in sun for the Tron transaction" }, "bandwidthFee": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The bandwidth fee in sun for the Tron transaction" }, "total": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The total network fee in sun (energyFee + bandwidthFee)" } }, "required": [ "chainType", "energyFee", "bandwidthFee", "total" ], "additionalProperties": false } ], "description": "Estimated gas costs for executing the transaction on the origin chain, formatted by chain type" }, "steps": { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this step will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this step" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this step" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens for this step in token base units" }, "type": { "type": "string", "enum": ["wrap"] } }, "required": [ "chainId", "sellToken", "buyToken", "amount", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "chainId": { "type": "number", "description": "The chain ID where this step will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this step" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this step" }, "amount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens for this step in token base units" }, "type": { "type": "string", "enum": ["unwrap"] } }, "required": [ "chainId", "sellToken", "buyToken", "amount", "type" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "enum": ["swap"] }, "chainId": { "type": "number", "description": "The chain ID where this swap will be executed" }, "sellToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The input token address for this swap" }, "buyToken": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The output token address for this swap" }, "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The input amount for this swap in token base units" }, "buyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The output amount for this swap in token base units" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum output amount for this swap in token base units" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this swap step to complete" } }, "required": [ "type", "chainId", "sellToken", "buyToken", "sellAmount", "buyAmount", "minBuyAmount", "estimatedTimeSeconds" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "enum": ["bridge"] }, "originChainId": { "type": "number", "description": "The chain ID where tokens will be sent from" }, "destinationChainId": { "type": "number", "description": "The chain ID where tokens will be received" }, "sellToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The token address on the origin chain" }, "buyToken": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The token address on the destination chain" }, "sellAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens to bridge from the origin chain in token base units" }, "buyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of tokens to be received on the destination chain in token base units" }, "minBuyAmount": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The minimum amount of tokens guaranteed on the destination chain in token base units" }, "provider": { "type": "string", "description": "The bridge provider name handling this cross-chain transfer" }, "estimatedTimeSeconds": { "type": "integer", "minimum": 0, "nullable": true, "description": "Estimated time for this bridge step to complete" } }, "required": [ "type", "originChainId", "destinationChainId", "sellToken", "buyToken", "sellAmount", "buyAmount", "minBuyAmount", "provider", "estimatedTimeSeconds" ], "additionalProperties": false } ] }, "description": "Sequential steps required to complete the cross-chain swap, including wrapping, swaps, and bridge operations" }, "transaction": { "anyOf": [ { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["evm"], "description": "The blockchain type for Ethereum-compatible chains" }, "details": { "type": "object", "properties": { "to": { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$", "description": "The contract address to send the transaction to on the EVM chain" }, "data": { "type": "string", "description": "The calldata containing execution details for the EVM transaction" }, "gas": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The estimated gas limit required for successful transaction execution" }, "gasPrice": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "nullable": true, "description": "The gas price in wei for the EVM transaction" }, "value": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of native currency in wei to send with the transaction" } }, "required": [ "to", "data", "gas", "gasPrice", "value" ], "additionalProperties": false } }, "required": [ "chainType", "details" ], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["svm"], "description": "The blockchain type for Solana Virtual Machine" }, "details": { "type": "object", "properties": { "serializedTransaction": { "type": "string", "description": "The base64-encoded serialized Solana transaction" } }, "required": [ "serializedTransaction" ], "additionalProperties": false } }, "required": [ "chainType", "details" ], "additionalProperties": false }, { "type": "object", "properties": { "chainType": { "type": "string", "enum": ["tvm"], "description": "The blockchain type for Tron Virtual Machine" }, "details": { "type": "object", "properties": { "to": { "type": "string", "description": "The Tron contract address to interact with" }, "data": { "type": "string", "description": "The calldata for the Tron smart contract call" }, "value": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The amount of TRX in sun to send with the transaction" }, "ownerAddress": { "type": "string", "description": "The Tron address of the transaction sender" }, "memo": { "type": "string", "description": "Optional memo attached to the Tron transaction" } }, "required": [ "to", "data", "value", "ownerAddress" ], "additionalProperties": false } }, "required": [ "chainType", "details" ], "additionalProperties": false } ], "description": "The transaction details to execute on the origin chain to initiate the cross-chain swap" }, "estimatedTimeSeconds": { "type": "number", "minimum": 0, "nullable": true, "description": "Estimated total time in seconds for the cross-chain swap to complete, including bridge confirmation time" }, "issues": { "type": "object", "properties": { "allowance": { "type": "object", "properties": { "actual": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The `originAddress`'s current allowance of the `spender`" }, "spender": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The address to set the allowance on" } }, "required": ["actual", "spender"], "additionalProperties": false, "description": "The allowances that the `originAddress` must set in order to execute the swap successfully. Null if no allowance is required", "nullable": true }, "balance": { "type": "object", "properties": { "token": { "anyOf": [ { "type": "string", "pattern": "^0x(?!0{40})[a-fA-F0-9]{40}$" }, { "type": "string" }, { "type": "string", "pattern": "^0x[a-fA-F0-9]{32}$" }, { "type": "string" } ], "description": "The contract address of the `sellToken`" }, "actual": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The current balance of `sellToken` in the `originAddress` address" }, "expected": { "allOf": [ { "type": "integer", "format": "int64" }, { "type": "string", "pattern": "^[-+]?(0|[1-9]\\d*)(\\.\\d+)?$" } ], "description": "The balance of `sellToken` required for the swap to execute successfully" } }, "required": [ "token", "actual", "expected" ], "additionalProperties": false, "description": "The balance of `sellToken` that the `originAddress` must hold. Null if the `originAddress` has sufficient balance", "nullable": true }, "simulationIncomplete": { "type": "boolean", "description": "This is set to `true` when 0x cannot validate the transaction. This happens when the `originAddress` has an insufficient balance of `sellToken` and 0x is unable to perform enhanced quote validation with such low balance. Note that this does not necessarily mean that the trade will revert" } }, "required": [ "allowance", "balance", "simulationIncomplete" ], "additionalProperties": false }, "quoteId": { "type": "string", "description": "The unique ID for this cross-chain quote" } }, "required": [ "sellAmount", "buyAmount", "minBuyAmount", "fees", "gasCosts", "steps", "transaction", "estimatedTimeSeconds", "issues", "quoteId" ], "additionalProperties": false, "description": "The cross-chain quote details including steps, fees, and transaction information" }, "allowanceTarget": { "type": "string", "description": "The contract address that needs token allowance approval for this quote" } }, "required": ["quote"], "additionalProperties": false, "description": "The quote data containing swap details and allowance information" } }, "required": ["type", "data"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "enum": ["result"], "description": "Event type indicating the final result of the quote search" }, "data": { "type": "object", "properties": { "liquidityAvailable": { "type": "boolean", "description": "Whether any liquidity was found for the requested cross-chain swap" } }, "required": ["liquidityAvailable"], "additionalProperties": false, "description": "The final result indicating whether any liquidity was available" } }, "required": ["type", "data"], "additionalProperties": false } ], "description": "The streaming event containing either quote data or final result" } }, "required": ["zid", "event"], "additionalProperties": false, "description": "A Server-Sent Event containing cross-chain quote information as it becomes available" }, "example": { "zid": "0xbed7b45844099af94219ba8c", "event": { "type": "quote", "data": { "quote": { "sellAmount": "2570", "buyAmount": "2972100", "minBuyAmount": "2942339", "fees": { "integratorFee": null, "zeroExFee": { "amount": "6", "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "type": "volume" }, "bridgeNativeFee": null }, "gasCosts": { "chainType": "evm", "gasPrice": "11550962", "gasLimit": "672945", "totalNetworkFee": "7790577030769" }, "steps": [ { "type": "swap", "chainId": 8453, "sellToken": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "buyToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "sellAmount": "2564", "buyAmount": "2979865", "minBuyAmount": "2950101", "estimatedTimeSeconds": 0 }, { "type": "bridge", "originChainId": 8453, "destinationChainId": 42161, "sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "buyToken": "0xaf88d065e77c8cc2239327c5edb3a432268e5831", "sellAmount": "2979865", "buyAmount": "2972100", "minBuyAmount": "2942339", "provider": "across_v3", "estimatedTimeSeconds": 3 } ], "transaction": { "chainType": "evm", "details": { "to": "0x0000000000001ff3684f28c67538d4d072c22734", "data": "0x2213bc0b...", "gas": "672945", "gasPrice": "0", "value": "0" } }, "estimatedTimeSeconds": 3, "issues": { "allowance": null, "balance": { "token": "0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf", "actual": "0", "expected": "2570" }, "simulationIncomplete": false }, "quoteId": "0xbed7b45844099af94219ba8c00000001" }, "allowanceTarget": "0x0000000000001ff3684f28c67538d4d072c22734" } } } } } }, "400": { "description": "400 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INPUT_INVALID" } ] } } } }, "500": { "description": "500 error response", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/INTERNAL_SERVER_ERROR" }, { "$ref": "#/components/schemas/UNCATEGORIZED" } ] } } } } } } } }, "components": { "securitySchemes": { "0x-api-key": { "type": "apiKey", "in": "header", "name": "0x-api-key" } }, "responses": { "error": { "description": "Error response", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "code": { "type": "string" }, "issues": { "type": "array", "items": { "type": "object", "properties": { "message": { "type": "string" } }, "required": ["message"], "additionalProperties": false } } }, "required": ["message", "code"], "additionalProperties": false } } } } }, "schemas": { "BRIDGE_PROVIDER_ERROR": { "type": "object", "properties": { "name": { "type": "string", "enum": ["BRIDGE_PROVIDER_ERROR"] }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" }, "bridge": { "type": "string", "description": "The bridge provider" } }, "required": ["zid", "bridge"], "additionalProperties": false } }, "required": ["name", "message", "data"], "additionalProperties": false }, "BRIDGE_UNKNOWN": { "type": "object", "properties": { "name": { "type": "string", "enum": ["BRIDGE_UNKNOWN"] }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" }, "originChain": { "type": "string", "description": "The origin chain of the transaction" }, "originTxHash": { "type": "string", "description": "The hash of the transaction on the origin chain" } }, "required": ["zid", "originChain", "originTxHash"], "additionalProperties": false } }, "required": ["name", "message", "data"], "additionalProperties": false }, "INPUT_INVALID": { "type": "object", "properties": { "name": { "type": "string", "enum": ["INPUT_INVALID"] }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" }, "details": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string", "description": "The input field name" }, "reason": { "type": "string", "description": "The validation failure reason" } }, "required": ["field", "reason"], "additionalProperties": false }, "description": "The list of invalid inputs" } }, "required": ["zid", "details"], "additionalProperties": false } }, "required": ["name", "message", "data"], "additionalProperties": false }, "INTERNAL_SERVER_ERROR": { "type": "object", "properties": { "name": { "type": "string", "enum": ["INTERNAL_SERVER_ERROR"] }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" } }, "required": ["zid"], "additionalProperties": false } }, "required": ["name", "message", "data"], "additionalProperties": false }, "TRANSACTION_NOT_FOUND": { "type": "object", "properties": { "name": { "type": "string", "enum": ["TRANSACTION_NOT_FOUND"] }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" }, "originChain": { "type": "string" }, "originTxHash": { "type": "string", "description": "The hash of the transaction on the origin chain" } }, "required": ["zid", "originChain", "originTxHash"], "additionalProperties": false } }, "required": ["name", "message", "data"], "additionalProperties": false }, "UNCATEGORIZED": { "type": "object", "properties": { "name": { "type": "string", "enum": ["UNCATEGORIZED"] }, "message": { "type": "string" }, "data": { "type": "object", "properties": { "zid": { "type": "string", "description": "The unique ZeroEx identifier of the request" } }, "required": ["zid"], "additionalProperties": false } }, "required": ["name", "message", "data"], "additionalProperties": false } } }, "tags": [ { "name": "Cross-Chain", "description": "Cross-Chain API endpoints" } ] }