🕵
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 testnet integrations of many bridges are experimental and might bear issues. This does not reflect the performance of those bridges on the mainnet.
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 = {
integrator: 'Your dApp/company name',
apiUrl: 'https://staging.li.quest/v1/'
... // other configurations
};
const lifi = new LiFi(config)
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 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.
const routesRequest = {
fromChainId: 5, // Goerli
fromAmount: '1000000000000000000', // 1
fromTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
toChainId: 5, // Goerli
toTokenAddress: '0xd87ba7a50b2e7e660f678a895e4b72e7cb4ccd9c' // USDC
};
const routesRequest = {
fromChainId: 5, // Goerli
fromAmount: '2000000000000000', // 0.002
fromTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
toChainId: 80001, // Mumbai
toTokenAddress: '0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa' // WETH
};
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);
Last modified 2mo ago