Testing your integration

The testnet environment integrates with contracts deployed to testnets. Using this environment is great for local development and testing. You can use all of the features of the widget, without needing to use real funds.

Testnet API URL https://swap-testnet.dev.swing.xyz/v0/transfer/

The testnet integrations are experimental and might have functional or liquidity issues. This does not reflect the performance on the mainnet.

Testnet implementation is only available on our testnet API. Make sure to change the request URL to the Testnet URL to get testnet routes. Testnet transfers work exactly the same way as the maintet transfers. To learn how to request a quote and send a transaction visit this API guide.

Suggested routes

The testnet implementation typically has liquidity challenges and fewer tokens than the mainnet version. Below is a list of confirmed routes available on testnets.

Cross-Chain Transfer

Celer bridge testnet has been integrated to offer cross-chain token transfers on the testnet chains.

USDT on Goerli Testnet to USDT on Fantom Testnet via Celer Bridge

Your quote request would look like this:

const getQuote = async () => {
  const result = await axios.get(
    'https://swap-testnet.dev.swing.xyz/v0/transfer/quote',
    {
      fromChain: 'goerli',
      tokenSymbol: 'USDT',
      fromTokenAddress: '0xf4B2cbc3bA04c478F0dC824f4806aC39982Dce73',
      fromUserAddress: '0x805EBB94084e01da57c4bc70B6FE414aF9148596',
      toChain: 'fantom-test',
      toTokenSymbol: 'USDT',
      toTokenAddress: '0x7d43AABC515C356145049227CeE54B608342c0ad',
      toUserAddress: '0x805EBB94084e01da57c4bc70B6FE414aF9148596',
      tokenAmount: '100000000',
      projectId: '',
      contractCall: 'false',
    },
  );
  return result.data;
};

Same-Chain Swaps

Goerli swaps via Swing Aggregator (Uniswap V2). Perform swap transactions between any of the supported tokens on Goerli Testnet:

Your quote request would look like this:

const getQuote = async () => {
  const result = await axios.get(
    'https://swap-testnet.dev.swing.xyz/v0/transfer/quote',
    {
      fromChain: 'goerli',
      tokenSymbol: 'ETH',
      fromTokenAddress: '0x0000000000000000000000000000000000000000',
      fromUserAddress: '0x805EBB94084e01da57c4bc70B6FE414aF9148596',
      toChain: 'goerli',
      toTokenSymbol: 'USDC.e',
      toTokenAddress: '0x07865c6E87B9F70255377e024ace6630C1Eaa37F',
      toUserAddress: '0x805EBB94084e01da57c4bc70B6FE414aF9148596',
      tokenAmount: '1000000000000000000',
      projectId: '',
      contractCall: 'false',
    },
  );
  return result.data;
};