Uniswap Api connects to a Nagent workspace with an API key. Once it is connected, agents can call 7 Uniswap Api actions, such as "Get Gasless Orders", "Get Quote" and "Get swappable tokens". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Uniswap Api, with input parameters and output schema.
UNISWAP_API_CHECK_APPROVALTool 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
The token which will be sent, specified by its token address.
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.
The unique ID of the blockchain.
The urgency impacts the estimated gas price of the transaction. The higher the urgency, the higher the gas price.
The token which will be received, specified by its token address.
The wallet address which will be used to send the token.
If set to true, the response will include the estimated gas fee for the proposed transaction.
The unique ID of the blockchain for the output token.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
UNISWAP_API_CHECK_WALLET_DELEGATIONGet 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
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.
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
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
UNISWAP_API_ENCODE7702_TRANSACTIONSEncode 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
Array of transaction requests to be encoded. All transactions must have the same chainId.
The smart contract wallet address.
The smart contract delegation address.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
UNISWAP_API_GET_GASLESS_ORDERSRetrieve 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
Sort query. For example: sort=gt(UNIX_TIMESTAMP), sort=between(1675872827, 1675872930), or lt(1675872930).
Maximum number of orders to return.
Cursor for pagination.
Filter by filler address (address of the filler who executed the order).
Filter by swapper address (wallet address of the user who initiated the swap).
A unique ID for the order. Used to track the order's status.
Sort key for ordering results.
A list of comma separated orderIds.
Order type for the request.
Order status filter.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
UNISWAP_API_GET_QUOTERequests 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
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.
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.
The wallet address which will be used to send the token.
The urgency impacts the estimated gas price.
The token which will be sent, specified by its token address.
The protocols to use for the swap/order.
The token which will be received, specified by its token address.
The auto slippage strategy for V4 pool quotes.
Hook options for V4 pool quotes.
The permit amount for Uniswap protocol swaps.
Optional integrator fee configuration.
The unique ID of the blockchain. For a list of supported chains see the FAQ.
The routing preference for the quote.
The slippage tolerance as a percentage up to a maximum of two decimal places.
The unique ID of the blockchain. For a list of supported chains see the FAQ.
Spread optimization for UniswapX swaps.
Indicates whether you want to receive a permit2 transaction to sign and submit onchain, or a permit message to sign.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
UNISWAP_API_GET_SWAPPABLE_TOKENSReturns 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
The contract address of the token on the source chain (zero address for native ETH).
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
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
UNISWAP_API_GET_SWAP_STATUSTool 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
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).
The list of transaction hashes to check the swap status for.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 7 Uniswap Api actions on Nagent, including "Get Gasless Orders", "Get Quote" and "Get swappable tokens". Get Gasless Orders: Retrieve one or more gasless orders from Uniswap, optionally filtered by query parameters. Each action is listed on this page with its input parameters and its output.
Uniswap Api connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
It also takes 10 optional inputs: sort, limit, cursor, filler, swapper, order_id, sort_key, order_ids, order_type and order_status. It returns data, error and successful.