Skip to main content

Overview

This page documents the main types exported by the Fusion SDK that are used across various SDK methods.

SDK Configuration

QuoteParams

Parameters for requesting a quote from the Fusion API.
fromTokenAddress
string
required
Source token contract address
toTokenAddress
string
required
Destination token contract address
amount
string
required
Amount of source token to swap (in token’s smallest unit)
walletAddress
string
Maker’s wallet address
enableEstimate
boolean
Enable amount estimation
permit
string
Permit signature for gasless approval
integratorFee
IntegratorFeeRequest
Fee configuration for integrators
source
string
Integration source identifier
isPermit2
boolean
Use Permit2 for approval
slippage
number
Slippage tolerance in percent (1-50). Example: 1 for 1%

OrderParams

Parameters for creating a Fusion order.
fromTokenAddress
string
required
Source token contract address
toTokenAddress
string
required
Destination token contract address
amount
string
required
Amount of source token to swap (in token’s smallest unit)
walletAddress
string
required
Maker’s wallet address
permit
string
Permit signature without the first 20 bytes of token address
receiver
string
Address to receive the destination tokens. Defaults to walletAddress
preset
PresetEnum
Auction speed preset. Defaults to recommended preset from quote
nonce
bigint
Unique nonce for the wallet address. Can be serial or randomly generated using randBigInt
source
string
Integration source identifier
isPermit2
boolean
Use Permit2 for approval
customPreset
CustomPreset
Custom auction parameters
orderExpirationDelay
bigint
Order expiration delay after auction ends. Default: 12 seconds
allowPartialFills
boolean
Allow order to be partially filled. Default: true
allowMultipleFills
boolean
Allow order to be filled multiple times. Default: true
integratorFee
IntegratorFeeRequest
Fee configuration for integrators
slippage
number
Slippage tolerance in percent (1-50)

Fee Types

IntegratorFeeRequest

Integrator fee parameters for SDK requests (used in getQuote() and placeOrder()).
receiver
Address
required
Address which will receive the integrator’s portion of the fee
value
Bps
required
Fee amount in basis points (1% = 100 bps)

IntegratorFeeResponse

Integrator fee parameters from API responses. Contains authoritative values calculated by the backend.
receiver
Address
required
Address which will receive share of value fee. The remaining portion goes to the protocol
value
Bps
required
Total fee amount in basis points
share
Bps
required
Percentage of the fee that the integrator receives (rest goes to protocol)

Enums

PresetEnum

Auction speed presets.
enum PresetEnum {
  fast = 'fast',
  medium = 'medium',
  slow = 'slow',
  custom = 'custom'
}
fast
string
Fast auction (shorter duration, higher initial premium)
medium
string
Medium-speed auction (balanced duration and premium)
slow
string
Slow auction (longer duration, lower initial premium)
custom
string
Custom auction parameters

OrderStatus

Possible order statuses.
enum OrderStatus {
  Pending = 'pending',
  Filled = 'filled',
  PartiallyFilled = 'partially-filled',
  Expired = 'expired',
  Cancelled = 'cancelled',
  FalsePredicate = 'false-predicate',
  NotEnoughBalanceOrAllowance = 'not-enough-balance-or-allowance',
  WrongPermit = 'wrong-permit',
  InvalidSignature = 'invalid-signature'
}
Pending
string
Order is active and waiting to be filled
Filled
string
Order has been completely filled
PartiallyFilled
string
Order has been partially filled
Expired
string
Order has expired
Cancelled
string
Order has been cancelled
FalsePredicate
string
Order predicate evaluation returned false
NotEnoughBalanceOrAllowance
string
Insufficient balance or allowance
WrongPermit
string
Permit signature is invalid
InvalidSignature
string
Order signature is invalid

NetworkEnum

Supported blockchain networks.
enum NetworkEnum {
  ETHEREUM = 1,
  POLYGON = 137,
  ZKSYNC = 324,
  BINANCE = 56,
  ARBITRUM = 42161,
  AVALANCHE = 43114,
  OPTIMISM = 10,
  FANTOM = 250,
  GNOSIS = 100,
  COINBASE = 8453,
  LINEA = 59144,
  SONIC = 146,
  UNICHAIN = 130
}

Core Types

Address

Wrapped Ethereum address type from @1inch/limit-order-sdk.
import { Address } from '@1inch/fusion-sdk'

const address = new Address('0x1111111254EEB25477B68fb85Ed929f73A960582')
ZERO_ADDRESS
Address
Static property: 0x0000000000000000000000000000000000000000

MakerTraits

Maker traits for limit orders. See @1inch/limit-order-sdk documentation.
import { MakerTraits } from '@1inch/fusion-sdk'

Bps

Basis points type (1% = 100 bps).
import { Bps } from '@1inch/fusion-sdk'

const fee = new Bps(100) // 1%

Order Types

OrderInfo

Signed order information ready for submission.
order
LimitOrderV4Struct
required
The limit order structure
signature
string
required
Order signature
quoteId
string
required
Quote identifier from the API
orderHash
string
required
Order hash
extension
string
required
Order extension data

PreparedOrder

Prepared order before signing.
order
FusionOrder
required
The Fusion order object
hash
string
required
Order hash
quoteId
string
required
Quote identifier from the API
nativeOrderFactory
Address
Native order factory address (for native token swaps)

OrderStatusResponse

Detailed order status information from the API.
status
OrderStatus
required
Current order status
order
LimitOrderV4Struct
required
The order structure
extension
string
required
Order extension data
points
AuctionPoint[] | null
required
Auction points defining the rate curve
cancelTx
string | null
required
Cancellation transaction hash if cancelled
fills
Fill[]
required
Array of fill events
createdAt
string
required
Order creation timestamp
auctionStartDate
number
required
Auction start date as Unix timestamp
auctionDuration
number
required
Auction duration in seconds
initialRateBump
number
required
Initial rate bump value
isNativeCurrency
boolean
required
Whether the order involves native currency
fromTokenToUsdPrice
string
required
Source token price in USD
toTokenToUsdPrice
string
required
Destination token price in USD

Fill

Information about a fill event.
txHash
string
required
Transaction hash of the fill
filledMakerAmount
string
required
Amount of maker token filled
filledAuctionTakerAmount
string
required
Amount of taker token filled at auction rate
takerFeeAmount
string | null
required
Taker fee amount if applicable

Custom Preset

CustomPreset

Custom auction parameters for advanced users.
auctionDuration
number
required
Duration of the auction in seconds
auctionStartAmount
string
required
Starting amount for the auction
auctionEndAmount
string
required
Ending amount for the auction
points
CustomPresetPoint[]
Custom auction points defining the rate curve

CustomPresetPoint

toTokenAmount
string
required
Token amount at this point
delay
number
required
Delay in seconds relative to previous point

Example Usage

import {
  FusionSDK,
  NetworkEnum,
  PresetEnum,
  OrderParams,
  QuoteParams,
  Address,
  Bps
} from '@1inch/fusion-sdk'

// Quote parameters
const quoteParams: QuoteParams = {
  fromTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
  toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
  amount: '1000000000',
  walletAddress: '0x...',
  integratorFee: {
    receiver: new Address('0x...'),
    value: new Bps(100) // 1%
  },
  slippage: 1 // 1%
}

// Order parameters
const orderParams: OrderParams = {
  fromTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
  toTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
  amount: '1000000000',
  walletAddress: '0x...',
  preset: PresetEnum.fast,
  allowPartialFills: true,
  allowMultipleFills: true
}

See Also

Build docs developers (and LLMs) love