Setup the Swing SDK

Swing enables secure, any blockchain to any blockchain communication to power multi-chain liquidity for applications.

The Swing SDK enables easy access to the Swing API, which allows you to find and execute the best multi-chain routes across major cross-chain bridges and exchanges.

Install @swing.xyz/sdk

The Swing SDK can be installed into your app using your favorite package manager.

yarn add @swing.xyz/sdk

# OR

npm install @swing.xyz/sdk

Create a client

Import the SwingSDK class from the package and create a new instance of the SwingSDK client.

import SwingSDK from '@swing.xyz/sdk'

const sdk = new SwingSDK({
  // Optionally enable debug mode for verbose logging
  // debug: true,
})

Initialize the client

This method loads the SDK with all available chains, tokens and bridges.

await sdk.init()