Links
🕵

Testing your Integration

Run test transactions on testnets.
Some bridges and exchanges have support for testnets. In these cases testnet transfers are also possible via our services.
The following guide will explain how to trigger a testnet transfer via our SDK or via our API.
The testnet integrations of many bridges are experimental and might bear issues. This does not reflect the performance of those bridges on the mainnet.

Requesting a Testnet Transfer via the LI.FI SDK

Setting up the SDK for testnet support

Testnets are only enabled on our staging environment. To be able to use it you have to set the correct apiUrl when configuring the SDK:
const config: ConfigUpdate = {
apiUrl: 'https://staging.li.quest/v1/'
... // other configurations
};
const lifi = new LIFI(config)
The remaining setup is identical to the one described here.

Requesting a route

After you have configured the SDK, you can request a route between two testnet tokens:
const routesRequest = {
fromChainId: 5, // Goerli
fromAmount: '1000000000000000000', // 1 ETH
fromTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
toChainId: 420, // Optimism Goerli
toTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
};
const routesResponse = await Lifi.getRoutes(routesRequest);
The received routesResponse can be executed via our SDK as described before.
If you need tokens in your wallet first, have a look at how Minting Tokens on Testnets works.

Possible testnet routes

The testnet implementation of bridges usually supports less tokens than the mainnet version.
Below is a list of possible transfers that can be made on testnets. It is incomplete and more transfers are possible, but it might help you get started.

ETH on Goerli to USDC on Goerli via Uniswap:

const routesRequest = {
fromChainId: 5, // Goerli
fromAmount: '1000000000000000000', // 1
fromTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
toChainId: 5, // Goerli
toTokenAddress: '0xd87ba7a50b2e7e660f678a895e4b72e7cb4ccd9c' // USDC
};

ETH on Goerli to WETH on Mumbai via Polygon Bridge:

const routesRequest = {
fromChainId: 5, // Goerli
fromAmount: '2000000000000000', // 0.002
fromTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
toChainId: 80001, // Mumbai
toTokenAddress: '0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa' // WETH
};

Requesting a Testnet Transfer via the LI.FI API

Requesting a testnet quote works the same way as requesting mainnet quotes. The only important change is the request URL. Testnets are only enabled on our staging environment:
const getQuote = async (fromChain, toChain, fromToken, toToken, fromAmount, fromAddress) => {
const result = await axios.get('https://staging.li.quest/v1/quote', {
params: {
fromChain,
toChain,
fromToken,
toToken,
fromAmount,
fromAddress,
}
});
return result.data;
}
​
const fromChain = 'GOR';
const fromToken = 'ETH';
const toChain = 'MUM';
const toToken = 'WETH';
const fromAmount = '2000000000000000';
const fromAddress = YOUR_WALLET_ADDRESS;
​
const quote = await getQuote(fromChain, toChain, fromToken, toToken, fromAmount, fromAddress);
For more examples of testnet transfers, check out the listing above.