pk_...) and the SDK installed.
Encode the call with the arrived amount
The amount that arrives can differ slightly from the quote because of fees and price movement. PutTRAILS_HYDRATE_PLACEHOLDER_AMOUNT wherever the amount belongs in your call. At execution, OMS replaces it with the exact amount that arrived.
Attach it in the widget
Pass the calldata asto.calldata, with your contract as to.recipient. Fund, Pay, Earn, and Swap all accept it.
From your server
SetdestinationToAddress to your contract and destinationCallData to the encoded call. If the contract pulls tokens with transferFrom, also set destinationApproveAddress to the contract.
Common destinations
- Vault deposits: ERC-4626
deposit(assets, receiver), with the customer asreceiver. See earn. - Lending supply: a lending pool’s
supplycall on behalf of the customer. - Purchases and mints: a contract call priced in the destination token, used with checkout.
refundTransaction. When funds remain at an intent address without a refund, the owner can use the recovery flow.