πŸ•΅
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: 3, // Ropsten
fromAmount: '10000000', // 10 USDT
fromTokenAddress: '0x110a13fc3efe6a245b50102d2d79b3e76125ae83', // USDT
toChainId: 4, // Rinkeby
toTokenAddress: '0xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02', // USDT
};
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.

TEST token on Ropsten to TEST token on Rinkeby via Connext:

const routesRequest = {
fromChainId: 3, // Ropsten
fromAmount: '10000000000000000000', // 10
fromTokenAddress: '0xe71678794fff8846bff855f716b0ce9d9a78e844', // TEST Token
toChainId: 4, // Rinkeby
toTokenAddress: '0x9ac2c46d7acc21c881154d57c0dc1c55a3139198' // TEST Token
};

DAI on Kovan to USDT on Kovan via Uniswap:

const routesRequest = {
fromChainId: 42, // Kovan
fromAmount: '10000000000000000000', // 10
fromTokenAddress: '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa', // DAI
toChainId: 42, // Kovan
toTokenAddress: '0x07de306ff27a2b630b1141956844eb1552b956b5' // USDT
};

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.
Copy link
Outline
Requesting a Testnet Transfer via the LI.FI SDK
Setting up the SDK for testnet support
Requesting a route
Possible testnet routes
Requesting a Testnet Transfer via the LI.FI API