@1inch/fusion-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.1-rc.43 • Public • Published

Utils library for 1inch Fusion Mode

Installation

Npm

npm install @1inch/fusion-sdk

Yarn

yarn add @1inch/fusion-sdk

Modules docs

How to swap with Fusion Mode

const makerPrivateKey = '0x123....'
const makerAddress = '0x123....'

const nodeUrl = '....'

const blockchainProvider = new PrivateKeyProviderConnector(
    makerPrivateKey,
    new Web3(nodeUrl)
)

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

sdk.placeOrder({
    fromTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // WETH
    toTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC
    amount: '50000000000000000', // 0.05 ETH
    walletAddress: makerAddress
}).then(console.log)

Resolvers

settleOrders function usage and Resolver contract examples you can find here

Other language implementations

Language Link Type
rust frolovdev/fusion-sdk-rs Community driven

/@1inch/fusion-sdk/

    Package Sidebar

    Install

    npm i @1inch/fusion-sdk

    Weekly Downloads

    1,484

    Version

    1.0.1-rc.43

    License

    none

    Unpacked Size

    415 kB

    Total Files

    256

    Last publish

    Collaborators

    • 1inch-robot
    • k06a
    • d.kotsiuba
    • artall641inch
    • zumzoom
    • sevenswen
    • zzomrot
    • krboktv-inch