FusionSDK class provides high-level functionality for working with 1inch Fusion Mode. It handles order creation, submission, querying, and management.
Constructor
Creates a new instance of the FusionSDK.Configuration object for the SDK
API endpoint URL (e.g.,
https://api.1inch.dev/fusion)Network to operate on (e.g.,
NetworkEnum.ETHEREUM)Authentication key for API access
Custom blockchain provider for signing transactions
Custom HTTP provider (defaults to axios)
Methods
getActiveOrders
Retrieves a paginated list of active orders from the Fusion API.Paginated list of active orders with metadata
getOrdersByMaker
Retrieves orders created by a specific maker address.Paginated list of orders by maker with fill information
getQuote
Retrieves a quote for a token swap with default presets.Quote parameters
Source token contract address
Destination token contract address
Amount to swap (in token’s smallest unit)
Wallet address (defaults to zero address)
EIP-2612 permit call data for gasless approval
Enable gas estimation
Source identifier for analytics
Use Permit2 for approvals
Integrator fee configuration
Slippage tolerance in percent (1-50)
Quote details including pricing, presets, and settlement information
getQuoteWithCustomPreset
Retrieves a quote with custom auction parameters.Quote parameters (same as
getQuote)Custom preset configuration
Custom auction preset
Auction duration in seconds
Starting amount for auction
Ending amount for auction
Custom auction curve points
Quote details with custom preset applied
placeOrder
Creates and submits a Fusion order in a single operation.Order parameters
Source token contract address
Destination token contract address
Amount to swap (in token’s smallest unit)
Maker’s wallet address
EIP-2612 permit call data
Recipient address (defaults to maker address)
Auction preset:
fast, medium, or slowUnique nonce for batch cancellation
Source identifier for analytics
Use Permit2 for approvals
Custom auction parameters
Order expiration delay after auction ends
Allow partial order fills (default: true)
Allow multiple fills (default: true)
Integrator fee configuration
Slippage tolerance in percent
createOrder
Creates a Fusion order without submitting it (for manual submission).Order parameters (same as
placeOrder)submitOrder
Submits a previously created order to the relayer. Note: For orders from native assets, usesubmitNativeOrder instead.
The FusionOrder instance to submit
Quote identifier from order creation
Information about the submitted order
submitNativeOrder
Submits an order from native assets (e.g., ETH) to the relayer. Note: Orders from native assets must also be submitted on-chain viaNativeOrdersFactory.create.
The FusionOrder instance to submit
Maker’s address
Quote identifier from order creation
Information about the submitted native order
getOrderStatus
Retrieves the current status of an order.The order hash to query
Detailed order status information
Current order status (pending, filled, cancelled, etc.)
The order structure
Order extension data
Array of fill transactions
Cancellation transaction hash (if cancelled)
Order creation timestamp
buildCancelOrderCallData
Builds the call data for cancelling an order.The order hash to cancel
Encoded call data for the cancel transaction