MULTI_SENDflag (leveraging battle-tested gnosisSafe transaction builder multisend library), the deSwap API now offers transaction bundling. It's a way to optionally pass multiple transaction calls that will be invoked sequentially one after another on the destination chain after the conversion is done and the target token (the result of a cross-chain swap) is obtained. This opens limitless possibilities for performing custom operations with the target token straight within the same atomic cross-chain transaction!
stake()method, passing the appropriate values to its arguments:
_aavePoolAddress=0x794a61358D6845594F94dc1DB02A252b5b4814aD(AAVE USDC pool on Polygon);
_stakeAssetAddress=0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174(USDC on Polygon);
_onBehalfOfis a user's wallet address;
_fallbackAddressis a user's wallet address (typically the same as above).
dstChainTxBundleparameter; separate the address and the call with the comma, and separate each transaction (if there are multiple transactions) with a semicolon:
dstBaseGasAmountparameter: this will allow the deSwap API backend to correctly calculate the recommended gas fee to include (former execution fee, a small amount of the intermediary token that incentivizes anyone to execute the transaction on the destination chain).
dstChainTokenOutRecipientparameter to the address of your adapter smart contract rather than the user wallet's address. This is extremely important as we agreed that the resulting amount of target tokens will be transferred to the adapter smart contract which will be called in the same atomic transaction performing the operation you've encoded above.