# Uniswap Api

Uniswap Trading API for executing swaps and managing liquidity across 25+ blockchain networks

- **Category:** developer tools
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 7
- **Triggers:** 0
- **Slug:** `UNISWAP_API`
- **Version:** 00000000_00

## Tools

### Check Token Approval

**Slug:** `UNISWAP_API_CHECK_APPROVAL`

Tool to check if a wallet has sufficient token approval for a specified transaction amount. Returns an approval transaction if needed, or null if approval already exists. Use this before executing a swap to verify or obtain the necessary token approval.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `token` | string | Yes | The token which will be sent, specified by its token address. |
| `amount` | string | Yes | The quantity of tokens denominated in the token's base units. For example, for an ERC20 token one token is 1x10^18 base units. For one USDC token one token is 1x10^6 base units. |
| `chainId` | integer | Yes | The unique ID of the blockchain. |
| `urgency` | string ("normal" | "fast" | "urgent") | No | The urgency impacts the estimated gas price of the transaction. The higher the urgency, the higher the gas price. |
| `tokenOut` | string | No | The token which will be received, specified by its token address. |
| `walletAddress` | string | Yes | The wallet address which will be used to send the token. |
| `includeGasInfo` | boolean | No | If set to true, the response will include the estimated gas fee for the proposed transaction. |
| `tokenOutChainId` | integer | No | The unique ID of the blockchain for the output token. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Check Wallet Delegation

**Slug:** `UNISWAP_API_CHECK_WALLET_DELEGATION`

Get the current delegation status and message for a smart contract wallet across different chains. Returns delegation information for each chain ID in the request, including whether the wallet is delegated, the delegate address, and delegator information. Use when checking if a smart contract wallet has delegated its swap permissions to another address or if someone has delegated to it.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `chain_ids` | array | Yes | Array of chain IDs to check delegation status for each wallet. Supported chain IDs include: 1 (Ethereum), 10 (Optimism), 56 (BNB Chain), 137 (Polygon), and others. |
| `wallet_addresses` | array | Yes | Array of smart contract wallet addresses to check delegation status for. Each address must be a valid Ethereum-style address (0x followed by 40 hex characters). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Encode 7702 transactions

**Slug:** `UNISWAP_API_ENCODE7702_TRANSACTIONS`

Encode a list of transactions into a single transaction for smart contract wallet execution (EIP-7702). All transactions must have the same chainId. Use when you need to batch multiple transactions into a single smart contract wallet transaction for atomic execution.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `calls` | array | Yes | Array of transaction requests to be encoded. All transactions must have the same chainId. |
| `walletAddress` | string | Yes | The smart contract wallet address. |
| `smartContractDelegationAddress` | string | Yes | The smart contract delegation address. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Gasless Orders

**Slug:** `UNISWAP_API_GET_GASLESS_ORDERS`

Retrieve one or more gasless orders from Uniswap, optionally filtered by query parameters. Must include at least one of: orderId, orderIds, orderStatus, swapper, or filler. Use when you need to check the status or details of Uniswap gasless orders (UniswapX orders).

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sort` | string | No | Sort query. For example: sort=gt(UNIX_TIMESTAMP), sort=between(1675872827, 1675872930), or lt(1675872930). |
| `limit` | integer | No | Maximum number of orders to return. |
| `cursor` | string | No | Cursor for pagination. |
| `filler` | string | No | Filter by filler address (address of the filler who executed the order). |
| `swapper` | string | No | Filter by swapper address (wallet address of the user who initiated the swap). |
| `order_id` | string | No | A unique ID for the order. Used to track the order's status. |
| `sort_key` | string ("createdAt") | No | Sort key for ordering results. |
| `order_ids` | string | No | A list of comma separated orderIds. |
| `order_type` | string ("Dutch" | "Dutch_V2" | "Dutch_V1_V2" | "Dutch_V3" | "Limit" | "Priority") | No | Order type for the request. |
| `order_status` | string ("open" | "expired" | "error" | "cancelled" | "filled" | "unverified" | "insufficient-funds") | No | Order status filter. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Quote

**Slug:** `UNISWAP_API_GET_QUOTE`

Requests a quote according to the specified swap parameters. This endpoint may be used to get a quote for a swap, a bridge, or a wrap/unwrap. The resulting response includes a quote for the swap and the proposed route by which the quote was achieved, along with estimated gas fees. Use when you need to get a quote for a token swap before executing the transaction.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `type` | string ("EXACT_INPUT" | "EXACT_OUTPUT") | No | The handling of the amount field. EXACT_INPUT means the requester will send the specified amount of input tokens and get a quote with a variable quantity of output tokens. EXACT_OUTPUT means the requester will receive the specified amount of output tokens and get a quote with a variable quantity of input tokens. |
| `amount` | string | Yes | The quantity of tokens denominated in the token's base units. For example, for an ERC20 token one token is 10^18 base units. For one USDC token one token is 10^6 base units. This value must be greater than 0. |
| `swapper` | string | Yes | The wallet address which will be used to send the token. |
| `urgency` | string ("normal" | "fast" | "urgent") | No | The urgency impacts the estimated gas price. |
| `token_in` | string | Yes | The token which will be sent, specified by its token address. |
| `protocols` | array | No | The protocols to use for the swap/order. |
| `token_out` | string | Yes | The token which will be received, specified by its token address. |
| `auto_slippage` | string ("DEFAULT") | No | The auto slippage strategy for V4 pool quotes. |
| `hooks_options` | string ("V4_HOOKS_INCLUSIVE" | "V4_HOOKS_ONLY" | "V4_NO_HOOKS") | No | Hook options for V4 pool quotes. |
| `permit_amount` | string ("FULL" | "EXACT") | No | The permit amount for Uniswap protocol swaps. |
| `integrator_fees` | array | No | Optional integrator fee configuration. |
| `token_in_chain_id` | integer | No | The unique ID of the blockchain. For a list of supported chains see the FAQ. |
| `routing_preference` | string ("BEST_PRICE" | "FASTEST") | No | The routing preference for the quote. |
| `slippage_tolerance` | number | No | The slippage tolerance as a percentage up to a maximum of two decimal places. |
| `token_out_chain_id` | integer | No | The unique ID of the blockchain. For a list of supported chains see the FAQ. |
| `spread_optimization` | string ("EXECUTION" | "PRICE") | No | Spread optimization for UniswapX swaps. |
| `generate_permit_as_transaction` | boolean | No | Indicates whether you want to receive a permit2 transaction to sign and submit onchain, or a permit message to sign. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get swappable tokens

**Slug:** `UNISWAP_API_GET_SWAPPABLE_TOKENS`

Returns the list of destination bridge chains for a given token on a given chain. Useful for discovering cross-chain swap/bridge options. Returns tokens that are available for swapping/bridging from the specified source token.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `token_in` | string | No | The contract address of the token on the source chain (zero address for native ETH). |
| `token_in_chain_id` | integer | No | The unique ID of the blockchain. For a list of supported chains see the FAQ (https://api-docs.uniswap.org/guides/faqs). Default is 1 (Ethereum mainnet). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Swap Status

**Slug:** `UNISWAP_API_GET_SWAP_STATUS`

Tool to retrieve the current status of swap or bridge transactions on the Uniswap trading platform. Use when you need to check if a swap transaction has been confirmed, is pending, or has failed. Provide the transaction hash(es) to get the status of one or more swap transactions.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `chain_id` | integer | No | The unique ID of the blockchain. For a list of supported chains see the [FAQ](https://api-docs.uniswap.org/guides/faqs). Defaults to 1 (Ethereum mainnet). |
| `tx_hashes` | array | Yes | The list of transaction hashes to check the swap status for. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
