LI.FI REST API offers seamless integration with the Solana blockchain through Mayan, Allbridge and Jupiter.
Mayan integration
Enables users to perform blue chip coins transfer between Solana and EVM chains supported by Mayan. This integration also supports the native USDC bridge CCTP.
We support the most popular tokens on SOL chain:
SOL, USDC, USDT, WETH, WBTC, wSOL, MSOL, DRIFT, JUP, JTO, PYTH, BSOL, BONK, HAWK, JITOSOL, JSOL, MNGO, MIMO,
Allbridge integration
Allbridge enables users to perform cost efficient stable coin transfers between Solana (USDC) and other supported Ethereum Virtual Machine (EVM) compatible chains, including ETH, POL, BSC (only USDT), OPT, AVA, ARB, and BAS.
Jupiter integration
Enables users to perform Solana swaps of wide range of tokens.
Note: We only support single step transactions per ecosystem at this point. Currently expanding to support two step transactions across the two ecosystems.
The native SOL is represented using the System Program address 11111111111111111111111111111111 when making requests to the backend. Native Solana doesn’t really have an address, so this is a representation specific to our system. Wrapped Solana should use the wSOL address So11111111111111111111111111111111111111112
In this documentation, we will explore how to use the API for Solana related requests, executing transactions, getting routes, and checking the status of transactions.
Requesting Solana specific information via the API
Chains
curl --request GET \
--url 'https://li.quest/v1/chains?chainTypes=SVM' \
--header 'accept: application/json'
Tokens
curl --request GET \
--url 'https://li.quest/v1/tokens?chains=SOL&chainTypes=SVM' \
--header 'accept: application/json'
Token details
curl --request GET \
--url 'https://li.quest/v1/token?chain=SOL&token=BONK' \
--header 'accept: application/json'
Requesting a Quote
const request = {
fromChain: 'SOL',
toChain: 'POL',
fromToken: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC on SOL
toToken: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', // USDC on POL
fromAmount: '10000000',
fromAddress: YOUR_SOL_WALLET_ADDRESS,
toAddress: YOUR_EVM_WALLET_ADDRESS,
fromAmountForGas: 37376 // amount in fromToken
}
The key difference between EVM -> SOL and SOL -> EVM transfers is the structure of the transactionRequest. For SOL -> EVM transfers, it contains only a data parameter, which represents base64 encoded Solana transaction data:
{
"fromChainId": "ARB",
"fromAmount": "1000000000",
"fromTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC on ARB,
"toChainId": "SOL",
"toTokenAddress": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", // ETH on SOL,
"fromAddress": YOUR_EVM_WALLET_ADDRESS,
"toAddress": YOUR_SOLANA_WALLET_ADDRESS,
}
You can set the fromAmountForGas parameter in /routes or /quotes requests to receive gas on the destination chain. Please note that this value is limited by the Allbridge API, and if it exceeds the limit, the error with the suggested maximum value will be returned.
Note: Li.Fuel is currenly only enabled via Allbridge
To execute the route, you need to pick one step from routes with the lifi type and make a /stepTransaction call.
Getting a Transaction to execute
To obtain transaction data for execution, you need to provide a full Step object. Typically, this object is retrieved by calling the /routes endpoint and selecting the most suitable route. Afterward, you can retrieve the transaction data for each required step using the /stepTransaction endpoint.
Typical /stepTransaction request will look like the following:
The response from such a call will have the same type as the /quote response.
Checking the Status of a Transaction
Last updated
Was this helpful?
To request a quote for a transaction between Solana and another blockchain, you can use the provided . Below is an example of a request to get a quote for transferring 10 USDC from Solana to POL:
Routes provide the necessary information to initiate a transaction request. Here are two guides on how to the route and it. Here's an example of a typical /routes request from POL to SOL:
The maximum limit you can receive on the destination chain can be found by calling the Allbridge endpoint. The txCostAmount.maxAmount parameter dictates the max amount that can be received in native token.
Here, you can find our full
To check the status of a Solana transaction, you can follow the provided , which will help you monitor the progress and confirmation of your transaction on the Solana blockchain.