Skip to main content
This page documents the configuration parameters, network enums, and connector interfaces used throughout the 1inch Fusion SDK.

FusionSDKConfigParams

Configuration object for initializing the FusionSDK.
type FusionSDKConfigParams = {
  url: string
  network: NetworkEnum
  authKey?: string
  blockchainProvider?: BlockchainProviderConnector
  httpProvider?: HttpProviderConnector
}
url
string
required
API endpoint URL for the Fusion APIExample: https://api.1inch.dev/fusion
network
NetworkEnum
required
Blockchain network to operate onSee NetworkEnum for available values
authKey
string
Authentication key for accessing the Fusion APIRequired for production use and higher rate limits
blockchainProvider
BlockchainProviderConnector
Custom blockchain provider for signing transactions and making contract callsSee BlockchainProviderConnector for interface details
httpProvider
HttpProviderConnector
Custom HTTP provider for API requestsDefaults to axios if not provided. See HttpProviderConnector for interface details

NetworkEnum

Supported blockchain networks for Fusion Mode.
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
}

Supported Networks

ETHEREUM
1
Ethereum Mainnet
POLYGON
137
Polygon (Matic) Network
ZKSYNC
324
zkSync Era
BINANCE
56
BNB Smart Chain (BSC)
ARBITRUM
42161
Arbitrum One
AVALANCHE
43114
Avalanche C-Chain
OPTIMISM
10
Optimism
FANTOM
250
Fantom Opera
GNOSIS
100
Gnosis Chain
COINBASE
8453
Base (Coinbase L2)
LINEA
59144
Linea
SONIC
146
Sonic
UNICHAIN
130
Unichain

BlockchainProviderConnector

Interface for custom blockchain providers that handle transaction signing and contract calls.
interface BlockchainProviderConnector {
  signTypedData(
    walletAddress: string,
    typedData: EIP712TypedData
  ): Promise<string>

  ethCall(contractAddress: string, callData: string): Promise<string>
}

Methods

signTypedData

Signs EIP-712 typed data for order creation.
walletAddress
string
required
The wallet address performing the signing
typedData
EIP712TypedData
required
The typed data structure to sign (EIP-712 format)
signature
string
The resulting signature as a hex string

ethCall

Performs a read-only contract call.
contractAddress
string
required
The contract address to call
callData
string
required
Encoded call data (hex string)
result
string
The call result as a hex string

Example Implementation

import Web3 from 'web3'
import { BlockchainProviderConnector } from '@1inch/fusion-sdk'

class CustomBlockchainProvider implements BlockchainProviderConnector {
  constructor(private web3: Web3, private privateKey: string) {}

  async signTypedData(
    walletAddress: string,
    typedData: EIP712TypedData
  ): Promise<string> {
    const account = this.web3.eth.accounts.privateKeyToAccount(this.privateKey)
    const signature = await account.signTypedData(typedData)
    return signature.signature
  }

  async ethCall(contractAddress: string, callData: string): Promise<string> {
    return this.web3.eth.call({
      to: contractAddress,
      data: callData
    })
  }
}

HttpProviderConnector

Interface for custom HTTP providers that handle API requests.
interface HttpProviderConnector {
  get<T>(url: string): Promise<T>

  post<T>(url: string, data: unknown): Promise<T>
}

Methods

get

Performs a GET request.
url
string
required
The URL to request
response
T
The response data (typed)

post

Performs a POST request.
url
string
required
The URL to request
data
unknown
required
The request body data
response
T
The response data (typed)

Example Implementation

import axios from 'axios'
import { HttpProviderConnector } from '@1inch/fusion-sdk'

class CustomHttpProvider implements HttpProviderConnector {
  async get<T>(url: string): Promise<T> {
    const response = await axios.get(url)
    return response.data
  }

  async post<T>(url: string, data: unknown): Promise<T> {
    const response = await axios.post(url, data)
    return response.data
  }
}

WsApiConfigWithNetwork

Configuration object for WebSocket API connections.
type WsApiConfigWithNetwork = {
  url: string
  network: NetworkEnum
  authKey?: string
  lazyInit?: boolean
}
url
string
required
WebSocket endpoint URLExample: wss://api.1inch.dev/fusion/ws
network
NetworkEnum
required
Blockchain network to connect to
authKey
string
Authentication key for WebSocket access
lazyInit
boolean
If true, delays connection until init() is calledDefault: false

Common Types

IntegratorFeeRequest

Integrator fee configuration for requests.
type IntegratorFeeRequest = {
  receiver: Address
  value: Bps
}
receiver
Address
required
Address that will receive the integrator fee
value
Bps
required
Fee amount in basis points (1% = 100 bps)Example: new Bps(100n) for 1%

PresetEnum

Auction speed presets.
enum PresetEnum {
  fast = 'fast',
  medium = 'medium',
  slow = 'slow',
  custom = 'custom'
}
fast
string
Fast auction (shorter duration, quicker execution)
medium
string
Medium-speed auction (balanced)
slow
string
Slow auction (longer duration, potentially better pricing)
custom
string
Custom auction with user-defined parameters

Example Configuration

import { FusionSDK, NetworkEnum } from '@1inch/fusion-sdk'
import { PrivateKeyProviderConnector } from '@1inch/fusion-sdk'
import Web3 from 'web3'

// Basic configuration
const sdk = new FusionSDK({
  url: 'https://api.1inch.dev/fusion',
  network: NetworkEnum.ETHEREUM,
  authKey: 'your-auth-key'
})

// With custom blockchain provider
const blockchainProvider = new PrivateKeyProviderConnector(
  '0x...private-key',
  new Web3('https://eth-mainnet.g.alchemy.com/v2/...')
)

const sdkWithProvider = new FusionSDK({
  url: 'https://api.1inch.dev/fusion',
  network: NetworkEnum.ETHEREUM,
  blockchainProvider,
  authKey: 'your-auth-key'
})

Build docs developers (and LLMs) love