Deposit into Aave from Solana
Below is an example flow depositing into Aave using a Solana wallet using the Intents Connect API.
You'll need to reference supported assets by their IDs, then run a dry execution to get the estimated output amount, and estimate costs for the destination chain action, signing the intent (deposit to Aave), and the transfer transaction to move SOL from the Solana wallet. As a result, you'll have deposited Aave into an intermediary account associated with your Solana wallet.
Make sure to understand Execution Lifecycle before you proceed with the implementation.
List supported tokens
Use List supported tokens to find the assetId values you will need. You'll need to use the Intents API for that.
const response = await fetch(`https://intents-connect-api.aurora.dev/api/v1/supported_tokens`);
const tokens = await response.json();Request an execution
Use Request an execution endpoint.
const response = await fetch(`https://intents-connect-api.aurora.dev/api/v1/executions/${solanaWalletAccount}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
// Generate your API key at https://studio.aurora.dev
'x-api-key': 'API_KEY',
},
body: JSON.stringify({
"dry": false,
"metadata": {
"intent": "aave_supply",
"title": "Supply to Aave"
},
"quote": {
"amount": "1270000",
"destinationAsset": "nep141:base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.omft.near",
"originAsset": "nep141:sol.omft.near",
"slippageTolerance": 100
},
"steps": [
{
"functionSignature": "approve(address,uint256)",
"parameters": [
"0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
"{MIN_AMOUNT_OUT}"
],
"to": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"value": "0"
},
{
"functionSignature": "supply(address,uint256,address,uint16)",
"parameters": [
"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"{MIN_AMOUNT_OUT}",
"0xFe6EF968D2F7B2e9CCCF92150d96c930C3CC4a4E",
"0"
],
"to": "0xA238Dd80C259a72e81d7e4664a9801593F98d1c5",
"value": "0"
}
],
"type": "evm"
})
});
const execution = await response.json();Submit the digest
Use Submit digest to submit the signed message. This will allow executing batched transactions on the destination chain.
const response = await fetch(`https://intents-connect-api.aurora.dev/api/v1/executions/${solanaWalletAccount}/submit`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"executionId": "92a10832-d36b-46c6-807d-7f28469c2a94",
"publicKey": "ed25519:BTKcXNp1wSzs9Mp2ejsPrHLr59z5UkEDJgqcWyXGhGc4",
"signature": "ed25519:5VUXRtVgS6bq3Wn64YdCt5NSPfA1Ni5zqiLFsSScyq6Dj53pbNEcwKcp7t1aRqw8zWCoN7coMLBUmatmwLAEvndP"
})
});
const execution = await response.json();Monitor the status of the execution
Use Fetch executions using id of the execution
const response = await fetch(`https://intents-connect-api.aurora.dev/api/v1/executions/BTKcXNp1wSzs9Mp2ejsPrHLr59z5UkEDJgqcWyXGhGc4?id=92a10832-d36b-46c6-807d-7f28469c2a94`);
const execution = await response.json();Last updated
