πŸ•΅
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:
1
const config: ConfigUpdate = {
2
apiUrl: 'https://staging.li.quest/v1/'
3
... // other configurations
4
};
5
const lifi = new LIFI(config)
Copied!
The remaining setup is identical to the one described here.

Requesting a route

After you configured the SDK, you can request a route between two testnet tokens:
1
const routesRequest = {
2
fromChainId: 3, // Ropsten
3
fromAmount: '10000000', // 10 USDT
4
fromTokenAddress: '0x110a13fc3efe6a245b50102d2d79b3e76125ae83', // USDT
5
toChainId: 4, // Rinkeby
6
toTokenAddress: '0xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02', // USDT
7
};
8
const routesResponse = await Lifi.getRoutes(routesRequest);
Copied!
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 not complete and more transfers are possible, but it might help you getting started.

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

1
const routesRequest = {
2
fromChainId: 3, // Ropsten
3
fromAmount: '10000000000000000000', // 10
4
fromTokenAddress: '0xe71678794fff8846bff855f716b0ce9d9a78e844', // TEST Token
5
toChainId: 4, // Rinkeby
6
toTokenAddress: '0x9ac2c46d7acc21c881154d57c0dc1c55a3139198' // TEST Token
7
};
Copied!

DAI on Kovan to USDT on Kovan via Uniswap:

1
const routesRequest = {
2
fromChainId: 42, // Kovan
3
fromAmount: '10000000000000000000', // 10
4
fromTokenAddress: '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa', // DAI
5
toChainId: 42, // Kovan
6
toTokenAddress: '0x07de306ff27a2b630b1141956844eb1552b956b5' // USDT
7
};
Copied!

ETH on Goerli to WETH on Mumbai via Polygon Bridge:

1
const routesRequest = {
2
fromChainId: 5, // Goerli
3
fromAmount: '2000000000000000', // 0.002
4
fromTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
5
toChainId: 80001, // Mumbai
6
toTokenAddress: '0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa' // WETH
7
};
Copied!

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:
1
const getQuote = async (fromChain, toChain, fromToken, toToken, fromAmount, fromAddress) => {
2
const result = await axios.get('https://staging.li.quest/v1/quote', {
3
params: {
4
fromChain,
5
toChain,
6
fromToken,
7
toToken,
8
fromAmount,
9
fromAddress,
10
}
11
});
12
return result.data;
13
}
14
​
15
const fromChain = 'GOR';
16
const fromToken = 'ETH';
17
const toChain = 'MUM';
18
const toToken = 'WETH';
19
const fromAmount = '2000000000000000';
20
const fromAddress = YOUR_WALLET_ADDRESS;
21
​
22
const quote = await getQuote(fromChain, toChain, fromToken, toToken, fromAmount, fromAddress);
Copied!
For more example testnet transfers check out the listing above.